GET 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: PUT Bucket quota
Next Article: Set Bucket Storage Class
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.