GET Bucket storagePolicy
API Description
You can use this API to obtain the storage class of a bucket.
Method Definition
1. ObsClient->getBucketStoragePolicy(array $parameter) 2. ObsClient->getBucketStoragePolicyAsync(array $parameter, callable $callback)
Request Parameter
|
Field |
Type |
Optional or Mandatory |
Description |
|---|---|---|---|
|
Bucket |
string |
Mandatory |
Bucket name |
Returned Result
|
Field |
Type |
Description |
|---|---|---|
|
HttpStatusCode |
integer |
HTTP status code |
|
Reason |
string |
Reason description |
|
RequestId |
string |
Request ID returned by the OBS server |
|
StorageClass |
string |
Storage class of the bucket |
Sample Code
try{
$resp = $obsClient -> getBucketStoragePolicy([
'Bucket' => 'bucketname'
]);
printf("RequestId:%s\n", $resp['RequestId']);
printf("StorageClass:%s\n", $resp['StorageClass']);
}catch (Obs\Common\ObsException $obsException){
printf("ExceptionCode:%s\n", $obsException->getExceptionCode());
printf("ExceptionMessage:%s\n", $obsException->getExceptionMessage());
}
Last Article: Set Bucket storagePolicy
Next Article: PUT Bucket acl
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.