Delete Multiple Objects
The sample code in this section shows how to delete multiple objects, object1, object2, object3, from a bucket my-bucket, at once from your storage. The following is an example for IDrive® e2’s Chicago region.
Follow the required configuration instructions then follow the steps below to delete multiple objects.
In order to delete multiple objects,
Create a json file containing all objects to be deleted. An example is provided below:
$ vi delete.json
{
"Objects": [
{
"Key": "object1"
},
{
"Key": "object2"
},
{
"Key": "object3"
}
],
"Quiet": false
}
Provide this file as input using the command below:
aws s3api delete-objects --bucket my-bucket --delete file://delete.json --endpoint-url https://storageendpoint