This document provides an overview of APIs and SDK code samples related to bucket tagging.
API | Operation Name | Operation Description |
---|---|---|
PUT Bucket tagging | Setting a bucket tag | Sets a tag for an existing bucket |
GET Bucket tagging | Querying bucket tags | Queries the existing tags of a specified bucket |
DELETE Bucket tagging | Deleting a bucket tag | Deletes a specified bucket tag |
This API (PUT Bucket tagging) is used to set a tag for an existing bucket.
put_bucket_tagging(Bucket, Tagging={}, **kwargs)
response = client.put_bucket_tagging(
Bucket='examplebucket-1250000000',
Tagging={
'TagSet': {
'Tag': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
)
Parameter Name | Description | Type | Required |
---|---|---|---|
Bucket | Bucket for which to set a tag in the format of BucketName-APPID . For more information, please see Naming Convention |
String | Yes |
Tag | Tag set | List | Yes |
Key | Tag key, which can contain letters, digits, spaces, plus signs, minus signs, underscores, equal signs, dots, colons, and slashes with a maximum length of 128 bytes | String | Yes |
Value | Tag value, which can contain letters, digits, spaces, plus signs, minus signs, underscores, equal signs, dots, colons, and slashes with a maximum length of 256 bytes | String | Yes |
The returned value of this method is None.
This API (GET Bucket tagging) is used to query the existing tags of a specified bucket.
get_bucket_tagging(Bucket, **kwargs)
response = client.get_bucket_tagging(
Bucket='examplebucket-1250000000'
)
Parameter Name | Description | Type | Required |
---|---|---|---|
Bucket | Bucket for which to query a tag in the format of BucketName-APPID . For more information, please see Naming Convention |
String | Yes |
Tag management list of bucket in dict type.
{
'TagSet': {
'Tag': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Parameter Name | Description | Type |
---|---|---|
Tag | Tag set | List |
Key | Tag key, which can contain letters, digits, spaces, plus signs, minus signs, underscores, equal signs, dots, colons, and slashes with a maximum length of 128 bytes | String |
Value | Tag value, which can contain letters, digits, spaces, plus signs, minus signs, underscores, equal signs, dots, colons, and slashes with a maximum length of 256 bytes | String |
This API (DELETE Bucket tagging) is used to delete an existing tag of a specified bucket.
delete_bucket_tagging(Bucket, **kwargs)
response = client.delete_bucket_tagging(
Bucket='examplebucket-1250000000'
)
Parameter Name | Description | Type | Required |
---|---|---|---|
Bucket | Bucket for which to delete a tag in the format of BucketName-APPID . For more information, please see Naming Convention |
String | Yes |
The returned value of this method is None.
Was this page helpful?