--- title: "get-object-retention" slug: "get-object-retention" updated: 2026-10-08T09:49:34Z published: 2026-10-08T09:49:34Z canonical: "cli.ncloud-docs.com/get-object-retention" --- > ## Documentation Index > Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # get-object-retention Classic/VPC環境で利用できます。 Ncloud Storageオブジェクトに設定されているリテンション情報を照会します。 参考 Sub Accountユーザーがこのコマンドを実行するには、View/GetObjectRetentionアクションの権限が必要です。 ## 構文 `get-object-retention`構文は次の通りです。 ``` aws s3api get-object-retention \ --bucket \ --key \ [--version-id ] \ --endpoint-url ``` ## オプション `get-object-retention`の実行時に指定できるオプションについて説明します。 ### 必須オプション `get-object-retention`の必須オプションです。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--bucket` | String | Required | バケット名 | | `--key` | String | Required | オブジェクト名 | ### 任意オプション `get-object-retention`の任意オプションです。指定しない場合、オプションにはデフォルト値が適用されます。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--version-id` | String | Optional | オブジェクトバージョン ID | ### 共通オプション `aws`コマンドで共通して使用するオプションについては、[Ncloud Storageのオプション](/docs/ja/storage-ncloudstorage#%EC%98%B5%EC%85%98)をご参照ください。 ## 例 リテンション設定の照会リクエストが成功すると、オブジェクトのリテンションモードとリテンション期限が返されます。 ### コマンド コマンドの例は次の通りです。 ``` aws s3api get-object-retention --bucket my-locked-bucket \ --key locked.txt \ --endpoint-url=https://kr.ncloudstorage.com ``` ### 出力 出力の例は次の通りです。 ``` { "Retention": { "Mode": "GOVERNANCE", "RetainUntilDate": "2026-08-25T00:00:00.000Z" } } ``` ## 関連コマンド 関連コマンドは次の通りです。 - [put-object-lock-configuration](/docs/ja/put-object-lock-configuration) - [get-object-lock-configuration](/docs/ja/get-object-lock-configuration) - [put-object-retention](/docs/ja/put-object-retention) - [put-object-legal-hold](/docs/ja/put-object-legal-hold) - [get-object-legal-hold](/docs/ja/get-object-legal-hold)