tencent cloud

Feedback

GET Bucket lifecycle

Last updated: 2021-11-11 14:19:22

    Feature Description

    This API is used to query the lifecycle configuration of a bucket. If no lifecycle rule is configured for the bucket, NoSuchLifecycleConfiguration will be returned.

    API Explorer is recommended.
    Debug
    API Explorer makes it easy to make online API calls, verify signatures, generate SDK code, search for APIs, etc. You can also use it to query the content of each request as well as its response.

    Request

    Sample request

    GET /?lifecycle HTTP/1.1
    Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
    Date: GMT Date
    Authorization: Auth String
    
    Note:

    Request headers

    This API only uses Common Request Headers.

    Request body

    The request body of this request is empty.

    Response

    Response headers

    This API only returns Common Response Headers.

    Response body

    Elements in the response body are the same as those in the request body of PUT Bucket lifecycle. For more information, please see PUT Bucket lifecycle.

    Error codes

    This API returns common error responses and error codes. For more information, please see Error Codes.

    Example

    Request

    GET /?lifecycle HTTP/1.1
    Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
    Date: Wed, 16 Aug 2017 12:23:54 GMT
    Authorization:q-sign-algorithm=sha1&q-ak=AKIDZfbOAo7cllgPvF9cXFrJD0a1ICvR****&q-sign-time=1502857357;1502937357&q-key-time=1502857357;1502937357&q-header-list=host&q-url-param-list=lifecycle&q-signature=da155cda3461bee7422ee95367ac8013ef84****
    

    Response

    HTTP/1.1 200 OK
    Content-Type: application/xml
    Content-Length: 312
    Date: Wed, 16 Aug 2017 12:23:54 GMT
    Server: tencent-cos
    x-cos-request-id: NTk5NDM5NWFfMjQ4OGY3Xzc3NGRf****
    <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>
    

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support