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.

If enabling Object Lock on the bucket, refer to the IBM Object Lock Feature Description Document for an overview of the feature and its benefits.

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

Table 1. Header elements
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.

Type
String
Valid Values
Md5 hash
Default
None
Yes

Request body

Table 2. Payload elements
Name Description Required
ObjectLockConfiguration

Container for enabling the Object Lock feature and defining a default retention rule for the bucket.

Type
Container
Children
ObjectLockEnabled, Rule
Yes
ObjectLockEnabled

The requested Object Lock state of the bucket.

Type
String
Valid Values
Enabled
Ancestor
ObjectLockConfiguration
Yes
Rule

Container for the Object Lock rule of the bucket. Only one ‘DefaultRetention’ rule can be defined at a time.

Type
Container
Children
DefaultRetention
Ancestor
ObjectLockConfiguration
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.

Type
Container
Children
Days,Mode,Years
Ancestor
Rule
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.

Type
Integer
Valid Values
1-36500 (inclusive)
Ancestor
DefaultRetention
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.

Type
Enum
Valid Values
COMPLIANCE
Ancestor
DefaultRetention
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.

Type
Integer
Valid Values
1-100 (inclusive)
Ancestor
DefaultRetention
Yes, when DefaultRetention rule is included and the rule does NOT specify ‘Days.'