After you restore Archive, Cold Archive, or Deep Cold Archive objects from Object Storage Service (OSS), you must confirm that the objects are fully restored before you read them. To check multiple objects in a batch, you can call the relevant API operations and specify a prefix to view their restored state. To check a small number of objects, you can call the HeadObject operation and specify the exact object name to view its restored state.
Check the restored state of objects in a batch
To check the restored state of multiple objects in a batch, you can call the ListObjectsV2, ListObjects, or ListObjectVersions operation. Then, you can check the RestoreInfo response element for the following information:
-
If the object is not restored or the restore operation timed out, the
RestoreInfofield is not returned. -
If the object is being restored, the
RestoreInfofield showsongoing-request="true". -
If the object is restored, the
RestoreInfofield showsongoing-request="false". It also includes anexpiry-datethat indicates when the readable state of the object expires.
Notes
The ListObjectsV2, ListObjects, and ListObjectVersions operations do not support specifying a storage class. To filter the results for Archive, Cold Archive, or Deep Cold Archive objects, you must manually check the storage-class property of each object and filter them on the client side.
Permissions
-
To check the restored state of objects in a batch, you must have the
oss:ListObjectspermission. -
To check the restored state of all versions of objects in a batch, you must have the
oss:ListObjectVersionspermission. -
For more information, see Grant custom permissions to a RAM user.
The OSS console and the ossutil command line interface do not support checking the restored state of objects in a batch by calling the ListObjectsV2, ListObjects, or ListObjectVersions operation.
Use Alibaba Cloud SDKs
Use REST API
Check the restored state of a specific object
To check the restored state of a small number of objects, you can call the HeadObject operation and check the x-oss-restore response header for the following information:
-
If the object is not restored or the restore operation timed out, the
x-oss-restorefield is not returned. -
If the object is being restored, the
x-oss-restorefield showsongoing-request="true". -
If the object is restored, the
x-oss-restorefield showsongoing-request="false". It also includes anexpiry-datethat indicates when the readable state of the object expires.
Notes
If you call the HeadObject operation for many objects, high fees for GET requests are incurred. For more information, see Request fees.
Permissions
To check the restored state of a specific object, you must have the oss:GetObject permission. For more information, see Grant custom permissions to a RAM user.