tencent cloud

All product documents
Cloud Object Storage
Restoring Archived Objects
Last updated: 2024-02-02 17:35:18
Restoring Archived Objects
Last updated: 2024-02-02 17:35:18

Overview

This document provides an overview of APIs and SDK code samples for restoring an archived object.
API
Operation
Description
Restoring an archived object
Restores an archived object for access.

Restoring an Archived Object

Feature description

The POST Object restore API is used to restore an archived COS object. The restored readable object is a temporary copy, for which you can set the readable status and the time to delete it through the Days parameter. If the time has elapsed and you haven't initiated a copy or extension operation, the temporary object will be automatically deleted. Temporary objects are only copies of the archived objects which always exist.

Sample code

cos.restoreObject({
Bucket: 'examplebucket-1250000000', /* Your bucket (required) */
Region: 'COS_REGION', /* Bucket region (required), such as ap-beijing */
Key: '1.jpg', /* Object key stored in the bucket (required), such as `1.jpg` and `a/b/test.txt`. */
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, see Regions and Access Endpoints.
String
Yes
Key
Object key (object name), which is the unique identifier of an object in a bucket. For more information, see Object Overview.
String
Yes
RestoreRequest
Container for data restoration
Object
Yes
- Days
Expiration time of the temporary copy
Number
Yes
- CASJobParameters
Container for archive job parameters
Object
Yes
- - Tier
Restoration mode. Valid values: Standard (which restores an object within 3–5 hours), Expedited (which restores an object within 15 minutes), Bulk (which restores an object within 5–12 hours).
String
Yes

Callback function description

function(err, data) { ... }
Parameter
Description
Type
err
The object returned when an error (network error or service error) occurs. If the request is successful, this parameter is empty. For more information, see Error Codes.
Object
- statusCode
Returned HTTP status code, such as 200, 403, and 404.
Number
- headers
Returned headers
Object
data
The object returned when the request is successful. If an error occurs with the request, this parameter is empty.
Object
- statusCode
Returned HTTP status code, such as 200, 403, and 404.
Number
- headers
Returned headers
Object

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

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
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon