public function getLocations(\Scalr_Environment $environment = null)
{
$retval = [];
if ($environment && $environment->isPlatformEnabled(\SERVER_PLATFORMS::GCE)) {
try {
$client = $this->getClient($environment);
$zones = $client->zones->listZones($environment->keychain(SERVER_PLATFORMS::GCE)->properties[Entity\CloudCredentialsProperty::GCE_PROJECT_ID]);
foreach ($zones->getItems() as $zone) {
if ($zone->status == 'UP') {
$retval[$zone->getName()] = $zone->getName();
}
}
} catch (Exception $e) {
}
}
return $retval;
}