Querying Versioning Information

Last Updated At: 2025-10-21 09:10:00

Description

The GET Bucket versioning API is used to obtain versioning information for a bucket.

Notes

  1. To obtain the status of versioning for a bucket, read permission for the bucket is required.

  2. There are three versioning states: versioning not enabled, versioning enabled, and versioning suspended.

    • If you have never enabled (or suspended) versioning on the bucket, the response is:
    <VersioningConfiguration/>
    
    • If you have enabled versioning for the bucket, the response is:
    <VersioningConfiguration>
      <Status>Enabled</Status>
    </VersioningConfiguration>
    
    • If you have suspended versioning for the bucket, the response is:
    <VersioningConfiguration>
      <Status>Suspended</Status>
    </VersioningConfiguration>
    

Request

Request Example

GET /?versioning HTTP 1.1
Host: <BucketName-APPID>.<Endpoint>
Date: GMT date
Authorization: Auth String

Note:

Authorization: Auth String (For details, see Request Signature documentation).

Request Header

Common Headers

This request uses common request headers. For details, see Public Request Headers.

Non-common Headers

This request has no special request header information.

Request Body

The request does not have a request body.

Response

Response Headers

Common Response Headers

This response uses common response headers. For details, see Common Response Headers.

Special Response Headers

There are no special response headers for this response operation.

Response Body

<VersioningConfiguration>
    <Status></Status>
</VersioningConfiguration>

The data are as follows:

Node Name (Keyword) Parent Node Description Type
VersioningConfiguration No Specify the details of versioning. Container
Status VersioningConfiguration Specify whether the versioning is enabled, enumerated values: Suspended, Enabled. Enum

Practical Case

Request

GET /?versioning HTTP/1.1
Host: <BucketName-APPID>.<Endpoint>
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.12.4
Authorization: q-sign-algorithm=sha1&q-ak=AKID15IsskiBQKTZbAo6WhgcBqVls9Sm****&q-sign-time=1480932292;1981012292&q-key-time=1480932292;1981012292&q-url-param-list=versioning&q-header-list=host&q-signature=5118a936049f9d44482bbb61309235cf4abe****

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 120
Connection: keep-alive
Date: Wed, 23 Aug 2017 08:15:16 GMT
x-cos-request-id: NTk5ZDM5OTRfZDNhZDM1MGFfMjYyMTFfZmU3****

<?xml version='1.0' encoding='utf-8' ?>
<VersioningConfiguration>
    <Status>Enabled</Status>
</VersioningConfiguration>