• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (OBS)
  4. Operations on Objects
  5. DELETE Multiple Objects
  6. Examples

Examples

Sample Request

POST /?delete HTTP/1.1  
 User-Agent: Jakarta Commons-HttpClient/3.1
 Host: bucketname.obs.example.com 
 Accept: */*
 Date: Tue, 14 Jan 2014 12:10:09 +0000
 Authorization: AWS BF6C09F302931425E9A7:wQ1Tp3rD7kaUCsYfPKxOIN7NoSA=  
 Content-MD5: 367CB63A2F283044981285491015079 
 Content-Length: 135 
 Expect: 100-continue

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

Sample Response

HTTP/1.1 200 OK 
 x-amz-id-2: Weag1LuByRx9e6j5Onimru9pO4ZVKnJ2Qz7/C1NPcfTWAtRPfTaOFg== 
 x-amz-request-id: 996c76696e6727732072657175657374  
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Date: Mon, 1 Nov 2010 20:34:56 GMT 
 Content-Type: application/xml 
 Content-Length: 10485760 
 Server: OBS  

 <?xml version="1.0" encoding="UTF-8"?> 
 <DeleteResult xmlns="http://obs.example.com/doc/2015-06-30/"> 
 <Deleted> 
 <Key>Key1</Key> 
 </Deleted> 
 <Error> 
 <Key>Key2</Key> 
 <Code>InternalError</Code> 
 <Message>Internal Error</Message> 
 </Error> 
 </DeleteResult>

Sample Request (Deleting an Object with No Version ID Specified form a Bucket with Versioning Enabled)

POST /?delete HTTP/1.1  
 User-Agent: Jakarta Commons-HttpClient/3.1
 Host: bucketname.obs.example.com 
 Accept: */*
 Date: Tue, 14 Jan 2014 12:10:09 +0000 
 Authorization: AWS C9590CEB8EC051BDEC9D:HLq5AmI/Zlz1PPsXdk6pIHuNaCM= 
 Content-MD5: uj2BQLIgDcegTcWHwEGoiA== 
 Content-Length: 64 
 Expect: 100-continue

 <Delete> 
 <Object> 
 <Key>object</Key> 
 </Object> 
 </Delete> 

Sample Response (Deleting an Object with No Version ID Specified form a Bucket with Versioning Enabled)

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: DCD2FC9CAB780000014390A8AA7D4763 
 x-amz-id-2: iFIiPx4egtz5ToRcIIkVZ5Nz8F+zUCis6JKhuQysA4gxLIt+EgPMTMuO08beG7sd 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: application/xml 
 Date: Tue, 14 Jan 2014 12:10:09 GMT 
 Content-Length: 280  

 <DeleteResult xmlns="http://obs.example.com/doc/2015-06-30/"> 
 <Deleted> 
 <Key>object</Key> 
 <DeleteMarker>true</DeleteMarker> 
 <DeleteMarkerVersionId>AAABQ5Coqqzc0vycq3gAAAAZVURTRkha</DeleteMarkerVersionId> 
 </Deleted> 
 </DeleteResult>

Sample Request (Deleting an Object with Version ID Specified from a Bucket)

POST /example?delete HTTP/1.1  
 User-Agent: Jakarta Commons-HttpClient/3.1
 Host: bucketname.obs.example.com 
 Accept: */*
 Date: Tue, 14 Jan 2014 12:19:57 +0000 
 Authorization: AWS C9590CEB8EC051BDEC9D:eTmW0xEkSYrfqOSjZUV7zS+Ap5Y= 
 Content-MD5: YDYt+eVo7S5tnBHaHOylGA== 
 Content-Length: 124 
 Expect: 100-continue

 <Delete> 
 <Object> 
 <Key>object</Key> 
 <VersionId>AAABQ4-glIvc0vycq3gAAAAVVURTRkha</VersionId> 
 </Object> 
 </Delete> 

Sample Response (Deleting an Object with Version ID Specified from a Bucket)

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: DCD2FC9CAB780000014390B1A5974C2C 
 x-amz-id-2: x9Vt2FIjXLjyu38NHeHG+IIYQIQKQjZrEDSHOElJMvEb/SUfY5k54C/uX8GfGUFz 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: application/xml 
 Date: Tue, 14 Jan 2014 12:19:58 GMT 
 Content-Length: 223 

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 <DeleteResult xmlns="http://obs.example.com/doc/2015-06-30/"> 
 <Deleted> 
 <Key>object</Key> 
 <VersionId>AAABQ4-glIvc0vycq3gAAAAVVURTRkha</VersionId> 
 </Deleted> 
 </DeleteResult>

Sample Request (Deleting a Deletion Mark in a Bucket with Version ID Specified)

POST /example?delete HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1
 Host: bucketname.obs.example.com 
 Accept: */*
 Date: Wed, 15 Jan 2014 02:03:40 +0000 
 Authorization: AWS C9590CEB8EC051BDEC9D:N/UdjEab/8H5Llgw1HUpTd21wc4= 
 Content-MD5: n9LlSFB87vGiGDqDKLXPLA== 
 Content-Length: 124 
 Expect: 100-continue

 <Delete> 
 <Object> 
 <Key>object</Key> 
 <VersionId>AAABQ49lNT_c0vycq3gAAAAOVURTRkha</VersionId> 
 </Object> 
 </Delete>

Sample Response (Deleting a Deletion Mark in a Bucket with Version ID Specified)

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: DCD2FC9CAB780000014393A3C5CEDE66 
 x-amz-id-2: N9UP5OvD4BwlQAfyqow6TLWq7HIsG8As4bP/CCNFjcp1Ab8Cc4JAFPm0bjV9WrTg 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: application/xml 
 Date: Wed, 15 Jan 2014 02:03:40 GMT 
 Content-Length: 335 

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 <DeleteResult xmlns="http://obs.example.com/doc/2015-06-30/"> 
 <Deleted> 
 <Key>object</Key> 
 <VersionId>AAABQ49lNT_c0vycq3gAAAAOVURTRkha</VersionId> 
 <DeleteMarker>true</DeleteMarker> 
 <DeleteMarkerVersionId>AAABQ49lNT_c0vycq3gAAAAOVURTRkha</DeleteMarkerVersionId> 
 </Deleted> 
 </DeleteResult>