Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
98 lines (68 sloc) 2.98 KB

deleteMultipleObjects method

Deletes objects based on a list of keys passed in a request.

It takes less time than deleting the same objects one by one via separate requests.

The delete list may contain a maximum of 1,000 keys.

If one of the objects does not exist, Object Storage marks it as deleted in the response.

You can configure responses so that Object Storage returns one of the following selections:

  • Statuses of all delete operations.
  • Only statuses with errors deleting objects. In this case, if no errors occurred, an empty response will be returned.

Request {#request}

POST /{bucket}?delete HTTP/1.1

Path parameters {#path-parameters}

Parameter Description
bucket Name of the bucket.

Query parameters {#request-parameters}

Parameter Description
delete Flag indicating a delete operation.

Headers {#request-headers}

In a request, use only common request headers.

For this request, the Content-MD5 and Content-Length headers are required.

Data schema {#request-scheme}

The list of keys to delete is passed in XML format.

<?xml version="1.0" encoding="UTF-8"?>
<Delete>
    <Quiet>true</Quiet>
    <Object>
         <Key>Key</Key>
    </Object>
    ...
</Delete>
Tag Description
Delete Contains the response body.

Path: /Delete.
Quiet <Quiet>true</Quiet> enables quiet mode.

Object Storage will only include deletion errors in the response. If there are no errors, there will be no response body.

If omitted, the default value is false.

Path: /Delete/Quiet.
Object Contains parameters for deleting an object.

Path: /Delete/Object.
Key Object key.

Path: /Delete/Object/Key.

Response {#response}

Headers {#response-headers}

A response can only contain common response headers.

Response codes {#response-codes}

For a list of possible responses, see #T.

A successful response contains additional data in XML format with the schema described below.

Data structure {#response-scheme}

<DeleteResult>
  <Deleted>
    <Key>some/key.txt</Key>
  </Deleted>
  <Error>
    <Key>some/another/key.txt</Key>
    <Code>TextErrorCode</Code>
    <Message>Describing message</Message>
  </Error>
</DeleteResult>
Tag Description
DeleteResult Response body.

Path: /DeleteResult.
Deleted Successfully deleted object.

Missing if the request was set to <Quiet>true</Quiet>.

Path: /DeleteResult/Deleted.
Key Object key.

Path: /DeleteResult/Deleted/Key or /DeleteResult/Error/Key
Error Error deleting an object.

Path: /DeleteResult/Error.
Code Error code.
Path: /DeleteResult/Error/Code.
Message Error description.
Path: /DeleteResult/Error/Message.
You can’t perform that action at this time.