1

The documentation states

To list CDN-only containers, follow the same operation for Storage which lists all containers. The only difference is which service object you execute the method on.

But what is the right service object. I tried:

$service = objectStoreService('cloudFiles', $region);
$service = objectStoreCDNService('cloudFilesCDN', $region);
$service = objectStoreCDNService('cloudFiles', $region);
$service = objectStoreService('cloudFilesCDN', $region);

And $containers = $service->listContainers() or $containers->listContainers(array('enabled_only' => TRUE)) with all of the above to no avail.

tic2000
  • 66
  • 5

1 Answers1

2

As you've already noticed, you need to provide the enabled_only query parameter in order to retrieve CDN-enabled containers.

You're going wrong because your true is being converted to 1 in the URL. This is a natural boolean conversion. The API, however, seems to be expecting a string. Changing it to:

$containers = $service->listContainers(array(
   'enabled_only' => 'true'
));

should work.


What happens if you perform the operation on the CDN service:

$containers = $service->getCdnService()->listContainers();
hohner
  • 11,498
  • 8
  • 49
  • 84