Put Object Lock Configuration (Flex WORM only)
Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration is applied by default to every new object placed in the specified bucket.
Request Syntax
PUT /{bucket}/?object-lock HTTP/1.1
Host: msdps3.server:8443
<?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>Request Parameters
Bucket
The bucket for which you want to create or replace Object Lock configuration.
Required: Yes
Type: String
Request body
ObjectLockConfiguration
Root level tag for the ObjectLockConfiguration parameters.
Required: Yes
ObjectLockEnabled
Indicates whether this bucket has an Object Lock configuration enabled. Enable ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket.
Valid Values: Enabled
Required: No
Type: String
Rule
Specifies the Object Lock rule for the specified objects. Enable the rule when you apply ObjectLockConfiguration to a bucket.
The settings require both a mode and a period. The period can be either Days or Years. You cannot specify Days and Years at the same time.
Required: No
Type: ObjectLockRule data type
Response Syntax
HTTP/1.1 200
Possible Error Response
Success
HTTP status code 200.
AccessDenied
Access Denied.
HTTP status code 403.
NoSuchBucket
The specified bucket does not exist.
HTTP status code 404.
InvalidBucketState
Object Lock configuration cannot be enabled on existing buckets.
HTTP status code 409.
InvalidRequest
The error may occur for some reasons. For details, please refer the error messages.
HTTP status code 400.