Adding Object Lock legal hold on an object
The Object Lock Legal Hold can be applied to an object after it has been uploaded to the system. If an object was uploaded without any applied retention or legal hold, the legal hold can be added with this request. If an object was uploaded with legal hold applied already, then that legal hold can be turned ON or OFF with this request.
Note: Only bucket owners have permissions to configure object legal hold on an object. Bucket owners
can also modify the legal hold status on objects owned by other users that were uploaded to their
bucket.
Note: The Contents of request must be signed by using either a Content-MD5 header
or with a x-amz-checksum- header or with V4 signing that includes content signing.
Request syntax
PUT /BucketName/ObjectName?legal-hold&versionId=<VersionID> HTTP/1.1
Content-MD5: <Calculated Content MD5 checksum>
<?xml version="1.0" encoding="UTF-8"?>
<LegalHold>
<Status>string</Status>
</LegalHold>
Request payload elements
| Name | Description |
|---|---|
| LegalHold |
Container holding the LegalHold Status element. |
| Status | The requested Object Lock LegalHold Status for the object.
|
Sample request
Object Lock Object LegalHold request
PUT /BucketName/ObjectName?legal-hold&versionId=<VersionID> HTTP/1.1 Host: myBucket.mydsNet.corp.com
Date: Wed, 8 Feb 2017 17:50:00 GMT
Authorization: authorization string Content-Type: text/plain
Content-MD5:<Valid-ContentMD5>
<?xml version="1.0" encoding="UTF-8"?>
<LegalHold>
<Status>ON</Status>
</LegalHold>
Sample response
Object Lock Object LegalHold response
HTTP/1.1 200 OK
Date: Wed, 8 Feb 2017 17:51:00 GMT
Connection: close