Help Center/ Object Storage Service/ API Reference/ Object APIs/ Basic Operations/ Restoring Archive or Deep Archive Objects
Updated on 2026-04-16 GMT+08:00

Restoring Archive or Deep Archive Objects

Functions

To obtain the content of an object in the Archive or Deep Archive storage class, you need to restore the object first and then you can download it. After an object is restored, a copy of the object is saved in the Standard storage class. By doing so, the object in the Archive or Deep Archive storage class and its copy in the Standard storage class co-exist in the bucket. The copy will be automatically deleted once its retention period ends.

For more information about restoring objects in the Archive or Deep Archive storage class, see Restoring Archive or Deep Archive Objects.

Versioning

By default, this operation returns the latest version of an object. If the object has a delete 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.

Constraints

  • Archive and Deep Archive objects can remain restored for up to 30 days.
  • If you attempt to restore an object that is being restored, error 409 will be reported. Wait for the current restore to finish before trying again.
  • Objects that are being restored cannot be added to a batch restore.

Authorization Information

To call this API, you must be the object owner or have the permission to restore objects. You are advised to use IAM or bucket policies for authorization. For details about OBS authorization methods, see Differences Between OBS Permissions Control Methods.

  • If you use IAM for authorization, you need to use either role/policy-based authorization or identity policy-based authorization and configure the required permissions:
    • If you use role/policy-based authorization (IAM v3 APIs in the old IAM version), you need to grant the obs:object:RestoreObject permission. For details, see Creating a Custom IAM Policy.
    • If you use identity policy-based authorization (IAM v5 APIs in the new IAM version), you need to grant the obs:object:restoreObject permission, as shown in the following table. For details, see Creating a Custom IAM Identity Policy.

      Action

      Access Level

      Resource Type (*: Required)

      Condition Key

      Alias

      Dependencies

      obs:object:restoreObject

      Write

      object *

      g:EnterpriseProjectId

      -

      -

      -

      • obs:EpochTime
      • obs:SourceIp
      • obs:TlsVersion
      • obs:CustomDomain
  • If you use bucket policies for authorization, you need to grant the obs:object:RestoreObject permission. For details, see Creating a Custom Bucket Policy.

Request Syntax

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

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

URI Parameters

Parameter

Type

Mandatory (Yes/No)

Description

versionId

String

No

Definition:

Version ID of the Archive or Deep Archive object to be restored

Constraints:

None

Range:

None

Default value:

None. If this parameter is not configured, the latest version of the object is specified.

Request Headers

This request uses common headers. For details, see Table 3.

Request Body

Table 1 Request body parameters

Element

Type

Mandatory (Yes/No)

Description

RestoreRequest

Container

Yes

Definition:

Container for the restore information

Constraints:

None

Range:

None

Default value:

None

Days

Integer

Yes

Definition:

After an object is restored, a Standard copy of it is generated. This parameter specifies how long the Standard copy can be retained, that is, the validity period of the restored object.

Constraints:

The retention period starts from the first 08:00 (Beijing time) after the object retrieval is initiated.

For example, if the retention period is one day and the retrieval is initiated any time between 08:00 on the 27th day and 08:00 on the 28th day, the expiration is always at 08:00 on the 29th day.

Range:

The value ranges from 1 to 30, in days.

Default value:

None

RestoreJob

Container

No

Definition:

Container for the restore options

Constraints:

None

Range:

None

Default value:

None

Tier

String

No

Definition:

Retrieval speed tier. You can select a tier that suits your retrieval needs.

NOTE:

To restore a large number of objects from the Deep Archive storage class, you are advised to use the standard restore. The restore time spent depends on the object size and data volume restored.

Range:

  • Expedited indicates that objects can be quickly restored from Archive storage within 1 to 5 minutes and from Deep Archive storage within 3 to 5 hours.
  • Standard indicates that objects can be restored from Archive storage within 3 to 5 hours and from Deep Archive storage within 5 to 12 hours.

Default value:

Standard

Response Syntax

1
2
HTTP/1.1 status_code
Date: date

Response Headers

This response uses common headers. For details, see Table 1.

Response Body

This response contains no elements.

Error Responses

Table 2 List of OBS access error codes

Error Code

Description

HTTP Status Code

RestoreAlreadyInProgress

Definition:

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

ErrorMessage: Object restore is already in progress

409 Conflict

ObjectHasAlreadyRestored

Definition:

The objects have been restored and the retention period of the objects cannot be shortened.

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

409 Conflict

MalformedXML

Definition:

Invalid value for the Days field (supposed to be an integer)

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

400 Bad Request

InvalidArgument

Definition:

Invalid value for the Days field (valid range: 1 to 30).

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

400 Bad Request

MalformedXML

Definition:

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

Definition:

The object to be restored is not in the Archive or Deep Archive storage.

ErrorMessage: Restore is not allowed, as object's storage class is not COLD or DEEP_ARCHIVE

403 Forbidden

Sample Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
POST /object?restore HTTP/1.1
Host: examplebucket.obs.region.myhuaweicloud.com
Accept: */*
Date: WED, 01 Jul 2015 04:39:46 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:kaEwOixnSVuS6If3Q0Lnd6kxm5A=
Content-Length: 183

<RestoreRequest>
   <Days>2</Days> 
   <RestoreJob>
     <Tier>Expedited</Tier>
   </RestoreJob> 
</RestoreRequest> 

Sample Response

1
2
3
4
5
6
HTTP/1.1 202 Accepted
Server: OBS
x-obs-request-id: A2F500000163F374CCBB2063F834C6C4
x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSLbWIs23RR95NVpkbWlJdlm8Dq+wQBw
Date: WED, 01 Jul 2015 04:39:46 GMT
Content-Length: 0

Using SDKs to Call APIs

You are advised to use OBS SDKs to call APIs. SDKs encapsulate APIs to simplify development. You can call SDK API functions to access OBS without manually calculating signatures.

Helpful Links