Feature Overview
This API is used to query the lifecycle configuration set for a bucket.
Notes
1. To get the versioning status of a bucket, you need to have read permission for the bucket.
2. There are three versioning statuses: not enabled, enabled, and suspended.
If you have never enabled or suspended versioning for 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>
Requests
Sample Request
GET /?versioning HTTP 1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT dateAuthorization: Auth String
Note
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com, where <BucketName-APPID> is the bucket name with the APPID suffix, such as examplebucket-1250000000. You can refer to the Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Convention documentation. <Region> represents the available regions for COS, which can be found in the Regions and Access Domain Names documentation.
Authorization: Auth String (For more information, see Request Signature.)
Request Header
Request Body
The request body of this request is empty.
Response
Response Header
Response Body
<VersioningConfiguration><Status></Status></VersioningConfiguration>
The nodes are described as follows:
Node Name (Keyword) | Parent Node | Description | Local Disk Types |
VersioningConfiguration | - | Versioning configuration | Container |
Status | VersioningConfiguration | Whether versioning is enabled. Enumerated values: Suspended, Enabled | Enum |
Error Codes
Examples
Requests
GET /?versioning HTTP/1.1Host: examplebucket-1250000000.cos.ap-chengdu.myqcloud.comConnection: keep-aliveAccept-Encoding: gzip, deflateAccept: */*User-Agent: python-requests/2.12.4Authorization: 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 OKContent-Type: application/xmlContent-Length: 120Connection: keep-aliveDate: Wed, 23 Aug 2017 08:15:16 GMTServer: tencent-cosx-cos-request-id: NTk5ZDM5OTRfZDNhZDM1MGFfMjYyMTFfZmU3****<?xml version='1.0' encoding='utf-8' ?><VersioningConfiguration><Status>Enabled</Status></VersioningConfiguration>