Aborting a Multipart Upload

API Description

You can use this API to abort a multipart upload in a bucket by specifying the multipart upload ID.

Method Definition

ObsClient.abortMultipartUpload(bucketName, objectKey, uploadId)

Request Parameters

Field

Type

Optional or Mandatory

Description

bucketName

str

Mandatory

Bucket name

objectKey

str

Mandatory

Object name

uploadId

str

Mandatory

Multipart upload ID

Returned Results

Type

Description

GetResult

SDK common result object

Sample Code

try:
    resp = obsClient.abortMultipartUpload('bucketname', 'objectkey', 'uploadId') 
      
    if resp.status < 300: 
        print('requestId:', resp.requestId) 
    else: 
        print('errorCode:', resp.errorCode) 
        print('errorMessage:', resp.errorMessage)
except:
    import traceback
    print(traceback.format_exc())