Scalr\Modules\Platforms\Cloudstack\CloudstackPlatformModule::getLocations PHP Méthode

getLocations() public méthode

See also: Scalr\Modules\PlatformModuleInterface::getLocations()
public getLocations ( Scalr_Environmen\Scalr_Environment $environment = null )
$environment Scalr_Environmen\Scalr_Environment
    public function getLocations(Scalr_Environment $environment = null)
    {
        $retval = [];
        if ($environment && $environment->isPlatformEnabled($this->platform)) {
            try {
                $cs = $environment->cloudstack($this->platform);
                foreach ($cs->zone->describe() as $zone) {
                    $retval[$zone->name] = ucfirst($this->platform) . " / {$zone->name}";
                }
            } catch (Exception $e) {
            }
        }
        return $retval;
    }