OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Aborts an in-progress multipart upload and deletes all parts that have been uploaded.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Aborts an in-progress multipart upload and deletes all parts that have been uploaded.
Aborts an in - progress multipart upload and deletes all parts that have been uploaded .
public async Task<AbortMultipartUploadResponse> AbortMultipartUpload(AbortMultipartUploadRequest request)
        {
            var uri = new Uri($"{GetEndPointNoneVersion(ObjectStorageServices.Bucket(request.NamespaceName, request.BucketName), this.Region)}/u/{request.ObjectName}?uploadId={request.UploadId}");
            using (var webResponse = await this.RestClientAsync.Delete(uri, new HttpRequestHeaderParam() { OpcClientRequestId = request.OpcClientRequestId }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new AbortMultipartUploadResponse()
                {
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id")
                };
            }
        }
public async Task < AbortMultipartUploadResponse > AbortMultipartUpload ( AbortMultipartUploadRequest request ) { var uri = new Uri ( $" { GetEndPointNoneVersion ( ObjectStorageServices . Bucket ( request . NamespaceName , request . BucketName ) , this . Region ) } /u/ { request . ObjectName } ?uploadId= { request . UploadId } " ) ; using ( var webResponse = await this . RestClientAsync . Delete ( uri , new HttpRequestHeaderParam ( ) { OpcClientRequestId = request . OpcClientRequestId } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new AbortMultipartUploadResponse ( ) { OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) } ; } }
Aborts an in-progress multipart upload and deletes all parts that have been uploaded.
Aborts an in - progress multipart upload and deletes all parts that have been uploaded .
None
request
AbortMultipartUploadRequest
None