/** * @param Scalr_environment $environment * @param DBServer $DBServer * * @return \stdClass */ public function GetPlatformAccessData($environment, DBServer $DBServer) { $ccProps = $environment->cloudCredentials($DBServer->platform)->properties; $accessData = new \stdClass(); $accessData->apiKey = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_API_KEY]; $accessData->secretKey = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_SECRET_KEY]; $accessData->apiUrl = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_API_URL]; return $accessData; }
/** * @param Scalr_environment $environment * @param DBServer $DBServer * * @return \stdClass */ public function GetPlatformAccessData($environment, DBServer $DBServer) { $ccProps = $environment->keychain($DBServer->platform)->properties; $accessData = new stdClass(); $accessData->apiKey = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_API_KEY]; $accessData->secretKey = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_SECRET_KEY]; $accessData->apiUrl = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_API_URL]; $config = \Scalr::getContainer()->config; if ($config->defined("scalr.{$this->platform}.use_proxy") && $config("scalr.{$this->platform}.use_proxy") && in_array($config('scalr.connections.proxy.use_on'), ['both', 'instance'])) { $proxySettings = $config('scalr.connections.proxy'); $accessData->proxy = new \stdClass(); $accessData->proxy->host = $proxySettings['host']; $accessData->proxy->port = $proxySettings['port']; $accessData->proxy->user = $proxySettings['user']; $accessData->proxy->pass = $proxySettings['pass']; $accessData->proxy->type = $proxySettings['type']; $accessData->proxy->authtype = $proxySettings['authtype']; } return $accessData; }