|
| 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 | + DescribeCapacityReservationTopologyRequest, |
| 11 | + DescribeCapacityReservationTopologyResult, |
| 12 | +} from "../models/models_4"; |
| 13 | +import { |
| 14 | + de_DescribeCapacityReservationTopologyCommand, |
| 15 | + se_DescribeCapacityReservationTopologyCommand, |
| 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 DescribeCapacityReservationTopologyCommand}. |
| 27 | + */ |
| 28 | +export interface DescribeCapacityReservationTopologyCommandInput extends DescribeCapacityReservationTopologyRequest {} |
| 29 | +/** |
| 30 | + * @public |
| 31 | + * |
| 32 | + * The output of {@link DescribeCapacityReservationTopologyCommand}. |
| 33 | + */ |
| 34 | +export interface DescribeCapacityReservationTopologyCommandOutput |
| 35 | + extends DescribeCapacityReservationTopologyResult, |
| 36 | + __MetadataBearer {} |
| 37 | + |
| 38 | +/** |
| 39 | + * <p>Describes a tree-based hierarchy that represents the physical host placement of your |
| 40 | + * pending or active Capacity Reservations within an Availability Zone or Local Zone. You |
| 41 | + * can use this information to determine the relative proximity of your capacity within the |
| 42 | + * Amazon Web Services network before it is launched and use this information to allocate capacity |
| 43 | + * together to support your tightly coupled workloads.</p> |
| 44 | + * <p>Capacity Reservation topology is supported for specific instance types only. For more |
| 45 | + * information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology-prerequisites.html">Prerequisites |
| 46 | + * for Amazon EC2 instance topology</a> in the |
| 47 | + * <i>Amazon EC2 User Guide</i>.</p> |
| 48 | + * <note> |
| 49 | + * <p>The Amazon EC2 API follows an eventual consistency model due to the |
| 50 | + * distributed nature of the system supporting it. As a result, when you call the |
| 51 | + * DescribeCapacityReservationTopology API command immediately after launching |
| 52 | + * instances, the response might return a <code>null</code> value for |
| 53 | + * <code>capacityBlockId</code> because the data might not have fully propagated |
| 54 | + * across all subsystems. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html">Eventual consistency in the |
| 55 | + * Amazon EC2 API</a> in the <i>Amazon EC2 Developer |
| 56 | + * Guide</i>.</p> |
| 57 | + * </note> |
| 58 | + * <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology.html">Amazon EC2 topology</a> in |
| 59 | + * the <i>Amazon EC2 User Guide</i>.</p> |
| 60 | + * <p></p> |
| 61 | + * @example |
| 62 | + * Use a bare-bones client and the command you need to make an API call. |
| 63 | + * ```javascript |
| 64 | + * import { EC2Client, DescribeCapacityReservationTopologyCommand } from "@aws-sdk/client-ec2"; // ES Modules import |
| 65 | + * // const { EC2Client, DescribeCapacityReservationTopologyCommand } = require("@aws-sdk/client-ec2"); // CommonJS import |
| 66 | + * // import type { EC2ClientConfig } from "@aws-sdk/client-ec2"; |
| 67 | + * const config = {}; // type is EC2ClientConfig |
| 68 | + * const client = new EC2Client(config); |
| 69 | + * const input = { // DescribeCapacityReservationTopologyRequest |
| 70 | + * DryRun: true || false, |
| 71 | + * NextToken: "STRING_VALUE", |
| 72 | + * MaxResults: Number("int"), |
| 73 | + * CapacityReservationIds: [ // CapacityReservationIdSet |
| 74 | + * "STRING_VALUE", |
| 75 | + * ], |
| 76 | + * Filters: [ // FilterList |
| 77 | + * { // Filter |
| 78 | + * Name: "STRING_VALUE", |
| 79 | + * Values: [ // ValueStringList |
| 80 | + * "STRING_VALUE", |
| 81 | + * ], |
| 82 | + * }, |
| 83 | + * ], |
| 84 | + * }; |
| 85 | + * const command = new DescribeCapacityReservationTopologyCommand(input); |
| 86 | + * const response = await client.send(command); |
| 87 | + * // { // DescribeCapacityReservationTopologyResult |
| 88 | + * // NextToken: "STRING_VALUE", |
| 89 | + * // CapacityReservations: [ // CapacityReservationTopologySet |
| 90 | + * // { // CapacityReservationTopology |
| 91 | + * // CapacityReservationId: "STRING_VALUE", |
| 92 | + * // CapacityBlockId: "STRING_VALUE", |
| 93 | + * // State: "STRING_VALUE", |
| 94 | + * // InstanceType: "STRING_VALUE", |
| 95 | + * // GroupName: "STRING_VALUE", |
| 96 | + * // NetworkNodes: [ // NetworkNodeSet |
| 97 | + * // "STRING_VALUE", |
| 98 | + * // ], |
| 99 | + * // AvailabilityZoneId: "STRING_VALUE", |
| 100 | + * // AvailabilityZone: "STRING_VALUE", |
| 101 | + * // }, |
| 102 | + * // ], |
| 103 | + * // }; |
| 104 | + * |
| 105 | + * ``` |
| 106 | + * |
| 107 | + * @param DescribeCapacityReservationTopologyCommandInput - {@link DescribeCapacityReservationTopologyCommandInput} |
| 108 | + * @returns {@link DescribeCapacityReservationTopologyCommandOutput} |
| 109 | + * @see {@link DescribeCapacityReservationTopologyCommandInput} for command's `input` shape. |
| 110 | + * @see {@link DescribeCapacityReservationTopologyCommandOutput} for command's `response` shape. |
| 111 | + * @see {@link EC2ClientResolvedConfig | config} for EC2Client's `config` shape. |
| 112 | + * |
| 113 | + * @throws {@link EC2ServiceException} |
| 114 | + * <p>Base exception class for all service exceptions from EC2 service.</p> |
| 115 | + * |
| 116 | + * |
| 117 | + * @public |
| 118 | + */ |
| 119 | +export class DescribeCapacityReservationTopologyCommand extends $Command |
| 120 | + .classBuilder< |
| 121 | + DescribeCapacityReservationTopologyCommandInput, |
| 122 | + DescribeCapacityReservationTopologyCommandOutput, |
| 123 | + EC2ClientResolvedConfig, |
| 124 | + ServiceInputTypes, |
| 125 | + ServiceOutputTypes |
| 126 | + >() |
| 127 | + .ep(commonParams) |
| 128 | + .m(function (this: any, Command: any, cs: any, config: EC2ClientResolvedConfig, o: any) { |
| 129 | + return [ |
| 130 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 131 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 132 | + ]; |
| 133 | + }) |
| 134 | + .s("AmazonEC2", "DescribeCapacityReservationTopology", {}) |
| 135 | + .n("EC2Client", "DescribeCapacityReservationTopologyCommand") |
| 136 | + .f(void 0, void 0) |
| 137 | + .ser(se_DescribeCapacityReservationTopologyCommand) |
| 138 | + .de(de_DescribeCapacityReservationTopologyCommand) |
| 139 | + .build() { |
| 140 | + /** @internal type navigation helper, not in runtime. */ |
| 141 | + protected declare static __types: { |
| 142 | + api: { |
| 143 | + input: DescribeCapacityReservationTopologyRequest; |
| 144 | + output: DescribeCapacityReservationTopologyResult; |
| 145 | + }; |
| 146 | + sdk: { |
| 147 | + input: DescribeCapacityReservationTopologyCommandInput; |
| 148 | + output: DescribeCapacityReservationTopologyCommandOutput; |
| 149 | + }; |
| 150 | + }; |
| 151 | +} |
0 commit comments