We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.
Protected
Applies a legal hold configuration to the specified object. For more information, see Locking Objects.
This action is not supported by Amazon S3 on Outposts.
Use a bare-bones client and the command you need to make an API call.
import { S3Client, PutObjectLegalHoldCommand } from "@aws-sdk/client-s3"; // ES Modules import// const { S3Client, PutObjectLegalHoldCommand } = require("@aws-sdk/client-s3"); // CommonJS importconst client = new S3Client(config);const input = { // PutObjectLegalHoldRequest Bucket: "STRING_VALUE", // required Key: "STRING_VALUE", // required LegalHold: { // ObjectLockLegalHold Status: "ON" || "OFF", }, RequestPayer: "requester", VersionId: "STRING_VALUE", ContentMD5: "STRING_VALUE", ChecksumAlgorithm: "CRC32" || "CRC32C" || "SHA1" || "SHA256", ExpectedBucketOwner: "STRING_VALUE",};const command = new PutObjectLegalHoldCommand(input);const response = await client.send(command);// { // PutObjectLegalHoldOutput// RequestCharged: "requester",// };
PutObjectLegalHoldCommandInput
PutObjectLegalHoldCommandOutput
input
response
config
S3ServiceException
Base exception class for all service exceptions from S3 service.
Readonly
Static
Applies a legal hold configuration to the specified object. For more information, see Locking Objects.
This action is not supported by Amazon S3 on Outposts.
Example
Use a bare-bones client and the command you need to make an API call.
Param
PutObjectLegalHoldCommandInput
Returns
PutObjectLegalHoldCommandOutput
See
input
shape.response
shape.config
shape.Throws
S3ServiceException
Base exception class for all service exceptions from S3 service.