You can call this operation to view information about a bucket. Only the bucket owner can view information about a bucket.

Note The request can be initiated from any OSS endpoint.

Request syntax

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

Response elements

Element Type Description
BucketInfo Container

The container that stores the bucket information content.

Child node: Bucket

Parent node: none

Bucket Container

The container that stores the specific information about the bucket.

Parent node: BucketInfo

CreationDate Time

The time when the bucket was created.

Time format: 2013-07-31T10:56:21.000Z. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

Parent node: BucketInfo.Bucket

ExtranetEndpoint String

The OSS domain name to access the bucket over the public network.

Parent node: BucketInfo.Bucket

IntranetEndpoint String

The OSS domain name to access the bucket from ECS within the same region over the internal network.

Parent node: BucketInfo.Bucket

Location String

The region where the bucket is located.

Parent node: BucketInfo.Bucket

Name String

The bucket name.

Parent node: BucketInfo.Bucket

Owner Container

The container that stores the information about the bucket owner.

Parent node: BucketInfo.Bucket

ID String

The user ID of the bucket owner.

Parent node: BucketInfo.Bucket.Owner

DisplayName String

The name of the bucket owner, which is currently the same as the user ID.

Parent node: BucketInfo.Bucket.Owner

AccessControlList Container

The container that stores the ACL information.

Parent node: BucketInfo.Bucket

Grant Enumerated string

The ACL for the bucket.

Valid values: private, public-read, and public-read-write

Parent node: BucketInfo.Bucket.AccessControlList

DataRedundancyType Enumerated string

The type of disaster recovery.

Valid values: LRS and ZRS

Parent node: BucketInfo.Bucket

StorageClass String

The bucket storage class.

Valid values: Standard, IA, Archive and ColdArchive

Versioning String

The status of versioning for the bucket.

Valid values: Enabled and Suspended

Parent node: BucketInfo.Bucket

ServerSideEncryptionRule Container

The container that stores server-side encryption rules.

Parent node: BucketInfo.Bucket

ApplyServerSideEncryptionByDefault Container

The container that stores the default server-side encryption method.

Parent node: BucketInfo.Bucket

SSEAlgorithm String

Displays the default server-side encryption method.

Valid values: KMS and AES256

KMSMasterKeyID String

Displays the currently used CMK ID. A valid value is returned only when you set SSEAlgorithm to KMS and specify the CMK ID. In other cases, null is returned.

Examples

Sample requests
Get /? bucketInfo HTTP/1.1
Host: oss-example.oss.aliyuncs.com  
Date: Sat, 12 Sep 2015 07:51:28 GMT
Authorization: OSS qn6qrrqxo2oawuk53otfjbyc: BuG4rRK+zNhH1AcF51NNHD39****
				
Sample responses
  • Sample success responses when information about the bucket is obtained
    HTTP/1.1 200
    x-oss-request-id: 534B371674E88A4D8906****
    Date: Sat, 12 Sep 2015 07:51:28 GMT
    Connection: keep-alive
    Content-Length: 531  
    Server: AliyunOSS
    <? xml version="1.0" encoding="UTF-8"? >
    <BucketInfo>
      <Bucket>
        <CreationDate>2013-07-31T10:56:21.000Z</CreationDate>
        <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>
        <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>
        <Location>oss-cn-hangzhou</Location>
        <StorageClass>ColdArchive</StorageClass>
        <Name>oss-example</Name>
        <Owner>
          <DisplayName>username</DisplayName>
          <ID>27183473914****</ID>
        </Owner>
        <AccessControlList>
          <Grant>private</Grant>
        </AccessControlList>
        <Comment>test</Comment>
      </Bucket>
    </BucketInfo>
  • Sample error responses when a specified bucket is not found
    HTTP/1.1 404 
    x-oss-request-id: 534B371674E88A4D8906****
    Date: Sat, 12 Sep 2015 07:51:28 GMT
    Connection: keep-alive
    Content-Length: 308  
    Server: AliyunOSS
    <? xml version="1.0" encoding="UTF-8"? >
    <Error>
      <Code>NoSuchBucket</Code>
      <Message>The specified bucket does not exist. </Message>
      <RequestId>568D547F31243C673BA1****</RequestId>
      <HostId>nosuchbucket.oss.aliyuncs.com</HostId>
      <BucketName>nosuchbucket</BucketName>
    </Error>
  • Sample error responses when you are not authorized to access information about the bucket
    HTTP/1.1 403
    x-oss-request-id: 534B371674E88A4D8906****
    Date: Sat, 12 Sep 2015 07:51:28 GMT
    Connection: keep-alive
    Content-Length: 209  
    Server: AliyunOSS
    <? xml version="1.0" encoding="UTF-8"? >
    <Error>
      <Code>AccessDenied</Code>
      <Message>AccessDenied</Message>
      <RequestId>568D5566F2D0F89F5C0E****</RequestId>
      <HostId>test.oss.aliyuncs.com</HostId>
    </Error>

SDKs

You can call this operation when you use SDK demos in any of the following programming languages:

Error codes

Error code HTTP status code Description
NoSuchBucket 404 The error message returned because no such bucket is found.
AccessDenied 403 The error message returned because you are not authorized to view information about the bucket. Only the bucket owner can view information about a bucket.