OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Restores one or more objects specified by the objectName parameter. By default objects will be restored for 24 hours. Duration can be configured using the hours parameter.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Restores one or more objects specified by the objectName parameter. By default objects will be restored for 24 hours. Duration can be configured using the hours parameter.
Restores one or more objects specified by the objectName parameter . By default objects will be restored for 24 hours . Duration can be configured using the hours parameter .
public async Task<RestoreObjectsResponse> RestoreObjects(RestoreObjectsRequest request)
        {
            var uri = new Uri($"{GetEndPointNoneVersion(ObjectStorageServices.Bucket(request.NamespaceName, request.BucketName), this.Region)}/actions/restoreObjects");
            using (var webResponse = await this.RestClientAsync.Post(uri, request.RestoreObjectsDetails, new HttpRequestHeaderParam() { OpcClientRequestId = request.OpcClientRequestId }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new RestoreObjectsResponse()
                {
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id")
                };
            }
        }
public async Task < RestoreObjectsResponse > RestoreObjects ( RestoreObjectsRequest request ) { var uri = new Uri ( $" { GetEndPointNoneVersion ( ObjectStorageServices . Bucket ( request . NamespaceName , request . BucketName ) , this . Region ) } /actions/restoreObjects " ) ; using ( var webResponse = await this . RestClientAsync . Post ( uri , request . RestoreObjectsDetails , new HttpRequestHeaderParam ( ) { OpcClientRequestId = request . OpcClientRequestId } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new RestoreObjectsResponse ( ) { OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) } ; } }
Restores one or more objects specified by the objectName parameter.
Restores one or more objects specified by the objectName parameter .
None
request
RestoreObjectsRequest
None