Deleting a Multipart Upload from Object Storage
Cancel and delete an uncommitted or failed multipart upload in Object Storage.
The uncommitted multipart upload you deleted no longer appears in the list. Use the oci os multipart abort command and required parameters to cancel and delete an uncommitted or failed multipart upload in a bucket:
oci os multipart abort --bucket-name bucket_name --object-name object_name --upload-id upload_ID [OPTIONS]For example:
oci os multipart abort --bucket-name MyBucket --object-name MyObject --upload-id 0b7abd48-9ff2-9d5f-2034-63a02fdd7afa WARNING: Are you sure you want to permanently remove this incomplete upload? [y/N]: yTip
The CLI interface asks you to confirm the deletion request. To delete without the confirmation prompt, use the--forceflag.You can also create a lifecycle policy that automatically deletes uncommitted or failed multipart uploads. See Object Lifecycle Management for more information.
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Deleting All Parts of an Uncommitted or Failed Multipart Upload
#!/bin/bash BUCKET=$1 oci os multipart list --bucket-name $BUCKET | \ jq -c '.data | map({'o': .object, 'i': ."upload-id"}) | .[]' | \ while read JSON; do OBJECTNAME=$(echo $JSON | jq '.o' | sed -e 's/\"//g;') UPLOADID=$(echo $JSON | jq '.i' | sed -e 's/\"//g;') echo Removing Object name $OBJECTNAME, ID $UPLOADID oci os multipart abort --bucket-name $BUCKET \ --object-name $OBJECTNAME \ --upload-id $UPLOADID \ --force doneYou can also create a lifecycle policy that automatically deletes uncommitted or failed multipart uploads. See Object Storage Object Lifecycle Management for details.
Run the AbortMultipartUpload operation to cancel and delete an uncommitted or failed multipart upload in a bucket.
See Using the Multipart API for more information.