Object Lock
Methods for working with object lock:
- GetObjectLegalHold — Get the legal hold status.
- PutObjectLegalHold — Set or remove a legal hold.
- GetObjectRetention — Get the retention status.
- PutObjectRetention — Set, configure, or remove retention.
- GetObjectLockConfiguration — Get the default retention status.
- PutObjectLockConfiguration — Set, configure, or remove the default retention.
Returns the legal hold status set on an object.
Request example:
GET /{Key+}?legal-hold HTTP/1.1Host: my-test-bucket1.hb.bizmrg.com
Response example:
HTTP/1.1 200<?xml version="1.0" encoding="UTF-8"?><LegalHold><Status>string</Status></LegalHold>
The PutObjectLegalHold method sets or removes a legal hold on an object.
Request body:
<LegalHold xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Status>string</Status></LegalHold>
Request parameters:
Parameter | Type | Description |
|---|---|---|
| complex element | Object legal hold settings |
| xs:string (enum) | Legal hold status:
|
Request example:
PUT /{Key+}?legal-hold HTTP/1.1Host: my-test-bucket1.hb.bizmrg.com<?xml version="1.0" encoding="UTF-8"?><LegalHold xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Status>string</Status></LegalHold>
Get the retention status set on an object.
Request example:
GET /{Key+}?retention HTTP/1.1Host: my-test-bucket1.hb.bizmrg.com
Response example:
HTTP/1.1 200<?xml version="1.0" encoding="UTF-8"?><Retention><Mode>string</Mode><RetainUntilDate>timestamp</RetainUntilDate></Retention>
The PutObjectRetention method sets, configures, or removes retention on an object.
To bypass governance-mode retention when calling this method, include a header with the value x-amz-bypass-governance-retention in the request.
Request body:
<Retention xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Mode>string</Mode><RetainUntilDate>timestamp</RetainUntilDate></Retention>
Request parameters:
Parameter | Type | Description |
|---|---|---|
| complex element | Object retention settings |
| xs:string (enum) | Lock type:
|
| xs:dateTime | Date and time when the object's retention period expires, in ISO8601 format |
Request example:
PUT /{Key+}?retention HTTP/1.1Host: my-test-bucket1.hb.bizmrg.comx-amz-bypass-governance-retention: BypassGovernanceRetention<?xml version="1.0" encoding="UTF-8"?>
Get the default retention status.
Request example:
GET /?object-lock HTTP/1.1Host: my-test-bucket1.hb.bizmrg.com
Response example:
HTTP/1.1 200<?xml version="1.0" encoding="UTF-8"?><ObjectLockConfiguration><ObjectLockEnabled>string</ObjectLockEnabled><Rule><DefaultRetention><Days>integer</Days><Mode>string</Mode><Years>integer</Years></DefaultRetention></Rule></ObjectLockConfiguration>
The PutObjectLockConfiguration method is used to set, configure, and remove the default retention.
Request body:
<ObjectLockConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><ObjectLockEnabled>string</ObjectLockEnabled><Rule><DefaultRetention><Days>integer</Days><Mode>string</Mode><Years>integer</Years></DefaultRetention></Rule></ObjectLockConfiguration>
Request parameters:
Parameter | Type | Description |
|---|---|---|
| ||
|
| Lock status. |
|
| Default retention rule |
|
| Default retention parameter |
|
| Lock type:
|
|
| Retention period in days from the moment the object is uploaded. Cannot be specified together with |
|
| Retention period in years from the moment the object is uploaded. Cannot be specified together with |
Request example:
PUT /?object-lock HTTP/1.1Host: my-test-bucket1.hb.bizmrg.com<?xml version="1.0" encoding="UTF-8"?><ObjectLockConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><ObjectLockEnabled>string</ObjectLockEnabled><Rule><DefaultRetention><Days>integer</Days><Mode>string</Mode><Years>integer</Years></DefaultRetention></Rule></ObjectLockConfiguration>