Available in Classic and VPC
Get the retention information configured for an Ncloud Storage object.
For a Sub Account user to execute this command, they must have the View/GetObjectRetention action permission.
Syntax
The get-object-retention syntax is as follows:
aws s3api get-object-retention \
--bucket <bucket> \
--key <key> \
[--version-id <version-id>] \
--endpoint-url <endpoint-url>
Options
This section describes the options available when running get-object-retention.
Required options
The following options are required for get-object-retention.
| Options | Type | Required | Description |
|---|---|---|---|
--bucket |
String | Required | Bucket name |
--key |
String | Required | Object name |
Optional options
These are the optional options for get-object-retention. Options that are not specified will use their default values.
| Options | Type | Required | Description |
|---|---|---|---|
--version-id |
String | Optional | Object version ID |
Common options
For information about the options common to all aws subcommands, see Ncloud Storage options.
Examples
If the request to retrieve retention settings is successful, the object's retention mode and retention expiration date and time are returned.
Command
The command example is as follows:
aws s3api get-object-retention --bucket my-locked-bucket \
--key locked.txt \
--endpoint-url=https://kr.ncloudstorage.com
Output
The output example is as follows:
{
"Retention": {
"Mode": "GOVERNANCE",
"RetainUntilDate": "2026-08-25T00:00:00.000Z"
}
}
Related commands
Related commands are as follows: