Add Object Lock configuration on a bucket
IBM’s Object Lock storage feature allows users to store objects in a write once read many (WORM) fashion using rules and interfaces aligned with industry Object Lock implementations. This Object Lock storage feature is different from IBM’s Bucket Protection Feature (Also known as IBM Immutable Bucket Storage) and should be viewed as distinct from that feature.
Request syntax
PUT https://{endpoint}/{bucket-name}?object-lock # path style
PUT https://{bucket-name}.{endpoint}?object-lock # virtual host style
Host: myBucket.mydsNet.corp.com
Date: Wed, 8 Feb 2017 17:50:00 GMT
Authorization: authorization string Content-Type: text/plain
Content-Length: <Length>
Content-Md5:<md5 hash>
<ObjectLockConfiguration>
<ObjectLockEnabled>string</ObjectLockEnabled>
<Rule>
<DefaultRetention>
<Days>integer</Days>
<Mode>string</Mode>
<Years>integer</Years>
</DefaultRetention>
</Rule>
</ObjectLockConfiguration>
Request header
Name | Description | Required |
---|---|---|
Content-MD5 |
The base64-encoded 128-bit MD5 digest of the message (without the headers) according to RFC 1864. This header is used as a message integrity check to verify that the data is the same data that was originally sent.
|
Yes |
Request body
Name | Description | Required |
---|---|---|
ObjectLockConfiguration |
Container for enabling the Object Lock feature and defining a default retention rule for the bucket.
|
Yes |
ObjectLockEnabled |
The requested Object Lock state of the bucket.
|
Yes |
Rule |
Container for the Object Lock rule of the bucket. Only one ‘DefaultRetention’ rule can be defined at a time.
|
No |
DefaultRetention |
A single rule that defines the default object lock mode and period applied to objects written to the bucket with no additional Object Lock headers specified as part of the upload request. The rule requires a ‘mode’ and only one of ‘days’ or ‘years’ if it is defined.
|
No |
Days |
The number of days that an object is retained when uploaded to the bucket with a request that does not include Object Lock headers. Only one of either ‘Days’ or ‘Years can be specified in the rule.
|
Yes, when the DefaultRetention rule is included and the rule does NOT specify ‘Years.’ |
Mode |
The default Object Lock retention mode that will be applied to new objects uploaded to the bucket. If a `DefaultRetention` is specified, then this MUST be specified.
|
Yes, when the DefaultRetention rule is included. |
Years |
The number of years that an object is retained when uploaded to the bucket with a request that does not include Object Lock headers. Only one of either ‘Days’ or ‘Years can be specified in the rule.
|
Yes, when DefaultRetention rule is included and the rule does NOT specify ‘Days.' |