Obtaining a Bucket Quota
API Description
You can use this API to obtain the bucket quota. Value 0 indicates that no upper limit is set for the bucket quota.
Method Definition
func (obsClient ObsClient) GetBucketQuota(bucketName string) (output *GetBucketQuotaOutput, err error)
Method Definition If a Signed URL Is Used
func (obsClient ObsClient) GetBucketQuotaWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketQuotaOutput, err error)
Request Parameter
| Field | Type | Optional or Mandatory | Description |
|---|---|---|---|
| bucketName | string | Mandatory | Bucket name |
Returned Result
| Field | Type |
|---|---|
| output | |
| err | error |
Sample Code
func main() { output, err := obsClient.GetBucketQuota("bucketname") if err == nil { fmt.Printf("RequestId:%s\n", output.RequestId) fmt.Printf("Quota:%d\n", output.Quota) } else { if obsError, ok := err.(obs.ObsError); ok { fmt.Println(obsError.Code) fmt.Println(obsError.Message) } else { fmt.Println(err) } } }
Last Article: Setting a Bucket Quota
Next Article: Setting a Storage Class for a Bucket
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.