POST Object Restore

If you want to obtain the content of an Archive object, restore the object first. Then you can download the object.

Versioning

By default, the object of the latest version is restored. If the object of the latest version has a deletion marker, status code 404 is returned. To restore an object of a specified version, the versionId parameter can be used to specify the desired version.

Request Syntax

POST /ObjectName?restore&versionId=VersionID HTTP/1.1
Host: bucketname.obs.cn-north-1.myhwclouds.com
Date: date
Authorization: authorization string
Content-MD5: MD5

<RestoreRequest>
   <Days>NumberOfDays</Days>
   <GlacierJobParameters>
       <Tier>RetrievalOption</Tier>
   </GlacierJobParameters>
</RestoreRequest>

Request Parameters

Parameter

Description

Required or Optional

versionId

Indicates the version ID of the Archive object to be restored.

Type: string

Optional

Request Headers

This request uses common headers. For details, see Common Request Headers.

Request Elements

Table 1 Request elements

Element

Description

Required or Optional

RestoreRequest

Indicates the container for restoration information.

Type: container

Required

Days

Indicates the retention period of the restored object. The value is an integer ranging from 1 to 30.

Type: positive integer

Required

GlacierJobParameters

Container for Glacier job parameters.

Type: container

Optional

Tier

Indicates the retrieval options: [Expedited|Standard]

  • Expedited: indicates that data can be restored within 1 to 5 minutes.
  • Standard: indicates that data can be restored within 3 to 5 hours.

Type: string

Optional

Response Syntax

HTTP/1.1 status_code
Date: date

Response Headers

This response uses common headers. For details, see Common Response Headers.

Response Elements

This response involves no elements.

Error Responses

Table 2 List of OBS error codes

Error Code

Description

HTTP Status Code

RestoreAlreadyInProgress

The object is being restored. The request conflicts with another.

ErrorMessage: Object restore is already in progress

409 Conflict

ObjectHasAlreadyRestored

The object has been restored and the retention period of the restored object is not allowed to be shortened.

ErrorMessage: After restoring an archived object, you cannot shorten the restoration period of the archived object

409 Conflict

MalformedXML

Invalid value for the Days field (not an integer)

ErrorMessage: The XML you provided was not well-formed or did not validate against our published schema

400 Bad Request

InvalidArgument

The value of the Days field is not within the range of 1 to 30.

ErrorMessage: Restoration days should be at least 1 and at most 30

400 Bad Request

MalformedXML

Invalid value for the Tier field.

ErrorMessage: The XML you provided was not well-formed or did not validate against our published schema

400 Bad Request

InvalidObjectState

The restored object is not an Archive object.

ErrorMessage: Restore is not allowed, as object's storage class is not GLACIER

403 Forbidden

Registration