Quota management
Updated at:2025-11-03
Quota management
Set bucket quota
Calling this method allows you to set the user’s quota, which includes the total number of buckets and the total storage capacity of each region. Currently, the maximum total number of buckets cannot exceed 100
- Basic workflow
- Initialize BOSClient
- Call the putUserQuota() method
- Example code
JavaScript
1const quotaInfo = {
2 maxBucketCount: <maxBucketCount>
3 maxCapacityMegaBytes: <maxCapacityMegaBytes>
4}
5client.putUserQuota(quotaInfo)
- Parameter: quotaInfo structure
| Parameters | Required or not | Description |
|---|---|---|
| max_bucket_count | Yes | Maximum number of buckets that can be created. A value of -1 means no setting |
| max_capacity_mega_bytes | Yes | Maximum storage capacity in MB. A value of -1 or 0 means no setting for storage capacity quota limit, namely no upper limit |
Note:
Only the bucket owner with FULL_CONTROL permission can make this request
Query quota settings
This API displays the user’s quota settings. Note that only primary users are authorized to call this API.
JavaScript
1client.getUserQuota()
Delete quota settings
This API deletes quota settings. Note that only the primary user is authorized to call this API.
JavaScript
1client.deleteUserQuota()
