Deleting a Multipart Upload from Object Storage
Cancel and delete an uncommitted or failed multipart upload in Object Storage.
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]: y
Tip
The CLI interface asks you to confirm the deletion request. To delete without the confirmation prompt, use the
--force
flag.You can also create a lifecycle policy that automatically deletes uncommitted or failed multipart uploads. See Object Lifecycle Management for more information.
To delete 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 done
You can also create a lifecycle policy that automatically deletes uncommitted or failed multipart uploads. See Object Storage Object Lifecycle Management for details.
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
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.