Bulk operation POST /v1/{account}?bulk-delete
Delete multiple objects or containers by one request.
Requesting POST specifying "?bulk-delete" for query parameter enables delete of multiple objects and containers. Two or more objects or containers can be deleted by requesting POST specifying "?bulk-delete" for query parameter. Up to 10,000 objects can be deleted by one request. Specify the object and the container to be deleted separated by line feed codes in the request body.
The object to be deleted is specified by the following formats. Please specify the object name that is encoded to URL encode after UTF-8 encoding.
/container_name/obj_name
The container to be deleted is specified by the following formats. Please specify the container name that is encoded to URL encoding after UTF-8encoding. The container must be empty when it is deleted.
/container_name
When the request is accepted, status code 200 is always returned.
To identify whether delete of object was success or not, the response body that exists in the following examples should be analyzed.
{
"Number Not Found": 0,
"Response Status": "200 OK",
"Errors": [],
"Number Deleted": 12,
"Response Body": ""
}
In case all of the delete target objects and the containers are deleted or they didn't exist already, "Response Status" is "200 OK". In case delete process failed, response code 400 or 5XX are returned in "Response Status". The object name of error and response code that indicate error are included in "Errors".
Also refer to the API error codes for the status code of failed case.
Request headers
X-Auth-Token
Authentication token.
Data Type | Cardinality |
---|---|
String | 1..1 |
Content-Type
Specify text/plain.
Data Type | Cardinality |
---|---|
String | 0..1 |
Accept
Valid values: application/json, application/xml, and text/xml.
Data Type | Cardinality |
---|---|
String | 0..1 |
Request Parameter
{account}
Name uniquely assigned by project
Data Type | Cardinality |
---|---|
String | 1..1 |
Response Headers
Content-Type
MIME type of the response body
Data Type | Cardinality |
---|---|
String | 1..1 |
X-Trans-Id
ID assigned to this request. This is used when inquiring about issues.
Data Type | Cardinality |
---|---|
Uuid | 1..1 |
Date
Datetime when the transaction was executed
Data Type | Cardinality |
---|---|
Datetime | 1..1 |
Response Elements
delete
Envelope of the response
Data Type | Cardinality | Parent Element | Child Element(s) |
---|---|---|---|
delete | 1..1 | None | number_deleted number_not_found response_body response_status errors |
number_deleted
Number of deleted objects and containers.
Data Type | Cardinality | Parent Element | Child Element(s) |
---|---|---|---|
String | 1..1 | delete | None |
number_not_found
Number of not found objects and containers.
Data Type | Cardinality | Parent Element | Child Element(s) |
---|---|---|---|
String | 1..1 | delete | None |
response_body
Response messages.
Data Type | Cardinality | Parent Element | Child Element(s) |
---|---|---|---|
String | 1..1 | delete | None |
response_status
Status code of the response.
Data Type | Cardinality | Parent Element | Child Element(s) |
---|---|---|---|
String | 1..1 | delete | None |
errors
Error information.
Data Type | Cardinality | Parent Element | Child Element(s) |
---|---|---|---|
String | 1..1 | delete | None |
object
Object information
Data Type | Cardinality | Parent Element | Child Element(s) |
---|---|---|---|
String | 1..1 | errors | name status |
name
Object name or container name.
Data Type | Cardinality | Parent Element | Child Element(s) |
---|---|---|---|
String | 1..1 | object | None |
status
Error status code
Data Type | Cardinality | Parent Element | Child Element(s) |
---|---|---|---|
String | 1..1 | object | None |
Example Bulk delete response: HTTP and JSON
Example of Request
curl -i $publicURL?bulk-delete -X POST -H "X-Auth-Token:$token" -H "Accept: application/json" -H "Content-Type:text/plain" --data-binary @DeleteList.txt
Example of Response
HTTP/1.1 200 OK
X-Trans-Id: tx893edf2c486e4fe98e128-005786df1d
Date: Thu, 14 Jul 2016 00:38:58 GMT
Content-Type: application/json
{
"Number Not Found": 0,
"Response Status": "200 OK",
"Errors": [],
"Number Deleted": 4,
"Response Body": ""
}
Example of Error Response
HTTP/1.1 200 OK
X-Trans-Id: txa5824c2ada3047d78a5d8-005786f942
Date: Thu, 14 Jul 2016 02:30:28 GMT
Content-Type: application/json
{
"Number Not Found": 0,
"Response Status": "400 Bad Request",
"Errors": [
["/container1", "409 Conflict"],
["/container2", "409 Conflict"],
["/container3", "409 Conflict"]
],
"Number Deleted": 0,
"Response Body": ""
}
Example Bulk delete response: HTTP and XML
Example of Request
curl -i $publicURL?bulk-delete -X POST -H "X-Auth-Token: $token" -H "Accept:application/xml" -H "Content-Type:text/plain" --data-binary @DeleteList.txt
Example of Response
HTTP/1.1 200 OK
X-Trans-Id: tx4aac9fc900e442f9a42f3-005783745e
Date: Mon, 11 Jul 2016 10:26:38 GMT
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<delete>
<number_deleted>4</number_deleted>
<number_not_found>0</number_not_found>
<response_body></response_body>
<response_status>200 OK</response_status>
<errors></errors>
</delete>
Example of Error Response
HTTP/1.1 200 OK
X-Trans-Id: tx42fb89d1157b4d7f95c54-005787125b
Date: Thu, 14 Jul 2016 04:17:31 GMT
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<delete>
<number_deleted>0</number_deleted>
<number_not_found>0</number_not_found>
<response_body></response_body>
<response_status>400 Bad Request</response_status>
<errors>
<object>
<name>/container1</name>
<status>409 Conflict</status>
</object>
<object>
<name>/container2</name>
<status>409 Conflict</status>
</object>
<object>
<name>/container3</name>
<status>409 Conflict</status>
</object>
</errors>
</delete>