Scalr\Modules\Platforms\Azure\AzurePlatformModule::getLocations PHP 메소드

getLocations() 공개 메소드

또한 보기: Scalr\Modules\PlatformModuleInterface::getLocations()
public getLocations ( Scalr_Environment $environment = null )
$environment Scalr_Environment
    public function getLocations(\Scalr_Environment $environment = null)
    {
        $retval = [];
        if ($environment && $environment->isPlatformEnabled(\SERVER_PLATFORMS::AZURE)) {
            $locationsResponse = $environment->azure()->getLocationsList();
            foreach ($locationsResponse->resourceTypes as $rt) {
                /* @var $rt \Scalr\Service\Azure\DataType\ResourceTypeData */
                if ($rt->resourceType == 'locations/vmSizes') {
                    foreach ($rt->locations as $location) {
                        $retval[strtolower(str_replace(" ", "", $location))] = $location;
                    }
                }
            }
        }
        return $retval;
    }