We are excited to announce our new API Documentation.
Protected
Creates a Recycle Bin retention rule. For more information, see Create Recycle Bin retention rules in the Amazon Elastic Compute Cloud User Guide.
Use a bare-bones client and the command you need to make an API call.
import { RbinClient, CreateRuleCommand } from "@aws-sdk/client-rbin"; // ES Modules import// const { RbinClient, CreateRuleCommand } = require("@aws-sdk/client-rbin"); // CommonJS importconst client = new RbinClient(config);const input = { // CreateRuleRequest RetentionPeriod: { // RetentionPeriod RetentionPeriodValue: Number("int"), // required RetentionPeriodUnit: "DAYS", // required }, Description: "STRING_VALUE", Tags: [ // TagList { // Tag Key: "STRING_VALUE", // required Value: "STRING_VALUE", // required }, ], ResourceType: "EBS_SNAPSHOT" || "EC2_IMAGE", // required ResourceTags: [ // ResourceTags { // ResourceTag ResourceTagKey: "STRING_VALUE", // required ResourceTagValue: "STRING_VALUE", }, ], LockConfiguration: { // LockConfiguration UnlockDelay: { // UnlockDelay UnlockDelayValue: Number("int"), // required UnlockDelayUnit: "DAYS", // required }, },};const command = new CreateRuleCommand(input);const response = await client.send(command);// { // CreateRuleResponse// Identifier: "STRING_VALUE",// RetentionPeriod: { // RetentionPeriod// RetentionPeriodValue: Number("int"), // required// RetentionPeriodUnit: "DAYS", // required// },// Description: "STRING_VALUE",// Tags: [ // TagList// { // Tag// Key: "STRING_VALUE", // required// Value: "STRING_VALUE", // required// },// ],// ResourceType: "EBS_SNAPSHOT" || "EC2_IMAGE",// ResourceTags: [ // ResourceTags// { // ResourceTag// ResourceTagKey: "STRING_VALUE", // required// ResourceTagValue: "STRING_VALUE",// },// ],// Status: "pending" || "available",// LockConfiguration: { // LockConfiguration// UnlockDelay: { // UnlockDelay// UnlockDelayValue: Number("int"), // required// UnlockDelayUnit: "DAYS", // required// },// },// LockState: "locked" || "pending_unlock" || "unlocked",// };
CreateRuleCommandInput
CreateRuleCommandOutput
input
response
config
InternalServerException (server fault)
The service could not respond to the request due to an internal problem.
ServiceQuotaExceededException (client fault)
The request would cause a service quota for the number of tags per resource to be exceeded.
ValidationException (client fault)
One or more of the parameters in the request is not valid.
RbinServiceException
Base exception class for all service exceptions from Rbin service.
Readonly
Static
Creates a Recycle Bin retention rule. For more information, see Create Recycle Bin retention rules in the Amazon Elastic Compute Cloud User Guide.
Example
Use a bare-bones client and the command you need to make an API call.
Param
CreateRuleCommandInput
Returns
CreateRuleCommandOutput
See
input
shape.response
shape.config
shape.Throws
InternalServerException (server fault)
The service could not respond to the request due to an internal problem.
Throws
ServiceQuotaExceededException (client fault)
The request would cause a service quota for the number of tags per resource to be exceeded.
Throws
ValidationException (client fault)
One or more of the parameters in the request is not valid.
Throws
RbinServiceException
Base exception class for all service exceptions from Rbin service.