POST Object Restore
API Description
You can use this API to restore an object in the OBS Archive storage class in a specified bucket.
Method Definition
ObsClient.restoreObject
Request Parameter
|
Field |
Type |
Optional or Mandatory |
Description |
|---|---|---|---|
|
Bucket |
String |
Mandatory |
Bucket name |
|
Key |
String |
Mandatory |
Object name |
|
VersionId |
String |
Optional |
Version ID of the to-be-restored object in the OBS Archive storage class |
|
Days |
Number |
Mandatory |
Retention period of the restored object, in days. The value ranges from 1 to 30. |
|
Tier |
String |
Optional |
Returned Result (InterfaceResult)
|
Field |
Type |
Description |
|---|---|---|
|
RequestId |
String |
Request ID returned by the OBS server |
|
RestoreStatus |
String |
Restoration status of the object. AVALIABLE indicates that the object can be downloaded. INPROGRESS indicates that the object is being restored. |
Sample Code
obsClient.restoreObject({
Bucket:'bucketname',
Key : 'objectkey',
Days : 1,
Tier : obsClient.enums.RestoreTierExpedited
},(err, result) => {
if(err){
console.error('Error-->' + err);
}else{
if(result.CommonMsg.Status < 300){
console.log('RequestId-->' + result.InterfaceResult.RequestId);
console.log('RestoreStatus-->' + result.InterfaceResult.RestoreStatus);
}else{
console.log('Code-->' + result.CommonMsg.Code);
console.log('Message-->' + result.CommonMsg.Message);
}
}
});
Last Article: Abort Multipart Upload
Next Article: Other APIs
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.