|
| 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 { ModifyInstanceCpuOptionsRequest, ModifyInstanceCpuOptionsResult } from "../models/models_6"; |
| 10 | +import { de_ModifyInstanceCpuOptionsCommand, se_ModifyInstanceCpuOptionsCommand } from "../protocols/Aws_ec2"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +export type { __MetadataBearer }; |
| 16 | +export { $Command }; |
| 17 | +/** |
| 18 | + * @public |
| 19 | + * |
| 20 | + * The input for {@link ModifyInstanceCpuOptionsCommand}. |
| 21 | + */ |
| 22 | +export interface ModifyInstanceCpuOptionsCommandInput extends ModifyInstanceCpuOptionsRequest {} |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The output of {@link ModifyInstanceCpuOptionsCommand}. |
| 27 | + */ |
| 28 | +export interface ModifyInstanceCpuOptionsCommandOutput extends ModifyInstanceCpuOptionsResult, __MetadataBearer {} |
| 29 | + |
| 30 | +/** |
| 31 | + * <p>By default, all vCPUs for the instance type are active when you launch an instance. When you |
| 32 | + * configure the number of active vCPUs for the instance, it can help you save on licensing costs and |
| 33 | + * optimize performance. The base cost of the instance remains unchanged.</p> |
| 34 | + * <p>The number of active vCPUs equals the number of threads per CPU core multiplied by the number |
| 35 | + * of cores.</p> |
| 36 | + * <note> |
| 37 | + * <p>Some instance type options do not support this capability. For more information, see |
| 38 | + * <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cpu-options-supported-instances-values.html">Supported CPU |
| 39 | + * options</a> in the <i>Amazon EC2 User Guide</i>.</p> |
| 40 | + * </note> |
| 41 | + * @example |
| 42 | + * Use a bare-bones client and the command you need to make an API call. |
| 43 | + * ```javascript |
| 44 | + * import { EC2Client, ModifyInstanceCpuOptionsCommand } from "@aws-sdk/client-ec2"; // ES Modules import |
| 45 | + * // const { EC2Client, ModifyInstanceCpuOptionsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import |
| 46 | + * const client = new EC2Client(config); |
| 47 | + * const input = { // ModifyInstanceCpuOptionsRequest |
| 48 | + * InstanceId: "STRING_VALUE", // required |
| 49 | + * CoreCount: Number("int"), // required |
| 50 | + * ThreadsPerCore: Number("int"), // required |
| 51 | + * DryRun: true || false, |
| 52 | + * }; |
| 53 | + * const command = new ModifyInstanceCpuOptionsCommand(input); |
| 54 | + * const response = await client.send(command); |
| 55 | + * // { // ModifyInstanceCpuOptionsResult |
| 56 | + * // InstanceId: "STRING_VALUE", |
| 57 | + * // CoreCount: Number("int"), |
| 58 | + * // ThreadsPerCore: Number("int"), |
| 59 | + * // }; |
| 60 | + * |
| 61 | + * ``` |
| 62 | + * |
| 63 | + * @param ModifyInstanceCpuOptionsCommandInput - {@link ModifyInstanceCpuOptionsCommandInput} |
| 64 | + * @returns {@link ModifyInstanceCpuOptionsCommandOutput} |
| 65 | + * @see {@link ModifyInstanceCpuOptionsCommandInput} for command's `input` shape. |
| 66 | + * @see {@link ModifyInstanceCpuOptionsCommandOutput} for command's `response` shape. |
| 67 | + * @see {@link EC2ClientResolvedConfig | config} for EC2Client's `config` shape. |
| 68 | + * |
| 69 | + * @throws {@link EC2ServiceException} |
| 70 | + * <p>Base exception class for all service exceptions from EC2 service.</p> |
| 71 | + * |
| 72 | + * @public |
| 73 | + */ |
| 74 | +export class ModifyInstanceCpuOptionsCommand extends $Command |
| 75 | + .classBuilder< |
| 76 | + ModifyInstanceCpuOptionsCommandInput, |
| 77 | + ModifyInstanceCpuOptionsCommandOutput, |
| 78 | + EC2ClientResolvedConfig, |
| 79 | + ServiceInputTypes, |
| 80 | + ServiceOutputTypes |
| 81 | + >() |
| 82 | + .ep(commonParams) |
| 83 | + .m(function (this: any, Command: any, cs: any, config: EC2ClientResolvedConfig, o: any) { |
| 84 | + return [ |
| 85 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 86 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 87 | + ]; |
| 88 | + }) |
| 89 | + .s("AmazonEC2", "ModifyInstanceCpuOptions", {}) |
| 90 | + .n("EC2Client", "ModifyInstanceCpuOptionsCommand") |
| 91 | + .f(void 0, void 0) |
| 92 | + .ser(se_ModifyInstanceCpuOptionsCommand) |
| 93 | + .de(de_ModifyInstanceCpuOptionsCommand) |
| 94 | + .build() { |
| 95 | + /** @internal type navigation helper, not in runtime. */ |
| 96 | + protected declare static __types: { |
| 97 | + api: { |
| 98 | + input: ModifyInstanceCpuOptionsRequest; |
| 99 | + output: ModifyInstanceCpuOptionsResult; |
| 100 | + }; |
| 101 | + sdk: { |
| 102 | + input: ModifyInstanceCpuOptionsCommandInput; |
| 103 | + output: ModifyInstanceCpuOptionsCommandOutput; |
| 104 | + }; |
| 105 | + }; |
| 106 | +} |
0 commit comments