Objects stored in the Archive, Cold Archive, or Deep Cold Archive storage classes of Object Storage Service (OSS) are in a frozen state to reduce storage costs. You cannot read these objects directly. You must restore them to a readable state before you can download, process, or analyze them.
How it works
A restore operation creates a temporary, readable replica of a frozen object. This operation does not change the storage class of the original object. The object transitions through the following states:
Frozen state: The initial state of the object. The object is not readable. You can perform only operations that do not involve reading the object's content, such as querying metadata and deleting the object.
Restoring: After you submit a
RestoreObjectrequest for the first time, the object enters this state. The server processes the request asynchronously.The API returns
202 Acceptedfor the first request.In this state, if you submit another restore request with the same priority, the API returns
409 Conflict. This indicates that the operation is in progress. However, you can submit a request with a higher priority to accelerate the restoration.
Restored: After the temporary replica is created, the object enters this state and its content becomes readable. If you submit another restore request in this state, the API returns
200 OKand extends the validity period of the temporary replica.Replica expired: After the validity period of the replica expires, the temporary replica is deleted. To read the object again, you must submit another restore request.
Choose a restoration priority
The time required to complete a restoration varies based on the storage class and priority. The actual restoration time may vary.
Storage class | Description |
Archive | 1 minute. |
Cold Archive |
|
Deep Cold Archive |
|
Choose a replica validity period
The replica validity period specifies the number of days that a restored object remains readable. During this period, you can access the object at any time without incurring additional data retrieval fees. Plan a validity period that suits your business needs. To read the object only once, set the validity period to 1 day. To access the object frequently over a period of time, set a longer validity period to avoid the cost of repeated restorations.
Object storage class | Description |
Archive | An integer from 1 to 7. The unit is day. |
Cold Archive | An integer from 1 to 365. The unit is day. |
Deep Cold Archive | An integer from 1 to 365. The unit is day. |
Perform restoration
After you determine the restoration priority and replica validity period, you can restore the object.
Console
The console does not support batch restoration of objects within the same folder. To perform batch restoration, use ossutil, OSS SDKs, or the API.
Log on to the OSS console.
Click Buckets, then click the name of the target bucket.
In the left-side navigation pane, choose Object Management > Objects.
In the Actions column of the target object, choose . In the dialog box that appears, configure Replica Validity Period and Restore Priority as needed.
SDK
You can use an SDK to restore objects in your application for more flexible automation control and error handling.
import com.aliyun.oss.*;
import com.aliyun.oss.common.auth.*;
import com.aliyun.oss.common.comm.SignVersion;
import com.aliyun.oss.model.*;
public class Demo {
public static void main(String[] args) throws Exception {
// In this example, the endpoint of the China (Hangzhou) region is used. Specify your actual endpoint.
String endpoint = "https://oss-cn-hangzhou.aliyuncs.com";
// Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured.
EnvironmentVariableCredentialsProvider credentialsProvider = CredentialsProviderFactory.newEnvironmentVariableCredentialsProvider();
// Specify the name of the bucket. Example: examplebucket.
String bucketName = "examplebucket";
// Specify the full path of the Archive object. Do not include the bucket name in the full path.
String objectName = "exampledir/object";
// Specify the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou.
String region = "cn-hangzhou";
// Create an OSSClient instance.
// Call the shutdown method to release resources when the OSSClient is no longer in use.
ClientBuilderConfiguration clientBuilderConfiguration = new ClientBuilderConfiguration();
clientBuilderConfiguration.setSignatureVersion(SignVersion.V4);
OSS ossClient = OSSClientBuilder.create()
.endpoint(endpoint)
.credentialsProvider(credentialsProvider)
.clientConfiguration(clientBuilderConfiguration)
.region(region)
.build();
try {
ObjectMetadata objectMetadata = ossClient.getObjectMetadata(bucketName, objectName);
// Check whether the object is an Archive object.
StorageClass storageClass = objectMetadata.getObjectStorageClass();
if (storageClass == StorageClass.Archive) {
// Restore the object.
ossClient.restoreObject(bucketName, objectName);
// Specify the time to wait for the object to be restored.
do {
Thread.sleep(1000);
objectMetadata = ossClient.getObjectMetadata(bucketName, objectName);
} while (!objectMetadata.isRestoreCompleted());
}
// Query the restored object.
OSSObject ossObject = ossClient.getObject(bucketName, objectName);
ossObject.getObjectContent().close();
} catch (OSSException oe) {
System.out.println("Caught an OSSException, which means your request made it to OSS, "
+ "but was rejected with an error response for some reason.");
System.out.println("Error Message:" + oe.getErrorMessage());
System.out.println("Error Code:" + oe.getErrorCode());
System.out.println("Request ID:" + oe.getRequestId());
System.out.println("Host ID:" + oe.getHostId());
} catch (ClientException ce) {
System.out.println("Caught an ClientException, which means the client encountered "
+ "a serious internal problem while trying to communicate with OSS, "
+ "such as not being able to access the network.");
System.out.println("Error Message:" + ce.getMessage());
} finally {
if (ossClient != null) {
ossClient.shutdown();
}
}
}
} import time
import argparse
import alibabacloud_oss_v2 as oss
# Create a command-line argument parser.
parser = argparse.ArgumentParser(description="A sample for restoring an object")
# Add the required command-line arguments.
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--key', help='The name of the object.', required=True)
def main():
# Parse the incoming command-line arguments.
args = parser.parse_args()
# Load authentication information from environment variables.
credentials_provider = oss.credentials.EnvironmentVariableCredentialsProvider()
# Use the default SDK configurations.
cfg = oss.config.load_default()
# Set the credential provider to EnvironmentVariableCredentialsProvider.
cfg.credentials_provider = credentials_provider
# Set the region.
cfg.region = args.region
# If an endpoint is provided, set the endpoint as a configuration item.
if args.endpoint is not None:
cfg.endpoint = args.endpoint
# Create an OSS client.
client = oss.Client(cfg)
# Execute the request to restore the object.
result = client.restore_object(oss.RestoreObjectRequest(
bucket=args.bucket,
key=args.key,
restore_request=oss.RestoreRequest(
days=1,
# Optional: Set the restoration priority for Cold Archive or Deep Cold Archive objects. Valid values: Expedited, Standard, and Bulk. Default value: Standard.
# tier="Bulk",
)
))
# Print the result of the restoration request.
print(f'status code: {result.status_code},'
f' request id: {result.request_id},'
f' version id: {result.version_id},'
f' restore priority: {result.restore_priority},'
)
# Loop to check whether the object is restored.
while True:
# Obtain the header of the object.
result = client.head_object(oss.HeadObjectRequest(
bucket=args.bucket,
key=args.key,
))
# Check the restored state.
if result.restore and result.restore != 'ongoing-request="true"':
print('The object is restored.')
break
# Check again after 5 seconds.
time.sleep(5)
print(result.restore)
# Program entry point.
if __name__ == "__main__":
main()
const OSS = require('ali-oss')
const client = new OSS({
// Specify the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the region to oss-cn-hangzhou.
region: 'yourRegion',
// Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured.
accessKeyId: process.env.OSS_ACCESS_KEY_ID,
accessKeySecret: process.env.OSS_ACCESS_KEY_SECRET,
authorizationV4: true,
// Specify the name of the bucket. Example: examplebucket.
bucket: 'examplebucket',
});
// Specify the name of the Archive object that you want to restore. Example: exampleobject.txt.
client.restore('exampleobject.txt').then((res) => {
console.log(res);
}).catch(err => {
console.log(err);
})using Aliyun.OSS;
using Aliyun.OSS.Model;
using Aliyun.OSS.Model;
using System.Net;
using System.Text;
using Aliyun.OSS.Common;
// Specify the endpoint of the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the endpoint to https://oss-cn-hangzhou.aliyuncs.com.
var endpoint = "yourEndpoint";
// Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured.
var accessKeyId = Environment.GetEnvironmentVariable("OSS_ACCESS_KEY_ID");
var accessKeySecret = Environment.GetEnvironmentVariable("OSS_ACCESS_KEY_SECRET");
// Specify the name of the bucket.
var bucketName = "examplebucket";
// Specify the full path of the object. The path cannot contain the bucket name.
var objectName = "yourObjectName";
// Specify the content of the object.
var objectContent = "More than just cloud.";
int maxWaitTimeInSeconds = 600;
// Specify the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou.
const string region = "cn-hangzhou";
// Create a ClientConfiguration instance and modify the default parameters based on your requirements.
var conf = new ClientConfiguration();
// Use the signature algorithm V4.
conf.SignatureVersion = SignatureVersion.V4;
// Create an OSSClient instance.
var client = new OssClient(endpoint, accessKeyId, accessKeySecret, conf);
client.SetRegion(region);
try
{
// Create an Archive bucket.
var bucket = client.CreateBucket(bucketName, StorageClass.Archive);
Console.WriteLine("Create Archive bucket succeeded, {0} ", bucket.Name);
}
catch (Exception ex)
{
Console.WriteLine("Create Archive bucket failed, {0}", ex.Message);
}
// Upload the object to the bucket and set the storage class of the object to Archive.
try
{
byte[] binaryData = Encoding.ASCII.GetBytes(objectContent);
MemoryStream requestContent = new MemoryStream(binaryData);
client.PutObject(bucketName, objectName, requestContent);
Console.WriteLine("Put object succeeded, {0}", objectName);
}
catch (Exception ex)
{
Console.WriteLine("Put object failed, {0}", ex.Message);
}
var metadata = client.GetObjectMetadata(bucketName, objectName);
string storageClass = metadata.HttpMetadata["x-oss-storage-class"] as string;
if (storageClass != "Archive")
{
Console.WriteLine("StorageClass is {0}", storageClass);
return;
}
// Restore the Archive object.
RestoreObjectResult result = client.RestoreObject(bucketName, objectName);
Console.WriteLine("RestoreObject result HttpStatusCode : {0}", result.HttpStatusCode);
if (result.HttpStatusCode != HttpStatusCode.Accepted)
{
throw new OssException(result.RequestId + ", " + result.HttpStatusCode + " ,");
}
while (maxWaitTimeInSeconds > 0)
{
var meta = client.GetObjectMetadata(bucketName, objectName);
string restoreStatus = meta.HttpMetadata["x-oss-restore"] as string;
if (restoreStatus != null && restoreStatus.StartsWith("ongoing-request=\"false\"", StringComparison.InvariantCultureIgnoreCase))
{
break;
}
Thread.Sleep(1000);
// The maximum wait time decreases by 1 second.
maxWaitTimeInSeconds--;
}
if (maxWaitTimeInSeconds == 0)
{
Console.WriteLine("RestoreObject is timeout. ");
throw new TimeoutException();
}
else
{
Console.WriteLine("RestoreObject is successful. ");
}// Restore the object.
RestoreObjectRequest restore = new RestoreObjectRequest();
// Specify the name of the bucket. Example: examplebucket.
restore.setBucketName("examplebucket");
// Specify the full path of the object. Do not include the bucket name in the full path. Example: exampleobject.txt.
restore.setObjectKey("exampleobject.txt");
OSSAsyncTask task = oss.asyncRestoreObject(restore, new OSSCompletedCallback<RestoreObjectRequest,
RestoreObjectResult>() {
@Override
public void onSuccess(RestoreObjectRequest request, RestoreObjectResult result) {
Log.i("info", "code::"+result.getStatusCode());
}
@Override
public void onFailure(RestoreObjectRequest request, ClientException clientException,
ServiceException serviceException) {
Log.e("errorMessage", "error: "+serviceException.getRawMessage());
}
});
task.waitUntilFinished();OSSRestoreObjectRequest *request = [OSSRestoreObjectRequest new];
// Specify the name of the bucket. Example: examplebucket.
request.bucketName = @"examplebucket";
// Specify the full path of the object. Do not include the bucket name in the full path. Example: exampleobject.txt.
request.objectKey = @"exampleobject.txt";
OSSTask *restoreObjectTask = [client restoreObject:request];
[restoreObjectTask continueWithBlock:^id _Nullable(OSSTask * _Nonnull task) {
if (!task.error) {
NSLog(@"restore object success");
} else {
NSLog(@"restore object failed, error: %@", task.error);
}
return nil;
}];
// Implement synchronous blocking to wait for the task to complete.
// [restoreObjectTask waitUntilFinished];#include <alibabacloud/oss/OssClient.h>
#include <thread>
#include <chrono>
#include <algorithm>
using namespace AlibabaCloud::OSS;
int main(void)
{
/* Initialize information about the account that is used to access OSS. */
/* Specify the endpoint of the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the endpoint to https://oss-cn-hangzhou.aliyuncs.com. */
std::string Endpoint = "yourEndpoint";
/* Specify the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou. */
std::string Region = "yourRegion";
/* Specify the name of the bucket. Example: examplebucket. */
std::string BucketName = "examplebucket";
/* Specify the full path of the Archive object. Do not include the bucket name in the full path. */
std::string ObjectName = "yourObjectName";
/* Initialize resources such as network resources. */
InitializeSdk();
ClientConfiguration conf;
conf.signatureVersion = SignatureVersionType::V4;
/* Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured. */
auto credentialsProvider = std::make_shared<EnvironmentVariableCredentialsProvider>();
OssClient client(Endpoint, credentialsProvider, conf);
client.SetRegion(Region);
/* Restore the Archive object. */
auto outcome = client.RestoreObject(BucketName, ObjectName);
/* You cannot restore objects of the non-Archive storage class. */
if (!outcome.isSuccess()) {
/* Handle exceptions. */
std::cout << "RestoreObject fail, code:" << outcome.error().Code() <<
", message:" << outcome.error().Message() <<
", requestId:" << outcome.error().RequestId() << std::endl;
return -1;
}
std::string onGoingRestore("ongoing-request=\"false\"");
int maxWaitTimeInSeconds = 600;
while (maxWaitTimeInSeconds > 0)
{
auto meta = client.HeadObject(BucketName, ObjectName);
std::string restoreStatus = meta.result().HttpMetaData()["x-oss-restore"];
std::transform(restoreStatus.begin(), restoreStatus.end(), restoreStatus.begin(), ::tolower);
if (!restoreStatus.empty() &&
restoreStatus.compare(0, onGoingRestore.size(), onGoingRestore)==0) {
std::cout << " success, restore status:" << restoreStatus << std::endl;
/* The Archive object is restored. */
break;
}
std::cout << " info, WaitTime:" << maxWaitTimeInSeconds
<< "; restore status:" << restoreStatus << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(10));
maxWaitTimeInSeconds--;
}
if (maxWaitTimeInSeconds == 0)
{
std::cout << "RestoreObject fail, TimeoutException" << std::endl;
}
/* Release resources such as network resources. */
ShutdownSdk();
return 0;
}#include "oss_api.h"
#include "aos_http_io.h"
/* Specify the endpoint of the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the endpoint to https://oss-cn-hangzhou.aliyuncs.com. */
const char *endpoint = "yourEndpoint";
/* Specify the name of the bucket. Example: examplebucket. */
const char *bucket_name = "examplebucket";
/* Specify the full path of the object. Do not include the bucket name in the full path. Example: exampledir/exampleobject.txt. */
const char *object_name = "exampledir/exampleobject.txt";
/* Specify the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou. */
const char *region = "yourRegion";
void init_options(oss_request_options_t *options)
{
options->config = oss_config_create(options->pool);
/* Use a char* string to initialize data of the aos_string_t type. */
aos_str_set(&options->config->endpoint, endpoint);
/* Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured. */
aos_str_set(&options->config->access_key_id, getenv("OSS_ACCESS_KEY_ID"));
aos_str_set(&options->config->access_key_secret, getenv("OSS_ACCESS_KEY_SECRET"));
// Specify two additional parameters.
aos_str_set(&options->config->region, region);
options->config->signature_version = 4;
/* Specify whether to use CNAME. The value 0 indicates that CNAME is not used. */
options->config->is_cname = 0;
/* Specify network parameters, such as the timeout period. */
options->ctl = aos_http_controller_create(options->pool, 0);
}
int main(int argc, char *argv[])
{
/* Call the aos_http_io_initialize method in main() to initialize global resources, such as network resources and memory resources. */
if (aos_http_io_initialize(NULL, 0) != AOSE_OK) {
exit(1);
}
/* Create a memory pool to manage memory. aos_pool_t is equivalent to apr_pool_t. The code used to create a memory pool is included in the APR library. */
aos_pool_t *pool;
/* Create a memory pool. The value of the second parameter is NULL. This value indicates that the pool does not inherit other memory pools. */
aos_pool_create(&pool, NULL);
/* Create and initialize options. This parameter includes global configuration information, such as endpoint, access_key_id, access_key_secret, is_cname, and curl. */
oss_request_options_t *oss_client_options;
/* Allocate the memory resources in the memory pool to the options. */
oss_client_options = oss_request_options_create(pool);
/* Initialize oss_client_options. */
init_options(oss_client_options);
/* Initialize the parameters. */
aos_string_t bucket;
aos_string_t object;
aos_table_t *headers = NULL;
aos_table_t *resp_headers = NULL;
aos_status_t *resp_status = NULL;
aos_str_set(&bucket, bucket_name);
aos_str_set(&object, object_name);
headers = aos_table_make(pool, 0);
/* Restore the object. */
do {
headers = aos_table_make(pool, 0);
resp_status = oss_restore_object(oss_client_options, &bucket, &object, headers, &resp_headers);
printf("restore object resp_status->code: %d \n", resp_status->code);
if (resp_status->code != 409) {
break;
} else {
printf("restore object is already in progress, resp_status->code: %d \n", resp_status->code);
apr_sleep(5000);
}
} while (1);
/* Release the memory pool. This operation releases the memory resources allocated for the request. */
aos_pool_destroy(pool);
/* Release the allocated global resources. */
aos_http_io_deinitialize();
return 0;
}package main
import (
"context"
"flag"
"log"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
)
// Define global variables.
var (
region string // The region.
bucketName string // The bucket name.
objectName string // The object name.
)
// The init function is used to initialize command-line parameters.
func init() {
flag.StringVar(®ion, "region", "", "The region in which the bucket is located.")
flag.StringVar(&bucketName, "bucket", "", "The name of the bucket.")
flag.StringVar(&objectName, "object", "", "The name of the object.")
}
func main() {
// Parse command-line parameters.
flag.Parse()
// Check whether the bucket name is empty.
if len(bucketName) == 0 {
flag.PrintDefaults()
log.Fatalf("invalid parameters, bucket name required")
}
// Check whether the region is empty.
if len(region) == 0 {
flag.PrintDefaults()
log.Fatalf("invalid parameters, region required")
}
// Check whether the object name is empty.
if len(objectName) == 0 {
flag.PrintDefaults()
log.Fatalf("invalid parameters, object name required")
}
// Load the default configurations and set the credential provider and region.
cfg := oss.LoadDefaultConfig().
WithCredentialsProvider(credentials.NewEnvironmentVariableCredentialsProvider()).
WithRegion(region)
// Create an OSS client.
client := oss.NewClient(cfg)
// Create a request to restore the object.
request := &oss.RestoreObjectRequest{
Bucket: oss.Ptr(bucketName), // The bucket name.
Key: oss.Ptr(objectName), // The object name.
RestoreRequest: &oss.RestoreRequest{
Days: 3, // Set the number of days for which the object can remain in the restored state to 3.
},
}
// Send the request to restore the object.
result, err := client.RestoreObject(context.TODO(), request)
if err != nil {
log.Fatalf("failed to restore object %v", err)
}
// Print the result of the object restoration.
log.Printf("restore object result:%#v\n", result)
}
<?php
// Include the autoload file to load dependencies.
require_once __DIR__ . '/../vendor/autoload.php';
use AlibabaCloud\Oss\V2 as Oss;
// Define and describe command-line parameters.
$optsdesc = [
"region" => ['help' => 'The region in which the bucket is located.', 'required' => True], // (Required) Specify the region in which the bucket is located.
"endpoint" => ['help' => 'The domain names that other services can use to access OSS.', 'required' => False], // (Optional) Specify the endpoint for accessing OSS.
"bucket" => ['help' => 'The name of the bucket', 'required' => True], // (Required) Specify the name of the bucket.
"key" => ['help' => 'The name of the object', 'required' => True], // (Required) Specify the name of the object.
];
// Convert the descriptions to a list of long options required by getopt.
// Add a colon (:) to the end of each parameter to indicate that a value is required.
$longopts = \array_map(function ($key) {
return "$key:";
}, array_keys($optsdesc));
// Parse the command-line parameters.
$options = getopt("", $longopts);
// Check whether the required parameters are configured.
foreach ($optsdesc as $key => $value) {
if ($value['required'] === True && empty($options[$key])) {
$help = $value['help']; // Obtain help information for the parameters.
echo "Error: the following arguments are required: --$key, $help" . PHP_EOL;
exit(1); // Exit the program if a required parameter is missing.
}
}
// Assign the values parsed from the command-line parameters to the corresponding variables.
$region = $options["region"]; // The region in which the bucket is located.
$bucket = $options["bucket"]; // The name of the bucket.
$key = $options["key"]; // The name of the object.
// Load access credentials from environment variables.
// Use EnvironmentVariableCredentialsProvider to retrieve the AccessKey ID and AccessKey secret from environment variables.
$credentialsProvider = new Oss\Credentials\EnvironmentVariableCredentialsProvider();
// Use the default configuration of the SDK.
$cfg = Oss\Config::loadDefault();
$cfg->setCredentialsProvider($credentialsProvider); // Specify the credential provider.
$cfg->setRegion($region); // Specify the region in which the bucket is located.
if (isset($options["endpoint"])) {
$cfg->setEndpoint($options["endpoint"]); // Specify the endpoint if one is provided.
}
// Create an OSSClient instance.
$client = new Oss\Client($cfg);
// Create a RestoreObjectRequest object to restore the Archive object.
$request = new Oss\Models\RestoreObjectRequest(bucket: $bucket, key: $key);
// Restore the object.
$result = $client->restoreObject($request);
// Display the result.
printf(
'status code:' . $result->statusCode . PHP_EOL . // The HTTP status code. For example, HTTP status code 200 indicates that the request succeeded.
'request id:' . $result->requestId . PHP_EOL // The request ID, which can be used to debug or trace the request.
);
ossutil
ossutil is a command-line interface (CLI) used to manage OSS. It is suitable for scripted and automated batch restorations.
Restore Archive objects
The following sample code provides an example on how to restore an Archive object named exampleobject.txt in examplebucket:
ossutil restore oss://examplebucket/exampleobject.txtThe following sample code provides an example on how to restore an Archive object named exampleobject.txt in examplebucket and set the duration within which the object remains in the restored state to 3:
ossutil restore oss://examplebucket/exampleobject.txt --days 3The following sample code provides an example on how to restore objects from the list.
NoteEach line in the list file represents an object. All objects within are in the format of the OSS path: oss://{bucket}/{key}.
The following section uses list.txt as an example.
oss://examplebucket/key1 oss://examplebucket/key2ossutil restore list://list.txtThe following sample code provides an example on how to restore objects directly from the list. The status of objects is not checked.
ossutil restore list://list.txt --no-check-statusThe following sample code provides an example on how to restore objects from the list file.
NoteA csv.gz file and a manifest.json file are generated after the inventory is configured, which are required for the restoration of objects from the list file.
ossutil restore list://ca8007fc-4123-493e-9a01-dd1511fbac54.csv.gz --list-format inventory --list-manifest-from manifest.jsonThe following sample code provides an example on how to restore objects directly from the list file. The status of objects is not checked.
ossutil restore list://ca8007fc-4123-493e-9a01-dd1511fbac54.csv.gz --list-format inventory --list-manifest-from manifest.json --no-check-status
Restore Cold Archive objects
The following sample code provides an example on how to restore a Cold Archive object named exampleobject.txt in examplebucket and set the duration within which the object remains in the restored state to 5:
ossutil restore oss://examplebucket/exampleobject.txt --tier Bulk --days 5Restore Deep Cold Archive objects
The following sample code provides an example on how to restore a Deep Cold Archive object named exampleobject.txt in examplebucket and set the duration within which the object remains in the restored state to 10:
ossutil restore oss://examplebucket/exampleobject.txt --tier Standard --days 10For more information, see restore (Restore objects).
ossbrowser
ossbrowser supports bucket-level operations that are similar to those supported by the console. Follow the instructions in the ossbrowser interface to restore objects. For more information, see Common operations.
API
If your application has highly customized requirements, you can send REST API requests directly. In this case, you must write the code to calculate signatures. For more information, see RestoreObject.
Billing
Billable item | Description | Applicable storage classes |
You are charged a one-time fee based on the actual volume of data (in GB) that is restored. This fee is the primary cost of a restoration operation. | Archive, Cold Archive, and Deep Cold Archive | |
You are charged for each | Archive (billed as Put requests), Cold Archive, and Deep Cold Archive (billed as retrieval requests) | |
During and after the restoration, you are charged storage fees based on the corresponding storage class. | Archive, Cold Archive, and Deep Cold Archive | |
A temporary replica is generated after a restoration and consumes storage space. You are charged for this temporary storage daily throughout the replica's validity period. | Cold Archive and Deep Cold Archive |
Quotas and limits
For a single Alibaba Cloud account in a single region, the reference restoration quota for Cold Archive objects is 500 objects per second on average. The total restoration quota for the three restoration priorities is 100 TB to 120 TB per day.If your business requires higher restoration quotas, contact Technical Support.
For a single Alibaba Cloud account in a single region, the reference restoration quota for Deep Cold Archive objects is 100 objects per second on average. The total restoration quota for the two restoration priorities is 10 TB to 15 TB per day.If your business requires higher restoration quotas, contact Technical Support.
If the reference restoration quota for Cold Archive or Deep Cold Archive objects is exceeded, you can still submit restoration requests. The restoration requests are added to a queue, and the restoration may take longer than the time specified for the selected priority.
> Restore