Get Object Lock configuration on a bucket

Retrieve the configured Object Lock configuration on a bucket.

Note: Only Bucket Owners can retrieve Object Lock configuration on a bucket.

Request syntax


GET https://{endpoint}/{bucket-name}?object-lock # path style
GET https://{bucket-name}.{endpoint}?object-lock # virtual host style

Response body

Table 1. 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.'

Object Lock with a Default Retention rule response

This response lists the configuration for a bucket with Object Lock Protection enabled and a Default Retention rule.


HTTP/1.1 200 OK
Date: Wed, 8 Feb 2017 17:51:00 GMT
Connection: close
<ObjectLockConfiguration>
   <ObjectLockEnabled>string</ObjectLockEnabled>
   <Rule>
      <DefaultRetention>
         <Days>integer</Days>
         <Mode>string</Mode>
         <Years>integer</Years>
      </DefaultRetention>
   </Rule>
</ObjectLockConfiguration>

Object Lock with no Default Retention rule response

This response lists the configuration for a bucket with Object Lock enabled, but no Default Retention Rule.

HTTP/1.1 200 OK
Date: Sat, 11 Feb 2017 12:00:00 GMT
Connection: close
<ObjectLockConfiguration>
   <ObjectLockEnabled>string</ObjectLockEnabled>
</ObjectLockConfiguration>