After restoring archived, cold archived, or deep cold archived OSS objects, you must confirm that the objects are restored before reading them. You can use the relevant API to batch check the restoration status of multiple objects by specifying a prefix. For individual objects, the HeadObject API allows you to check the restoration status by specifying the object name.
Batch check the restoration status of objects
To batch check the restoration status of multiple objects, use the ListObjectsV2
, ListObjects
, or ListObjectVersions
API and examine the RestoreInfo
response element for restoration status information:
If not restored or the restoration has timed out, the
RestoreInfo
field is not returned.If restoring, the
RestoreInfo
field indicatesongoing-request="true"
.Once restoration is completed, the
RestoreInfo
field showsongoing-request="false"
and includes anexpiry-date
that specifies when the object's readable state will expire.
Notes
The APIs ListObjectsV2
, ListObjects
, and ListObjectVersions
do not support filtering by storage class. To filter objects of specific storage classes like Archive, Cold Archive, or Deep Cold Archive, you must manually inspect the storage-class
property of each object and filter them on the client side.
Permissions
To batch check the restoration status of objects, you need the
oss:ListObjects
permission.To check the restoration status of all object versions, the
oss:ListObjectVersions
permission is required.For more information, see grant custom policy to RAM users.
The OSS console and the command line tool ossutil do not support batch checking the restoration status of objects using the ListObjectsV2
, ListObjects
, or ListObjectVersions
API.
Use Alibaba Cloud SDKs
Use RESTful API operations
Check the restoration status of a specified object
For a small number of objects, use the HeadObject
API and examine the response header x-oss-restore
for restoration status information:
If not restored or the restoration has timed out, the
x-oss-restore
field is not returned.If restoring, the
x-oss-restore
field indicatesongoing-request="true"
.Once restoration is completed, the
x-oss-restore
field showsongoing-request="false"
and includes anexpiry-date
that specifies when the object's readable state will expire.
Notes
When checking the restoration status of many objects, using the HeadObject
API can result in high GET request fees. For more information, see request fees.
Permissions
To check the restoration status of a specific object, the oss:GetObject
permission is required. For details, see grant custom policy to RAM users.