Overview
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
Description
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 request
cos.restoreObject({
Bucket: 'examplebucket-1250000000',
Region: 'COS_REGION',
Key: '1.jpg',
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 ID 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 |
Apakah halaman ini membantu?