Example #1
0
 public function __construct(Client $client, $type = null, $name = null, $region = null, $urlType = null)
 {
     parent::__construct($client, $type, $name, $region, $urlType);
     try {
         $this->cdnService = ServiceBuilder::factory($client, 'OpenCloud\\ObjectStore\\CDNService', array('region' => $region));
     } catch (Exceptions\EndpointError $e) {
     }
 }
Example #2
0
 /**
  * Creates a new ObjectStore service object.
  *
  * @param OpenCloud\OpenStack $connection    The connection object
  * @param string              $serviceName   The name of the service
  * @param string              $serviceRegion The service's region
  * @param string              $urlType       The type of URL (normally 'publicURL')
  */
 public function __construct(OpenStack $connection, $serviceName = RAXSDK_OBJSTORE_NAME, $serviceRegion = RAXSDK_OBJSTORE_REGION, $urltype = RAXSDK_OBJSTORE_URLTYPE)
 {
     $this->getLogger()->info('Initializing Container Service...');
     parent::__construct($connection, 'object-store', $serviceName, $serviceRegion, $urltype);
     // establish the CDN container, if available
     try {
         $this->cdn = new CDNService($connection, $serviceName . 'CDN', $serviceRegion, $urltype);
     } catch (Exceptions\EndpointError $e) {
         // If we have an endpoint error, then the CDN functionality is not
         // available. In this case, we silently ignore  it.
     }
 }
Example #3
0
 /**
  * Creates a new CDNService object.
  *
  * This is a simple wrapper function around the parent Service construct,
  * but supplies defaults for the service type.
  *
  * @param OpenCloud\OpenStack $connection    The connection object
  * @param string              $serviceName   The name of the service
  * @param string              $serviceRegion The service's region
  * @param string              $urlType       The type of URL (normally 'publicURL')
  */
 public function __construct(OpenStack $connection, $serviceName = RAXSDK_OBJSTORE_NAME, $serviceRegion = RAXSDK_OBJSTORE_REGION, $urltype = RAXSDK_URL_PUBLIC)
 {
     $this->getLogger()->info('Initializing CDN Service...');
     parent::__construct($connection, 'rax:object-cdn', $serviceName, $serviceRegion, $urltype);
 }