Scalr\Modules\Platforms\Ec2\Ec2PlatformModule::GetBlockDeviceMapping PHP Метод

GetBlockDeviceMapping() приватный Метод

Gets block device mapping
private GetBlockDeviceMapping ( string $instanceType, string $prefix = '/dev/sd' ) : array
$instanceType string The type of the instance
$prefix string The prefix
Результат array Returns array of the BlockDeviceMappingData
    private function GetBlockDeviceMapping($instanceType, $prefix = '/dev/sd')
    {
        $retval = array();
        $instanceTypesInfo = $this->getInstanceTypes(null, null, true);
        if (isset($instanceTypesInfo[$instanceType]['instancestore'])) {
            $devicesNames = ['b', 'c', 'e', 'f', 'g', 'h', 'i', 'j', 'k1', 'k2', 'k3', 'k4', 'k5', 'k6', 'k7', 'k8', 'k9', 'l1', 'l2', 'l3', 'l4', 'l5', 'l6', 'l7'];
            $namesOverrides = ['d2.4xlarge' => [8 => 'k', 9 => 'l', 10 => 'm', 11 => 'n'], 'd2.8xlarge' => [8 => 'k', 9 => 'l', 10 => 'm', 11 => 'n', 12 => 'o', 13 => 'p', 14 => 'q', 15 => 'r', 16 => 's', 17 => 't', 18 => 'u', 19 => 'v', 20 => 'w', 21 => 'x', 22 => 'y', 23 => 'd']];
            if (isset($namesOverrides[$instanceType])) {
                $devicesNames = array_replace($devicesNames, $namesOverrides[$instanceType]);
            }
            if (isset($instanceTypesInfo[$instanceType]['instancestore']['number'])) {
                for ($i = 0; $i < $instanceTypesInfo[$instanceType]['instancestore']['number']; $i++) {
                    $retval[] = new BlockDeviceMappingData("{$prefix}{$devicesNames[$i]}", "ephemeral{$i}");
                }
            }
        }
        return $retval;
    }