簡體   English   中英

使用php-opencloud列出啟用CDN的機架式容器

[英]List rackspace CDN-enabled containers with php-opencloud

文檔說明

要列出僅CDN的容器,請對存儲列出所有容器進行相同的操作。 唯一的區別是您在哪個服務對象上執行該方法。

但是正確的服務對象是什么。 我試過了:

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

$containers = $service->listContainers()$containers->listContainers(array('enabled_only' => TRUE))以上均無濟於事。

正如您已經注意到的,您需要提供enabled_only查詢參數才能檢索啟用CDN的容器。

您出了錯,因為您的true在URL中被轉換為1 這是自然的布爾轉換。 但是,API似乎期望使用字符串。 更改為:

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

應該管用。


如果您在CDN服務上執行該操作會發生什么:

$containers = $service->getCdnService()->listContainers();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM