Scalr\Modules\Platforms\Openstack\OpenstackPlatformModule::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($this->platform)) {
            try {
                $client = $environment->openstack($this->platform, "fakeRegion");
                foreach ($client->listZones() as $zone) {
                    $retval[$zone->name] = ucfirst($this->platform) . " / {$zone->name}";
                }
            } catch (\Exception $e) {
                // No need to do anything here
                // If we cannot get list of cloud locations - will return an empty one
            }
        }
        return $retval;
    }