Object Storage Service

Products

Object Storage Service

Delete Multiple Objects

Description

The operation can delete multiple Objects through single HTTP request, which contains 1,000 Objects at most. If specified Object is not found in the request, OSS will return Deleted.

Batch deletion supports two response methods, which are verbose method and quiet method respectively. If the default method is verbose, the response contains deletion results of all Objects; if quiet mode is specified, the response only contains Objects with errors.

Request

Syntax

POST /?delete HTTP/1.1
Host: <bucket>.s3.<region>.jdcloud-oss.com
Authorization: <authorization string>
Content-Length: <Size>
Content-MD5: <MD5>

<?xml version="1.0" encoding="UTF-8"?>
<Delete>
    <Quiet>true</Quiet>
    <Object>
         <Key>Key</Key>
         <VersionId>VersionId</VersionId>
    </Object>
    <Object>
         <Key>Key</Key>
    </Object>
    ...
</Delete>			

Request Parameter

No Request Parameters

Request Header

Name Description Must
Content-MD5 Perform base64 encoding for 128-bit MD5. The Header is used for determining whether the request entity is corrupted in transmission.
Type: String
Default: None
Yes
Content-Length Entity length
Type: String
Default: None
Yes

Request Elements

Name Description Request
Delete Request Set.
Ancestor: None
Type: Container
One or multiple Object Elements and Optional Quiet Elements.
Yes
Quiet Enable quiet mode, and when adding the element, its value shall be specified as true.
Ancestor: Delete
Type: Boolean
Default: false
No
Object Delete set of specified Objects in the request.
Ancestor: Delete
Type: Container
Children: Key
Yes
Key object Name
Ancestor: Object
Type: String
Yes

Response

Request Header

No Request Header

Request Elements

Name Description
DeleteResult Response Set
Children: Deleted, Error
Type: Container
Ancestor: None
Deleted Deleted Element Set.
Children: Key
Type: Container
Ancestor: DeleteResult
Key Object Name Executing Deletion Operation.
Type: String
Ancestor: Deleted, or Error
Error Error Information Set.
Children: Key, Code, Message.
Type: String
Ancestor: DeleteResult
Code Delete returned Status Code of Failure.
Type: String
Values: AccessDenied, InternalError
Ancestor: Error
Message Error Description
Type: String
Ancestor: Error

Examples

Request Example

POST /?delete HTTP/1.1
Host: oss-example.s3.<region>.jdcloud-oss.com 
Accept: */*
x-amz-date: Wed, 30 Nov 2011 03:39:05 GMT
Content-MD5: p5/WA/oEr30qrEEl21PAqw==
Authorization: <authorization string>
Content-Length: 125
Connection: Keep-Alive

<Delete>
  <Object>
    <Key>sample1.txt</Key>
  </Object>
  <Object>
    <Key>sample2.txt</Key>
  </Object>
</Delete>

Response Example
HTTP/1.1 200 OK
x-amz-request-id: A437B3B641629AEE
Date: Fri, 02 Dec 2011 01:53:42 GMT
Content-Type: application/xml
Server: JDCloudOSS
Content-Length: 251

<?xml version="1.0" encoding="UTF-8"?>
<DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Deleted>
    <Key>sample1.txt</Key>
  </Deleted>
  <Error>
    <Key>sample2.txt</Key>
    <Code>AccessDenied</Code>
    <Message>Access Denied</Message>
  </Error>
</DeleteResult>
Update Time:2019-05-28 16:47:17