tencent cloud


Restoring Archived Objects

Last updated: 2022-01-13 12:40:58


    This document provides an overview of APIs and SDK code samples related to restoring an archived object.

    API Operation Description
    POST Object restore Restoring an archived object Restores an archived object for access.

    Restoring an Archived Object


    This API (POST Object restore) is used to restore an archived COS object. The restored readable object is temporary. You can set the time during which the temporary object remains readable and the time to delete it. You can use the Days parameter to specify the expiration time of the temporary object. If you have not performed any operation on the object, such as copying it or extending its validity period, when it expires, the temporary object will be automatically deleted. A temporary object is only a copy of the archived object. The source object continues to exist throughout this period.

    Sample code

       Bucket: 'examplebucket-1250000000', /* Your bucket name. Required. */
       Region: 'COS_REGION',  /* Bucket region, such as `ap-beijing`. Required. */
       Key: '1.jpg',  /* Object key stored in the bucket (such as `1.jpg` and `a/b/test.txt`). Required. */
       RestoreRequest: {
           Days: 1,
           CASJobParameters: {
               Tier: 'Expedited'
    }, function(err, data) {
       console.log(err || data);

    Parameter description

    Parameter Description Type Required
    Bucket Bucket name in the format of BucketName-APPID String Yes
    Region Bucket region. For the enumerated values, please see Regions and Access Endpoints. String Yes
    Key Object key (object name), the unique identifier of an object in a bucket. For more information, please see Object Overview. String Yes
    RestoreRequest A container for data restoration Object Yes
    - Days Expiration time of the temporary copy Number Yes
    - CASJobParameters A container for the archive job parameters Object Yes
    - - Tier Restoration mode. Valid values: Standard, which completes a restoration task in 3-5 hours; Expedited, which completes a restoration job in 15 minutes; Bulk, which completes multiple restoration tasks in 5-12 hours String Yes

    Callback function description

    function(err, data) { ... }
    Parameter Description Type
    err Error code, which is returned when an error (network error or service error) occurs. If the request is successful, this parameter is empty. For more information, please see Error Codes. Object
    - statusCode HTTP status code, such as 200, 403, and 404 Number
    - headers Headers Object
    data Content returned when the request is successful. If the request fails, this parameter is empty. Object
    - statusCode HTTP status code, such as 200, 403, and 404 Number
    - headers Headers Object
    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