tencent cloud

Feedback

PUT Object Retention

Last updated: 2024-06-12 15:10:38

    Function Description

    This interface is used to set the lock mode and retention period for an object.

    Request

    Request Example

    PUT /<object-key>?retention HTTP/1.1
    Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
    Date: GMT Date
    Authorization: Auth String
    Note:
    Host: <BucketName-APPID>.cos.<Region>.myqcloud.com. <BucketName-APPID> indicates the bucket name suffixed with APPID, such as examplebucket-1250000000. Refer to Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Conventions. <Region> indicates the available regions of COS, for which you may refer to Regions and Access Endpoints.
    Authorization: Auth String (for details, refer to Request Signature).

    Request Headers

    This interface only uses common request headers. For details, refer to Common Request Headers.

    Request Body

    <Retention>
    <Mode>COMPLIANCE</Mode>
    <RetainUntilDate>timestamp</RetainUntilDate>
    </Retention>
    The specific data is described as follows:
    Node Name (Keyword)
    Parent Node
    Description
    Type
    Retention
    None
    Period.
    Container
    Mode
    Retention
    Object lock mode. Only the enumerated value COMPLIANCE is supported.
    Enum
    RetainUntilDate
    Retention
    Specific to date.
    String Date

    Response

    Response Headers

    This interface only returns common response headers. For details, refer to Common Response Headers.

    Response Body

    The response body is empty.

    Error Codes

    This interface adheres to unified error responses and error codes. For details, refer to Error Codes.

    Examples

    Request

    PUT /temp.txt?retention HTTP/1.1
    Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
    Authorization: Auth String
    
    <Retention>
    <Mode>COMPLIANCE</Mode>
    <RetainUntilDate>2022-12-10T08:34:48.000Z</RetainUntilDate>
    </Retention>

    Response

    HTTP/1.1 200 OK
    Content-Type: application/xml
    Content-Length: 87
    Connection: keep-alive
    Date: Fri, 09 Dec 2022 08:35:49 GMT
    Server: tencent-cos
    x-cos-request-id: NjM5MmYzNjVfMjBkMDM4MGJfMWM2ND****
    
    
    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