Use restore-object to restore Archive, Cold Archive, or Deep Cold Archive objects before reading them.
Prerequisites
Before you begin, ensure that you have:
An Archive, Cold Archive, or Deep Cold Archive object to restore. This command does not apply to Standard or Infrequent Access (IA) objects.
The
oss:RestoreObjectpermission (required for Resource Access Management (RAM) users and Security Token Service (STS) token users; Alibaba Cloud account owners have this permission by default)
How it works
All restore operations are asynchronous. The object moves through the following states:
Frozen — the initial state of an archived object; not accessible.
Restoring — OSS is processing the restore request.
Restored — the object is accessible. To extend this state, submit another restore request before it expires. The total duration cannot exceed the maximum for the storage class.
Frozen again — after the restored state expires, the object returns to the frozen state. Its storage class does not change.
Syntax
ossutil api restore-object --bucket <value> --key <value> [flags]Required parameters:
| Parameter | Type | Description |
|---|---|---|
--bucket | string | The name of the bucket. |
--key | string | The full path of the object. |
Optional parameters:
| Parameter | Type | Description |
|---|---|---|
--restore-request | string | The restore request body. Supports XML and JSON. Use the file:// prefix to read from a local file. |
--version-id | string | The version ID of the object to restore. |
For global command-line options supported by ossutil, see Supported global command-line options.
--restore-request format
The --restore-request parameter accepts XML or JSON. Specify it inline or read it from a file using the file:// prefix.
XML syntax:
<RestoreRequest>
<Days>integer</Days>
<JobParameters>
<Tier>string</Tier>
</JobParameters>
</RestoreRequest>JSON syntax:
{
"Days": integer,
"JobParameters": {
"Tier": "string"
}
}Days sets how long the object stays in the restored state. Tier sets the retrieval priority for Cold Archive and Deep Cold Archive objects — not required for Archive. The table below shows the restoration time for each tier.
| Storage class | Tier | Restoration time |
|---|---|---|
| Archive | — | ~1 minute |
| Cold Archive | Expedited | Within 1 hour |
| Cold Archive | Standard | 2–5 hours |
| Cold Archive | Bulk | 5–12 hours |
| Deep Cold Archive | Expedited | Within 12 hours |
| Deep Cold Archive | Standard | Within 48 hours |
These are reference values. Actual restoration time may vary.
Restoration quotas
OSS applies per-account, per-region restore quotas. These are reference values.
| Storage class | Quota |
|---|---|
| Cold Archive | Average 500 objects/sec; 100 TB–120 TB/day (across all three tiers) |
| Deep Cold Archive | Average 100 objects/sec; 10 TB–15 TB/day (across both tiers) |
Restore requests are still accepted after the quota is exceeded. The request is queued, and the actual restoration time may be longer than the expected time for the selected tier.
Duration of the restored state
| Storage class | Duration |
|---|---|
| Archive | 1–7 days |
| Cold Archive | 1–365 days |
| Deep Cold Archive | 1–365 days |
Billing
All restore operations incur storage fees, data retrieval fees, and request fees.
Storage fees: Calculated based on the storage class throughout and after restoration. See Storage fees.
Data retrieval fees: Incurred for all storage classes. See Data processing fees.
Request fees:
Archive: PUT request fees.
Cold Archive and Deep Cold Archive: retrieval request fees.
See Request fees.
Temporary storage fees (Cold Archive and Deep Cold Archive only): OSS creates a temporary replica to allow access during the restored state. This replica is billed at the Standard storage class rate until the restored state expires. See Temporary storage fees.
Examples
Restore an Archive object
Archive objects require only the Days parameter — no Tier needed. The following examples restore exampleobject from examplebucket for 2 days.
Inline JSON (quickest):
ossutil api restore-object --bucket examplebucket --key exampleobject --restore-request "{\"Days\":\"2\"}"JSON file (restore-request.json):
{
"Days": "2"
}ossutil api restore-object --bucket examplebucket --key exampleobject --restore-request file://restore-request.jsonXML file (restore-request.xml):
<?xml version="1.0" encoding="UTF-8"?>
<RestoreRequest>
<Days>2</Days>
</RestoreRequest>ossutil api restore-object --bucket examplebucket --key exampleobject --restore-request file://restore-request.xmlRestore a Cold Archive or Deep Cold Archive object
Cold Archive and Deep Cold Archive objects require a Tier value to set the retrieval priority. The following examples restore exampleobject from examplebucket for 2 days using Standard retrieval.
Inline JSON:
ossutil api restore-object --bucket examplebucket --key exampleobject --restore-request "{\"Days\":\"2\",\"JobParameters\":{\"Tier\":\"Standard\"}}"JSON file (restore-request.json):
{
"Days": "2",
"JobParameters": {
"Tier": "Standard"
}
}ossutil api restore-object --bucket examplebucket --key exampleobject --restore-request file://restore-request.jsonXML file (restore-request.xml):
<?xml version="1.0" encoding="UTF-8"?>
<RestoreRequest>
<Days>2</Days>
<JobParameters>
<Tier>Standard</Tier>
</JobParameters>
</RestoreRequest>ossutil api restore-object --bucket examplebucket --key exampleobject --restore-request file://restore-request.xmlWhat's next
RestoreObject — the underlying API operation for this command.
Attach a custom policy to a RAM user — grant the
oss:RestoreObjectpermission to RAM users or STS token users.