Restore Object

Last update:2024-06-18 17:11:54

This API can restore files stored in Archive Storage type. Once restored, you can directly access these archived files.

Request Syntax

To call this API, send a POST request in the following format:

POST /restore/{encodedEntry}/days/{duration}
Host: {mgrDomain}
Authorization: {managementcredential}

Parameter Description

The following table provides the necessary information and description of the parameters:

Parameter Required Description
encodedEntry Yes The file to be restored, formatted as EncodeEntryURI(bucket:key), where bucket is the storage bucket name and key is the file name (including path). For example, YnVja2V0MToxLmpwZw== represents the URL-safe Base64 encoded form of bucket1:1.jpg.
days Yes The duration for which the file will be accessible after restoration, with a minimum of 1 day. If the format is invalid, a 400 error will be returned.
mgrDomain Yes The management domain, which can be found in the Overview section of the bucket. The format is usually *.v1.wcsapi.com.
managementcredential Yes The management credential is used for authentication in API calls. For more details on creating the management credential, please refer to Management Credential.

Request Example

The following example shows how to initiate a request to restore an archived file using the curl command:

curl -v -X POST "http://{mgrDomain}/restore/aW1hZ2VzOkltYWdlLnBuZw==/days/1"

Response Description

Successful Request

On successful call:

{"code": 200, "message": "ok"}

Failed Request

If the file is already in Standard Storage, the response will be:

{"code": 401, "message": "Invalid Object State"}

If the file is already being restored, a repeated call will return:

{"code": 409, "message": "Restore Is InProgress"}

If the file is not of Archive Storage type, the response will be:

{"code": 403, "message": "Unsupported Operation"}

If the file does not exist, the response will be:

{"code": 404, "message": "File Not Found"}

For other failure scenarios, the response will be:

{
    "code": "<httpCode int>",
    "message": "<errMsg string>"
}
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!