bucket-tagging command is used to create (modify), get, and delete bucket tags. One bucket can have up to 50 tags.cos:GetBucketTagging. cos:PutBucketTagging. cos:DeleteBucketTagging. ./coscli bucket-tagging --method [method] cos://<bucket-name> [tag_key]#[tag_value]
bucket-tagging includes the following parameters:Parameter Format | Description | Sample |
cos://<bucket-name> | Specify the bucket to access. You can use the bucket alias from the configuration parameters or the bucket name. If using the bucket name, you must also include the endpoint flag. | Access using bucket alias: cos://example-alias Access using bucket name: cos://examplebucket-1250000000 |
bucket-tagging command contains the following optional flags:Flag Abbreviation | Flag Name | Description |
-h | --help | View the usage of this command. |
None | --method | Specify the required operations, including put (set tag), get (query tag), delete (delete tag), and add (add tag). |
403 AccessDenied../coscli bucket-tagging --method put cos://bucketAlias key1#value1 key2#value2
key#value represents the tag key-value pair Key-Value, where key and value are separated by #.If the bucket does not have a tag, this command will add the specified tag to the bucket; otherwise, it will overwrite the original tag../coscli bucket-tagging --method put cos://exmaple-alias 1#111 2#222
./coscli bucket-tagging --method get cos://bucketAlias
./coscli bucket-tagging --method get cos://exmaple-alias
example-alias has two sets of tags configured. One set has a key of 1 and a value of 111, while the other set has a key of 2 and a value of 222.KEY | VALUE------+--------1 | 1112 | 222
./coscli bucket-tagging --method delete cos://bucketAlias
./coscli bucket-tagging --method delete cos://exmaple-alias
403 AccessDenied../coscli bucket-tagging --method add cos://bucketAlias key1#value1 key2#value2
key#value represents the tag key-value pair Key-Value, where key and value are separated by #../coscli bucket-tagging --method add cos://example-alias 1#111
Feedback