You must restore an Archive object before you read the object. This topic describes how to restore an Archive object.
Examples
The following code provides an example on how to restore an object named exampleobject.txt in a bucket named examplebucket:
OSSRestoreObjectRequest *request = [OSSRestoreObjectRequest new];
// Specify the name of the bucket. Example: examplebucket.
request.bucketName = @"examplebucket";
// Specify the full path of the object. The full path cannot contain the bucket name. 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;
}];
References
For more information about the API operation that you can call to restore Archive objects, see RestoreObject.