Overview
  • Namespace
  • Class

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CloudMonitoring
      • Collection
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Log
      • Resource
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Collection
      • Resource
    • Identity
      • Constants
      • Resource
    • Image
      • Enum
      • Resource
        • JsonPatch
        • Schema
    • LoadBalancer
      • Collection
      • Enum
      • Resource
    • Networking
      • Resource
    • ObjectStore
      • Constants
      • Exception
      • Resource
      • Upload
    • Orchestration
      • Resource
    • Queues
      • Collection
      • Exception
      • Resource
    • Volume
      • Resource

Classes

  • OpenCloud\Volume\Resource\Snapshot
  • OpenCloud\Volume\Resource\Volume
  • OpenCloud\Volume\Resource\VolumeType
 1 <?php
 2 /**
 3  * Copyright 2012-2014 Rackspace US, Inc.
 4  *
 5  * Licensed under the Apache License, Version 2.0 (the "License");
 6  * you may not use this file except in compliance with the License.
 7  * You may obtain a copy of the License at
 8  *
 9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 namespace OpenCloud\ObjectStore;
19 
20 use OpenCloud\ObjectStore\Resource\CDNContainer;
21 use OpenCloud\ObjectStore\Resource\ContainerMetadata;
22 
23 /**
24  * This is the CDN version of the ObjectStore service.
25  */
26 class CDNService extends AbstractService
27 {
28     const DEFAULT_NAME = 'cloudFilesCDN';
29     const DEFAULT_TYPE = 'rax:object-cdn';
30 
31     /**
32      * List CDN-enabled containers.
33      *
34      * @param array $filter
35      * @return \OpenCloud\Common\Collection\PaginatedIterator
36      */
37     public function listContainers(array $filter = array())
38     {
39         $filter['format'] = 'json';
40         return $this->resourceList('CDNContainer', $this->getUrl(null, $filter), $this);
41     }
42 
43     public function cdnContainer($data)
44     {
45         $container = new CDNContainer($this, $data);
46 
47         $metadata = new ContainerMetadata();
48         $metadata->setArray(array(
49             'Streaming-Uri' => $data->cdn_streaming_uri,
50             'Ios-Uri' => $data->cdn_ios_uri,
51             'Ssl-Uri' => $data->cdn_ssl_uri,
52             'Enabled' => $data->cdn_enabled,
53             'Ttl' => $data->ttl,
54             'Log-Retention' => $data->log_retention,
55             'Uri' => $data->cdn_uri,
56         ));
57 
58         $container->setMetadata($metadata);
59 
60         return $container;
61     }
62 }
63 
API documentation generated by ApiGen