OSS\OssClient::listBuckets PHP Метод

listBuckets() публичный Метод

列举用户所有的Bucket[GetService], Endpoint类型为cname不能进行此操作
public listBuckets ( array $options = NULL ) : OSS\Model\BucketListInfo
$options array
Результат OSS\Model\BucketListInfo
    public function listBuckets($options = NULL)
    {
        if ($this->hostType === self::OSS_HOST_TYPE_CNAME) {
            throw new OssException("operation is not permitted with CName host");
        }
        $this->precheckOptions($options);
        $options[self::OSS_BUCKET] = '';
        $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
        $options[self::OSS_OBJECT] = '/';
        $response = $this->auth($options);
        $result = new ListBucketsResult($response);
        return $result->getData();
    }

Usage Example

 public function testConstrunct8()
 {
     try {
         $ossClient = new OssClient(Config::OSS_ACCESS_ID, Config::OSS_ACCESS_KEY, "http://123.123.123.1", true);
         $ossClient->listBuckets();
         $this->assertFalse(true);
     } catch (OssException $e) {
     }
 }
All Usage Examples Of OSS\OssClient::listBuckets