public function containers($enabledOnly = NULL) {
    $client = \HPCloud\Transport::instance();
    $url = $this->url . '/?format=json';

    if ($enabledOnly) {
      $url .= '&enabled_only=true';
    }
    // DEVEX-1733 suggests that this should result in the
    // server listing only DISABLED containers.
    elseif ($enabledOnly === FALSE) {
      $url .= '&enabled_only=false';
    }

    $headers = array(
      'X-Auth-Token' => $this->token,
    );

    $response = $client->doRequest($url, 'GET', $headers);

    $raw = $response->content();
    $json = json_decode($raw, TRUE);

    return $json;
  }
public function containers($enabledOnly = NULL) {
    $client = \HPCloud\Transport::instance();
    $url = $this->url . '/?format=json';

    if ($enabledOnly) {
      $url .= '&enabled_only=true';
    }
    // DEVEX-1733 suggests that this should result in the
    // server listing only DISABLED containers.
    elseif ($enabledOnly === FALSE) {
      $url .= '&enabled_only=false';
    }

    $headers = array(
      'X-Auth-Token' => $this->token,
    );

    $response = $client->doRequest($url, 'GET', $headers);

    $raw = $response->content();
    $json = json_decode($raw, TRUE);

    return $json;
  }
public function containers ( $ enabledOnly = NULL ) { $ client = \ HPCloud \ Transport :: instance ( ) ; $ url = $ this -> url . '/?format=json' ; if ( $ enabledOnly ) { $ url .= '&enabled_only=true' ; } // DEVEX-1733 suggests that this should result in the // server listing only DISABLED containers. elseif ( $ enabledOnly === FALSE ) { $ url .= '&enabled_only=false' ; } $ headers = array ( 'X-Auth-Token' => $ this -> token , ) ; $ response = $ client -> doRequest ( $ url , 'GET' , $ headers ) ; $ raw = $ response -> content ( ) ; $ json = json_decode ( $ raw , TRUE ) ; return $ json ; }
Get a list of containers that the CDN system knows of.

This returns a list of ObjectStorage Containers that the
CDN service knows of. These containers can be either enabled or
disabled.

The CDN service does not attempt to discover all of the containers
from a Swift endpoint. Instead, it passively acquires a list of
containers (added via, for example, enabledContainer()).

Once a container has been added to the CDN service, it can be in
one of two states:

- enabled (\c cdn_enabled=TRUE)
- disabled (\c cdn_enabled=FALSE)

This listing will retrieve both enabled and disabled unless
$enabledOnly is set to TRUE.

Returned data is in this format:
@code
<?php
array(
array(
'log_retention' => 0
'cdn_enabled' => 1
'name' => 'I♡HPCloud'
'x-cdn-uri' => 'http://hcf937838.cdn.aw1.hpcloud.net'
'x-cdn-ssl-uri' => 'https://hcf937838.cdn.aw1.hpcloud.net'
'ttl' => 1234
),
array(
'log_retention' => 0
'cdn_enabled' => 0
'name' => 'HPCloud2'
'x-cdn-uri' => 'http://hcf9abc38.cdn.aw1.hpcloud.net'
'x-cdn-ssl-uri' => 'https://hcf937838.cdn.aw1.hpcloud.net'
'ttl' => 1234
),
);
?>
@endcode

@attention
The $enabledOnly flag sendes \c enabled_only to the
endpoint. The endpoint may or may not honor this.

@param boolean $enabledOnly
If this is set to TRUE, then only containers that are
CDN-enabled will be returned.
@retval array
@return array
An indexed array of associative arrays. The format of each
associative array is explained on container().
@throws HPCloud::Exception
An HTTP-level exception on error.
Get a list of containers that the CDN system knows of .