|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 4 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 5 | + |
| 6 | +import { AutoScalingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AutoScalingClient"; |
| 7 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 8 | +import { LaunchInstancesRequest, LaunchInstancesResult } from "../models/models_0"; |
| 9 | +import { LaunchInstances } from "../schemas/schemas_0"; |
| 10 | + |
| 11 | +/** |
| 12 | + * @public |
| 13 | + */ |
| 14 | +export type { __MetadataBearer }; |
| 15 | +export { $Command }; |
| 16 | +/** |
| 17 | + * @public |
| 18 | + * |
| 19 | + * The input for {@link LaunchInstancesCommand}. |
| 20 | + */ |
| 21 | +export interface LaunchInstancesCommandInput extends LaunchInstancesRequest {} |
| 22 | +/** |
| 23 | + * @public |
| 24 | + * |
| 25 | + * The output of {@link LaunchInstancesCommand}. |
| 26 | + */ |
| 27 | +export interface LaunchInstancesCommandOutput extends LaunchInstancesResult, __MetadataBearer {} |
| 28 | + |
| 29 | +/** |
| 30 | + * <p> Launches a specified number of instances in an Auto Scaling group. Returns instance IDs and |
| 31 | + * other details if launch is successful or error details if launch is unsuccessful. </p> |
| 32 | + * @example |
| 33 | + * Use a bare-bones client and the command you need to make an API call. |
| 34 | + * ```javascript |
| 35 | + * import { AutoScalingClient, LaunchInstancesCommand } from "@aws-sdk/client-auto-scaling"; // ES Modules import |
| 36 | + * // const { AutoScalingClient, LaunchInstancesCommand } = require("@aws-sdk/client-auto-scaling"); // CommonJS import |
| 37 | + * // import type { AutoScalingClientConfig } from "@aws-sdk/client-auto-scaling"; |
| 38 | + * const config = {}; // type is AutoScalingClientConfig |
| 39 | + * const client = new AutoScalingClient(config); |
| 40 | + * const input = { // LaunchInstancesRequest |
| 41 | + * AutoScalingGroupName: "STRING_VALUE", // required |
| 42 | + * RequestedCapacity: Number("int"), // required |
| 43 | + * ClientToken: "STRING_VALUE", // required |
| 44 | + * AvailabilityZones: [ // AvailabilityZonesLimit1 |
| 45 | + * "STRING_VALUE", |
| 46 | + * ], |
| 47 | + * AvailabilityZoneIds: [ // AvailabilityZoneIdsLimit1 |
| 48 | + * "STRING_VALUE", |
| 49 | + * ], |
| 50 | + * SubnetIds: [ // SubnetIdsLimit1 |
| 51 | + * "STRING_VALUE", |
| 52 | + * ], |
| 53 | + * RetryStrategy: "retry-with-group-configuration" || "none", |
| 54 | + * }; |
| 55 | + * const command = new LaunchInstancesCommand(input); |
| 56 | + * const response = await client.send(command); |
| 57 | + * // { // LaunchInstancesResult |
| 58 | + * // AutoScalingGroupName: "STRING_VALUE", |
| 59 | + * // ClientToken: "STRING_VALUE", |
| 60 | + * // Instances: [ // InstanceCollections |
| 61 | + * // { // InstanceCollection |
| 62 | + * // InstanceType: "STRING_VALUE", |
| 63 | + * // MarketType: "STRING_VALUE", |
| 64 | + * // SubnetId: "STRING_VALUE", |
| 65 | + * // AvailabilityZone: "STRING_VALUE", |
| 66 | + * // AvailabilityZoneId: "STRING_VALUE", |
| 67 | + * // InstanceIds: [ // InstanceIds |
| 68 | + * // "STRING_VALUE", |
| 69 | + * // ], |
| 70 | + * // }, |
| 71 | + * // ], |
| 72 | + * // Errors: [ // LaunchInstancesErrors |
| 73 | + * // { // LaunchInstancesError |
| 74 | + * // InstanceType: "STRING_VALUE", |
| 75 | + * // MarketType: "STRING_VALUE", |
| 76 | + * // SubnetId: "STRING_VALUE", |
| 77 | + * // AvailabilityZone: "STRING_VALUE", |
| 78 | + * // AvailabilityZoneId: "STRING_VALUE", |
| 79 | + * // ErrorCode: "STRING_VALUE", |
| 80 | + * // ErrorMessage: "STRING_VALUE", |
| 81 | + * // }, |
| 82 | + * // ], |
| 83 | + * // }; |
| 84 | + * |
| 85 | + * ``` |
| 86 | + * |
| 87 | + * @param LaunchInstancesCommandInput - {@link LaunchInstancesCommandInput} |
| 88 | + * @returns {@link LaunchInstancesCommandOutput} |
| 89 | + * @see {@link LaunchInstancesCommandInput} for command's `input` shape. |
| 90 | + * @see {@link LaunchInstancesCommandOutput} for command's `response` shape. |
| 91 | + * @see {@link AutoScalingClientResolvedConfig | config} for AutoScalingClient's `config` shape. |
| 92 | + * |
| 93 | + * @throws {@link IdempotentParameterMismatchError} (client fault) |
| 94 | + * <p> |
| 95 | + * Indicates that the parameters in the current request do not match the parameters from a previous request with the same client token within the idempotency window. |
| 96 | + * </p> |
| 97 | + * |
| 98 | + * @throws {@link ResourceContentionFault} (server fault) |
| 99 | + * <p>You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, |
| 100 | + * instance, or load balancer).</p> |
| 101 | + * |
| 102 | + * @throws {@link AutoScalingServiceException} |
| 103 | + * <p>Base exception class for all service exceptions from AutoScaling service.</p> |
| 104 | + * |
| 105 | + * |
| 106 | + * @public |
| 107 | + */ |
| 108 | +export class LaunchInstancesCommand extends $Command |
| 109 | + .classBuilder< |
| 110 | + LaunchInstancesCommandInput, |
| 111 | + LaunchInstancesCommandOutput, |
| 112 | + AutoScalingClientResolvedConfig, |
| 113 | + ServiceInputTypes, |
| 114 | + ServiceOutputTypes |
| 115 | + >() |
| 116 | + .ep(commonParams) |
| 117 | + .m(function (this: any, Command: any, cs: any, config: AutoScalingClientResolvedConfig, o: any) { |
| 118 | + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; |
| 119 | + }) |
| 120 | + .s("AutoScaling_2011_01_01", "LaunchInstances", {}) |
| 121 | + .n("AutoScalingClient", "LaunchInstancesCommand") |
| 122 | + .sc(LaunchInstances) |
| 123 | + .build() { |
| 124 | + /** @internal type navigation helper, not in runtime. */ |
| 125 | + protected declare static __types: { |
| 126 | + api: { |
| 127 | + input: LaunchInstancesRequest; |
| 128 | + output: LaunchInstancesResult; |
| 129 | + }; |
| 130 | + sdk: { |
| 131 | + input: LaunchInstancesCommandInput; |
| 132 | + output: LaunchInstancesCommandOutput; |
| 133 | + }; |
| 134 | + }; |
| 135 | +} |
0 commit comments