API | 操作名 | 操作描述 |
恢复归档对象 | 将归档类型的对象取回访问 |
QCloudPostObjectRestoreRequest *req = [QCloudPostObjectRestoreRequest new];// 存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucketreq.bucket = @"examplebucket-1250000000";// 对象键,是对象在 COS 上的完整路径,如果带目录的话,格式为 "video/xxx/movie.mp4"req.object = @"exampleobject";// 设置临时副本的过期时间req.restoreRequest.days = 10;// 复原的过程类型配置信息req.restoreRequest.CASJobParameters.tier = QCloudCASTierStandard;[req setFinishBlock:^(id outputObject, NSError *error) {// outputObject 包含所有的响应 http 头部NSDictionary* info = (NSDictionary *) outputObject;}];[[QCloudCOSXMLService defaultCOSXML] PostObjectRestore:req];
let restore = QCloudPostObjectRestoreRequest.init();// 存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.tencentcloud.com/cos5/bucketrestore.bucket = "examplebucket-1250000000";// 对象键,是对象在 COS 上的完整路径,如果带目录的话,格式为 "video/xxx/movie.mp4"restore.object = "exampleobject";// 设置临时副本的过期时间restore.restoreRequest.days = 10;// 复原的过程类型配置信息restore.restoreRequest.casJobParameters.tier = .standard;restore.finishBlock = {(result,error)inif let result = result {// result 包含响应的 header 信息} else {print(error!);}}QCloudCOSXMLService.defaultCOSXML().postObjectRestore(restore);
本页内容是否解决了您的问题?