Archive, Cold Archive, and Deep Cold Archive objects must be restored before you can read them. After you initiate a restore, use one of the following approaches to check whether the operation is complete:
A few objects: Call
HeadObjectand check thex-oss-restoreresponse header. Available through the OSS console, SDKs, ossutil, and the API.Many objects: Call
ListObjectsV2,ListObjects, orListObjectVersionsand check theRestoreInforesponse element. Available through SDKs and the API only.
Restoration states
Both approaches return one of three states:
| State | HeadObject (x-oss-restore header) | ListObjects (RestoreInfo element) |
|---|---|---|
| Not restored or restoration timed out | Header not returned | Element not returned |
| Restoration in progress | ongoing-request="true" | ongoing-request="true" |
| Restoration complete | ongoing-request="false", expiry-date="<date>" | ongoing-request="false", expiry-date="<date>" |
When restoration is complete, the expiry-date value indicates when the object becomes unreadable again.
Check a specific object
Use HeadObject to check the restoration status of an individual object.
Usage notes
HeadObject calls on a large number of objects incur high GET request fees. For more information, see API operation calling fees. To check many objects at once, use the batch query approach instead.
Permissions
The oss:GetObject permission is required. For more information, see Attach a custom policy to a RAM user.
Check multiple objects at once
Use ListObjectsV2, ListObjects, or ListObjectVersions to check the restoration status of multiple objects by prefix.
The OSS console and ossutil do not support batch restoration status queries. Use SDKs or the API.
Usage notes
These operations do not filter objects by storage class. To check only Archive, Cold Archive, or Deep Cold Archive objects, filter the results by the storage-class attribute on the client side.
Permissions
oss:ListObjectspermission is required.To list object versions, the
oss:ListObjectVersionspermission is also required.
For more information, see Attach a custom policy to a RAM user.