This implementation of the GET operation uses the tagging subresource to return the tag set associated with the bucket. However, searching for buckets by tag is not supported.
Only users granted the s3:GetBucketTagging permission can perform this operation. By default, the permission is granted to the bucket owner only. However, it can be granted to other users by configuring the bucket policy.
GET /?tagging HTTP/1.1 User-Agent: agent Host: bucketname.obs.example.com Accept: */* Date: date Authorization: authorization string
This request contains no parameter.
This request uses common headers. For details about common request headers, see section Common Request Headers.
This request contains no element.
HTTP/1.1 200 OK Server: Server Name x-amz-request-id: request id x-amz-id-2: id x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc Content-Type: application/xml Content-Length: 0 Date: date <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Tagging xmlns="http://obs.example.com/doc/2015-06-30/"> <TagSet> <Tag> <Key>TagNameJJ1</Key> <Value>tytttasceettt</Value> </Tag> </TagSet> </Tagging>
This response uses common headers. For details about common response headers, see section Common Response Headers.
This response contains elements to detail bucket lifecycle configuration. The following table describes the elements.
Element |
Description |
Mandatory or Not |
---|---|---|
Tagging |
Container for the TagSet and Tag elements Type: Container Ancestor: None |
Yes |
TagSet |
Container for a set of tags Type: Container Ancestor: Tagging |
Yes |
Tag |
Container for tag information Type: Container. Each bucket supports a maximum of 20 tags. Ancestor: TagSet |
Yes |
Key |
Name of the tag Type: String. It can contain a maximum of 36 characters, including A to Z, a to z, 0 to 9, hyphens (-), underscores (_), and Unicode(\u4E00-\u9FFF). In the same bucket, the key of a tag must be unique. Ancestor: Tag |
Yes |
Value |
Value of the tag Type: String. It can contain a maximum of 43 characters, including A to Z, a to z, 0 to 9, hyphens (-), underscores (_), periods (.), and Unicode(\u4E00-\u9FFF). Note that periods (.) can be used for this parameter. Ancestor: Tag |
Yes |
Except for common error responses, special error responses are also returned. The following table lists error responses and possible causes.
Error Code |
Possible Cause |
HTTP Status Code |
---|---|---|
NoSuchTagSet |
The specified bucket is not configured with a tag. |
404 Not Found |
GET /?tagging HTTP/1.1 User-Agent: curl/7.19.7 (x86_64-suse-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8j zlib/1.2.7 libidn/1.10 Host: bucketname.obs.example.com Accept: */* Date: Tue, 09 May 2017 03:17:07 +0000 Authorization: authorization string
HTTP/1.1 200 OK Server: OBS x-amz-request-id: 0002B7532E0000015BEB35330C5884X1 x-amz-id-2: s12w20LYNQqSb7moq4ibgJwmQRSmVQV+rFBqplOGYkXUpXeS/nOmbkyD+E35K79j x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc Content-Type: application/xml Date: Tue, 09 May 2017 03:16:23 GMT Content-Length: 441 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Tagging xmlns="http://obs.example.com/doc/2015-06-30/"> <TagSet> <Tag> <Key>TagNameJJ1</Key> <Value>tytttasceettt</Value> </Tag> </TagSet> </Tagging>