listCapabilities() 공개 메소드

Lists capabilities
public listCapabilities ( Scalr\Service\CloudStack\DataType\PaginationType $pagination = null ) : null | Scalr\Service\CloudStack\DataType\CapabilityData
$pagination Scalr\Service\CloudStack\DataType\PaginationType Pagination
리턴 null | Scalr\Service\CloudStack\DataType\CapabilityData
예제 #1
0
파일: Clouds.php 프로젝트: mheydt/scalr
 private function getCloudStackDetails($platform)
 {
     $ccProps = $this->env->cloudCredentials($platform)->properties;
     $params = array();
     $params["{$platform}.is_enabled"] = true;
     $params[Entity\CloudCredentialsProperty::CLOUDSTACK_API_URL] = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_API_URL];
     $params[Entity\CloudCredentialsProperty::CLOUDSTACK_API_KEY] = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_API_KEY];
     $params[Entity\CloudCredentialsProperty::CLOUDSTACK_SECRET_KEY] = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_SECRET_KEY] != '' ? '******' : '';
     try {
         $cs = new CloudStack($params[Entity\CloudCredentialsProperty::CLOUDSTACK_API_URL], $params[Entity\CloudCredentialsProperty::CLOUDSTACK_API_KEY], $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_SECRET_KEY], $platform);
         $params['_info'] = $cs->listCapabilities();
     } catch (Exception $e) {
     }
     return $params;
 }
예제 #2
0
파일: Clouds.php 프로젝트: scalr/scalr
 private function getCloudStackDetails($platform)
 {
     $ccProps = $this->env->keychain($platform)->properties;
     $params = array();
     $params["{$platform}.is_enabled"] = true;
     $params[Entity\CloudCredentialsProperty::CLOUDSTACK_API_URL] = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_API_URL];
     $params[Entity\CloudCredentialsProperty::CLOUDSTACK_API_KEY] = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_API_KEY];
     $params[Entity\CloudCredentialsProperty::CLOUDSTACK_SECRET_KEY] = $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_SECRET_KEY] != '' ? '******' : '';
     try {
         $cs = new CloudStack($params[Entity\CloudCredentialsProperty::CLOUDSTACK_API_URL], $params[Entity\CloudCredentialsProperty::CLOUDSTACK_API_KEY], $ccProps[Entity\CloudCredentialsProperty::CLOUDSTACK_SECRET_KEY], $platform);
         /* @var $config Yaml */
         $config = $this->env->getContainer()->config;
         if ($config->defined("scalr.{$platform}.use_proxy") && $config("scalr.{$platform}.use_proxy") && in_array($config('scalr.connections.proxy.use_on'), ['both', 'scalr'])) {
             $proxySettings = $config('scalr.connections.proxy');
             $cs->setProxy($proxySettings['host'], $proxySettings['port'], $proxySettings['user'], $proxySettings['pass'], $proxySettings['type'], $proxySettings['authtype']);
         }
         $params['_info'] = $cs->listCapabilities();
     } catch (Exception $e) {
     }
     return $params;
 }
예제 #3
0
 private function getCloudStackDetails($platform)
 {
     $params = array();
     $params["{$platform}.is_enabled"] = true;
     $params[CloudstackPlatformModule::API_URL] = $this->env->getPlatformConfigValue("{$platform}." . CloudstackPlatformModule::API_URL);
     $params[CloudstackPlatformModule::API_KEY] = $this->env->getPlatformConfigValue("{$platform}." . CloudstackPlatformModule::API_KEY);
     $params[CloudstackPlatformModule::SECRET_KEY] = $this->env->getPlatformConfigValue("{$platform}." . CloudstackPlatformModule::SECRET_KEY) != '' ? '******' : '';
     try {
         $cs = new CloudStack($params[CloudstackPlatformModule::API_URL], $params[CloudstackPlatformModule::API_KEY], $this->env->getPlatformConfigValue("{$platform}." . CloudstackPlatformModule::SECRET_KEY), $platform);
         $params['_info'] = $cs->listCapabilities();
     } catch (Exception $e) {
     }
     return $params;
 }