To discover whether your Object Storage system supports this feature, see Discoverability. Alternatively, check with your service provider.
With bulk delete, you can delete up to 10,000 objects or containers (configurable) in one request.
To perform a bulk delete operation, add the bulk-delete query parameter to the path of a POST or DELETE operation.
Note
The DELETE operation is supported for backwards compatibility.
The path is the account, such as /v1/12345678912345, that contains the objects and containers.
In the request body of the POST or DELETE operation, list the objects or containers to be deleted. Separate each name with a newline character. You can include a maximum of 10,000 items (configurable) in the list.
In addition, you must:
When Object Storage processes the request, it performs multiple sub-operations. Even if all sub-operations fail, the operation returns a 200 status. The bulk operation returns a response body that contains details that indicate which sub-operations have succeeded and failed. Some sub-operations might succeed while others fail. Examine the response body to determine the results of each delete sub-operation.
You can set the Accept request header to one of the following values to define the response format:
The response body contains the following information:
The following bulk delete response is in application/xml format. In this example, the mycontainer container is not empty, so it cannot be deleted.
<delete>
<number_deleted>2</number_deleted>
<number_not_found>4</number_not_found>
<errors>
<object>
<name>/v1/12345678912345/mycontainer</name>
<status>409 Conflict</status>
</object>
</errors>
</delete>
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.