From 7b94e36f5716b89d732ba1f2f9e3b02d75c682ea Mon Sep 17 00:00:00 2001
From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Date: Mon, 6 Jan 2020 16:48:15 -0800
Subject: [PATCH] feat: add client-auto-scaling-plans (#656)
---
clients/client-auto-scaling-plans/.gitignore | 14 +
clients/client-auto-scaling-plans/.npmignore | 4 +
.../AutoScalingPlans.ts | 291 +++
.../AutoScalingPlansClient.ts | 225 ++
clients/client-auto-scaling-plans/LICENSE | 201 ++
clients/client-auto-scaling-plans/README.md | 6 +
.../commands/CreateScalingPlanCommand.ts | 84 +
.../commands/DeleteScalingPlanCommand.ts | 84 +
.../DescribeScalingPlanResourcesCommand.ts | 93 +
.../commands/DescribeScalingPlansCommand.ts | 87 +
...tScalingPlanResourceForecastDataCommand.ts | 93 +
.../commands/UpdateScalingPlanCommand.ts | 84 +
.../client-auto-scaling-plans/endpoints.ts | 143 ++
clients/client-auto-scaling-plans/index.ts | 8 +
.../client-auto-scaling-plans/models/index.ts | 1576 ++++++++++++++
.../client-auto-scaling-plans/package.json | 75 +
.../protocols/Aws_json1_1.ts | 1907 +++++++++++++++++
.../runtimeConfig.browser.ts | 30 +
.../runtimeConfig.shared.ts | 7 +
.../runtimeConfig.ts | 31 +
.../tsconfig.es.json | 19 +
.../client-auto-scaling-plans/tsconfig.json | 27 +
22 files changed, 5089 insertions(+)
create mode 100644 clients/client-auto-scaling-plans/.gitignore
create mode 100644 clients/client-auto-scaling-plans/.npmignore
create mode 100644 clients/client-auto-scaling-plans/AutoScalingPlans.ts
create mode 100644 clients/client-auto-scaling-plans/AutoScalingPlansClient.ts
create mode 100644 clients/client-auto-scaling-plans/LICENSE
create mode 100644 clients/client-auto-scaling-plans/README.md
create mode 100644 clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts
create mode 100644 clients/client-auto-scaling-plans/commands/DeleteScalingPlanCommand.ts
create mode 100644 clients/client-auto-scaling-plans/commands/DescribeScalingPlanResourcesCommand.ts
create mode 100644 clients/client-auto-scaling-plans/commands/DescribeScalingPlansCommand.ts
create mode 100644 clients/client-auto-scaling-plans/commands/GetScalingPlanResourceForecastDataCommand.ts
create mode 100644 clients/client-auto-scaling-plans/commands/UpdateScalingPlanCommand.ts
create mode 100644 clients/client-auto-scaling-plans/endpoints.ts
create mode 100644 clients/client-auto-scaling-plans/index.ts
create mode 100644 clients/client-auto-scaling-plans/models/index.ts
create mode 100644 clients/client-auto-scaling-plans/package.json
create mode 100644 clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts
create mode 100644 clients/client-auto-scaling-plans/runtimeConfig.browser.ts
create mode 100644 clients/client-auto-scaling-plans/runtimeConfig.shared.ts
create mode 100644 clients/client-auto-scaling-plans/runtimeConfig.ts
create mode 100644 clients/client-auto-scaling-plans/tsconfig.es.json
create mode 100644 clients/client-auto-scaling-plans/tsconfig.json
diff --git a/clients/client-auto-scaling-plans/.gitignore b/clients/client-auto-scaling-plans/.gitignore
new file mode 100644
index 000000000000..b41c05b597c4
--- /dev/null
+++ b/clients/client-auto-scaling-plans/.gitignore
@@ -0,0 +1,14 @@
+/node_modules/
+/build/
+/coverage/
+/docs/
+/types/
+/dist/
+*.tsbuildinfo
+*.tgz
+*.log
+package-lock.json
+
+*.d.ts
+*.js
+*.js.map
diff --git a/clients/client-auto-scaling-plans/.npmignore b/clients/client-auto-scaling-plans/.npmignore
new file mode 100644
index 000000000000..b7ff81137c4a
--- /dev/null
+++ b/clients/client-auto-scaling-plans/.npmignore
@@ -0,0 +1,4 @@
+/coverage/
+/docs/
+tsconfig.test.json
+*.tsbuildinfo
diff --git a/clients/client-auto-scaling-plans/AutoScalingPlans.ts b/clients/client-auto-scaling-plans/AutoScalingPlans.ts
new file mode 100644
index 000000000000..1bf08e42cc5f
--- /dev/null
+++ b/clients/client-auto-scaling-plans/AutoScalingPlans.ts
@@ -0,0 +1,291 @@
+import { AutoScalingPlansClient } from "./AutoScalingPlansClient";
+import {
+ CreateScalingPlanCommand,
+ CreateScalingPlanCommandInput,
+ CreateScalingPlanCommandOutput
+} from "./commands/CreateScalingPlanCommand";
+import {
+ DeleteScalingPlanCommand,
+ DeleteScalingPlanCommandInput,
+ DeleteScalingPlanCommandOutput
+} from "./commands/DeleteScalingPlanCommand";
+import {
+ DescribeScalingPlanResourcesCommand,
+ DescribeScalingPlanResourcesCommandInput,
+ DescribeScalingPlanResourcesCommandOutput
+} from "./commands/DescribeScalingPlanResourcesCommand";
+import {
+ DescribeScalingPlansCommand,
+ DescribeScalingPlansCommandInput,
+ DescribeScalingPlansCommandOutput
+} from "./commands/DescribeScalingPlansCommand";
+import {
+ GetScalingPlanResourceForecastDataCommand,
+ GetScalingPlanResourceForecastDataCommandInput,
+ GetScalingPlanResourceForecastDataCommandOutput
+} from "./commands/GetScalingPlanResourceForecastDataCommand";
+import {
+ UpdateScalingPlanCommand,
+ UpdateScalingPlanCommandInput,
+ UpdateScalingPlanCommandOutput
+} from "./commands/UpdateScalingPlanCommand";
+import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
+
+/**
+ *
+ *
Use AWS Auto Scaling to quickly discover all the scalable AWS resources for your application and + * configure dynamic scaling and predictive scaling for your resources using scaling plans. + * Use this service in conjunction with the Amazon EC2 Auto Scaling, Application Auto Scaling, Amazon CloudWatch, and AWS + * CloudFormation services.
+ *Currently, predictive scaling is only available for Amazon EC2 Auto Scaling groups.
+ *For more information about AWS Auto Scaling, including information about granting IAM users + * required permissions for AWS Auto Scaling actions, see the AWS Auto Scaling User Guide.
+ * + */ +export class AutoScalingPlans extends AutoScalingPlansClient { + /** + * + *Creates a scaling plan.
+ * + */ + public createScalingPlan( + args: CreateScalingPlanCommandInput, + options?: __HttpHandlerOptions + ): PromiseDeletes the specified scaling plan.
+ *Deleting a scaling plan deletes the underlying ScalingInstruction for + * all of the scalable resources that are covered by the plan.
+ *If the plan has launched resources or has scaling activities in progress, you must + * delete those resources separately.
+ * + */ + public deleteScalingPlan( + args: DeleteScalingPlanCommandInput, + options?: __HttpHandlerOptions + ): PromiseDescribes the scalable resources in the specified scaling plan.
+ * + */ + public describeScalingPlanResources( + args: DescribeScalingPlanResourcesCommandInput, + options?: __HttpHandlerOptions + ): PromiseDescribes one or more of your scaling plans.
+ * + */ + public describeScalingPlans( + args: DescribeScalingPlansCommandInput, + options?: __HttpHandlerOptions + ): PromiseRetrieves the forecast data for a scalable resource.
+ *Capacity forecasts are represented as predicted values, or data points, that are + * calculated using historical data points from a specified CloudWatch load metric. Data points are + * available for up to 56 days. + * + *
+ * + */ + public getScalingPlanResourceForecastData( + args: GetScalingPlanResourceForecastDataCommandInput, + options?: __HttpHandlerOptions + ): PromiseUpdates the specified scaling plan.
+ *You cannot update a scaling plan if it is in the process of being created, updated, or + * deleted.
+ * + */ + public updateScalingPlan( + args: UpdateScalingPlanCommandInput, + options?: __HttpHandlerOptions + ): PromiseUse AWS Auto Scaling to quickly discover all the scalable AWS resources for your application and + * configure dynamic scaling and predictive scaling for your resources using scaling plans. + * Use this service in conjunction with the Amazon EC2 Auto Scaling, Application Auto Scaling, Amazon CloudWatch, and AWS + * CloudFormation services.
+ *Currently, predictive scaling is only available for Amazon EC2 Auto Scaling groups.
+ *For more information about AWS Auto Scaling, including information about granting IAM users + * required permissions for AWS Auto Scaling actions, see the AWS Auto Scaling User Guide.
+ * + */ +export class AutoScalingPlansClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + AutoScalingPlansClientResolvedConfig +> { + readonly config: AutoScalingPlansClientResolvedConfig; + + constructor(configuration: AutoScalingPlansClientConfig) { + let _config_0 = { + ...__ClientDefaultValues, + ...configuration + }; + let _config_1 = resolveRegionConfig(_config_0); + let _config_2 = resolveEndpointsConfig(_config_1); + let _config_3 = resolveAwsAuthConfig(_config_2); + let _config_4 = resolveRetryConfig(_config_3); + let _config_5 = resolveUserAgentConfig(_config_4); + let _config_6 = resolveHostHeaderConfig(_config_5); + super(_config_6); + this.config = _config_6; + this.middlewareStack.use(getAwsAuthPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + } + + destroy(): void {} +} diff --git a/clients/client-auto-scaling-plans/LICENSE b/clients/client-auto-scaling-plans/LICENSE new file mode 100644 index 000000000000..b7d2463d8cc0 --- /dev/null +++ b/clients/client-auto-scaling-plans/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/clients/client-auto-scaling-plans/README.md b/clients/client-auto-scaling-plans/README.md new file mode 100644 index 000000000000..cbafbaded0d9 --- /dev/null +++ b/clients/client-auto-scaling-plans/README.md @@ -0,0 +1,6 @@ +@aws-sdk/client-auto-scaling-plans + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-auto-scaling-plans/preview.svg)](https://www.npmjs.com/package/@aws-sdk/client-auto-scaling-plans) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-auto-scaling-plans.svg)](https://www.npmjs.com/package/@aws-sdk/client-auto-scaling-plans) + +For SDK usage, please step to [SDK reademe](https://github.com/aws/aws-sdk-js-v3). diff --git a/clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts b/clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts new file mode 100644 index 000000000000..a43bb5f111ad --- /dev/null +++ b/clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts @@ -0,0 +1,84 @@ +import { + AutoScalingPlansClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AutoScalingPlansClient"; +import { + CreateScalingPlanRequest, + CreateScalingPlanResponse +} from "../models/index"; +import { + deserializeAws_json1_1CreateScalingPlanCommand, + serializeAws_json1_1CreateScalingPlanCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type CreateScalingPlanCommandInput = CreateScalingPlanRequest; +export type CreateScalingPlanCommandOutput = CreateScalingPlanResponse; + +export class CreateScalingPlanCommand extends $Command< + CreateScalingPlanCommandInput, + CreateScalingPlanCommandOutput, + AutoScalingPlansClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateScalingPlanCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStackRepresents an application source.
+ * + */ +export interface ApplicationSource { + __type?: "ApplicationSource"; + /** + * + *The Amazon Resource Name (ARN) of a AWS CloudFormation stack.
+ * + */ + CloudFormationStackARN?: string; + + /** + * + *A set of tags (up to 50).
+ * + */ + TagFilters?: ArrayConcurrent updates caused an exception, for example, if you request an update to a + * scaling plan that already has a pending update.
+ * + */ +export interface ConcurrentUpdateException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ConcurrentUpdateException"; + $fault: "server"; + Message?: string; +} + +export namespace ConcurrentUpdateException { + export function isa(o: any): o is ConcurrentUpdateException { + return _smithy.isa(o, "ConcurrentUpdateException"); + } +} + +export interface CreateScalingPlanRequest { + __type?: "CreateScalingPlanRequest"; + /** + * + *A CloudFormation stack or set of tags. You can create one scaling plan per application + * source.
+ * + */ + ApplicationSource: ApplicationSource | undefined; + + /** + * + *The scaling instructions.
+ * + */ + ScalingInstructions: ArrayThe name of the scaling plan. Names cannot contain vertical bars, colons, or forward + * slashes.
+ * + */ + ScalingPlanName: string | undefined; +} + +export namespace CreateScalingPlanRequest { + export function isa(o: any): o is CreateScalingPlanRequest { + return _smithy.isa(o, "CreateScalingPlanRequest"); + } +} + +export interface CreateScalingPlanResponse extends $MetadataBearer { + __type?: "CreateScalingPlanResponse"; + /** + * + *The version number of the scaling plan. This value is always 1.
+ *Currently, you cannot specify multiple scaling plan versions.
+ * + */ + ScalingPlanVersion: number | undefined; +} + +export namespace CreateScalingPlanResponse { + export function isa(o: any): o is CreateScalingPlanResponse { + return _smithy.isa(o, "CreateScalingPlanResponse"); + } +} + +/** + * + *Represents a CloudWatch metric of your choosing that can be used for predictive scaling.
+ *For predictive scaling to work with a customized load metric specification, AWS Auto Scaling
+ * needs access to the Sum
and Average
statistics that CloudWatch computes
+ * from metric data. Statistics are calculations used to aggregate data over specified time
+ * periods.
When you choose a load metric, make sure that the required Sum
and
+ * Average
statistics for your metric are available in CloudWatch and that they
+ * provide relevant data for predictive scaling. The Sum
statistic must represent
+ * the total load on the resource, and the Average
statistic must represent the
+ * average load per capacity unit of the resource. For example, there is a metric that counts
+ * the number of requests processed by your Auto Scaling group. If the Sum
statistic
+ * represents the total request count processed by the group, then the Average
+ * statistic for the specified metric must represent the average request count processed by
+ * each instance of the group.
For information about terminology, available metrics, or how to publish new metrics, see + * Amazon CloudWatch + * Concepts in the Amazon CloudWatch User Guide.
+ * + */ +export interface CustomizedLoadMetricSpecification { + __type?: "CustomizedLoadMetricSpecification"; + /** + * + *The dimensions of the metric.
+ *Conditional: If you published your metric with dimensions, you must specify the same + * dimensions in your customized load metric specification.
+ * + */ + Dimensions?: ArrayThe name of the metric.
+ * + */ + MetricName: string | undefined; + + /** + * + *The namespace of the metric.
+ * + */ + Namespace: string | undefined; + + /** + * + *The statistic of the metric. Currently, the value must always be Sum
.
+ *
The unit of the metric.
+ * + */ + Unit?: string; +} + +export namespace CustomizedLoadMetricSpecification { + export function isa(o: any): o is CustomizedLoadMetricSpecification { + return _smithy.isa(o, "CustomizedLoadMetricSpecification"); + } +} + +/** + * + *Represents a CloudWatch metric of your choosing that can be used for dynamic scaling as part + * of a target tracking scaling policy.
+ *To create your customized scaling metric specification:
+ *Add values for each required parameter from CloudWatch. You can use an existing metric, + * or a new metric that you create. To use your own metric, you must first publish the + * metric to CloudWatch. For more information, see Publish Custom + * Metrics in the Amazon CloudWatch User Guide.
+ *Choose a metric that changes proportionally with capacity. The value of the metric + * should increase or decrease in inverse proportion to the number of capacity units. + * That is, the value of the metric should decrease when capacity increases.
+ *For more information about CloudWatch, see Amazon CloudWatch + * Concepts.
+ * + */ +export interface CustomizedScalingMetricSpecification { + __type?: "CustomizedScalingMetricSpecification"; + /** + * + *The dimensions of the metric.
+ *Conditional: If you published your metric with dimensions, you must specify the same + * dimensions in your customized scaling metric specification.
+ * + */ + Dimensions?: ArrayThe name of the metric.
+ * + */ + MetricName: string | undefined; + + /** + * + *The namespace of the metric.
+ * + */ + Namespace: string | undefined; + + /** + * + *The statistic of the metric.
+ * + */ + Statistic: MetricStatistic | string | undefined; + + /** + * + *The unit of the metric.
+ * + */ + Unit?: string; +} + +export namespace CustomizedScalingMetricSpecification { + export function isa(o: any): o is CustomizedScalingMetricSpecification { + return _smithy.isa(o, "CustomizedScalingMetricSpecification"); + } +} + +/** + * + *Represents a single value in the forecast data used for predictive scaling.
+ * + */ +export interface Datapoint { + __type?: "Datapoint"; + /** + * + *The time stamp for the data point in UTC format.
+ * + */ + Timestamp?: Date; + + /** + * + *The value of the data point.
+ * + */ + Value?: number; +} + +export namespace Datapoint { + export function isa(o: any): o is Datapoint { + return _smithy.isa(o, "Datapoint"); + } +} + +export interface DeleteScalingPlanRequest { + __type?: "DeleteScalingPlanRequest"; + /** + * + *The name of the scaling plan.
+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *The version number of the scaling plan.
+ * + */ + ScalingPlanVersion: number | undefined; +} + +export namespace DeleteScalingPlanRequest { + export function isa(o: any): o is DeleteScalingPlanRequest { + return _smithy.isa(o, "DeleteScalingPlanRequest"); + } +} + +export interface DeleteScalingPlanResponse extends $MetadataBearer { + __type?: "DeleteScalingPlanResponse"; +} + +export namespace DeleteScalingPlanResponse { + export function isa(o: any): o is DeleteScalingPlanResponse { + return _smithy.isa(o, "DeleteScalingPlanResponse"); + } +} + +export interface DescribeScalingPlanResourcesRequest { + __type?: "DescribeScalingPlanResourcesRequest"; + /** + * + *The maximum number of scalable resources to return. The value must be between + * 1 and 50. The default value is 50.
+ * + */ + MaxResults?: number; + + /** + * + *The token for the next set of results.
+ * + */ + NextToken?: string; + + /** + * + *The name of the scaling plan.
+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *The version number of the scaling plan.
+ * + */ + ScalingPlanVersion: number | undefined; +} + +export namespace DescribeScalingPlanResourcesRequest { + export function isa(o: any): o is DescribeScalingPlanResourcesRequest { + return _smithy.isa(o, "DescribeScalingPlanResourcesRequest"); + } +} + +export interface DescribeScalingPlanResourcesResponse extends $MetadataBearer { + __type?: "DescribeScalingPlanResourcesResponse"; + /** + * + *The token required to get the next set of results. This value is null
if
+ * there are no more results to return.
Information about the scalable resources.
+ * + */ + ScalingPlanResources?: ArrayThe sources for the applications (up to 10). If you specify scaling plan names, you + * cannot specify application sources.
+ * + */ + ApplicationSources?: ArrayThe maximum number of scalable resources to return. This value can be between + * 1 and 50. The default value is 50.
+ * + */ + MaxResults?: number; + + /** + * + *The token for the next set of results.
+ * + */ + NextToken?: string; + + /** + * + *The names of the scaling plans (up to 10). If you specify application sources, you + * cannot specify scaling plan names.
+ * + */ + ScalingPlanNames?: ArrayThe version number of the scaling plan. If you specify a scaling plan version, you must + * also specify a scaling plan name.
+ * + */ + ScalingPlanVersion?: number; +} + +export namespace DescribeScalingPlansRequest { + export function isa(o: any): o is DescribeScalingPlansRequest { + return _smithy.isa(o, "DescribeScalingPlansRequest"); + } +} + +export interface DescribeScalingPlansResponse extends $MetadataBearer { + __type?: "DescribeScalingPlansResponse"; + /** + * + *The token required to get the next set of results. This value is null
if
+ * there are no more results to return.
Information about the scaling plans.
+ * + */ + ScalingPlans?: ArrayThe exclusive end time of the time range for the forecast data to get. The maximum time + * duration between the start and end time is seven days.
+ *Although this parameter can accept a date and time that is more than two days in the + * future, the availability of forecast data has limits. AWS Auto Scaling only issues forecasts for + * periods of two days in advance.
+ * + */ + EndTime: Date | undefined; + + /** + * + *The type of forecast data to get.
+ *
+ * LoadForecast
: The load metric forecast.
+ * CapacityForecast
: The capacity forecast.
+ * ScheduledActionMinCapacity
: The minimum capacity for each scheduled
+ * scaling action. This data is calculated as the larger of two values: the capacity
+ * forecast or the minimum capacity in the scaling instruction.
+ * ScheduledActionMaxCapacity
: The maximum capacity for each scheduled
+ * scaling action. The calculation used is determined by the predictive scaling maximum
+ * capacity behavior setting in the scaling instruction.
The ID of the resource. This string consists of the resource type and unique identifier. + *
+ *Auto Scaling group - The resource type is autoScalingGroup
and the unique identifier is the
+ * name of the Auto Scaling group. Example: autoScalingGroup/my-asg
.
ECS service - The resource type is service
and the unique identifier is the cluster name
+ * and service name. Example: service/default/sample-webapp
.
Spot Fleet request - The resource type is spot-fleet-request
and the unique identifier is the
+ * Spot Fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
.
DynamoDB table - The resource type is table
and the unique identifier is the resource ID.
+ * Example: table/my-table
.
DynamoDB global secondary index - The resource type is index
and the unique identifier is the resource ID.
+ * Example: table/my-table/index/my-table-index
.
Aurora DB cluster - The resource type is cluster
and the unique identifier is the cluster name.
+ * Example: cluster:my-db-cluster
.
The scalable dimension for the resource.
+ * + */ + ScalableDimension: ScalableDimension | string | undefined; + + /** + * + *The name of the scaling plan.
+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *The version number of the scaling plan.
+ * + */ + ScalingPlanVersion: number | undefined; + + /** + * + *The namespace of the AWS service.
+ * + */ + ServiceNamespace: ServiceNamespace | string | undefined; + + /** + * + *The inclusive start time of the time range for the forecast data to get. The date and + * time can be at most 56 days before the current date and time.
+ * + */ + StartTime: Date | undefined; +} + +export namespace GetScalingPlanResourceForecastDataRequest { + export function isa(o: any): o is GetScalingPlanResourceForecastDataRequest { + return _smithy.isa(o, "GetScalingPlanResourceForecastDataRequest"); + } +} + +export interface GetScalingPlanResourceForecastDataResponse + extends $MetadataBearer { + __type?: "GetScalingPlanResourceForecastDataResponse"; + /** + * + *The data points to return.
+ * + */ + Datapoints: ArrayThe service encountered an internal error.
+ * + */ +export interface InternalServiceException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "InternalServiceException"; + $fault: "server"; + Message?: string; +} + +export namespace InternalServiceException { + export function isa(o: any): o is InternalServiceException { + return _smithy.isa(o, "InternalServiceException"); + } +} + +/** + * + *The token provided is not valid.
+ * + */ +export interface InvalidNextTokenException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "InvalidNextTokenException"; + $fault: "client"; + Message?: string; +} + +export namespace InvalidNextTokenException { + export function isa(o: any): o is InvalidNextTokenException { + return _smithy.isa(o, "InvalidNextTokenException"); + } +} + +/** + * + *Your account exceeded a limit. This exception is thrown when a per-account resource + * limit is exceeded.
+ * + */ +export interface LimitExceededException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "LimitExceededException"; + $fault: "client"; + Message?: string; +} + +export namespace LimitExceededException { + export function isa(o: any): o is LimitExceededException { + return _smithy.isa(o, "LimitExceededException"); + } +} + +export enum LoadMetricType { + ALBTargetGroupRequestCount = "ALBTargetGroupRequestCount", + ASGTotalCPUUtilization = "ASGTotalCPUUtilization", + ASGTotalNetworkIn = "ASGTotalNetworkIn", + ASGTotalNetworkOut = "ASGTotalNetworkOut" +} + +/** + * + *Represents a dimension for a customized metric.
+ * + */ +export interface MetricDimension { + __type?: "MetricDimension"; + /** + * + *The name of the dimension.
+ * + */ + Name: string | undefined; + + /** + * + *The value of the dimension.
+ * + */ + Value: string | undefined; +} + +export namespace MetricDimension { + export function isa(o: any): o is MetricDimension { + return _smithy.isa(o, "MetricDimension"); + } +} + +export enum MetricStatistic { + Average = "Average", + Maximum = "Maximum", + Minimum = "Minimum", + SampleCount = "SampleCount", + Sum = "Sum" +} + +/** + * + *The specified object could not be found.
+ * + */ +export interface ObjectNotFoundException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ObjectNotFoundException"; + $fault: "client"; + Message?: string; +} + +export namespace ObjectNotFoundException { + export function isa(o: any): o is ObjectNotFoundException { + return _smithy.isa(o, "ObjectNotFoundException"); + } +} + +export enum PolicyType { + TargetTrackingScaling = "TargetTrackingScaling" +} + +/** + * + *Represents a predefined metric that can be used for predictive scaling.
+ * + */ +export interface PredefinedLoadMetricSpecification { + __type?: "PredefinedLoadMetricSpecification"; + /** + * + *The metric type.
+ * + */ + PredefinedLoadMetricType: LoadMetricType | string | undefined; + + /** + * + *Identifies the resource associated with the metric type. You can't specify a resource
+ * label unless the metric type is ALBRequestCountPerTarget
and there is a target
+ * group for an Application Load Balancer attached to the Auto Scaling group.
The format is
+ * app/
app/
targetgroup/
Represents a predefined metric that can be used for dynamic scaling as part of a target + * tracking scaling policy.
+ * + */ +export interface PredefinedScalingMetricSpecification { + __type?: "PredefinedScalingMetricSpecification"; + /** + * + *The metric type. The ALBRequestCountPerTarget
metric type applies only to
+ * Auto Scaling groups, Spot Fleet requests, and ECS services.
Identifies the resource associated with the metric type. You can't specify a resource
+ * label unless the metric type is ALBRequestCountPerTarget
and there is a target
+ * group for an Application Load Balancer attached to the Auto Scaling group, Spot Fleet request, or
+ * ECS service.
The format is
+ * app/
app/
targetgroup/
Describes a scaling instruction for a scalable resource.
+ *The scaling instruction is used in combination with a scaling plan, which is a set of + * instructions for configuring dynamic scaling and predictive scaling for the scalable + * resources in your application. Each scaling instruction applies to one resource.
+ *AWS Auto Scaling creates target tracking scaling policies based on the scaling instructions. + * Target tracking scaling policies adjust the capacity of your scalable resource as required + * to maintain resource utilization at the target value that you specified.
+ *AWS Auto Scaling also configures predictive scaling for your Amazon EC2 Auto Scaling groups using a subset of + * parameters, including the load metric, the scaling metric, the target value for the scaling + * metric, the predictive scaling mode (forecast and scale or forecast only), and the desired + * behavior when the forecast capacity exceeds the maximum capacity of the resource. With + * predictive scaling, AWS Auto Scaling generates forecasts with traffic predictions for the two days + * ahead and schedules scaling actions that proactively add and remove resource capacity to + * match the forecast.
+ *We recommend waiting a minimum of 24 hours after creating an Auto Scaling group to configure + * predictive scaling. At minimum, there must be 24 hours of historical data to generate a + * forecast.
+ *For more information, see Getting Started with + * AWS Auto Scaling.
+ * + */ +export interface ScalingInstruction { + __type?: "ScalingInstruction"; + /** + * + *The customized load metric to use for predictive scaling. This parameter or a PredefinedLoadMetricSpecification is required when configuring + * predictive scaling, and cannot be used otherwise.
+ * + */ + CustomizedLoadMetricSpecification?: CustomizedLoadMetricSpecification; + + /** + * + *Controls whether dynamic scaling by AWS Auto Scaling is disabled. When dynamic scaling is + * enabled, AWS Auto Scaling creates target tracking scaling policies based on the specified target + * tracking configurations.
+ *The default is enabled (false
).
The maximum capacity of the resource. The exception to this upper limit is if you + * specify a non-default setting for PredictiveScalingMaxCapacityBehavior.
+ * + */ + MaxCapacity: number | undefined; + + /** + * + *The minimum capacity of the resource.
+ * + */ + MinCapacity: number | undefined; + + /** + * + *The predefined load metric to use for predictive scaling. This parameter or a CustomizedLoadMetricSpecification is required when configuring + * predictive scaling, and cannot be used otherwise.
+ * + */ + PredefinedLoadMetricSpecification?: PredefinedLoadMetricSpecification; + + /** + * + *Defines the behavior that should be applied if the forecast capacity approaches or
+ * exceeds the maximum capacity specified for the resource. The default value is
+ * SetForecastCapacityToMaxCapacity
.
The following are possible values:
+ *
+ * SetForecastCapacityToMaxCapacity
- AWS Auto Scaling cannot scale resource
+ * capacity higher than the maximum capacity. The maximum capacity is enforced as a hard
+ * limit.
+ * SetMaxCapacityToForecastCapacity
- AWS Auto Scaling may scale resource
+ * capacity higher than the maximum capacity to equal but not exceed forecast
+ * capacity.
+ * SetMaxCapacityAboveForecastCapacity
- AWS Auto Scaling may scale resource
+ * capacity higher than the maximum capacity by a specified buffer value. The intention
+ * is to give the target tracking scaling policy extra capacity if unexpected traffic
+ * occurs.
Only valid when configuring predictive scaling.
+ * + */ + PredictiveScalingMaxCapacityBehavior?: + | PredictiveScalingMaxCapacityBehavior + | string; + + /** + * + *The size of the capacity buffer to use when the forecast capacity is close to or exceeds + * the maximum capacity. The value is specified as a percentage relative to the forecast + * capacity. For example, if the buffer is 10, this means a 10 percent buffer, such that if + * the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum + * capacity is 55.
+ *Only valid when configuring predictive scaling. Required if the PredictiveScalingMaxCapacityBehavior is set to
+ * SetMaxCapacityAboveForecastCapacity
, and cannot be used otherwise.
The range is 1-100.
+ * + */ + PredictiveScalingMaxCapacityBuffer?: number; + + /** + * + *The predictive scaling mode. The default value is ForecastAndScale
.
+ * Otherwise, AWS Auto Scaling forecasts capacity but does not create any scheduled scaling actions
+ * based on the capacity forecast.
The ID of the resource. This string consists of the resource type and unique + * identifier.
+ *Auto Scaling group - The resource type is autoScalingGroup
and the unique identifier is the
+ * name of the Auto Scaling group. Example: autoScalingGroup/my-asg
.
ECS service - The resource type is service
and the unique identifier is the cluster name
+ * and service name. Example: service/default/sample-webapp
.
Spot Fleet request - The resource type is spot-fleet-request
and the unique identifier is the
+ * Spot Fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
.
DynamoDB table - The resource type is table
and the unique identifier is the resource ID.
+ * Example: table/my-table
.
DynamoDB global secondary index - The resource type is index
and the unique identifier is the resource ID.
+ * Example: table/my-table/index/my-table-index
.
Aurora DB cluster - The resource type is cluster
and the unique identifier is the cluster name.
+ * Example: cluster:my-db-cluster
.
The scalable dimension associated with the resource.
+ *
+ * autoscaling:autoScalingGroup:DesiredCapacity
- The desired capacity of an Auto Scaling group.
+ * ecs:service:DesiredCount
- The desired task count of an ECS service.
+ * ec2:spot-fleet-request:TargetCapacity
- The target capacity of a Spot Fleet request.
+ * dynamodb:table:ReadCapacityUnits
- The provisioned read capacity for a DynamoDB table.
+ * dynamodb:table:WriteCapacityUnits
- The provisioned write capacity for a DynamoDB table.
+ * dynamodb:index:ReadCapacityUnits
- The provisioned read capacity for a DynamoDB global secondary index.
+ * dynamodb:index:WriteCapacityUnits
- The provisioned write capacity for a DynamoDB global secondary index.
+ * rds:cluster:ReadReplicaCount
- The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.
Controls whether a resource's externally created scaling policies are kept or replaced.
+ *The default value is KeepExternalPolicies
. If the parameter is set to
+ * ReplaceExternalPolicies
, any scaling policies that are external to AWS Auto Scaling
+ * are deleted and new target tracking scaling policies created.
Only valid when configuring dynamic scaling.
+ *Condition: The number of existing policies to be replaced must be less than or equal to + * 50. If there are more than 50 policies to be replaced, AWS Auto Scaling keeps all existing policies + * and does not create new ones.
+ * + */ + ScalingPolicyUpdateBehavior?: ScalingPolicyUpdateBehavior | string; + + /** + * + *The amount of time, in seconds, to buffer the run time of scheduled scaling actions when + * scaling out. For example, if the forecast says to add capacity at 10:00 AM, and the buffer + * time is 5 minutes, then the run time of the corresponding scheduled scaling action will be + * 9:55 AM. The intention is to give resources time to be provisioned. For example, it can + * take a few minutes to launch an EC2 instance. The actual amount of time required depends on + * several factors, such as the size of the instance and whether there are startup scripts to + * complete.
+ *The value must be less than the forecast interval duration of 3600 seconds (60 minutes). + * The default is 300 seconds.
+ *Only valid when configuring predictive scaling.
+ * + */ + ScheduledActionBufferTime?: number; + + /** + * + *The namespace of the AWS service.
+ * + */ + ServiceNamespace: ServiceNamespace | string | undefined; + + /** + * + *The structure that defines new target tracking configurations (up to 10). Each of these + * structures includes a specific scaling metric and a target value for the metric, along with + * various parameters to use with dynamic scaling.
+ *With predictive scaling and dynamic scaling, the resource scales based on the target + * tracking configuration that provides the largest capacity for both scale in and scale out.
+ *Condition: The scaling metric must be unique across target tracking + * configurations.
+ * + */ + TargetTrackingConfigurations: ArrayRepresents a scaling plan.
+ * + */ +export interface ScalingPlan { + __type?: "ScalingPlan"; + /** + * + *The application source.
+ * + */ + ApplicationSource: ApplicationSource | undefined; + + /** + * + *The Unix time stamp when the scaling plan was created.
+ * + */ + CreationTime?: Date; + + /** + * + *The scaling instructions.
+ * + */ + ScalingInstructions: ArrayThe name of the scaling plan.
+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *The version number of the scaling plan.
+ * + */ + ScalingPlanVersion: number | undefined; + + /** + * + *The status of the scaling plan.
+ *
+ * Active
- The scaling plan is active.
+ * ActiveWithProblems
- The scaling plan is active, but the scaling
+ * configuration for one or more resources could not be applied.
+ * CreationInProgress
- The scaling plan is being created.
+ * CreationFailed
- The scaling plan could not be created.
+ * DeletionInProgress
- The scaling plan is being deleted.
+ * DeletionFailed
- The scaling plan could not be deleted.
+ * UpdateInProgress
- The scaling plan is being updated.
+ * UpdateFailed
- The scaling plan could not be updated.
A simple message about the current status of the scaling plan.
+ * + */ + StatusMessage?: string; + + /** + * + *The Unix time stamp when the scaling plan entered the current status.
+ * + */ + StatusStartTime?: Date; +} + +export namespace ScalingPlan { + export function isa(o: any): o is ScalingPlan { + return _smithy.isa(o, "ScalingPlan"); + } +} + +/** + * + *Represents a scalable resource.
+ * + */ +export interface ScalingPlanResource { + __type?: "ScalingPlanResource"; + /** + * + *The ID of the resource. This string consists of the resource type and unique + * identifier.
+ *Auto Scaling group - The resource type is autoScalingGroup
and the unique identifier is the
+ * name of the Auto Scaling group. Example: autoScalingGroup/my-asg
.
ECS service - The resource type is service
and the unique identifier is the cluster name
+ * and service name. Example: service/default/sample-webapp
.
Spot Fleet request - The resource type is spot-fleet-request
and the unique identifier is the
+ * Spot Fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
.
DynamoDB table - The resource type is table
and the unique identifier is the resource ID.
+ * Example: table/my-table
.
DynamoDB global secondary index - The resource type is index
and the unique identifier is the resource ID.
+ * Example: table/my-table/index/my-table-index
.
Aurora DB cluster - The resource type is cluster
and the unique identifier is the cluster name.
+ * Example: cluster:my-db-cluster
.
The scalable dimension for the resource.
+ *
+ * autoscaling:autoScalingGroup:DesiredCapacity
- The desired capacity of an Auto Scaling group.
+ * ecs:service:DesiredCount
- The desired task count of an ECS service.
+ * ec2:spot-fleet-request:TargetCapacity
- The target capacity of a Spot Fleet request.
+ * dynamodb:table:ReadCapacityUnits
- The provisioned read capacity for a DynamoDB table.
+ * dynamodb:table:WriteCapacityUnits
- The provisioned write capacity for a DynamoDB table.
+ * dynamodb:index:ReadCapacityUnits
- The provisioned read capacity for a DynamoDB global secondary index.
+ * dynamodb:index:WriteCapacityUnits
- The provisioned write capacity for a DynamoDB global secondary index.
+ * rds:cluster:ReadReplicaCount
- The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.
The name of the scaling plan.
+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *The version number of the scaling plan.
+ * + */ + ScalingPlanVersion: number | undefined; + + /** + * + *The scaling policies.
+ * + */ + ScalingPolicies?: ArrayThe scaling status of the resource.
+ *
+ * Active
- The scaling configuration is active.
+ * Inactive
- The scaling configuration is not active because the
+ * scaling plan is being created or the scaling configuration could not be applied.
+ * Check the status message for more information.
+ * PartiallyActive
- The scaling configuration is partially active
+ * because the scaling plan is being created or deleted or the scaling configuration
+ * could not be fully applied. Check the status message for more information.
A simple message about the current scaling status of the resource.
+ * + */ + ScalingStatusMessage?: string; + + /** + * + *The namespace of the AWS service.
+ * + */ + ServiceNamespace: ServiceNamespace | string | undefined; +} + +export namespace ScalingPlanResource { + export function isa(o: any): o is ScalingPlanResource { + return _smithy.isa(o, "ScalingPlanResource"); + } +} + +export enum ScalingPlanStatusCode { + Active = "Active", + ActiveWithProblems = "ActiveWithProblems", + CreationFailed = "CreationFailed", + CreationInProgress = "CreationInProgress", + DeletionFailed = "DeletionFailed", + DeletionInProgress = "DeletionInProgress", + UpdateFailed = "UpdateFailed", + UpdateInProgress = "UpdateInProgress" +} + +/** + * + *Represents a scaling policy.
+ * + */ +export interface ScalingPolicy { + __type?: "ScalingPolicy"; + /** + * + *The name of the scaling policy.
+ * + */ + PolicyName: string | undefined; + + /** + * + *The type of scaling policy.
+ * + */ + PolicyType: PolicyType | string | undefined; + + /** + * + *The target tracking scaling policy. Includes support for predefined or customized + * metrics.
+ * + */ + TargetTrackingConfiguration?: TargetTrackingConfiguration; +} + +export namespace ScalingPolicy { + export function isa(o: any): o is ScalingPolicy { + return _smithy.isa(o, "ScalingPolicy"); + } +} + +export enum ScalingPolicyUpdateBehavior { + KeepExternalPolicies = "KeepExternalPolicies", + ReplaceExternalPolicies = "ReplaceExternalPolicies" +} + +export enum ScalingStatusCode { + Active = "Active", + Inactive = "Inactive", + PartiallyActive = "PartiallyActive" +} + +export enum ServiceNamespace { + AUTOSCALING = "autoscaling", + DYNAMODB = "dynamodb", + EC2 = "ec2", + ECS = "ecs", + RDS = "rds" +} + +/** + * + *Represents a tag.
+ * + */ +export interface TagFilter { + __type?: "TagFilter"; + /** + * + *The tag key.
+ * + */ + Key?: string; + + /** + * + *The tag values (0 to 20).
+ * + */ + Values?: ArrayDescribes a target tracking configuration to use with AWS Auto Scaling. Used with ScalingInstruction and ScalingPolicy.
+ * + */ +export interface TargetTrackingConfiguration { + __type?: "TargetTrackingConfiguration"; + /** + * + *A customized metric. You can specify either a predefined metric or a customized metric. + *
+ * + */ + CustomizedScalingMetricSpecification?: CustomizedScalingMetricSpecification; + + /** + * + *Indicates whether scale in by the target tracking scaling policy is disabled. If the
+ * value is true
, scale in is disabled and the target tracking scaling policy
+ * doesn't remove capacity from the scalable resource. Otherwise, scale in is enabled and the
+ * target tracking scaling policy can remove capacity from the scalable resource.
The default value is false
.
The estimated time, in seconds, until a newly launched instance can contribute to the + * CloudWatch metrics. This value is used only if the resource is an Auto Scaling group.
+ * + */ + EstimatedInstanceWarmup?: number; + + /** + * + *A predefined metric. You can specify either a predefined metric or a customized + * metric.
+ * + */ + PredefinedScalingMetricSpecification?: PredefinedScalingMetricSpecification; + + /** + * + *The amount of time, in seconds, after a scale in activity completes before another scale + * in activity can start. This value is not used if the scalable resource is an Auto Scaling + * group.
+ *The cooldown period is used to block subsequent scale in requests until it has expired. + * The intention is to scale in conservatively to protect your application's availability. + * However, if another alarm triggers a scale-out policy during the cooldown period after a + * scale-in, AWS Auto Scaling scales out your scalable target immediately.
+ * + */ + ScaleInCooldown?: number; + + /** + * + *The amount of time, in seconds, after a scale-out activity completes before another + * scale-out activity can start. This value is not used if the scalable resource is an Auto + * Scaling group.
+ *While the cooldown period is in effect, the capacity that has been added by the previous + * scale-out event that initiated the cooldown is calculated as part of the desired capacity + * for the next scale out. The intention is to continuously (but not excessively) scale + * out.
+ * + */ + ScaleOutCooldown?: number; + + /** + * + *The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) + * or 2e-360 to 2e360 (Base 2).
+ * + */ + TargetValue: number | undefined; +} + +export namespace TargetTrackingConfiguration { + export function isa(o: any): o is TargetTrackingConfiguration { + return _smithy.isa(o, "TargetTrackingConfiguration"); + } +} + +export interface UpdateScalingPlanRequest { + __type?: "UpdateScalingPlanRequest"; + /** + * + *A CloudFormation stack or set of tags.
+ * + */ + ApplicationSource?: ApplicationSource; + + /** + * + *The scaling instructions.
+ * + */ + ScalingInstructions?: ArrayThe name of the scaling plan.
+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *The version number of the scaling plan.
+ * + */ + ScalingPlanVersion: number | undefined; +} + +export namespace UpdateScalingPlanRequest { + export function isa(o: any): o is UpdateScalingPlanRequest { + return _smithy.isa(o, "UpdateScalingPlanRequest"); + } +} + +export interface UpdateScalingPlanResponse extends $MetadataBearer { + __type?: "UpdateScalingPlanResponse"; +} + +export namespace UpdateScalingPlanResponse { + export function isa(o: any): o is UpdateScalingPlanResponse { + return _smithy.isa(o, "UpdateScalingPlanResponse"); + } +} + +/** + * + *An exception was thrown for a validation issue. Review the parameters provided.
+ * + */ +export interface ValidationException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ValidationException"; + $fault: "client"; + Message?: string; +} + +export namespace ValidationException { + export function isa(o: any): o is ValidationException { + return _smithy.isa(o, "ValidationException"); + } +} diff --git a/clients/client-auto-scaling-plans/package.json b/clients/client-auto-scaling-plans/package.json new file mode 100644 index 000000000000..fb02043882b0 --- /dev/null +++ b/clients/client-auto-scaling-plans/package.json @@ -0,0 +1,75 @@ +{ + "name": "@aws-sdk/client-auto-scaling-plans", + "description": "@aws-sdk/client-auto-scaling-plans client", + "version": "1.0.0", + "scripts": { + "clean": "npm run remove-definitions && npm run remove-dist && npm run remove-js && npm run remove-maps", + "build-documentation": "npm run clean && typedoc ./", + "prepublishOnly": "yarn build", + "pretest": "tsc", + "remove-definitions": "rimraf ./types", + "remove-dist": "rimraf ./dist", + "remove-documentation": "rimraf ./docs", + "remove-js": "rimraf *.js && rimraf ./commands/*.js && rimraf ./models/*.js && rimraf ./protocols/*.js", + "remove-maps": "rimraf *.js.map && rimraf ./commands/*.js.map && rimraf ./models/*.js.map && rimraf ./protocols/*.js.map", + "test": "exit 0", + "smoke-test": "npm run pretest && node ./test/smoke/index.spec.js", + "build:es": "tsc -p tsconfig.es.json", + "build": "yarn pretest && yarn build:es" + }, + "main": "./dist/cjs/index.js", + "types": "./types/index.d.ts", + "module": "./dist/es/index.js", + "browser": { + "./runtimeConfig": "./runtimeConfig.browser" + }, + "sideEffects": false, + "dependencies": { + "tslib": "^1.8.0", + "@aws-crypto/sha256-browser": "^0.1.0-preview.1", + "@aws-sdk/config-resolver": "^0.1.0-preview.5", + "@aws-sdk/credential-provider-node": "^0.1.0-preview.7", + "@aws-sdk/fetch-http-handler": "^0.1.0-preview.5", + "@aws-sdk/hash-node": "^0.1.0-preview.5", + "@aws-sdk/invalid-dependency": "^0.1.0-preview.1", + "@aws-sdk/middleware-content-length": "^0.1.0-preview.5", + "@aws-sdk/middleware-host-header": "^0.1.0-preview.1", + "@aws-sdk/middleware-retry": "^0.1.0-preview.5", + "@aws-sdk/middleware-serde": "^0.1.0-preview.1", + "@aws-sdk/middleware-signing": "^0.1.0-preview.7", + "@aws-sdk/middleware-stack": "^0.1.0-preview.6", + "@aws-sdk/middleware-user-agent": "^0.1.0-preview.1", + "@aws-sdk/node-http-handler": "^0.1.0-preview.6", + "@aws-sdk/protocol-http": "^0.1.0-preview.1", + "@aws-sdk/region-provider": "^0.1.0-preview.5", + "@aws-sdk/smithy-client": "^0.1.0-preview.1", + "@aws-sdk/stream-collector-browser": "^0.1.0-preview.5", + "@aws-sdk/stream-collector-node": "^0.1.0-preview.6", + "@aws-sdk/types": "^0.1.0-preview.5", + "@aws-sdk/url-parser-browser": "^0.1.0-preview.5", + "@aws-sdk/url-parser-node": "^0.1.0-preview.5", + "@aws-sdk/util-base64-browser": "^0.1.0-preview.3", + "@aws-sdk/util-base64-node": "^0.1.0-preview.3", + "@aws-sdk/util-body-length-browser": "^0.1.0-preview.3", + "@aws-sdk/util-body-length-node": "^0.1.0-preview.4", + "@aws-sdk/util-user-agent-browser": "^0.1.0-preview.6", + "@aws-sdk/util-user-agent-node": "^0.1.0-preview.6", + "@aws-sdk/util-utf8-browser": "^0.1.0-preview.3", + "@aws-sdk/util-utf8-node": "^0.1.0-preview.3" + }, + "devDependencies": { + "rimraf": "^3.0.0", + "typedoc": "^0.15.0", + "typescript": "^3.6.3", + "@types/node": "^12.7.5", + "tslib": "^1.8.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" +} diff --git a/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts b/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts new file mode 100644 index 000000000000..dff920182be3 --- /dev/null +++ b/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts @@ -0,0 +1,1907 @@ +import { + CreateScalingPlanCommandInput, + CreateScalingPlanCommandOutput +} from "../commands/CreateScalingPlanCommand"; +import { + DeleteScalingPlanCommandInput, + DeleteScalingPlanCommandOutput +} from "../commands/DeleteScalingPlanCommand"; +import { + DescribeScalingPlanResourcesCommandInput, + DescribeScalingPlanResourcesCommandOutput +} from "../commands/DescribeScalingPlanResourcesCommand"; +import { + DescribeScalingPlansCommandInput, + DescribeScalingPlansCommandOutput +} from "../commands/DescribeScalingPlansCommand"; +import { + GetScalingPlanResourceForecastDataCommandInput, + GetScalingPlanResourceForecastDataCommandOutput +} from "../commands/GetScalingPlanResourceForecastDataCommand"; +import { + UpdateScalingPlanCommandInput, + UpdateScalingPlanCommandOutput +} from "../commands/UpdateScalingPlanCommand"; +import { + ApplicationSource, + ConcurrentUpdateException, + CreateScalingPlanRequest, + CreateScalingPlanResponse, + CustomizedLoadMetricSpecification, + CustomizedScalingMetricSpecification, + Datapoint, + DeleteScalingPlanRequest, + DeleteScalingPlanResponse, + DescribeScalingPlanResourcesRequest, + DescribeScalingPlanResourcesResponse, + DescribeScalingPlansRequest, + DescribeScalingPlansResponse, + GetScalingPlanResourceForecastDataRequest, + GetScalingPlanResourceForecastDataResponse, + InternalServiceException, + InvalidNextTokenException, + LimitExceededException, + MetricDimension, + ObjectNotFoundException, + PredefinedLoadMetricSpecification, + PredefinedScalingMetricSpecification, + ScalingInstruction, + ScalingPlan, + ScalingPlanResource, + ScalingPolicy, + TagFilter, + TargetTrackingConfiguration, + UpdateScalingPlanRequest, + UpdateScalingPlanResponse, + ValidationException +} from "../models/index"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { SmithyException as __SmithyException } from "@aws-sdk/smithy-client"; +import { + Endpoint as __Endpoint, + MetadataBearer as __MetadataBearer, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext +} from "@aws-sdk/types"; + +export async function serializeAws_json1_1CreateScalingPlanCommand( + input: CreateScalingPlanCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.CreateScalingPlan"; + let body: any = {}; + const wrappedBody: any = { + CreateScalingPlanRequest: serializeAws_json1_1CreateScalingPlanRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/CreateScalingPlan", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DeleteScalingPlanCommand( + input: DeleteScalingPlanCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.DeleteScalingPlan"; + let body: any = {}; + const wrappedBody: any = { + DeleteScalingPlanRequest: serializeAws_json1_1DeleteScalingPlanRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DeleteScalingPlan", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeScalingPlanResourcesCommand( + input: DescribeScalingPlanResourcesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources"; + let body: any = {}; + const wrappedBody: any = { + DescribeScalingPlanResourcesRequest: serializeAws_json1_1DescribeScalingPlanResourcesRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeScalingPlanResources", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeScalingPlansCommand( + input: DescribeScalingPlansCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.DescribeScalingPlans"; + let body: any = {}; + const wrappedBody: any = { + DescribeScalingPlansRequest: serializeAws_json1_1DescribeScalingPlansRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeScalingPlans", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1GetScalingPlanResourceForecastDataCommand( + input: GetScalingPlanResourceForecastDataCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.GetScalingPlanResourceForecastData"; + let body: any = {}; + const wrappedBody: any = { + GetScalingPlanResourceForecastDataRequest: serializeAws_json1_1GetScalingPlanResourceForecastDataRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/GetScalingPlanResourceForecastData", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1UpdateScalingPlanCommand( + input: UpdateScalingPlanCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.UpdateScalingPlan"; + let body: any = {}; + const wrappedBody: any = { + UpdateScalingPlanRequest: serializeAws_json1_1UpdateScalingPlanRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/UpdateScalingPlan", + headers: headers, + body: body + }); +} + +export async function deserializeAws_json1_1CreateScalingPlanCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise