GetBucketInfo

Last Updated: Jun 06, 2017

The Get Bucket Info operation is used to view the bucket information. The information includes the following:

  • Create time
  • Internet access endpoint
  • Intranet access endpoint
  • Bucket owner information
  • Bucket ACL (AccessControlList)

Request syntax

  1. GET /?bucketInfo HTTP/1.1
  2. Host: BucketName.oss.aliyuncs.com
  3. Date: GMT Date
  4. Authorization: SignatureValue

Response elements

Name Description
BucketInfo The container that saves the bucket information content
Type: container
Sub-node: Bucket node
Parent node: none
Bucket The container that saves the bucket specific information
Type: container
Parent node: BucketInfo node
CreationDate The create time of the bucket. Time format: 2013-07-31T10:56:21.000Z
Type: time
Parent node: BucketInfo.Bucket
ExtranetEndpoint The internet domain name that the bucket accesses
Type: string
Parent node: BucketInfo.Bucket
IntranetEndpoint The intranet domain name for accessing the bucket from ECS in the same region
Type: string
Parent node: BucketInfo.Bucket
Location The region of the data center that the bucket is located in
Type: string
Parent node: BucketInfo.Bucket
Name The bucket name
Type: string
Parent node: BucketInfo.Bucket
Owner Container used for saving the information about the bucket owner.
Type: container
Parent node: BucketInfo.Bucket
ID User ID of the bucket owner.
Type: string
Parent node: BucketInfo.Bucket.Owner
DisplayName Name of the bucket owner (the same as the ID currently).
Type: string
Parent node: BucketInfo.Bucket.Owner
AccessControlList Container used for storing the ACL information
Type: container
Parent node: BucketInfo.Bucket
Grant ACL permissions of the bucket.
Type: enumerative string
Valid values: private, public-read, public-read-write
Parent node: BucketInfo.Bucket.AccessControlList

Detail analysis

  1. If the bucket does not exist, error 404 is returned. Error code: NoSuchBucket.
  2. Only the owner of a bucket can view the information of the bucket. If other users attempt to access the location information, the error 403 Forbidden with the error code: AccessDenied will be returned.
  3. The request can be initiated from any OSS endpoint.

Example

Request example:

  1. Get /?bucketInfo HTTP/1.1
  2. Host: oss-example.oss.aliyuncs.com
  3. Date: Sat, 12 Sep 2015 07:51:28 GMT
  4. Authorization: OSS qn6qrrqxo2oawuk53otfjbyc: BuG4rRK+zNhH1AcF51NNHD39zXw=

Return example after the bucket information is obtained successfully:

  1. HTTP/1.1 200
  2. x-oss-request-id: 534B371674E88A4D8906008B
  3. Date: Sat, 12 Sep 2015 07:51:28 GMT
  4. Connection: keep-alive
  5. Content-Length: 531
  6. Server: AliyunOSS
  7. <?xml version="1.0" encoding="UTF-8"?>
  8. <BucketInfo>
  9. <Bucket>
  10. <CreationDate>2013-07-31T10:56:21.000Z</CreationDate>
  11. <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>
  12. <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>
  13. <Location>oss-cn-hangzhou</Location>
  14. <Name>oss-example</Name>
  15. <Owner>
  16. <DisplayName>username</DisplayName>
  17. <ID>271834739143143</ID>
  18. </Owner>
  19. <AccessControlList>
  20. <Grant>private</Grant>
  21. </AccessControlList>
  22. </Bucket>
  23. </BucketInfo>

Return example if the requested bucket information does not exist:

  1. HTTP/1.1 404
  2. x-oss-request-id: 534B371674E88A4D8906009B
  3. Date: Sat, 12 Sep 2015 07:51:28 GMT
  4. Connection: keep-alive
  5. Content-Length: 308
  6. Server: AliyunOSS
  7. <?xml version="1.0" encoding="UTF-8"?>
  8. <Error>
  9. <Code>NoSuchBucket</Code>
  10. <Message>The specified bucket does not exist.</Message>
  11. <RequestId>568D547F31243C673BA14274</RequestId>
  12. <HostId>nosuchbucket.oss.aliyuncs.com</HostId>
  13. <BucketName>nosuchbucket</BucketName>
  14. </Error>

Return example if the requester has no access permission to the bucket information:

  1. HTTP/1.1 403
  2. x-oss-request-id: 534B371674E88A4D8906008C
  3. Date: Sat, 12 Sep 2015 07:51:28 GMT
  4. Connection: keep-alive
  5. Content-Length: 209
  6. Server: AliyunOSS
  7. <?xml version="1.0" encoding="UTF-8"?>
  8. <Error>
  9. <Code>AccessDenied</Code>
  10. <Message>AccessDenied</Message>
  11. <RequestId>568D5566F2D0F89F5C0EB66E</RequestId>
  12. <HostId>test.oss.aliyuncs.com</HostId>
  13. </Error>
Thank you! We've received your feedback.