We are excited to announce our new API Documentation.
Protected
Retrieves an object's retention settings. For more information, see Locking Objects.
This action is not supported by Amazon S3 on Outposts.
The following action is related to GetObjectRetention:
GetObjectRetention
GetObjectAttributes
Use a bare-bones client and the command you need to make an API call.
import { S3Client, GetObjectRetentionCommand } from "@aws-sdk/client-s3"; // ES Modules import// const { S3Client, GetObjectRetentionCommand } = require("@aws-sdk/client-s3"); // CommonJS importconst client = new S3Client(config);const input = { // GetObjectRetentionRequest Bucket: "STRING_VALUE", // required Key: "STRING_VALUE", // required VersionId: "STRING_VALUE", RequestPayer: "requester", ExpectedBucketOwner: "STRING_VALUE",};const command = new GetObjectRetentionCommand(input);const response = await client.send(command);// { // GetObjectRetentionOutput// Retention: { // ObjectLockRetention// Mode: "GOVERNANCE" || "COMPLIANCE",// RetainUntilDate: new Date("TIMESTAMP"),// },// };
GetObjectRetentionCommandInput
GetObjectRetentionCommandOutput
input
response
config
S3ServiceException
Base exception class for all service exceptions from S3 service.
Readonly
Static
Retrieves an object's retention settings. For more information, see Locking Objects.
This action is not supported by Amazon S3 on Outposts.
The following action is related to
GetObjectRetention
:GetObjectAttributes
Example
Use a bare-bones client and the command you need to make an API call.
Param
GetObjectRetentionCommandInput
Returns
GetObjectRetentionCommandOutput
See
input
shape.response
shape.config
shape.Throws
S3ServiceException
Base exception class for all service exceptions from S3 service.