Description
The POST Object restore API can be used to restore an object that is archived as the archive storage type by COS. The restored readable object is temporary, and you can set the duration for it to remain readable as well as specify when to delete this temporary replica. You can use the Days parameter to set the expiration time of the temporary object. If it exceeds this duration and you have not initiated any copy, extension, or other operations, the temporary object will be automatically deleted by the system. The temporary object is only a replica of the object of the archive storage type, and the archived source object always exists during this period.
Request
Request Example
POST /<ObjectKey>?restore HTTP/1.1
Host: <BucketName-APPID>.<Endpoint>
Date: GMT Date
Authorization: Auth String
Request Header
Common Headers
Public request headers are used for implementing this request.
Non-common Headers
This request has no special request header information.
Request Body
The following figure shows the request bodies required for implementing this request operation.
<RestoreRequest>
<Days>2</Days>
<CASJobParameters>
<Tier>Bulk</Tier>
</CASJobParameters>
</RestoreRequest>
The data are described as follows:
| Node Name (Keyword) | Parent Node | Description | Type | Required |
|---|---|---|---|---|
| RestoreRequest | No | Container for data restoration. | Container | Yes |
| Days | No | Expiration time of the temporary replica. | integer | Yes |
| CASJobParameters | No | Restores job parameters. | Container | Yes |
| Tier | No | During data recovery, Tier can be specified as one of the three recovery modes supported by CAS: Standard (standard mode, with the recovery task completed within 3–5 hours), Expedited (speed mode, with the recovery task completed within 15 minutes), and Bulk (batch mode, with the recovery task completed within 5–12 hours). | Enum | Yes |
Response
Response Headers
Common Response Headers
This response contains common response headers.
Special Response Headers
There are no special response headers for this response operation.
Response Body
The response body is empty.
Error Code
The following table describes errors that may occur with this request.
| Error Code | Description | HTTP Status Code |
|---|---|---|
| None | Restored successfully. | 202 Accepted |
| RestoreAlreadyInProgress | Restoring the object. | 409 Conflict |
Practical Case
Request
POST /exampleobject?restore HTTP/1.1
Accept: */*
Authorization:q-sign-algorithm=sha1&q-ak=AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=28e9a4986df11bed0255e97ff90500557e0ea057
Host: <BucketName-APPID>.<Endpoint>
Content-Length: 105
Content-Type: application/x-www-form-urlencoded
<RestoreRequest>
<Days>2</Days>
<CASJobParameters>
<Tier>Bulk</Tier>
</CASJobParameters>
</RestoreRequest>
Response
HTTP/1.1 202 Accepted
Content-Type: application/xml
Content-Length: 0
Connection: keep-alive
Date: Thu, 15 Jun 2017 12:37:29 GMT
x-cos-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhfMjc=