PUT Bucket tagging
API Description
You can use this API to set bucket tags.
Method Definition
func (obsClient ObsClient) SetBucketTagging(input *SetBucketTaggingInput) (output *BaseModel, err error)
Method Definition If a Signed URL Is Used
func (obsClient ObsClient) SetBucketTaggingWithSignedUrl(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.SetBucketTaggingInput{}
input.Bucket = "bucketname"
var tags [2]obs.Tag
tags[0] = obs.Tag{Key: "key0", Value: "value0"}
tags[1] = obs.Tag{Key: "key1", Value: "value1"}
input.Tags = tags[:]
output, err := obsClient.SetBucketTagging(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 notification
Next Article: GET Bucket tagging
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.