PUT'> POST'> ]>
Bulk delete To discover whether your Object Storage system supports this feature, see . Alternatively, check with your service provider. With bulk delete, you can delete up to 10,000 (configurable) objects or containers in one request. The objects to be deleted are listed in the body of a &POST; operation. Use the bulk-delete query parameter to indicate that you are performing a bulk delete operation instead of a normal delete.
Bulk delete request body To perform a bulk delete operation, add the bulk-delete query parameter to the path. The path should be the account, such as /v1/12345678912345), that contains the objects and containers. You must set the Content-Type request header to text/plain. In the request body, specify a list of objects or containers names that are separated by a newline character. In addition: You must UTF-8-encode and then URL-encode the names. To indicate an object, specify the container and object name as: CONTAINER_NAME/OBJECT_NAME To indicate a container, specify the container name as: CONTAINER_NAME A container must be empty. If it contains objects, Object Storage does not delete the container. You can include a maximum of 10,000 items in the list. You can configure the maximum number of items value.
Bulk delete response When Object Storage processes the request, it performs multiple sub-operations. Even if all sub-operations fail, the operation returns a 200 status. You must examine the response body to determine which members failed to result in an object deletion. You can set the Accept request header to one of these values, which defines the response format: text/plain. Formats response as plain text. If you omit the Accept header, text/plain is the default. application/json. Formats response as JSON. application/xml or text/xml. Formats response as XML. For more information, see .
Response body for bulk operations Some bulk operations, such as bulk delete and auto-extract archive files, perform multiple sub-operations. Some sub-operations might succeed while others fail. The bulk operation returns a response body that contains details that indicate which sub-operations have succeeded and failed. You can set the Accept request header to define the response format. The response body contains the following information: The number of files actually deleted or created, depending on context. The number of not found objects. For bulk delete only. Errors. A list of object names and associated error statuses for the objects that failed to create or delete. The format depends on the value you set in the Accept header. The following auto-extract archive files example shows a text/plain response body where no failures occurred: Number Files Created: 10 Errors: The following auto-extract archive files example shows a text/plain response where some failures occurred. In this example, the Object Storage system is configured to reject certain character strings so that the 400 Bad Request error occurs for any objects that use the restricted strings. Number Files Created: 8 Errors: /v1/12345678912345/mycontainer/home/xx%3Cyy, 400 Bad Request /v1/12345678912345/mycontainer/../image.gif, 400 Bad Request The following example shows the failure response in application/json format. This example output has been reformatted with whitespace to make it easier to read. The actual response has no such whitespace. { "Number Files Created":1, "Errors":[ [ "/v1/12345678912345/mycontainer/home/xx%3Cyy", "400 Bad Request" ], [ "/v1/12345678912345/mycontainer/../image.gif", "400 Bad Request" ] ] } The following bulk delete example response is in application/xml format. In this example, the mycontainer container is not empty, so it cannot be deleted.