Lists legal holds for an object.
Use a bare-bones client and the command you need to make an API call.
import { S3Client, ListLegalHoldsCommand } from "ibm-cos-sdk-v2"; // ES Modules import// const { S3Client, ListLegalHoldsCommand } = require("ibm-cos-sdk-v2"); // CommonJS import// import type { S3ClientConfig } from "ibm-cos-sdk-v2";const config = {}; // type is S3ClientConfigconst client = new S3Client(config);const input = { // ListLegalHoldsInput Bucket: "STRING_VALUE", // required Key: "STRING_VALUE", // required MirrorDestination: "STRING_VALUE",};const command = new ListLegalHoldsCommand(input);const response = await client.send(command);// { // ListLegalHoldsOutput// CreateTime: new Date("TIMESTAMP"),// LegalHolds: [ // LegalHoldList// { // LegalHoldEntry// Date: new Date("TIMESTAMP"),// ID: "STRING_VALUE",// },// ],// RetentionPeriod: Number("int"),// RetentionPeriodExpirationDate: new Date("TIMESTAMP"),// }; Copy
import { S3Client, ListLegalHoldsCommand } from "ibm-cos-sdk-v2"; // ES Modules import// const { S3Client, ListLegalHoldsCommand } = require("ibm-cos-sdk-v2"); // CommonJS import// import type { S3ClientConfig } from "ibm-cos-sdk-v2";const config = {}; // type is S3ClientConfigconst client = new S3Client(config);const input = { // ListLegalHoldsInput Bucket: "STRING_VALUE", // required Key: "STRING_VALUE", // required MirrorDestination: "STRING_VALUE",};const command = new ListLegalHoldsCommand(input);const response = await client.send(command);// { // ListLegalHoldsOutput// CreateTime: new Date("TIMESTAMP"),// LegalHolds: [ // LegalHoldList// { // LegalHoldEntry// Date: new Date("TIMESTAMP"),// ID: "STRING_VALUE",// },// ],// RetentionPeriod: Number("int"),// RetentionPeriodExpirationDate: new Date("TIMESTAMP"),// };
ListLegalHoldsCommandInput
ListLegalHoldsCommandOutput
input
response
config
S3ServiceException
Base exception class for all service exceptions from S3 service.
Lists legal holds for an object.
Example
Use a bare-bones client and the command you need to make an API call.
Param: ListLegalHoldsCommandInput
ListLegalHoldsCommandInput
Returns
ListLegalHoldsCommandOutput
See
inputshape.responseshape.configshape.Throws
S3ServiceException
Base exception class for all service exceptions from S3 service.