예제 #1
0
 /**
  * Returns the selected endpoint URL of this Service
  *
  * @param string $resource - a child resource. For example,
  *      passing 'servers' would return .../servers. Should *not* be
  *    prefixed with a slash (/).
  * @param array $args (optional) an array of key-value pairs for query
  *      strings to append to the URL
  * @returns string - the requested URL
  */
 public function Url($resource = '', $args = array())
 {
     $baseurl = parent::Url();
     if ($resource != '') {
         $baseurl = noslash($baseurl) . '/' . $resource;
     }
     if (!empty($args)) {
         $baseurl .= '?' . $this->MakeQueryString($args);
     }
     return $baseurl;
 }
 /**
  * Returns the URL of the service, selected from the connection's
  * serviceCatalog
  */
 public function Url($param = array())
 {
     return noslash(parent::Url($param));
 }
예제 #3
0
 /**
  * Called when creating a new Compute service object
  *
  * _NOTE_ that the order of parameters for this is *different* from the
  * parent Service class. This is because the earlier parameters are the
  * ones that most typically change, whereas the later ones are not
  * modified as often.
  *
  * @param \OpenCloud\Identity $conn - a connection object
  * @param string $serviceRegion - identifies the region of this Compute
  *      service
  * @param string $urltype - identifies the URL type ("publicURL",
  *      "privateURL")
  * @param string $serviceName - identifies the name of the service in the
  *      catalog
  */
 public function __construct(OpenStack $conn, $serviceType, $serviceName, $serviceRegion, $urltype)
 {
     $this->debug(_('initializing Nova...'));
     parent::__construct($conn, $serviceType, $serviceName, $serviceRegion, $urltype);
     $this->_url = noslash(parent::Url());
 }