28 namespace HPCloud\Storage;
161 $tok = $identity->token();
162 $cat = $identity->serviceCatalog();
210 for ($i = 0; $i < $c; ++$i) {
211 if (
$catalog[$i][
'type'] == self::SERVICE_TYPE) {
213 if (isset($endpoint[
'publicURL']) && $endpoint[
'region'] == $region) {
224 $cdn =
new CDN(
$token, $endpoint[
'publicURL']);
321 $client = \HPCloud\Transport::instance();
322 $url = $this->url .
'/?format=json';
325 $url .=
'&enabled_only=true';
329 elseif ($enabledOnly === FALSE) {
330 $url .=
'&enabled_only=false';
334 'X-Auth-Token' => $this->token,
337 $response = $client->doRequest(
$url,
'GET', $headers);
339 $raw = $response->content();
340 $json = json_decode($raw, TRUE);
375 if ($container[
'name'] ==
$name) {
434 $headers[
'X-TTL'] = (int) $ttl;
437 $created = $res->status() == 201;
439 $url = $res->header(
'X-Cdn-Uri',
'UNKNOWN');
470 foreach ($attrs as $item => $val) {
473 $headers[
'X-TTL'] = (int) $val;
477 if (isset($val) && $val == FALSE) {
484 $headers[
'X-CDN-Enabled'] = $flag;
487 case 'log_retention':
489 if (isset($val) && $val == FALSE) {
495 $headers[
'X-Log-Retention'] = $flag;
498 $headers[$item] = (string) $val;
506 return $response->status() == 204;
558 return $res->status() == 204;
574 $url = $this->url .
'/' . rawurlencode(
$name) . $qstring;
577 $client = \HPCloud\Transport::instance();
578 $response = $client->doRequest(
$url, $method, $headers);