From 1cc5eef1604a154e52af6996afc6972b2678d704 Mon Sep 17 00:00:00 2001 From: awstools Date: Wed, 20 Nov 2024 19:12:54 +0000 Subject: [PATCH] feat(client-elastic-load-balancing-v2): This release adds support for configuring Load balancer Capacity Unit reservations --- .../README.md | 16 + .../src/ElasticLoadBalancingV2.ts | 46 ++ .../src/ElasticLoadBalancingV2Client.ts | 12 + .../DescribeCapacityReservationCommand.ts | 113 +++++ .../ModifyCapacityReservationCommand.ts | 140 ++++++ .../src/commands/SetSubnetsCommand.ts | 3 + .../src/commands/index.ts | 2 + .../src/models/models_0.ts | 273 ++++++++++++ .../src/protocols/Aws_query.ts | 409 ++++++++++++++++++ .../aws-models/elastic-load-balancing-v2.json | 367 ++++++++++++++++ 10 files changed, 1381 insertions(+) create mode 100644 clients/client-elastic-load-balancing-v2/src/commands/DescribeCapacityReservationCommand.ts create mode 100644 clients/client-elastic-load-balancing-v2/src/commands/ModifyCapacityReservationCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/README.md b/clients/client-elastic-load-balancing-v2/README.md index 4d36f45fc4fc..53d7c2ccb4e1 100644 --- a/clients/client-elastic-load-balancing-v2/README.md +++ b/clients/client-elastic-load-balancing-v2/README.md @@ -359,6 +359,14 @@ DescribeAccountLimits [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/elastic-load-balancing-v2/command/DescribeAccountLimitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-elastic-load-balancing-v2/Interface/DescribeAccountLimitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-elastic-load-balancing-v2/Interface/DescribeAccountLimitsCommandOutput/) + +
+ +DescribeCapacityReservation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/elastic-load-balancing-v2/command/DescribeCapacityReservationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-elastic-load-balancing-v2/Interface/DescribeCapacityReservationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-elastic-load-balancing-v2/Interface/DescribeCapacityReservationCommandOutput/) +
@@ -495,6 +503,14 @@ GetTrustStoreRevocationContent [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/elastic-load-balancing-v2/command/GetTrustStoreRevocationContentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-elastic-load-balancing-v2/Interface/GetTrustStoreRevocationContentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-elastic-load-balancing-v2/Interface/GetTrustStoreRevocationContentCommandOutput/) +
+
+ +ModifyCapacityReservation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/elastic-load-balancing-v2/command/ModifyCapacityReservationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-elastic-load-balancing-v2/Interface/ModifyCapacityReservationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-elastic-load-balancing-v2/Interface/ModifyCapacityReservationCommandOutput/) +
diff --git a/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2.ts b/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2.ts index 1348304880c8..63cdf8f9ce8c 100644 --- a/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2.ts +++ b/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2.ts @@ -70,6 +70,11 @@ import { DescribeAccountLimitsCommandInput, DescribeAccountLimitsCommandOutput, } from "./commands/DescribeAccountLimitsCommand"; +import { + DescribeCapacityReservationCommand, + DescribeCapacityReservationCommandInput, + DescribeCapacityReservationCommandOutput, +} from "./commands/DescribeCapacityReservationCommand"; import { DescribeListenerAttributesCommand, DescribeListenerAttributesCommandInput, @@ -155,6 +160,11 @@ import { GetTrustStoreRevocationContentCommandInput, GetTrustStoreRevocationContentCommandOutput, } from "./commands/GetTrustStoreRevocationContentCommand"; +import { + ModifyCapacityReservationCommand, + ModifyCapacityReservationCommandInput, + ModifyCapacityReservationCommandOutput, +} from "./commands/ModifyCapacityReservationCommand"; import { ModifyListenerAttributesCommand, ModifyListenerAttributesCommandInput, @@ -237,6 +247,7 @@ const commands = { DeleteTrustStoreCommand, DeregisterTargetsCommand, DescribeAccountLimitsCommand, + DescribeCapacityReservationCommand, DescribeListenerAttributesCommand, DescribeListenerCertificatesCommand, DescribeListenersCommand, @@ -254,6 +265,7 @@ const commands = { GetResourcePolicyCommand, GetTrustStoreCaCertificatesBundleCommand, GetTrustStoreRevocationContentCommand, + ModifyCapacityReservationCommand, ModifyListenerCommand, ModifyListenerAttributesCommand, ModifyLoadBalancerAttributesCommand, @@ -521,6 +533,23 @@ export interface ElasticLoadBalancingV2 { cb: (err: any, data?: DescribeAccountLimitsCommandOutput) => void ): void; + /** + * @see {@link DescribeCapacityReservationCommand} + */ + describeCapacityReservation( + args: DescribeCapacityReservationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + describeCapacityReservation( + args: DescribeCapacityReservationCommandInput, + cb: (err: any, data?: DescribeCapacityReservationCommandOutput) => void + ): void; + describeCapacityReservation( + args: DescribeCapacityReservationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeCapacityReservationCommandOutput) => void + ): void; + /** * @see {@link DescribeListenerAttributesCommand} */ @@ -804,6 +833,23 @@ export interface ElasticLoadBalancingV2 { cb: (err: any, data?: GetTrustStoreRevocationContentCommandOutput) => void ): void; + /** + * @see {@link ModifyCapacityReservationCommand} + */ + modifyCapacityReservation( + args: ModifyCapacityReservationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + modifyCapacityReservation( + args: ModifyCapacityReservationCommandInput, + cb: (err: any, data?: ModifyCapacityReservationCommandOutput) => void + ): void; + modifyCapacityReservation( + args: ModifyCapacityReservationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ModifyCapacityReservationCommandOutput) => void + ): void; + /** * @see {@link ModifyListenerCommand} */ diff --git a/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts b/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts index 10799cfbea1b..8779e8799a9f 100644 --- a/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts +++ b/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts @@ -81,6 +81,10 @@ import { DescribeAccountLimitsCommandInput, DescribeAccountLimitsCommandOutput, } from "./commands/DescribeAccountLimitsCommand"; +import { + DescribeCapacityReservationCommandInput, + DescribeCapacityReservationCommandOutput, +} from "./commands/DescribeCapacityReservationCommand"; import { DescribeListenerAttributesCommandInput, DescribeListenerAttributesCommandOutput, @@ -137,6 +141,10 @@ import { GetTrustStoreRevocationContentCommandInput, GetTrustStoreRevocationContentCommandOutput, } from "./commands/GetTrustStoreRevocationContentCommand"; +import { + ModifyCapacityReservationCommandInput, + ModifyCapacityReservationCommandOutput, +} from "./commands/ModifyCapacityReservationCommand"; import { ModifyListenerAttributesCommandInput, ModifyListenerAttributesCommandOutput, @@ -198,6 +206,7 @@ export type ServiceInputTypes = | DeleteTrustStoreCommandInput | DeregisterTargetsCommandInput | DescribeAccountLimitsCommandInput + | DescribeCapacityReservationCommandInput | DescribeListenerAttributesCommandInput | DescribeListenerCertificatesCommandInput | DescribeListenersCommandInput @@ -215,6 +224,7 @@ export type ServiceInputTypes = | GetResourcePolicyCommandInput | GetTrustStoreCaCertificatesBundleCommandInput | GetTrustStoreRevocationContentCommandInput + | ModifyCapacityReservationCommandInput | ModifyListenerAttributesCommandInput | ModifyListenerCommandInput | ModifyLoadBalancerAttributesCommandInput @@ -251,6 +261,7 @@ export type ServiceOutputTypes = | DeleteTrustStoreCommandOutput | DeregisterTargetsCommandOutput | DescribeAccountLimitsCommandOutput + | DescribeCapacityReservationCommandOutput | DescribeListenerAttributesCommandOutput | DescribeListenerCertificatesCommandOutput | DescribeListenersCommandOutput @@ -268,6 +279,7 @@ export type ServiceOutputTypes = | GetResourcePolicyCommandOutput | GetTrustStoreCaCertificatesBundleCommandOutput | GetTrustStoreRevocationContentCommandOutput + | ModifyCapacityReservationCommandOutput | ModifyListenerAttributesCommandOutput | ModifyListenerCommandOutput | ModifyLoadBalancerAttributesCommandOutput diff --git a/clients/client-elastic-load-balancing-v2/src/commands/DescribeCapacityReservationCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeCapacityReservationCommand.ts new file mode 100644 index 000000000000..15425b5966e5 --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/src/commands/DescribeCapacityReservationCommand.ts @@ -0,0 +1,113 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { + ElasticLoadBalancingV2ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../ElasticLoadBalancingV2Client"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DescribeCapacityReservationInput, DescribeCapacityReservationOutput } from "../models/models_0"; +import { de_DescribeCapacityReservationCommand, se_DescribeCapacityReservationCommand } from "../protocols/Aws_query"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DescribeCapacityReservationCommand}. + */ +export interface DescribeCapacityReservationCommandInput extends DescribeCapacityReservationInput {} +/** + * @public + * + * The output of {@link DescribeCapacityReservationCommand}. + */ +export interface DescribeCapacityReservationCommandOutput extends DescribeCapacityReservationOutput, __MetadataBearer {} + +/** + *

Describes the capacity reservation status for the specified load balancer.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ElasticLoadBalancingV2Client, DescribeCapacityReservationCommand } from "@aws-sdk/client-elastic-load-balancing-v2"; // ES Modules import + * // const { ElasticLoadBalancingV2Client, DescribeCapacityReservationCommand } = require("@aws-sdk/client-elastic-load-balancing-v2"); // CommonJS import + * const client = new ElasticLoadBalancingV2Client(config); + * const input = { // DescribeCapacityReservationInput + * LoadBalancerArn: "STRING_VALUE", // required + * }; + * const command = new DescribeCapacityReservationCommand(input); + * const response = await client.send(command); + * // { // DescribeCapacityReservationOutput + * // LastModifiedTime: new Date("TIMESTAMP"), + * // DecreaseRequestsRemaining: Number("int"), + * // MinimumLoadBalancerCapacity: { // MinimumLoadBalancerCapacity + * // CapacityUnits: Number("int"), + * // }, + * // CapacityReservationState: [ // ZonalCapacityReservationStates + * // { // ZonalCapacityReservationState + * // State: { // CapacityReservationStatus + * // Code: "provisioned" || "pending" || "rebalancing" || "failed", + * // Reason: "STRING_VALUE", + * // }, + * // AvailabilityZone: "STRING_VALUE", + * // EffectiveCapacityUnits: Number("double"), + * // }, + * // ], + * // }; + * + * ``` + * + * @param DescribeCapacityReservationCommandInput - {@link DescribeCapacityReservationCommandInput} + * @returns {@link DescribeCapacityReservationCommandOutput} + * @see {@link DescribeCapacityReservationCommandInput} for command's `input` shape. + * @see {@link DescribeCapacityReservationCommandOutput} for command's `response` shape. + * @see {@link ElasticLoadBalancingV2ClientResolvedConfig | config} for ElasticLoadBalancingV2Client's `config` shape. + * + * @throws {@link LoadBalancerNotFoundException} (client fault) + *

The specified load balancer does not exist.

+ * + * @throws {@link ElasticLoadBalancingV2ServiceException} + *

Base exception class for all service exceptions from ElasticLoadBalancingV2 service.

+ * + * @public + */ +export class DescribeCapacityReservationCommand extends $Command + .classBuilder< + DescribeCapacityReservationCommandInput, + DescribeCapacityReservationCommandOutput, + ElasticLoadBalancingV2ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ElasticLoadBalancingV2ClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("ElasticLoadBalancing_v10", "DescribeCapacityReservation", {}) + .n("ElasticLoadBalancingV2Client", "DescribeCapacityReservationCommand") + .f(void 0, void 0) + .ser(se_DescribeCapacityReservationCommand) + .de(de_DescribeCapacityReservationCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DescribeCapacityReservationInput; + output: DescribeCapacityReservationOutput; + }; + sdk: { + input: DescribeCapacityReservationCommandInput; + output: DescribeCapacityReservationCommandOutput; + }; + }; +} diff --git a/clients/client-elastic-load-balancing-v2/src/commands/ModifyCapacityReservationCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/ModifyCapacityReservationCommand.ts new file mode 100644 index 000000000000..cecbdae36011 --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/src/commands/ModifyCapacityReservationCommand.ts @@ -0,0 +1,140 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { + ElasticLoadBalancingV2ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../ElasticLoadBalancingV2Client"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { ModifyCapacityReservationInput, ModifyCapacityReservationOutput } from "../models/models_0"; +import { de_ModifyCapacityReservationCommand, se_ModifyCapacityReservationCommand } from "../protocols/Aws_query"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ModifyCapacityReservationCommand}. + */ +export interface ModifyCapacityReservationCommandInput extends ModifyCapacityReservationInput {} +/** + * @public + * + * The output of {@link ModifyCapacityReservationCommand}. + */ +export interface ModifyCapacityReservationCommandOutput extends ModifyCapacityReservationOutput, __MetadataBearer {} + +/** + *

Modifies the capacity reservation of the specified load balancer.

+ *

When modifying capacity reservation, you must include at least one MinimumLoadBalancerCapacity + * or ResetCapacityReservation.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ElasticLoadBalancingV2Client, ModifyCapacityReservationCommand } from "@aws-sdk/client-elastic-load-balancing-v2"; // ES Modules import + * // const { ElasticLoadBalancingV2Client, ModifyCapacityReservationCommand } = require("@aws-sdk/client-elastic-load-balancing-v2"); // CommonJS import + * const client = new ElasticLoadBalancingV2Client(config); + * const input = { // ModifyCapacityReservationInput + * LoadBalancerArn: "STRING_VALUE", // required + * MinimumLoadBalancerCapacity: { // MinimumLoadBalancerCapacity + * CapacityUnits: Number("int"), + * }, + * ResetCapacityReservation: true || false, + * }; + * const command = new ModifyCapacityReservationCommand(input); + * const response = await client.send(command); + * // { // ModifyCapacityReservationOutput + * // LastModifiedTime: new Date("TIMESTAMP"), + * // DecreaseRequestsRemaining: Number("int"), + * // MinimumLoadBalancerCapacity: { // MinimumLoadBalancerCapacity + * // CapacityUnits: Number("int"), + * // }, + * // CapacityReservationState: [ // ZonalCapacityReservationStates + * // { // ZonalCapacityReservationState + * // State: { // CapacityReservationStatus + * // Code: "provisioned" || "pending" || "rebalancing" || "failed", + * // Reason: "STRING_VALUE", + * // }, + * // AvailabilityZone: "STRING_VALUE", + * // EffectiveCapacityUnits: Number("double"), + * // }, + * // ], + * // }; + * + * ``` + * + * @param ModifyCapacityReservationCommandInput - {@link ModifyCapacityReservationCommandInput} + * @returns {@link ModifyCapacityReservationCommandOutput} + * @see {@link ModifyCapacityReservationCommandInput} for command's `input` shape. + * @see {@link ModifyCapacityReservationCommandOutput} for command's `response` shape. + * @see {@link ElasticLoadBalancingV2ClientResolvedConfig | config} for ElasticLoadBalancingV2Client's `config` shape. + * + * @throws {@link CapacityDecreaseRequestsLimitExceededException} (client fault) + *

You've exceeded the daily capacity decrease limit for this reservation.

+ * + * @throws {@link CapacityReservationPendingException} (client fault) + *

There is a pending capacity reservation.

+ * + * @throws {@link CapacityUnitsLimitExceededException} (client fault) + *

You've exceeded the capacity units limit.

+ * + * @throws {@link InsufficientCapacityException} (server fault) + *

There is insufficient capacity to reserve.

+ * + * @throws {@link InvalidConfigurationRequestException} (client fault) + *

The requested configuration is not valid.

+ * + * @throws {@link LoadBalancerNotFoundException} (client fault) + *

The specified load balancer does not exist.

+ * + * @throws {@link OperationNotPermittedException} (client fault) + *

This operation is not allowed.

+ * + * @throws {@link PriorRequestNotCompleteException} (client fault) + *

This operation is not allowed while a prior request has not been completed.

+ * + * @throws {@link ElasticLoadBalancingV2ServiceException} + *

Base exception class for all service exceptions from ElasticLoadBalancingV2 service.

+ * + * @public + */ +export class ModifyCapacityReservationCommand extends $Command + .classBuilder< + ModifyCapacityReservationCommandInput, + ModifyCapacityReservationCommandOutput, + ElasticLoadBalancingV2ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ElasticLoadBalancingV2ClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("ElasticLoadBalancing_v10", "ModifyCapacityReservation", {}) + .n("ElasticLoadBalancingV2Client", "ModifyCapacityReservationCommand") + .f(void 0, void 0) + .ser(se_ModifyCapacityReservationCommand) + .de(de_ModifyCapacityReservationCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ModifyCapacityReservationInput; + output: ModifyCapacityReservationOutput; + }; + sdk: { + input: ModifyCapacityReservationCommandInput; + output: ModifyCapacityReservationCommandOutput; + }; + }; +} diff --git a/clients/client-elastic-load-balancing-v2/src/commands/SetSubnetsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/SetSubnetsCommand.ts index 12a0a183fbb5..306ee16ad508 100644 --- a/clients/client-elastic-load-balancing-v2/src/commands/SetSubnetsCommand.ts +++ b/clients/client-elastic-load-balancing-v2/src/commands/SetSubnetsCommand.ts @@ -100,6 +100,9 @@ export interface SetSubnetsCommandOutput extends SetSubnetsOutput, __MetadataBea * @throws {@link AvailabilityZoneNotSupportedException} (client fault) *

The specified Availability Zone is not supported.

* + * @throws {@link CapacityReservationPendingException} (client fault) + *

There is a pending capacity reservation.

+ * * @throws {@link InvalidConfigurationRequestException} (client fault) *

The requested configuration is not valid.

* diff --git a/clients/client-elastic-load-balancing-v2/src/commands/index.ts b/clients/client-elastic-load-balancing-v2/src/commands/index.ts index 394a3515c90d..3975ae263743 100644 --- a/clients/client-elastic-load-balancing-v2/src/commands/index.ts +++ b/clients/client-elastic-load-balancing-v2/src/commands/index.ts @@ -15,6 +15,7 @@ export * from "./DeleteTargetGroupCommand"; export * from "./DeleteTrustStoreCommand"; export * from "./DeregisterTargetsCommand"; export * from "./DescribeAccountLimitsCommand"; +export * from "./DescribeCapacityReservationCommand"; export * from "./DescribeListenerAttributesCommand"; export * from "./DescribeListenerCertificatesCommand"; export * from "./DescribeListenersCommand"; @@ -32,6 +33,7 @@ export * from "./DescribeTrustStoresCommand"; export * from "./GetResourcePolicyCommand"; export * from "./GetTrustStoreCaCertificatesBundleCommand"; export * from "./GetTrustStoreRevocationContentCommand"; +export * from "./ModifyCapacityReservationCommand"; export * from "./ModifyListenerAttributesCommand"; export * from "./ModifyListenerCommand"; export * from "./ModifyLoadBalancerAttributesCommand"; diff --git a/clients/client-elastic-load-balancing-v2/src/models/models_0.ts b/clients/client-elastic-load-balancing-v2/src/models/models_0.ts index ad86ae172106..e4a20f8c13fd 100644 --- a/clients/client-elastic-load-balancing-v2/src/models/models_0.ts +++ b/clients/client-elastic-load-balancing-v2/src/models/models_0.ts @@ -1187,6 +1187,107 @@ export class CaCertificatesBundleNotFoundException extends __BaseException { } } +/** + *

You've exceeded the daily capacity decrease limit for this reservation.

+ * @public + */ +export class CapacityDecreaseRequestsLimitExceededException extends __BaseException { + readonly name: "CapacityDecreaseRequestsLimitExceededException" = "CapacityDecreaseRequestsLimitExceededException"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "CapacityDecreaseRequestsLimitExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, CapacityDecreaseRequestsLimitExceededException.prototype); + this.Message = opts.Message; + } +} + +/** + *

There is a pending capacity reservation.

+ * @public + */ +export class CapacityReservationPendingException extends __BaseException { + readonly name: "CapacityReservationPendingException" = "CapacityReservationPendingException"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "CapacityReservationPendingException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, CapacityReservationPendingException.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + * @enum + */ +export const CapacityReservationStateEnum = { + FAILED: "failed", + PENDING: "pending", + PROVISIONED: "provisioned", + REBALANCING: "rebalancing", +} as const; + +/** + * @public + */ +export type CapacityReservationStateEnum = + (typeof CapacityReservationStateEnum)[keyof typeof CapacityReservationStateEnum]; + +/** + *

The status of a capacity reservation.

+ * @public + */ +export interface CapacityReservationStatus { + /** + *

The status code.

+ * @public + */ + Code?: CapacityReservationStateEnum | undefined; + + /** + *

The reason code for the status.

+ * @public + */ + Reason?: string | undefined; +} + +/** + *

You've exceeded the capacity units limit.

+ * @public + */ +export class CapacityUnitsLimitExceededException extends __BaseException { + readonly name: "CapacityUnitsLimitExceededException" = "CapacityUnitsLimitExceededException"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "CapacityUnitsLimitExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, CapacityUnitsLimitExceededException.prototype); + this.Message = opts.Message; + } +} + /** *

Information about a cipher used in a policy.

* @public @@ -3658,6 +3759,82 @@ export interface DescribeAccountLimitsOutput { NextMarker?: string | undefined; } +/** + * @public + */ +export interface DescribeCapacityReservationInput { + /** + *

The Amazon Resource Name (ARN) of the load balancer.

+ * @public + */ + LoadBalancerArn: string | undefined; +} + +/** + *

The capacity reservation status for each availability zone.

+ * @public + */ +export interface ZonalCapacityReservationState { + /** + *

The state of the capacity reservation.

+ * @public + */ + State?: CapacityReservationStatus | undefined; + + /** + *

Information about the availability zone.

+ * @public + */ + AvailabilityZone?: string | undefined; + + /** + *

The number of effective capacity units.

+ * @public + */ + EffectiveCapacityUnits?: number | undefined; +} + +/** + *

The minimum capacity for a load balancer.

+ * @public + */ +export interface MinimumLoadBalancerCapacity { + /** + *

The number of capacity units.

+ * @public + */ + CapacityUnits?: number | undefined; +} + +/** + * @public + */ +export interface DescribeCapacityReservationOutput { + /** + *

The last time the capacity reservation was modified.

+ * @public + */ + LastModifiedTime?: Date | undefined; + + /** + *

The amount of daily capacity decreases remaining.

+ * @public + */ + DecreaseRequestsRemaining?: number | undefined; + + /** + *

The requested minimum capacity reservation for the load balancer

+ * @public + */ + MinimumLoadBalancerCapacity?: MinimumLoadBalancerCapacity | undefined; + + /** + *

The state of the capacity reservation.

+ * @public + */ + CapacityReservationState?: ZonalCapacityReservationState[] | undefined; +} + /** * @public */ @@ -5072,6 +5249,102 @@ export interface GetTrustStoreRevocationContentOutput { Location?: string | undefined; } +/** + *

There is insufficient capacity to reserve.

+ * @public + */ +export class InsufficientCapacityException extends __BaseException { + readonly name: "InsufficientCapacityException" = "InsufficientCapacityException"; + readonly $fault: "server" = "server"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InsufficientCapacityException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InsufficientCapacityException.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface ModifyCapacityReservationInput { + /** + *

The Amazon Resource Name (ARN) of the load balancer.

+ * @public + */ + LoadBalancerArn: string | undefined; + + /** + *

The minimum load balancer capacity reserved.

+ * @public + */ + MinimumLoadBalancerCapacity?: MinimumLoadBalancerCapacity | undefined; + + /** + *

Resets the capacity reservation.

+ * @public + */ + ResetCapacityReservation?: boolean | undefined; +} + +/** + * @public + */ +export interface ModifyCapacityReservationOutput { + /** + *

The last time the capacity reservation was modified.

+ * @public + */ + LastModifiedTime?: Date | undefined; + + /** + *

The amount of daily capacity decreases remaining.

+ * @public + */ + DecreaseRequestsRemaining?: number | undefined; + + /** + *

The requested minimum capacity reservation for the load balancer

+ * @public + */ + MinimumLoadBalancerCapacity?: MinimumLoadBalancerCapacity | undefined; + + /** + *

The state of the capacity reservation.

+ * @public + */ + CapacityReservationState?: ZonalCapacityReservationState[] | undefined; +} + +/** + *

This operation is not allowed while a prior request has not been completed.

+ * @public + */ +export class PriorRequestNotCompleteException extends __BaseException { + readonly name: "PriorRequestNotCompleteException" = "PriorRequestNotCompleteException"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "PriorRequestNotCompleteException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, PriorRequestNotCompleteException.prototype); + this.Message = opts.Message; + } +} + /** * @public */ diff --git a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts index a4557d8d435e..e1b47310bb4b 100644 --- a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts @@ -10,6 +10,7 @@ import { getArrayIfSingleItem as __getArrayIfSingleItem, parseBoolean as __parseBoolean, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + strictParseFloat as __strictParseFloat, strictParseInt32 as __strictParseInt32, strictParseLong as __strictParseLong, withBaseException, @@ -49,6 +50,10 @@ import { DescribeAccountLimitsCommandInput, DescribeAccountLimitsCommandOutput, } from "../commands/DescribeAccountLimitsCommand"; +import { + DescribeCapacityReservationCommandInput, + DescribeCapacityReservationCommandOutput, +} from "../commands/DescribeCapacityReservationCommand"; import { DescribeListenerAttributesCommandInput, DescribeListenerAttributesCommandOutput, @@ -105,6 +110,10 @@ import { GetTrustStoreRevocationContentCommandInput, GetTrustStoreRevocationContentCommandOutput, } from "../commands/GetTrustStoreRevocationContentCommand"; +import { + ModifyCapacityReservationCommandInput, + ModifyCapacityReservationCommandOutput, +} from "../commands/ModifyCapacityReservationCommand"; import { ModifyListenerAttributesCommandInput, ModifyListenerAttributesCommandOutput, @@ -153,6 +162,10 @@ import { AvailabilityZone, AvailabilityZoneNotSupportedException, CaCertificatesBundleNotFoundException, + CapacityDecreaseRequestsLimitExceededException, + CapacityReservationPendingException, + CapacityReservationStatus, + CapacityUnitsLimitExceededException, Certificate, CertificateNotFoundException, Cipher, @@ -183,6 +196,8 @@ import { DeregisterTargetsOutput, DescribeAccountLimitsInput, DescribeAccountLimitsOutput, + DescribeCapacityReservationInput, + DescribeCapacityReservationOutput, DescribeListenerAttributesInput, DescribeListenerAttributesOutput, DescribeListenerCertificatesInput, @@ -231,6 +246,7 @@ import { HttpHeaderConditionConfig, HttpRequestMethodConditionConfig, IncompatibleProtocolsException, + InsufficientCapacityException, InvalidCaCertificatesBundleException, InvalidConfigurationRequestException, InvalidLoadBalancerActionException, @@ -249,6 +265,9 @@ import { LoadBalancerNotFoundException, LoadBalancerState, Matcher, + MinimumLoadBalancerCapacity, + ModifyCapacityReservationInput, + ModifyCapacityReservationOutput, ModifyListenerAttributesInput, ModifyListenerAttributesOutput, ModifyListenerInput, @@ -267,6 +286,7 @@ import { OperationNotPermittedException, PathPatternConditionConfig, PriorityInUseException, + PriorRequestNotCompleteException, QueryStringConditionConfig, QueryStringKeyValuePair, RedirectActionConfig, @@ -331,6 +351,7 @@ import { TrustStoreNotReadyException, TrustStoreRevocation, UnsupportedProtocolException, + ZonalCapacityReservationState, } from "../models/models_0"; /** @@ -605,6 +626,23 @@ export const se_DescribeAccountLimitsCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_queryDescribeCapacityReservationCommand + */ +export const se_DescribeCapacityReservationCommand = async ( + input: DescribeCapacityReservationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_DescribeCapacityReservationInput(input, context), + [_A]: _DCR, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_queryDescribeListenerAttributesCommand */ @@ -894,6 +932,23 @@ export const se_GetTrustStoreRevocationContentCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_queryModifyCapacityReservationCommand + */ +export const se_ModifyCapacityReservationCommand = async ( + input: ModifyCapacityReservationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_ModifyCapacityReservationInput(input, context), + [_A]: _MCR, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_queryModifyListenerCommand */ @@ -1469,6 +1524,26 @@ export const de_DescribeAccountLimitsCommand = async ( return response; }; +/** + * deserializeAws_queryDescribeCapacityReservationCommand + */ +export const de_DescribeCapacityReservationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeCapacityReservationOutput(data.DescribeCapacityReservationResult, context); + const response: DescribeCapacityReservationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_queryDescribeListenerAttributesCommand */ @@ -1809,6 +1884,26 @@ export const de_GetTrustStoreRevocationContentCommand = async ( return response; }; +/** + * deserializeAws_queryModifyCapacityReservationCommand + */ +export const de_ModifyCapacityReservationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyCapacityReservationOutput(data.ModifyCapacityReservationResult, context); + const response: ModifyCapacityReservationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_queryModifyListenerCommand */ @@ -2272,6 +2367,21 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "ResourceNotFound": case "com.amazonaws.elasticloadbalancingv2#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "CapacityDecreaseRequestLimitExceeded": + case "com.amazonaws.elasticloadbalancingv2#CapacityDecreaseRequestsLimitExceededException": + throw await de_CapacityDecreaseRequestsLimitExceededExceptionRes(parsedOutput, context); + case "CapacityReservationPending": + case "com.amazonaws.elasticloadbalancingv2#CapacityReservationPendingException": + throw await de_CapacityReservationPendingExceptionRes(parsedOutput, context); + case "CapacityUnitsLimitExceeded": + case "com.amazonaws.elasticloadbalancingv2#CapacityUnitsLimitExceededException": + throw await de_CapacityUnitsLimitExceededExceptionRes(parsedOutput, context); + case "InsufficientCapacity": + case "com.amazonaws.elasticloadbalancingv2#InsufficientCapacityException": + throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); + case "PriorRequestNotComplete": + case "com.amazonaws.elasticloadbalancingv2#PriorRequestNotCompleteException": + throw await de_PriorRequestNotCompleteExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ @@ -2346,6 +2456,54 @@ const de_CaCertificatesBundleNotFoundExceptionRes = async ( return __decorateServiceException(exception, body); }; +/** + * deserializeAws_queryCapacityDecreaseRequestsLimitExceededExceptionRes + */ +const de_CapacityDecreaseRequestsLimitExceededExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_CapacityDecreaseRequestsLimitExceededException(body.Error, context); + const exception = new CapacityDecreaseRequestsLimitExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_queryCapacityReservationPendingExceptionRes + */ +const de_CapacityReservationPendingExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_CapacityReservationPendingException(body.Error, context); + const exception = new CapacityReservationPendingException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_queryCapacityUnitsLimitExceededExceptionRes + */ +const de_CapacityUnitsLimitExceededExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_CapacityUnitsLimitExceededException(body.Error, context); + const exception = new CapacityUnitsLimitExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + /** * deserializeAws_queryCertificateNotFoundExceptionRes */ @@ -2490,6 +2648,22 @@ const de_IncompatibleProtocolsExceptionRes = async ( return __decorateServiceException(exception, body); }; +/** + * deserializeAws_queryInsufficientCapacityExceptionRes + */ +const de_InsufficientCapacityExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_InsufficientCapacityException(body.Error, context); + const exception = new InsufficientCapacityException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + /** * deserializeAws_queryInvalidCaCertificatesBundleExceptionRes */ @@ -2682,6 +2856,22 @@ const de_PriorityInUseExceptionRes = async ( return __decorateServiceException(exception, body); }; +/** + * deserializeAws_queryPriorRequestNotCompleteExceptionRes + */ +const de_PriorRequestNotCompleteExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_PriorRequestNotCompleteException(body.Error, context); + const exception = new PriorRequestNotCompleteException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + /** * deserializeAws_queryResourceInUseExceptionRes */ @@ -3794,6 +3984,17 @@ const se_DescribeAccountLimitsInput = (input: DescribeAccountLimitsInput, contex return entries; }; +/** + * serializeAws_queryDescribeCapacityReservationInput + */ +const se_DescribeCapacityReservationInput = (input: DescribeCapacityReservationInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_LBA] != null) { + entries[_LBA] = input[_LBA]; + } + return entries; +}; + /** * serializeAws_queryDescribeListenerAttributesInput */ @@ -4442,6 +4643,38 @@ const se_Matcher = (input: Matcher, context: __SerdeContext): any => { return entries; }; +/** + * serializeAws_queryMinimumLoadBalancerCapacity + */ +const se_MinimumLoadBalancerCapacity = (input: MinimumLoadBalancerCapacity, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_CU] != null) { + entries[_CU] = input[_CU]; + } + return entries; +}; + +/** + * serializeAws_queryModifyCapacityReservationInput + */ +const se_ModifyCapacityReservationInput = (input: ModifyCapacityReservationInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_LBA] != null) { + entries[_LBA] = input[_LBA]; + } + if (input[_MLBC] != null) { + const memberEntries = se_MinimumLoadBalancerCapacity(input[_MLBC], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `MinimumLoadBalancerCapacity.${key}`; + entries[loc] = value; + }); + } + if (input[_RCR] != null) { + entries[_RCR] = input[_RCR]; + } + return entries; +}; + /** * serializeAws_queryModifyListenerAttributesInput */ @@ -5821,6 +6054,62 @@ const de_CaCertificatesBundleNotFoundException = ( return contents; }; +/** + * deserializeAws_queryCapacityDecreaseRequestsLimitExceededException + */ +const de_CapacityDecreaseRequestsLimitExceededException = ( + output: any, + context: __SerdeContext +): CapacityDecreaseRequestsLimitExceededException => { + const contents: any = {}; + if (output[_Me] != null) { + contents[_Me] = __expectString(output[_Me]); + } + return contents; +}; + +/** + * deserializeAws_queryCapacityReservationPendingException + */ +const de_CapacityReservationPendingException = ( + output: any, + context: __SerdeContext +): CapacityReservationPendingException => { + const contents: any = {}; + if (output[_Me] != null) { + contents[_Me] = __expectString(output[_Me]); + } + return contents; +}; + +/** + * deserializeAws_queryCapacityReservationStatus + */ +const de_CapacityReservationStatus = (output: any, context: __SerdeContext): CapacityReservationStatus => { + const contents: any = {}; + if (output[_Cod] != null) { + contents[_Cod] = __expectString(output[_Cod]); + } + if (output[_R] != null) { + contents[_R] = __expectString(output[_R]); + } + return contents; +}; + +/** + * deserializeAws_queryCapacityUnitsLimitExceededException + */ +const de_CapacityUnitsLimitExceededException = ( + output: any, + context: __SerdeContext +): CapacityUnitsLimitExceededException => { + const contents: any = {}; + if (output[_Me] != null) { + contents[_Me] = __expectString(output[_Me]); + } + return contents; +}; + /** * deserializeAws_queryCertificate */ @@ -6036,6 +6325,31 @@ const de_DescribeAccountLimitsOutput = (output: any, context: __SerdeContext): D return contents; }; +/** + * deserializeAws_queryDescribeCapacityReservationOutput + */ +const de_DescribeCapacityReservationOutput = ( + output: any, + context: __SerdeContext +): DescribeCapacityReservationOutput => { + const contents: any = {}; + if (output[_LMT] != null) { + contents[_LMT] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LMT])); + } + if (output[_DRR] != null) { + contents[_DRR] = __strictParseInt32(output[_DRR]) as number; + } + if (output[_MLBC] != null) { + contents[_MLBC] = de_MinimumLoadBalancerCapacity(output[_MLBC], context); + } + if (output.CapacityReservationState === "") { + contents[_CRS] = []; + } else if (output[_CRS] != null && output[_CRS][_m] != null) { + contents[_CRS] = de_ZonalCapacityReservationStates(__getArrayIfSingleItem(output[_CRS][_m]), context); + } + return contents; +}; + /** * deserializeAws_queryDescribeListenerAttributesOutput */ @@ -6500,6 +6814,17 @@ const de_IncompatibleProtocolsException = (output: any, context: __SerdeContext) return contents; }; +/** + * deserializeAws_queryInsufficientCapacityException + */ +const de_InsufficientCapacityException = (output: any, context: __SerdeContext): InsufficientCapacityException => { + const contents: any = {}; + if (output[_Me] != null) { + contents[_Me] = __expectString(output[_Me]); + } + return contents; +}; + /** * deserializeAws_queryInvalidCaCertificatesBundleException */ @@ -6898,6 +7223,39 @@ const de_Matcher = (output: any, context: __SerdeContext): Matcher => { return contents; }; +/** + * deserializeAws_queryMinimumLoadBalancerCapacity + */ +const de_MinimumLoadBalancerCapacity = (output: any, context: __SerdeContext): MinimumLoadBalancerCapacity => { + const contents: any = {}; + if (output[_CU] != null) { + contents[_CU] = __strictParseInt32(output[_CU]) as number; + } + return contents; +}; + +/** + * deserializeAws_queryModifyCapacityReservationOutput + */ +const de_ModifyCapacityReservationOutput = (output: any, context: __SerdeContext): ModifyCapacityReservationOutput => { + const contents: any = {}; + if (output[_LMT] != null) { + contents[_LMT] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LMT])); + } + if (output[_DRR] != null) { + contents[_DRR] = __strictParseInt32(output[_DRR]) as number; + } + if (output[_MLBC] != null) { + contents[_MLBC] = de_MinimumLoadBalancerCapacity(output[_MLBC], context); + } + if (output.CapacityReservationState === "") { + contents[_CRS] = []; + } else if (output[_CRS] != null && output[_CRS][_m] != null) { + contents[_CRS] = de_ZonalCapacityReservationStates(__getArrayIfSingleItem(output[_CRS][_m]), context); + } + return contents; +}; + /** * deserializeAws_queryModifyListenerAttributesOutput */ @@ -7050,6 +7408,20 @@ const de_PriorityInUseException = (output: any, context: __SerdeContext): Priori return contents; }; +/** + * deserializeAws_queryPriorRequestNotCompleteException + */ +const de_PriorRequestNotCompleteException = ( + output: any, + context: __SerdeContext +): PriorRequestNotCompleteException => { + const contents: any = {}; + if (output[_Me] != null) { + contents[_Me] = __expectString(output[_Me]); + } + return contents; +}; + /** * deserializeAws_queryQueryStringConditionConfig */ @@ -8027,6 +8399,34 @@ const de_UnsupportedProtocolException = (output: any, context: __SerdeContext): return contents; }; +/** + * deserializeAws_queryZonalCapacityReservationState + */ +const de_ZonalCapacityReservationState = (output: any, context: __SerdeContext): ZonalCapacityReservationState => { + const contents: any = {}; + if (output[_St] != null) { + contents[_St] = de_CapacityReservationStatus(output[_St], context); + } + if (output[_AZ] != null) { + contents[_AZ] = __expectString(output[_AZ]); + } + if (output[_ECU] != null) { + contents[_ECU] = __strictParseFloat(output[_ECU]) as number; + } + return contents; +}; + +/** + * deserializeAws_queryZonalCapacityReservationStates + */ +const de_ZonalCapacityReservationStates = (output: any, context: __SerdeContext): ZonalCapacityReservationState[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_ZonalCapacityReservationState(entry, context); + }); +}; + const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ httpStatusCode: output.statusCode, requestId: @@ -8096,17 +8496,20 @@ const _CL = "CreateListener"; const _CLB = "CreateLoadBalancer"; const _COIP = "CustomerOwnedIpv4Pool"; const _CR = "CreateRule"; +const _CRS = "CapacityReservationState"; const _CS = "ClientSecret"; const _CT = "ContentType"; const _CTG = "CreateTargetGroup"; const _CTS = "CreateTrustStore"; const _CTr = "CreatedTime"; +const _CU = "CapacityUnits"; const _Ci = "Ciphers"; const _Co = "Conditions"; const _Cod = "Code"; const _D = "Description"; const _DA = "DefaultActions"; const _DAL = "DescribeAccountLimits"; +const _DCR = "DescribeCapacityReservation"; const _DL = "DeleteListener"; const _DLA = "DescribeListenerAttributes"; const _DLB = "DeleteLoadBalancer"; @@ -8116,6 +8519,7 @@ const _DLC = "DescribeListenerCertificates"; const _DLe = "DescribeListeners"; const _DNSN = "DNSName"; const _DR = "DeleteRule"; +const _DRR = "DecreaseRequestsRemaining"; const _DRe = "DescribeRules"; const _DS = "DurationSeconds"; const _DSSLP = "DescribeSSLPolicies"; @@ -8131,6 +8535,7 @@ const _DTSR = "DescribeTrustStoreRevocations"; const _DTSe = "DescribeTrustStores"; const _DTe = "DescribeTags"; const _E = "Enabled"; +const _ECU = "EffectiveCapacityUnits"; const _EPFISN = "EnablePrefixForIpv6SourceNat"; const _ESGIROPLT = "EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic"; const _F = "Field"; @@ -8171,15 +8576,18 @@ const _LBAo = "LoadBalancerArns"; const _LBAoa = "LoadBalancerAddresses"; const _LBN = "LoadBalancerName"; const _LBT = "LoadBalancerType"; +const _LMT = "LastModifiedTime"; const _Li = "Limits"; const _Lo = "Location"; const _M = "Matcher"; const _MA = "MutualAuthentication"; const _MB = "MessageBody"; +const _MCR = "ModifyCapacityReservation"; const _MIE = "MitigationInEffect"; const _ML = "ModifyListener"; const _MLA = "ModifyListenerAttributes"; const _MLBA = "ModifyLoadBalancerAttributes"; +const _MLBC = "MinimumLoadBalancerCapacity"; const _MR = "ModifyRule"; const _MTG = "ModifyTargetGroup"; const _MTGA = "ModifyTargetGroupAttributes"; @@ -8213,6 +8621,7 @@ const _RAe = "ResourceArn"; const _RAu = "RuleArn"; const _RAul = "RuleArns"; const _RC = "RedirectConfig"; +const _RCR = "ResetCapacityReservation"; const _RCe = "RevocationContents"; const _RI = "RevocationIds"; const _RIe = "RevocationId"; diff --git a/codegen/sdk-codegen/aws-models/elastic-load-balancing-v2.json b/codegen/sdk-codegen/aws-models/elastic-load-balancing-v2.json index f8c9b0f4aff3..6123ccb1f480 100644 --- a/codegen/sdk-codegen/aws-models/elastic-load-balancing-v2.json +++ b/codegen/sdk-codegen/aws-models/elastic-load-balancing-v2.json @@ -813,6 +813,112 @@ "com.amazonaws.elasticloadbalancingv2#CanonicalHostedZoneId": { "type": "string" }, + "com.amazonaws.elasticloadbalancingv2#CapacityDecreaseRequestsLimitExceededException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.elasticloadbalancingv2#ErrorDescription" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "CapacityDecreaseRequestLimitExceeded", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

You've exceeded the daily capacity decrease limit for this reservation.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.elasticloadbalancingv2#CapacityReservationPendingException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.elasticloadbalancingv2#ErrorDescription" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "CapacityReservationPending", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

There is a pending capacity reservation.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.elasticloadbalancingv2#CapacityReservationStateEnum": { + "type": "enum", + "members": { + "PROVISIONED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "provisioned" + } + }, + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pending" + } + }, + "REBALANCING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "rebalancing" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "failed" + } + } + } + }, + "com.amazonaws.elasticloadbalancingv2#CapacityReservationStatus": { + "type": "structure", + "members": { + "Code": { + "target": "com.amazonaws.elasticloadbalancingv2#CapacityReservationStateEnum", + "traits": { + "smithy.api#documentation": "

The status code.

" + } + }, + "Reason": { + "target": "com.amazonaws.elasticloadbalancingv2#StateReason", + "traits": { + "smithy.api#documentation": "

The reason code for the status.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The status of a capacity reservation.

" + } + }, + "com.amazonaws.elasticloadbalancingv2#CapacityUnits": { + "type": "integer" + }, + "com.amazonaws.elasticloadbalancingv2#CapacityUnitsDouble": { + "type": "double" + }, + "com.amazonaws.elasticloadbalancingv2#CapacityUnitsLimitExceededException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.elasticloadbalancingv2#ErrorDescription" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "CapacityUnitsLimitExceeded", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

You've exceeded the capacity units limit.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, "com.amazonaws.elasticloadbalancingv2#Certificate": { "type": "structure", "members": { @@ -1796,6 +1902,9 @@ "com.amazonaws.elasticloadbalancingv2#DNSName": { "type": "string" }, + "com.amazonaws.elasticloadbalancingv2#DecreaseRequestsRemaining": { + "type": "integer" + }, "com.amazonaws.elasticloadbalancingv2#Default": { "type": "boolean" }, @@ -2248,6 +2357,71 @@ "smithy.api#output": {} } }, + "com.amazonaws.elasticloadbalancingv2#DescribeCapacityReservation": { + "type": "operation", + "input": { + "target": "com.amazonaws.elasticloadbalancingv2#DescribeCapacityReservationInput" + }, + "output": { + "target": "com.amazonaws.elasticloadbalancingv2#DescribeCapacityReservationOutput" + }, + "errors": [ + { + "target": "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes the capacity reservation status for the specified load balancer.

" + } + }, + "com.amazonaws.elasticloadbalancingv2#DescribeCapacityReservationInput": { + "type": "structure", + "members": { + "LoadBalancerArn": { + "target": "com.amazonaws.elasticloadbalancingv2#LoadBalancerArn", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the load balancer.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.elasticloadbalancingv2#DescribeCapacityReservationOutput": { + "type": "structure", + "members": { + "LastModifiedTime": { + "target": "com.amazonaws.elasticloadbalancingv2#LastModifiedTime", + "traits": { + "smithy.api#documentation": "

The last time the capacity reservation was modified.

" + } + }, + "DecreaseRequestsRemaining": { + "target": "com.amazonaws.elasticloadbalancingv2#DecreaseRequestsRemaining", + "traits": { + "smithy.api#documentation": "

The amount of daily capacity decreases remaining.

" + } + }, + "MinimumLoadBalancerCapacity": { + "target": "com.amazonaws.elasticloadbalancingv2#MinimumLoadBalancerCapacity", + "traits": { + "smithy.api#documentation": "

The requested minimum capacity reservation for the load balancer

" + } + }, + "CapacityReservationState": { + "target": "com.amazonaws.elasticloadbalancingv2#ZonalCapacityReservationStates", + "traits": { + "smithy.api#documentation": "

The state of the capacity reservation.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.elasticloadbalancingv2#DescribeListenerAttributes": { "type": "operation", "input": { @@ -3893,6 +4067,9 @@ { "target": "com.amazonaws.elasticloadbalancingv2#DescribeAccountLimits" }, + { + "target": "com.amazonaws.elasticloadbalancingv2#DescribeCapacityReservation" + }, { "target": "com.amazonaws.elasticloadbalancingv2#DescribeListenerAttributes" }, @@ -3944,6 +4121,9 @@ { "target": "com.amazonaws.elasticloadbalancingv2#GetTrustStoreRevocationContent" }, + { + "target": "com.amazonaws.elasticloadbalancingv2#ModifyCapacityReservation" + }, { "target": "com.amazonaws.elasticloadbalancingv2#ModifyListener" }, @@ -5430,6 +5610,23 @@ "smithy.api#httpError": 400 } }, + "com.amazonaws.elasticloadbalancingv2#InsufficientCapacityException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.elasticloadbalancingv2#ErrorDescription" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "InsufficientCapacity", + "httpResponseCode": 500 + }, + "smithy.api#documentation": "

There is insufficient capacity to reserve.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, "com.amazonaws.elasticloadbalancingv2#InvalidCaCertificatesBundleException": { "type": "structure", "members": { @@ -5595,6 +5792,9 @@ "com.amazonaws.elasticloadbalancingv2#IsDefault": { "type": "boolean" }, + "com.amazonaws.elasticloadbalancingv2#LastModifiedTime": { + "type": "timestamp" + }, "com.amazonaws.elasticloadbalancingv2#Limit": { "type": "structure", "members": { @@ -6112,6 +6312,20 @@ "com.amazonaws.elasticloadbalancingv2#Max": { "type": "string" }, + "com.amazonaws.elasticloadbalancingv2#MinimumLoadBalancerCapacity": { + "type": "structure", + "members": { + "CapacityUnits": { + "target": "com.amazonaws.elasticloadbalancingv2#CapacityUnits", + "traits": { + "smithy.api#documentation": "

The number of capacity units.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The minimum capacity for a load balancer.

" + } + }, "com.amazonaws.elasticloadbalancingv2#MitigationInEffectEnum": { "type": "enum", "members": { @@ -6132,6 +6346,104 @@ "com.amazonaws.elasticloadbalancingv2#Mode": { "type": "string" }, + "com.amazonaws.elasticloadbalancingv2#ModifyCapacityReservation": { + "type": "operation", + "input": { + "target": "com.amazonaws.elasticloadbalancingv2#ModifyCapacityReservationInput" + }, + "output": { + "target": "com.amazonaws.elasticloadbalancingv2#ModifyCapacityReservationOutput" + }, + "errors": [ + { + "target": "com.amazonaws.elasticloadbalancingv2#CapacityDecreaseRequestsLimitExceededException" + }, + { + "target": "com.amazonaws.elasticloadbalancingv2#CapacityReservationPendingException" + }, + { + "target": "com.amazonaws.elasticloadbalancingv2#CapacityUnitsLimitExceededException" + }, + { + "target": "com.amazonaws.elasticloadbalancingv2#InsufficientCapacityException" + }, + { + "target": "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException" + }, + { + "target": "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException" + }, + { + "target": "com.amazonaws.elasticloadbalancingv2#OperationNotPermittedException" + }, + { + "target": "com.amazonaws.elasticloadbalancingv2#PriorRequestNotCompleteException" + } + ], + "traits": { + "smithy.api#documentation": "

Modifies the capacity reservation of the specified load balancer.

\n

When modifying capacity reservation, you must include at least one MinimumLoadBalancerCapacity \n or ResetCapacityReservation.

" + } + }, + "com.amazonaws.elasticloadbalancingv2#ModifyCapacityReservationInput": { + "type": "structure", + "members": { + "LoadBalancerArn": { + "target": "com.amazonaws.elasticloadbalancingv2#LoadBalancerArn", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the load balancer.

", + "smithy.api#required": {} + } + }, + "MinimumLoadBalancerCapacity": { + "target": "com.amazonaws.elasticloadbalancingv2#MinimumLoadBalancerCapacity", + "traits": { + "smithy.api#documentation": "

The minimum load balancer capacity reserved.

" + } + }, + "ResetCapacityReservation": { + "target": "com.amazonaws.elasticloadbalancingv2#ResetCapacityReservation", + "traits": { + "smithy.api#documentation": "

Resets the capacity reservation.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.elasticloadbalancingv2#ModifyCapacityReservationOutput": { + "type": "structure", + "members": { + "LastModifiedTime": { + "target": "com.amazonaws.elasticloadbalancingv2#LastModifiedTime", + "traits": { + "smithy.api#documentation": "

The last time the capacity reservation was modified.

" + } + }, + "DecreaseRequestsRemaining": { + "target": "com.amazonaws.elasticloadbalancingv2#DecreaseRequestsRemaining", + "traits": { + "smithy.api#documentation": "

The amount of daily capacity decreases remaining.

" + } + }, + "MinimumLoadBalancerCapacity": { + "target": "com.amazonaws.elasticloadbalancingv2#MinimumLoadBalancerCapacity", + "traits": { + "smithy.api#documentation": "

The requested minimum capacity reservation for the load balancer

" + } + }, + "CapacityReservationState": { + "target": "com.amazonaws.elasticloadbalancingv2#ZonalCapacityReservationStates", + "traits": { + "smithy.api#documentation": "

The state of the capacity reservation.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.elasticloadbalancingv2#ModifyListener": { "type": "operation", "input": { @@ -7118,6 +7430,23 @@ } } }, + "com.amazonaws.elasticloadbalancingv2#PriorRequestNotCompleteException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.elasticloadbalancingv2#ErrorDescription" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "PriorRequestNotComplete", + "httpResponseCode": 429 + }, + "smithy.api#documentation": "

This operation is not allowed while a prior request has not been completed.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429 + } + }, "com.amazonaws.elasticloadbalancingv2#PriorityInUseException": { "type": "structure", "members": { @@ -7595,6 +7924,9 @@ "smithy.api#output": {} } }, + "com.amazonaws.elasticloadbalancingv2#ResetCapacityReservation": { + "type": "boolean" + }, "com.amazonaws.elasticloadbalancingv2#ResourceArn": { "type": "string" }, @@ -8182,6 +8514,9 @@ { "target": "com.amazonaws.elasticloadbalancingv2#AvailabilityZoneNotSupportedException" }, + { + "target": "com.amazonaws.elasticloadbalancingv2#CapacityReservationPendingException" + }, { "target": "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException" }, @@ -9592,6 +9927,38 @@ "com.amazonaws.elasticloadbalancingv2#VpcId": { "type": "string" }, + "com.amazonaws.elasticloadbalancingv2#ZonalCapacityReservationState": { + "type": "structure", + "members": { + "State": { + "target": "com.amazonaws.elasticloadbalancingv2#CapacityReservationStatus", + "traits": { + "smithy.api#documentation": "

The state of the capacity reservation.

" + } + }, + "AvailabilityZone": { + "target": "com.amazonaws.elasticloadbalancingv2#ZoneName", + "traits": { + "smithy.api#documentation": "

Information about the availability zone.

" + } + }, + "EffectiveCapacityUnits": { + "target": "com.amazonaws.elasticloadbalancingv2#CapacityUnitsDouble", + "traits": { + "smithy.api#documentation": "

The number of effective capacity units.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The capacity reservation status for each availability zone.

" + } + }, + "com.amazonaws.elasticloadbalancingv2#ZonalCapacityReservationStates": { + "type": "list", + "member": { + "target": "com.amazonaws.elasticloadbalancingv2#ZonalCapacityReservationState" + } + }, "com.amazonaws.elasticloadbalancingv2#ZoneName": { "type": "string" }