Example #1
0
 /**
  * Gets a normalized url for an each platform
  *
  * @param    string $platform Cloud platform
  * @return   string Returns url
  */
 public function getUrl($platform)
 {
     if (!isset($this->aUrl[$platform])) {
         if ($platform == \SERVER_PLATFORMS::EC2 || $platform == \SERVER_PLATFORMS::GCE || $platform == \SERVER_PLATFORMS::AZURE) {
             $value = '';
         } else {
             if (PlatformFactory::isOpenstack($platform)) {
                 $value = CloudLocation::normalizeUrl($this->env->keychain($platform)->properties[CloudCredentialsProperty::OPENSTACK_KEYSTONE_URL]);
             } else {
                 if (PlatformFactory::isCloudstack($platform)) {
                     $value = CloudLocation::normalizeUrl($this->env->keychain($platform)->properties[CloudCredentialsProperty::CLOUDSTACK_API_URL]);
                 }
             }
         }
         $this->aUrl[$platform] = $value;
     }
     return $this->aUrl[$platform];
 }
Example #2
0
 /**
  * Gets a normalized url for an each platform
  *
  * @param    string $platform Cloud platform
  * @return   string Returns url
  */
 public function getUrl($platform)
 {
     if (!isset($this->aUrl[$platform])) {
         if ($platform == \SERVER_PLATFORMS::EC2) {
             $value = '';
         } else {
             if (PlatformFactory::isOpenstack($platform)) {
                 $value = CloudLocation::normalizeUrl($this->env->getPlatformConfigValue($platform . '.' . OpenstackPlatformModule::KEYSTONE_URL));
             } else {
                 if (PlatformFactory::isCloudstack($platform)) {
                     $value = CloudLocation::normalizeUrl($this->env->getPlatformConfigValue($platform . '.' . CloudstackPlatformModule::API_URL));
                 } else {
                     if ($platform == \SERVER_PLATFORMS::GCE) {
                         $value = '';
                     }
                 }
             }
         }
         $this->aUrl[$platform] = $value;
     }
     return $this->aUrl[$platform];
 }
Example #3
0
 /**
  * Normalizes an url from environment settings to use for price_history table
  *
  * @param   string    $url  Original url
  * @return  string    Returns normalized url to use in price_history database table
  */
 public function normalizeUrl($url)
 {
     return CloudLocation::normalizeUrl($url);
 }