Description
The GET Bucket lifecycle API is used to query the lifecycle configuration of a bucket. If no lifecycle rule is configured for the bucket, NoSuchLifecycleConfiguration will be returned.
Request
Request Example
GET /?lifecycle HTTP/1.1
Host: <BucketName-APPID>.<Endpoint>
Date: GMT Date
Authorization: Auth String
Note:
Authorization: Auth String (See Request Signature for details.)
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
The content and meaning of each element in the response body are the same as those in the request body of the PUT Bucket lifecycle API. For details, see the description of the request body in Setting Lifecycle.
Error Code
This request returns common error responses and error codes. For more information, see Error Codes.
Practical Case
Request
GET /?lifecycle HTTP/1.1
Host: <BucketName-APPID>.<Endpoint>
Date: Wed, 16 Aug 2017 12:23:54 GMT
Authorization:q-sign-algorithm=sha1&q-ak=AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&q-sign-time=1502857357;1502937357&q-key-time=1502857357;1502937357&q-header-list=host&q-url-param-list=lifecycle&q-signature=da155cda3461bee7422ee95367ac8013ef847e02
Response
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 312
Date: Wed, 16 Aug 2017 12:23:54 GMT
x-cos-request-id: NTk5NDM5NWFfMjQ4OGY3Xzc3NGRfMjA=
<LifecycleConfiguration>
<Rule>
<ID>id1</ID>
<Filter>
<Prefix>documents/</Prefix>
</Filter>
<Status>Enabled</Status>
<Transition>
<Days>100</Days>
<StorageClass>STANDARD_IA</StorageClass>
</Transition>
</Rule>
<Rule>
<ID>id2</ID>
<Filter>
<Prefix>logs/</Prefix>
</Filter>
<Status>Enabled</Status>
<Expiration>
<Days>10</Days>
</Expiration>
</Rule>
</LifecycleConfiguration>