Replacing custom metadata for an existing object

Here’s a sample PUT request that replaces the existing custom metadata for the object named hum_res/budget_proposals/BudgProp-2013 in the finance bucket with new custom metadata. The request is being made while versioning is disabled for the bucket, so the custom metadata is replaced on the current version of the object. No new version is created.

Request with s3curl command line

./s3curl.pl --id=lgreen
     --copysrc=/finance/hum_res/budget_proposals/BudgProp-2013 -- -k
     "https://finance.europe.hcp.example.com/hum_res/budget_     proposals/
     BudgProp-2013" -H "x-amz-meta-author:Robin Silver"
     -H "x-amz-meta-department:Human Resources"
     -H "x-amz-metadata-directive:REPLACE" -H "x-hcp-pretty-     print:true"

Request headers

PUT /hum_res/budget_proposals/BudgProp-2013 HTTP/1.1
Host: finance.europe.hcp.example.com
Date: Wed, 10 Apr 2013 18:29:34 +0000
Authorization: AWS bGdyZWVu:WAamEr9PkL76M/kWkFu5K2rY9Bs=
x-amz-copy-source: /finance/hum_res/budget_proposals/BudgProp-2013
x-amz-meta-author: Robin Silver
x-amz-meta-department: Human Resources
x-amz-metadata-directive: REPLACE
x-hcp-pretty-print: true

Response headers

HTTP/1.1 200 OK
Date: Wed, 10 Apr 2013 18:29:33 GMT
Server: HCP V7.0.0.16
Content-Type: application/xml;charset=UTF-8
Transfer-Encoding: chunked

Response body

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CopyObjectResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
     <LastModified>2012-11-16T23:29:17.062Z</LastModified>
     <ETag>"76216527ff2f6219f7c29251a619c8db"</ETag>
</CopyObjectResult>

Trademark and LegalDisclaimer

© 2015 Hitachi Data Systems Corporation. All rights reserved.