API | Operation | Description |
Restoring an archived object | Restores an archived object for access. |
POST Object restore
) is used to restore an archived object for access.try{// Bucket name in the format of bucketname-APPID. You can get APPID by referring to https://console.tencentcloud.com/developer.string bucket = "examplebucket-1250000000";string key = "exampleobject"; // Object keyRestoreObjectRequest request = new RestoreObjectRequest(bucket, key);// Restoration timerequest.SetExpireDays(3);request.SetTier(COSXML.Model.Tag.RestoreConfigure.Tier.Bulk);// Execute the requestRestoreObjectResult result = cosXml.RestoreObject(request);// Request succeededConsole.WriteLine(result.GetResultInfo());}catch (COSXML.CosException.CosClientException clientEx){// Request failedConsole.WriteLine("CosClientException: " + clientEx);}catch (COSXML.CosException.CosServerException serverEx){// Request failedConsole.WriteLine("CosServerException: " + serverEx.GetInfo());}
Apakah halaman ini membantu?