Available in Classic and VPC
Apply object lock settings on an Ncloud Storage bucket. Using object lock prevents objects from being deleted or modified for a specified period of time.
For a Sub Account user to execute this command, they must have the Change/PutBucketObjectLockConfiguration action permission.
Syntax
The put-object-lock-configuration syntax is as follows:
aws s3api put-object-lock-configuration \
--bucket <bucket> \
--object-lock-configuration <object-lock-configuration> \
[--content-md5 <content-md5>] \
[--checksum-algorithm <checksum-algorithm>] \
--endpoint-url <endpoint-url>
Options
This section describes the options available when running put-object-lock-configuration.
Required options
The following options are required for put-object-lock-configuration.
| Options | Type | Required | Description |
|---|---|---|---|
--bucket |
String | Required | Bucket name |
--object-lock-configuration |
String | Required | Object lock settings
|
Optional options
These are the optional options for put-object-lock-configuration. Options that are not specified will use their default values.
| Options | Type | Required | Description |
|---|---|---|---|
--content-md5 |
String | Optional | Base64-encoded 128-bit MD5 hash of the request data
|
--checksum-algorithm |
String | Optional | Checksum algorithm used to validate the request data
|
Common options
For information about the options common to all aws subcommands, see Ncloud Storage options.
Examples
If the object lock configuration request is successful, the settings are applied, and no result is displayed.
Command
The command example is as follows:
aws s3api put-object-lock-configuration --bucket my-locked-bucket \
--object-lock-configuration '{"ObjectLockEnabled":"Enabled","Rule":{"DefaultRetention":{"Mode":"GOVERNANCE","Days":1}}}' \
--endpoint-url=https://kr.ncloudstorage.com
Related commands
Related commands are as follows: