Available in Classic and VPC
Bulk delete 2 or more objects stored in a Ncloud Storage bucket at the same time.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
POST | - |
Request headers
The following describes the request headers.
For information about the headers common to all Ncloud Storage APIs, see Ncloud Storage request headers.
Field | Type | Required | Description |
---|---|---|---|
Content-MD5 |
String | Conditional | MD5 hash value
|
x-amz-checksum-* |
String | Conditional | Checksum hash value
|
Request query parameters
You can use the following query parameters with your request:
Field | Type | Required | Description |
---|---|---|---|
delete |
String | Required | Request object deletion.
|
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
Delete |
Object | Required | Object list |
Delete.Object |
Array | Required | Object information |
Delete.Quiet |
Boolean | Optional | Whether to omit response details
|
Delete.Object
The following describes Delete.Object
.
Field | Type | Required | Description |
---|---|---|---|
Key |
String | Required | Object name
|
VersionId |
String | Optional | Object version ID
|
ETag |
String | Optional | Unique object identifier (entity tag)
|
LastModifiedTime |
Integer | Optional | Last modification date and time
|
Size |
Integer | Optional | Object size (byte)
|
Request example
The request example is as follows:
POST /?delete HTTP/1.1
Host: {Bucket}.kr.ncloudstorage.com
Content-MD5: {Content-MD5}
<?xml version="1.0" encoding="UTF-8"?>
<Delete>
<Object>
<Key>Data1.xlsx</Key>
<VersionId>89f83309-****-****-****-9cc2c468d0e9</VersionId>
</Object>
<Object>
<Key>Data2.xlsx</Key>
</Object>
</Delete>
Response
This section describes the response format.
Response headers
For information about the headers common to all Ncloud Storage APIs, see Ncloud Storage response headers.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
DeleteResult |
Object | - | Deletion request object information |
DeleteResult.Deleted |
Array | - | List of successfully deleted objects |
DeleteResult.Error |
Array | - | List of objects failed to be deleted |
DeleteResult.Deleted
The following describes DeleteResult.Deleted
.
Field | Type | Required | Description |
---|---|---|---|
Key |
String | - | Object name |
VersionId |
String | - | Object version ID
|
DeleteMarker |
Boolean | - | Whether it is a deletion marker
|
DeleteMarkerVersionId |
String | - | Deletion marker version ID
|
DeleteResult.Error
The following describes DeleteResult.Error
.
Field | Type | Required | Description |
---|---|---|---|
Key |
String | - | Object name |
VersionId |
String | - | Object version ID |
Code |
String | - | Errors |
Message |
String | - | Error message |
Response status codes
For information about the HTTP status codes common to all Ncloud Storage APIs, see Common Ncloud Storage response status codes.
Response example
The response example is as follows:
If complete deletion is successful
The following is a sample response when complete deletion is successful.
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<DeleteResult>
<Deleted>
<Key>Data1.xlsx</Key>
<DeleteMarker>true</DeleteMarker>
<DeleteMarkerVersionId>b253ab10-****-****-****-9cc2c468d0e9</DeleteMarkerVersionId>
</Deleted>
<Deleted>
<Key>Date2.xlsx</Key>
<DeleteMarker>true</DeleteMarker>
<DeleteMarkerVersionId>b253aad9-****-****-****-9cc2c468d0e9</DeleteMarkerVersionId>
</Deleted>
</DeleteResult>
If the object information in the request body does not match the information registered in the console, the object may not be deleted even if the Content-MD5
or x-amz-checksum-*
header value matches the request body and a 200 OK response is returned. Therefore, check in the console after the API call to confirm that the object has been deleted correctly.
If only partial deletion is successful
The following is a sample response when only partial deletion is successful.
HTTP/1.1 200 OK
<DeleteResult>
<Deleted>
<Key>Data2.xlsx</Key>
<DeleteMarker>true</DeleteMarker>
<DeleteMarkerVersionId>f201de46-****-****-****-9cc2c468d0e9</DeleteMarkerVersionId>
</Deleted>
<Error>
<Key>Data1.xlsx</Key>
<VersionId>	89f83309-****-****-****-9cc2c468d0e9</VersionId>
<Code>InvalidArgument</Code>
<Message>Invalid version id specified</Message>
</Error>
</DeleteResult>