Obtaining the Storage Class of a Bucket
API Description
You can use this API to obtain the storage class of a bucket.
Method Definition
ObsClient.getBucketStoragePolicy(bucketName)
Request Parameters
| Field | Type | Optional or Mandatory | Description |
|---|---|---|---|
| bucketName | str | Mandatory | Bucket name |
Returned Results
| Type | Description |
|---|---|
| SDK common result object |
| GetResult.body Type | Description |
|---|---|
| Response result of the request for obtaining the storage class of a bucket |
Sample Code
try:
resp = obsClient.getBucketStoragePolicy('bucketname')
if resp.status < 300:
print('requestId:', resp.requestId)
print('storageClass:', resp.body.storageClass)
else:
print('errorCode:', resp.errorCode)
print('errorMessage:', resp.errorMessage)
except:
import traceback
print(traceback.format_exc()) Last Article: Setting a Storage Class for a Bucket
Next Article: Setting a Bucket ACL
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.