Setting the Storage Capacity Quota for a Bucket
API Description
You can use this API to set the storage capacity quota for a bucket. The quota must be expressed in bytes and the maximum value is 263-1. Value 0 indicates that no upper limit is set for the bucket storage capacity.
Method Definition
ObsClient.setBucketQuota(bucketName, quota)
Request Parameters
|
Field |
Type |
Optional or Mandatory |
Description |
|---|---|---|---|
|
bucketName |
str |
Mandatory |
Bucket name |
|
quota |
int |
Mandatory |
Bucket storage capacity quota. The value is a non-negative integer. |
Returned Results
|
Type |
Description |
|---|---|
|
SDK common result object |
Sample Code
try:
resp = obsClient.setBucketQuota('bucketname', 1024 * 1024 * 1024)
if resp.status < 300:
print('requestId:', resp.requestId)
else:
print('errorCode:', resp.errorCode)
print('errorMessage:', resp.errorMessage)
except:
import traceback
print(traceback.format_exc())
Last Article: Obtaining Bucket Storage Information
Next Article: Obtaining the Storage Capacity Quota of a Bucket
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.