• Object Storage Service

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

Examples

Sample Request

PUT /destobject HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com 
 Accept: */* 
 Date: Sat, 03 Dec 2011 08:48:07 +0000 
 Authorization: AWS BF6C09F302931425E9A7:2rZR+iaH8xUewvUKuicLhLHpNoU= 
 x-amz-copy-source: /bucket/srcobject

Sample Response

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: 001B21A61C6C00000134031BE8005293 
 x-amz-id-2: MDAxQjIxQTYxQzZDMDAwMDAxMzQwMzFCRTgwMDUyOTNBQUFBQUFBQWJiYmJiYmJi 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: application/xml 
 Date: Sat, 03 Dec 2011 08:48:07 GMT 
 Content-Length: 254 

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 <CopyObjectResult xmlns="http://obs.example.com/doc/2015-06-30/"> 
 <LastModified>2011-12-03T08:48:07.706Z</LastModified> 
 <ETag>"507e3fff69b69bf57d303e807448560b"</ETag> 
 </CopyObjectResult>

Sample Request (Copying an Object with Version ID Specified to a Bucket with Versioning Enabled)

PUT /destobject HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com 
 Accept: */* 
 Date: Mon, 13 Jan 2014 12:19:13 +0000 
 Authorization: AWS C5780CDE717D50F4CDAA:4BLYv+1UxfRSHBMvrhVLDszxvcY= 
 x-amz-copy-source: versionbucket/srcobject?versionId=AAABQ4uBLdLc0vycq3gAAAAEVURTRkha

Sample Response (Copying an Object with Version ID Specified to a Bucket with Versioning Enabled)

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: DCD2FC9CAB78000001438B8A9C898B79 
 x-amz-id-2: DB/qBZmbN6AIoX9mrrSNYdLxwvbO0tLR/l6/XKTT4NmZspzhWrwp5Z74ybAYVOgr 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: application/xml 
 x-amz-version-id: AAABQ4uKnOrc0vycq3gAAAAFVURTRkha 
 x-amz-copy-source-version-id: AAABQ4uBLdLc0vycq3gAAAAEVURTRkha 
 Date: Mon, 13 Jan 2014 12:19:14 GMT 
 Transfer-Encoding: chunked
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 <CopyObjectResult xmlns="http://obs.example.com/doc/2015-06-30/"> 
 <LastModified>2014-01-13T12:19:13.770Z</LastModified> 
 <ETag>"ba1f2511fc30423bdbb183fe33f3dd0f"</ETag> 
 </CopyObjectResult>

Sample Request (Copying an Object with Version ID Specified to a Bucket with Versioning Suspended)

PUT /object03 HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com 
 Accept: */* 
 Date: Mon, 13 Jan 2014 12:30:11 +0000 
 Authorization: AWS C5780CDE717D50F4CDAA:TzFaMXTynxWqPdhhRy9l/8Litb8= 
 x-amz-copy-source: versionbucket/srcobject?versionId=AAABQ4uBLdLc0vycq3gAAAAEVURTRkha

Sample Response (Copying an Object with Version ID Specified to a Bucket with Versioning Suspended)

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: DCD2FC9CAB78000001438B94A6CE90D3 
 x-amz-id-2: ITdGwAvGXezuPzC6m87LVpk2F0i6P5W8GxhBOhmwdf03VjrcL/OXSeOlTpnTLnJy 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: application/xml 
 x-amz-version-id: null 
 Date: Mon, 13 Jan 2014 12:30:11 GMT 
 Transfer-Encoding: chunked
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 <CopyObjectResult xmlns="http://obs.example.com/doc/2015-06-30/"> 
 <LastModified>2014-01-13T12:30:11.690Z</LastModified> 
 <ETag>"ba1f2511fc30423bdbb183fe33f3dd0f"</ETag> 
 </CopyObjectResult>