PUT Bucket quota
API Description
You can use this API to set the bucket quota. A bucket 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 quota.
Method Definition
func (obsClient ObsClient) SetBucketQuota(input *SetBucketQuotaInput) (output *BaseModel, err error)
Method Definition If a Signed URL Is Used
func (obsClient ObsClient) SetBucketQuotaWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)
Request Parameter
| Field | Type | Optional or Mandatory |
|---|---|---|
| input | Mandatory |
Returned Result
| Field | Type |
|---|---|
| output | |
| err | error |
Sample Code
func main() {
input := &obs.SetBucketQuotaInput{}
input.Bucket = "bucketname"
input.Quota = 1024 * 1024 * 1024
output, err := obsClient.SetBucketQuota(input)
if err == nil {
fmt.Printf("RequestId:%s\n", output.RequestId)
} else {
if obsError, ok := err.(obs.ObsError); ok {
fmt.Println(obsError.Code)
fmt.Println(obsError.Message)
} else {
fmt.Println(err)
}
}
} Last Article: GET Bucket storageinfo
Next Article: GET Bucket quota
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.