Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class CreateRuleCommandProtected

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.

import { RbinClient, CreateRuleCommand } from "@aws-sdk/client-rbin"; // ES Modules import
// const { RbinClient, CreateRuleCommand } = require("@aws-sdk/client-rbin"); // CommonJS import
const 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",
// };

Param

CreateRuleCommandInput

Returns

CreateRuleCommandOutput

See

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.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods