tencent cloud

masukan

Restoring Archived Objects

Terakhir diperbarui:2024-02-02 14:36:36

    Overview

    This document provides an overview of APIs and SDK code samples related to restoring an archived object.
    API
    Operation
    Description
    Restoring an archived object
    Restores an archived object for access.

    Restoring an Archived Object

    Description

    This API (POST Object restore) is used to restore an archived object for access.

    Sample code

    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 key
    RestoreObjectRequest request = new RestoreObjectRequest(bucket, key);
    // Restoration time
    request.SetExpireDays(3);
    request.SetTier(COSXML.Model.Tag.RestoreConfigure.Tier.Bulk);
    
    // Execute the request
    RestoreObjectResult result = cosXml.RestoreObject(request);
    // Request succeeded
    Console.WriteLine(result.GetResultInfo());
    }
    catch (COSXML.CosException.CosClientException clientEx)
    {
    // Request failed
    Console.WriteLine("CosClientException: " + clientEx);
    }
    catch (COSXML.CosException.CosServerException serverEx)
    {
    // Request failed
    Console.WriteLine("CosServerException: " + serverEx.GetInfo());
    }
    Note:
    For the complete sample, go to GitHub.
    Hubungi Kami

    Hubungi tim penjualan atau penasihat bisnis kami untuk membantu bisnis Anda.

    Dukungan Teknis

    Buka tiket jika Anda mencari bantuan lebih lanjut. Tiket kami tersedia 7x24.

    Dukungan Telepon 7x24