|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 5 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 6 | + |
| 7 | +import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { |
| 10 | + CreateCapacityReservationBySplittingRequest, |
| 11 | + CreateCapacityReservationBySplittingResult, |
| 12 | +} from "../models/models_0"; |
| 13 | +import { |
| 14 | + de_CreateCapacityReservationBySplittingCommand, |
| 15 | + se_CreateCapacityReservationBySplittingCommand, |
| 16 | +} from "../protocols/Aws_ec2"; |
| 17 | + |
| 18 | +/** |
| 19 | + * @public |
| 20 | + */ |
| 21 | +export type { __MetadataBearer }; |
| 22 | +export { $Command }; |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The input for {@link CreateCapacityReservationBySplittingCommand}. |
| 27 | + */ |
| 28 | +export interface CreateCapacityReservationBySplittingCommandInput extends CreateCapacityReservationBySplittingRequest {} |
| 29 | +/** |
| 30 | + * @public |
| 31 | + * |
| 32 | + * The output of {@link CreateCapacityReservationBySplittingCommand}. |
| 33 | + */ |
| 34 | +export interface CreateCapacityReservationBySplittingCommandOutput |
| 35 | + extends CreateCapacityReservationBySplittingResult, |
| 36 | + __MetadataBearer {} |
| 37 | + |
| 38 | +/** |
| 39 | + * <p> |
| 40 | + * Create a new Capacity Reservation by splitting the available capacity of the source Capacity Reservation. The new Capacity Reservation will have the same attributes as the source Capacity Reservation except for tags. The source Capacity Reservation must be <code>active</code> and owned by your Amazon Web Services account. |
| 41 | + * </p> |
| 42 | + * @example |
| 43 | + * Use a bare-bones client and the command you need to make an API call. |
| 44 | + * ```javascript |
| 45 | + * import { EC2Client, CreateCapacityReservationBySplittingCommand } from "@aws-sdk/client-ec2"; // ES Modules import |
| 46 | + * // const { EC2Client, CreateCapacityReservationBySplittingCommand } = require("@aws-sdk/client-ec2"); // CommonJS import |
| 47 | + * const client = new EC2Client(config); |
| 48 | + * const input = { // CreateCapacityReservationBySplittingRequest |
| 49 | + * DryRun: true || false, |
| 50 | + * ClientToken: "STRING_VALUE", |
| 51 | + * SourceCapacityReservationId: "STRING_VALUE", // required |
| 52 | + * InstanceCount: Number("int"), // required |
| 53 | + * TagSpecifications: [ // TagSpecificationList |
| 54 | + * { // TagSpecification |
| 55 | + * ResourceType: "capacity-reservation" || "client-vpn-endpoint" || "customer-gateway" || "carrier-gateway" || "coip-pool" || "dedicated-host" || "dhcp-options" || "egress-only-internet-gateway" || "elastic-ip" || "elastic-gpu" || "export-image-task" || "export-instance-task" || "fleet" || "fpga-image" || "host-reservation" || "image" || "import-image-task" || "import-snapshot-task" || "instance" || "instance-event-window" || "internet-gateway" || "ipam" || "ipam-pool" || "ipam-scope" || "ipv4pool-ec2" || "ipv6pool-ec2" || "key-pair" || "launch-template" || "local-gateway" || "local-gateway-route-table" || "local-gateway-virtual-interface" || "local-gateway-virtual-interface-group" || "local-gateway-route-table-vpc-association" || "local-gateway-route-table-virtual-interface-group-association" || "natgateway" || "network-acl" || "network-interface" || "network-insights-analysis" || "network-insights-path" || "network-insights-access-scope" || "network-insights-access-scope-analysis" || "placement-group" || "prefix-list" || "replace-root-volume-task" || "reserved-instances" || "route-table" || "security-group" || "security-group-rule" || "snapshot" || "spot-fleet-request" || "spot-instances-request" || "subnet" || "subnet-cidr-reservation" || "traffic-mirror-filter" || "traffic-mirror-session" || "traffic-mirror-target" || "transit-gateway" || "transit-gateway-attachment" || "transit-gateway-connect-peer" || "transit-gateway-multicast-domain" || "transit-gateway-policy-table" || "transit-gateway-route-table" || "transit-gateway-route-table-announcement" || "volume" || "vpc" || "vpc-endpoint" || "vpc-endpoint-connection" || "vpc-endpoint-service" || "vpc-endpoint-service-permission" || "vpc-peering-connection" || "vpn-connection" || "vpn-gateway" || "vpc-flow-log" || "capacity-reservation-fleet" || "traffic-mirror-filter-rule" || "vpc-endpoint-connection-device-type" || "verified-access-instance" || "verified-access-group" || "verified-access-endpoint" || "verified-access-policy" || "verified-access-trust-provider" || "vpn-connection-device-type" || "vpc-block-public-access-exclusion" || "ipam-resource-discovery" || "ipam-resource-discovery-association" || "instance-connect-endpoint" || "ipam-external-resource-verification-token", |
| 56 | + * Tags: [ // TagList |
| 57 | + * { // Tag |
| 58 | + * Key: "STRING_VALUE", |
| 59 | + * Value: "STRING_VALUE", |
| 60 | + * }, |
| 61 | + * ], |
| 62 | + * }, |
| 63 | + * ], |
| 64 | + * }; |
| 65 | + * const command = new CreateCapacityReservationBySplittingCommand(input); |
| 66 | + * const response = await client.send(command); |
| 67 | + * // { // CreateCapacityReservationBySplittingResult |
| 68 | + * // SourceCapacityReservation: { // CapacityReservation |
| 69 | + * // CapacityReservationId: "STRING_VALUE", |
| 70 | + * // OwnerId: "STRING_VALUE", |
| 71 | + * // CapacityReservationArn: "STRING_VALUE", |
| 72 | + * // AvailabilityZoneId: "STRING_VALUE", |
| 73 | + * // InstanceType: "STRING_VALUE", |
| 74 | + * // InstancePlatform: "Linux/UNIX" || "Red Hat Enterprise Linux" || "SUSE Linux" || "Windows" || "Windows with SQL Server" || "Windows with SQL Server Enterprise" || "Windows with SQL Server Standard" || "Windows with SQL Server Web" || "Linux with SQL Server Standard" || "Linux with SQL Server Web" || "Linux with SQL Server Enterprise" || "RHEL with SQL Server Standard" || "RHEL with SQL Server Enterprise" || "RHEL with SQL Server Web" || "RHEL with HA" || "RHEL with HA and SQL Server Standard" || "RHEL with HA and SQL Server Enterprise" || "Ubuntu Pro", |
| 75 | + * // AvailabilityZone: "STRING_VALUE", |
| 76 | + * // Tenancy: "default" || "dedicated", |
| 77 | + * // TotalInstanceCount: Number("int"), |
| 78 | + * // AvailableInstanceCount: Number("int"), |
| 79 | + * // EbsOptimized: true || false, |
| 80 | + * // EphemeralStorage: true || false, |
| 81 | + * // State: "active" || "expired" || "cancelled" || "pending" || "failed" || "scheduled" || "payment-pending" || "payment-failed", |
| 82 | + * // StartDate: new Date("TIMESTAMP"), |
| 83 | + * // EndDate: new Date("TIMESTAMP"), |
| 84 | + * // EndDateType: "unlimited" || "limited", |
| 85 | + * // InstanceMatchCriteria: "open" || "targeted", |
| 86 | + * // CreateDate: new Date("TIMESTAMP"), |
| 87 | + * // Tags: [ // TagList |
| 88 | + * // { // Tag |
| 89 | + * // Key: "STRING_VALUE", |
| 90 | + * // Value: "STRING_VALUE", |
| 91 | + * // }, |
| 92 | + * // ], |
| 93 | + * // OutpostArn: "STRING_VALUE", |
| 94 | + * // CapacityReservationFleetId: "STRING_VALUE", |
| 95 | + * // PlacementGroupArn: "STRING_VALUE", |
| 96 | + * // CapacityAllocations: [ // CapacityAllocations |
| 97 | + * // { // CapacityAllocation |
| 98 | + * // AllocationType: "used", |
| 99 | + * // Count: Number("int"), |
| 100 | + * // }, |
| 101 | + * // ], |
| 102 | + * // ReservationType: "default" || "capacity-block", |
| 103 | + * // }, |
| 104 | + * // DestinationCapacityReservation: { |
| 105 | + * // CapacityReservationId: "STRING_VALUE", |
| 106 | + * // OwnerId: "STRING_VALUE", |
| 107 | + * // CapacityReservationArn: "STRING_VALUE", |
| 108 | + * // AvailabilityZoneId: "STRING_VALUE", |
| 109 | + * // InstanceType: "STRING_VALUE", |
| 110 | + * // InstancePlatform: "Linux/UNIX" || "Red Hat Enterprise Linux" || "SUSE Linux" || "Windows" || "Windows with SQL Server" || "Windows with SQL Server Enterprise" || "Windows with SQL Server Standard" || "Windows with SQL Server Web" || "Linux with SQL Server Standard" || "Linux with SQL Server Web" || "Linux with SQL Server Enterprise" || "RHEL with SQL Server Standard" || "RHEL with SQL Server Enterprise" || "RHEL with SQL Server Web" || "RHEL with HA" || "RHEL with HA and SQL Server Standard" || "RHEL with HA and SQL Server Enterprise" || "Ubuntu Pro", |
| 111 | + * // AvailabilityZone: "STRING_VALUE", |
| 112 | + * // Tenancy: "default" || "dedicated", |
| 113 | + * // TotalInstanceCount: Number("int"), |
| 114 | + * // AvailableInstanceCount: Number("int"), |
| 115 | + * // EbsOptimized: true || false, |
| 116 | + * // EphemeralStorage: true || false, |
| 117 | + * // State: "active" || "expired" || "cancelled" || "pending" || "failed" || "scheduled" || "payment-pending" || "payment-failed", |
| 118 | + * // StartDate: new Date("TIMESTAMP"), |
| 119 | + * // EndDate: new Date("TIMESTAMP"), |
| 120 | + * // EndDateType: "unlimited" || "limited", |
| 121 | + * // InstanceMatchCriteria: "open" || "targeted", |
| 122 | + * // CreateDate: new Date("TIMESTAMP"), |
| 123 | + * // Tags: [ |
| 124 | + * // { |
| 125 | + * // Key: "STRING_VALUE", |
| 126 | + * // Value: "STRING_VALUE", |
| 127 | + * // }, |
| 128 | + * // ], |
| 129 | + * // OutpostArn: "STRING_VALUE", |
| 130 | + * // CapacityReservationFleetId: "STRING_VALUE", |
| 131 | + * // PlacementGroupArn: "STRING_VALUE", |
| 132 | + * // CapacityAllocations: [ |
| 133 | + * // { |
| 134 | + * // AllocationType: "used", |
| 135 | + * // Count: Number("int"), |
| 136 | + * // }, |
| 137 | + * // ], |
| 138 | + * // ReservationType: "default" || "capacity-block", |
| 139 | + * // }, |
| 140 | + * // InstanceCount: Number("int"), |
| 141 | + * // }; |
| 142 | + * |
| 143 | + * ``` |
| 144 | + * |
| 145 | + * @param CreateCapacityReservationBySplittingCommandInput - {@link CreateCapacityReservationBySplittingCommandInput} |
| 146 | + * @returns {@link CreateCapacityReservationBySplittingCommandOutput} |
| 147 | + * @see {@link CreateCapacityReservationBySplittingCommandInput} for command's `input` shape. |
| 148 | + * @see {@link CreateCapacityReservationBySplittingCommandOutput} for command's `response` shape. |
| 149 | + * @see {@link EC2ClientResolvedConfig | config} for EC2Client's `config` shape. |
| 150 | + * |
| 151 | + * @throws {@link EC2ServiceException} |
| 152 | + * <p>Base exception class for all service exceptions from EC2 service.</p> |
| 153 | + * |
| 154 | + * @public |
| 155 | + */ |
| 156 | +export class CreateCapacityReservationBySplittingCommand extends $Command |
| 157 | + .classBuilder< |
| 158 | + CreateCapacityReservationBySplittingCommandInput, |
| 159 | + CreateCapacityReservationBySplittingCommandOutput, |
| 160 | + EC2ClientResolvedConfig, |
| 161 | + ServiceInputTypes, |
| 162 | + ServiceOutputTypes |
| 163 | + >() |
| 164 | + .ep({ |
| 165 | + ...commonParams, |
| 166 | + }) |
| 167 | + .m(function (this: any, Command: any, cs: any, config: EC2ClientResolvedConfig, o: any) { |
| 168 | + return [ |
| 169 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 170 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 171 | + ]; |
| 172 | + }) |
| 173 | + .s("AmazonEC2", "CreateCapacityReservationBySplitting", {}) |
| 174 | + .n("EC2Client", "CreateCapacityReservationBySplittingCommand") |
| 175 | + .f(void 0, void 0) |
| 176 | + .ser(se_CreateCapacityReservationBySplittingCommand) |
| 177 | + .de(de_CreateCapacityReservationBySplittingCommand) |
| 178 | + .build() {} |
0 commit comments