From d8a4d0be89ed034217e1b011a284c082719e194d Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 21 Nov 2024 19:24:38 +0000 Subject: [PATCH] feat(client-application-auto-scaling): Application Auto Scaling now supports Predictive Scaling to proactively increase the desired capacity ahead of predicted demand, ensuring improved availability and responsiveness for customers' applications. This feature is currently only made available for Amazon ECS Service scalable targets. --- .../client-application-auto-scaling/README.md | 8 + .../src/ApplicationAutoScaling.ts | 23 + .../src/ApplicationAutoScalingClient.ts | 6 + .../DescribeScalableTargetsCommand.ts | 1 + .../DescribeScalingPoliciesCommand.ts | 97 ++- .../GetPredictiveScalingForecastCommand.ts | 224 +++++++ .../src/commands/PutScalingPolicyCommand.ts | 97 ++- .../src/commands/index.ts | 1 + .../src/models/models_0.ts | 592 ++++++++++++++++- .../src/protocols/Aws_json1_1.ts | 279 ++++++++ .../aws-models/application-auto-scaling.json | 606 +++++++++++++++++- 11 files changed, 1930 insertions(+), 4 deletions(-) create mode 100644 clients/client-application-auto-scaling/src/commands/GetPredictiveScalingForecastCommand.ts diff --git a/clients/client-application-auto-scaling/README.md b/clients/client-application-auto-scaling/README.md index 0a836cfc1dd1..73535b1a32d4 100644 --- a/clients/client-application-auto-scaling/README.md +++ b/clients/client-application-auto-scaling/README.md @@ -340,6 +340,14 @@ DescribeScheduledActions [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/application-auto-scaling/command/DescribeScheduledActionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-application-auto-scaling/Interface/DescribeScheduledActionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-application-auto-scaling/Interface/DescribeScheduledActionsCommandOutput/) + +
+ +GetPredictiveScalingForecast + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/application-auto-scaling/command/GetPredictiveScalingForecastCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-application-auto-scaling/Interface/GetPredictiveScalingForecastCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-application-auto-scaling/Interface/GetPredictiveScalingForecastCommandOutput/) +
diff --git a/clients/client-application-auto-scaling/src/ApplicationAutoScaling.ts b/clients/client-application-auto-scaling/src/ApplicationAutoScaling.ts index 2d9a6796a1e2..3e6d37dbee27 100644 --- a/clients/client-application-auto-scaling/src/ApplicationAutoScaling.ts +++ b/clients/client-application-auto-scaling/src/ApplicationAutoScaling.ts @@ -38,6 +38,11 @@ import { DescribeScheduledActionsCommandInput, DescribeScheduledActionsCommandOutput, } from "./commands/DescribeScheduledActionsCommand"; +import { + GetPredictiveScalingForecastCommand, + GetPredictiveScalingForecastCommandInput, + GetPredictiveScalingForecastCommandOutput, +} from "./commands/GetPredictiveScalingForecastCommand"; import { ListTagsForResourceCommand, ListTagsForResourceCommandInput, @@ -73,6 +78,7 @@ const commands = { DescribeScalingActivitiesCommand, DescribeScalingPoliciesCommand, DescribeScheduledActionsCommand, + GetPredictiveScalingForecastCommand, ListTagsForResourceCommand, PutScalingPolicyCommand, PutScheduledActionCommand, @@ -201,6 +207,23 @@ export interface ApplicationAutoScaling { cb: (err: any, data?: DescribeScheduledActionsCommandOutput) => void ): void; + /** + * @see {@link GetPredictiveScalingForecastCommand} + */ + getPredictiveScalingForecast( + args: GetPredictiveScalingForecastCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getPredictiveScalingForecast( + args: GetPredictiveScalingForecastCommandInput, + cb: (err: any, data?: GetPredictiveScalingForecastCommandOutput) => void + ): void; + getPredictiveScalingForecast( + args: GetPredictiveScalingForecastCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetPredictiveScalingForecastCommandOutput) => void + ): void; + /** * @see {@link ListTagsForResourceCommand} */ diff --git a/clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts b/clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts index 3aa821a30346..89d284b1626a 100644 --- a/clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts +++ b/clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts @@ -81,6 +81,10 @@ import { DescribeScheduledActionsCommandInput, DescribeScheduledActionsCommandOutput, } from "./commands/DescribeScheduledActionsCommand"; +import { + GetPredictiveScalingForecastCommandInput, + GetPredictiveScalingForecastCommandOutput, +} from "./commands/GetPredictiveScalingForecastCommand"; import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput, @@ -115,6 +119,7 @@ export type ServiceInputTypes = | DescribeScalingActivitiesCommandInput | DescribeScalingPoliciesCommandInput | DescribeScheduledActionsCommandInput + | GetPredictiveScalingForecastCommandInput | ListTagsForResourceCommandInput | PutScalingPolicyCommandInput | PutScheduledActionCommandInput @@ -133,6 +138,7 @@ export type ServiceOutputTypes = | DescribeScalingActivitiesCommandOutput | DescribeScalingPoliciesCommandOutput | DescribeScheduledActionsCommandOutput + | GetPredictiveScalingForecastCommandOutput | ListTagsForResourceCommandOutput | PutScalingPolicyCommandOutput | PutScheduledActionCommandOutput diff --git a/clients/client-application-auto-scaling/src/commands/DescribeScalableTargetsCommand.ts b/clients/client-application-auto-scaling/src/commands/DescribeScalableTargetsCommand.ts index 1ab182178892..da3f76181b8a 100644 --- a/clients/client-application-auto-scaling/src/commands/DescribeScalableTargetsCommand.ts +++ b/clients/client-application-auto-scaling/src/commands/DescribeScalableTargetsCommand.ts @@ -60,6 +60,7 @@ export interface DescribeScalableTargetsCommandOutput extends DescribeScalableTa * // ScalableDimension: "ecs:service:DesiredCount" || "ec2:spot-fleet-request:TargetCapacity" || "elasticmapreduce:instancegroup:InstanceCount" || "appstream:fleet:DesiredCapacity" || "dynamodb:table:ReadCapacityUnits" || "dynamodb:table:WriteCapacityUnits" || "dynamodb:index:ReadCapacityUnits" || "dynamodb:index:WriteCapacityUnits" || "rds:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredInstanceCount" || "custom-resource:ResourceType:Property" || "comprehend:document-classifier-endpoint:DesiredInferenceUnits" || "comprehend:entity-recognizer-endpoint:DesiredInferenceUnits" || "lambda:function:ProvisionedConcurrency" || "cassandra:table:ReadCapacityUnits" || "cassandra:table:WriteCapacityUnits" || "kafka:broker-storage:VolumeSize" || "elasticache:replication-group:NodeGroups" || "elasticache:replication-group:Replicas" || "neptune:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredProvisionedConcurrency" || "sagemaker:inference-component:DesiredCopyCount" || "workspaces:workspacespool:DesiredUserSessions", // required * // MinCapacity: Number("int"), // required * // MaxCapacity: Number("int"), // required + * // PredictedCapacity: Number("int"), * // RoleARN: "STRING_VALUE", // required * // CreationTime: new Date("TIMESTAMP"), // required * // SuspendedState: { // SuspendedState diff --git a/clients/client-application-auto-scaling/src/commands/DescribeScalingPoliciesCommand.ts b/clients/client-application-auto-scaling/src/commands/DescribeScalingPoliciesCommand.ts index defd620795a5..ed2a67d56421 100644 --- a/clients/client-application-auto-scaling/src/commands/DescribeScalingPoliciesCommand.ts +++ b/clients/client-application-auto-scaling/src/commands/DescribeScalingPoliciesCommand.ts @@ -62,7 +62,7 @@ export interface DescribeScalingPoliciesCommandOutput extends DescribeScalingPol * // ServiceNamespace: "ecs" || "elasticmapreduce" || "ec2" || "appstream" || "dynamodb" || "rds" || "sagemaker" || "custom-resource" || "comprehend" || "lambda" || "cassandra" || "kafka" || "elasticache" || "neptune" || "workspaces", // required * // ResourceId: "STRING_VALUE", // required * // ScalableDimension: "ecs:service:DesiredCount" || "ec2:spot-fleet-request:TargetCapacity" || "elasticmapreduce:instancegroup:InstanceCount" || "appstream:fleet:DesiredCapacity" || "dynamodb:table:ReadCapacityUnits" || "dynamodb:table:WriteCapacityUnits" || "dynamodb:index:ReadCapacityUnits" || "dynamodb:index:WriteCapacityUnits" || "rds:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredInstanceCount" || "custom-resource:ResourceType:Property" || "comprehend:document-classifier-endpoint:DesiredInferenceUnits" || "comprehend:entity-recognizer-endpoint:DesiredInferenceUnits" || "lambda:function:ProvisionedConcurrency" || "cassandra:table:ReadCapacityUnits" || "cassandra:table:WriteCapacityUnits" || "kafka:broker-storage:VolumeSize" || "elasticache:replication-group:NodeGroups" || "elasticache:replication-group:Replicas" || "neptune:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredProvisionedConcurrency" || "sagemaker:inference-component:DesiredCopyCount" || "workspaces:workspacespool:DesiredUserSessions", // required - * // PolicyType: "StepScaling" || "TargetTrackingScaling", // required + * // PolicyType: "StepScaling" || "TargetTrackingScaling" || "PredictiveScaling", // required * // StepScalingPolicyConfiguration: { // StepScalingPolicyConfiguration * // AdjustmentType: "ChangeInCapacity" || "PercentChangeInCapacity" || "ExactCapacity", * // StepAdjustments: [ // StepAdjustments @@ -120,6 +120,101 @@ export interface DescribeScalingPoliciesCommandOutput extends DescribeScalingPol * // ScaleInCooldown: Number("int"), * // DisableScaleIn: true || false, * // }, + * // PredictiveScalingPolicyConfiguration: { // PredictiveScalingPolicyConfiguration + * // MetricSpecifications: [ // PredictiveScalingMetricSpecifications // required + * // { // PredictiveScalingMetricSpecification + * // TargetValue: Number("double"), // required + * // PredefinedMetricPairSpecification: { // PredictiveScalingPredefinedMetricPairSpecification + * // PredefinedMetricType: "STRING_VALUE", // required + * // ResourceLabel: "STRING_VALUE", + * // }, + * // PredefinedScalingMetricSpecification: { // PredictiveScalingPredefinedScalingMetricSpecification + * // PredefinedMetricType: "STRING_VALUE", // required + * // ResourceLabel: "STRING_VALUE", + * // }, + * // PredefinedLoadMetricSpecification: { // PredictiveScalingPredefinedLoadMetricSpecification + * // PredefinedMetricType: "STRING_VALUE", // required + * // ResourceLabel: "STRING_VALUE", + * // }, + * // CustomizedScalingMetricSpecification: { // PredictiveScalingCustomizedMetricSpecification + * // MetricDataQueries: [ // PredictiveScalingMetricDataQueries // required + * // { // PredictiveScalingMetricDataQuery + * // Id: "STRING_VALUE", // required + * // Expression: "STRING_VALUE", + * // MetricStat: { // PredictiveScalingMetricStat + * // Metric: { // PredictiveScalingMetric + * // Dimensions: [ // PredictiveScalingMetricDimensions + * // { // PredictiveScalingMetricDimension + * // Name: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // MetricName: "STRING_VALUE", + * // Namespace: "STRING_VALUE", + * // }, + * // Stat: "STRING_VALUE", // required + * // Unit: "STRING_VALUE", + * // }, + * // Label: "STRING_VALUE", + * // ReturnData: true || false, + * // }, + * // ], + * // }, + * // CustomizedLoadMetricSpecification: { + * // MetricDataQueries: [ // required + * // { + * // Id: "STRING_VALUE", // required + * // Expression: "STRING_VALUE", + * // MetricStat: { + * // Metric: { + * // Dimensions: [ + * // { + * // Name: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // MetricName: "STRING_VALUE", + * // Namespace: "STRING_VALUE", + * // }, + * // Stat: "STRING_VALUE", // required + * // Unit: "STRING_VALUE", + * // }, + * // Label: "STRING_VALUE", + * // ReturnData: true || false, + * // }, + * // ], + * // }, + * // CustomizedCapacityMetricSpecification: { + * // MetricDataQueries: [ // required + * // { + * // Id: "STRING_VALUE", // required + * // Expression: "STRING_VALUE", + * // MetricStat: { + * // Metric: { + * // Dimensions: [ + * // { + * // Name: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // MetricName: "STRING_VALUE", + * // Namespace: "STRING_VALUE", + * // }, + * // Stat: "STRING_VALUE", // required + * // Unit: "STRING_VALUE", + * // }, + * // Label: "STRING_VALUE", + * // ReturnData: true || false, + * // }, + * // ], + * // }, + * // }, + * // ], + * // Mode: "ForecastOnly" || "ForecastAndScale", + * // SchedulingBufferTime: Number("int"), + * // MaxCapacityBreachBehavior: "HonorMaxCapacity" || "IncreaseMaxCapacity", + * // MaxCapacityBuffer: Number("int"), + * // }, * // Alarms: [ // Alarms * // { // Alarm * // AlarmName: "STRING_VALUE", // required diff --git a/clients/client-application-auto-scaling/src/commands/GetPredictiveScalingForecastCommand.ts b/clients/client-application-auto-scaling/src/commands/GetPredictiveScalingForecastCommand.ts new file mode 100644 index 000000000000..07dbe815e3cb --- /dev/null +++ b/clients/client-application-auto-scaling/src/commands/GetPredictiveScalingForecastCommand.ts @@ -0,0 +1,224 @@ +// 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 { + ApplicationAutoScalingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../ApplicationAutoScalingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { GetPredictiveScalingForecastRequest, GetPredictiveScalingForecastResponse } from "../models/models_0"; +import { + de_GetPredictiveScalingForecastCommand, + se_GetPredictiveScalingForecastCommand, +} from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetPredictiveScalingForecastCommand}. + */ +export interface GetPredictiveScalingForecastCommandInput extends GetPredictiveScalingForecastRequest {} +/** + * @public + * + * The output of {@link GetPredictiveScalingForecastCommand}. + */ +export interface GetPredictiveScalingForecastCommandOutput + extends GetPredictiveScalingForecastResponse, + __MetadataBearer {} + +/** + *

Retrieves the forecast data for a predictive scaling policy.

+ *

Load forecasts are predictions of the hourly load values using historical load data + * from CloudWatch and an analysis of historical trends. Capacity forecasts are represented as + * predicted values for the minimum capacity that is needed on an hourly basis, based on + * the hourly load forecast.

+ *

A minimum of 24 hours of data is required to create the initial forecasts. However, + * having a full 14 days of historical data results in more accurate forecasts.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ApplicationAutoScalingClient, GetPredictiveScalingForecastCommand } from "@aws-sdk/client-application-auto-scaling"; // ES Modules import + * // const { ApplicationAutoScalingClient, GetPredictiveScalingForecastCommand } = require("@aws-sdk/client-application-auto-scaling"); // CommonJS import + * const client = new ApplicationAutoScalingClient(config); + * const input = { // GetPredictiveScalingForecastRequest + * ServiceNamespace: "ecs" || "elasticmapreduce" || "ec2" || "appstream" || "dynamodb" || "rds" || "sagemaker" || "custom-resource" || "comprehend" || "lambda" || "cassandra" || "kafka" || "elasticache" || "neptune" || "workspaces", // required + * ResourceId: "STRING_VALUE", // required + * ScalableDimension: "ecs:service:DesiredCount" || "ec2:spot-fleet-request:TargetCapacity" || "elasticmapreduce:instancegroup:InstanceCount" || "appstream:fleet:DesiredCapacity" || "dynamodb:table:ReadCapacityUnits" || "dynamodb:table:WriteCapacityUnits" || "dynamodb:index:ReadCapacityUnits" || "dynamodb:index:WriteCapacityUnits" || "rds:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredInstanceCount" || "custom-resource:ResourceType:Property" || "comprehend:document-classifier-endpoint:DesiredInferenceUnits" || "comprehend:entity-recognizer-endpoint:DesiredInferenceUnits" || "lambda:function:ProvisionedConcurrency" || "cassandra:table:ReadCapacityUnits" || "cassandra:table:WriteCapacityUnits" || "kafka:broker-storage:VolumeSize" || "elasticache:replication-group:NodeGroups" || "elasticache:replication-group:Replicas" || "neptune:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredProvisionedConcurrency" || "sagemaker:inference-component:DesiredCopyCount" || "workspaces:workspacespool:DesiredUserSessions", // required + * PolicyName: "STRING_VALUE", // required + * StartTime: new Date("TIMESTAMP"), // required + * EndTime: new Date("TIMESTAMP"), // required + * }; + * const command = new GetPredictiveScalingForecastCommand(input); + * const response = await client.send(command); + * // { // GetPredictiveScalingForecastResponse + * // LoadForecast: [ // LoadForecasts + * // { // LoadForecast + * // Timestamps: [ // PredictiveScalingForecastTimestamps // required + * // new Date("TIMESTAMP"), + * // ], + * // Values: [ // PredictiveScalingForecastValues // required + * // Number("double"), + * // ], + * // MetricSpecification: { // PredictiveScalingMetricSpecification + * // TargetValue: Number("double"), // required + * // PredefinedMetricPairSpecification: { // PredictiveScalingPredefinedMetricPairSpecification + * // PredefinedMetricType: "STRING_VALUE", // required + * // ResourceLabel: "STRING_VALUE", + * // }, + * // PredefinedScalingMetricSpecification: { // PredictiveScalingPredefinedScalingMetricSpecification + * // PredefinedMetricType: "STRING_VALUE", // required + * // ResourceLabel: "STRING_VALUE", + * // }, + * // PredefinedLoadMetricSpecification: { // PredictiveScalingPredefinedLoadMetricSpecification + * // PredefinedMetricType: "STRING_VALUE", // required + * // ResourceLabel: "STRING_VALUE", + * // }, + * // CustomizedScalingMetricSpecification: { // PredictiveScalingCustomizedMetricSpecification + * // MetricDataQueries: [ // PredictiveScalingMetricDataQueries // required + * // { // PredictiveScalingMetricDataQuery + * // Id: "STRING_VALUE", // required + * // Expression: "STRING_VALUE", + * // MetricStat: { // PredictiveScalingMetricStat + * // Metric: { // PredictiveScalingMetric + * // Dimensions: [ // PredictiveScalingMetricDimensions + * // { // PredictiveScalingMetricDimension + * // Name: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // MetricName: "STRING_VALUE", + * // Namespace: "STRING_VALUE", + * // }, + * // Stat: "STRING_VALUE", // required + * // Unit: "STRING_VALUE", + * // }, + * // Label: "STRING_VALUE", + * // ReturnData: true || false, + * // }, + * // ], + * // }, + * // CustomizedLoadMetricSpecification: { + * // MetricDataQueries: [ // required + * // { + * // Id: "STRING_VALUE", // required + * // Expression: "STRING_VALUE", + * // MetricStat: { + * // Metric: { + * // Dimensions: [ + * // { + * // Name: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // MetricName: "STRING_VALUE", + * // Namespace: "STRING_VALUE", + * // }, + * // Stat: "STRING_VALUE", // required + * // Unit: "STRING_VALUE", + * // }, + * // Label: "STRING_VALUE", + * // ReturnData: true || false, + * // }, + * // ], + * // }, + * // CustomizedCapacityMetricSpecification: { + * // MetricDataQueries: [ // required + * // { + * // Id: "STRING_VALUE", // required + * // Expression: "STRING_VALUE", + * // MetricStat: { + * // Metric: { + * // Dimensions: [ + * // { + * // Name: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // MetricName: "STRING_VALUE", + * // Namespace: "STRING_VALUE", + * // }, + * // Stat: "STRING_VALUE", // required + * // Unit: "STRING_VALUE", + * // }, + * // Label: "STRING_VALUE", + * // ReturnData: true || false, + * // }, + * // ], + * // }, + * // }, + * // }, + * // ], + * // CapacityForecast: { // CapacityForecast + * // Timestamps: [ // required + * // new Date("TIMESTAMP"), + * // ], + * // Values: [ // required + * // Number("double"), + * // ], + * // }, + * // UpdateTime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param GetPredictiveScalingForecastCommandInput - {@link GetPredictiveScalingForecastCommandInput} + * @returns {@link GetPredictiveScalingForecastCommandOutput} + * @see {@link GetPredictiveScalingForecastCommandInput} for command's `input` shape. + * @see {@link GetPredictiveScalingForecastCommandOutput} for command's `response` shape. + * @see {@link ApplicationAutoScalingClientResolvedConfig | config} for ApplicationAutoScalingClient's `config` shape. + * + * @throws {@link InternalServiceException} (server fault) + *

The service encountered an internal error.

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

An exception was thrown for a validation issue. Review the available parameters for the + * API request.

+ * + * @throws {@link ApplicationAutoScalingServiceException} + *

Base exception class for all service exceptions from ApplicationAutoScaling service.

+ * + * @public + */ +export class GetPredictiveScalingForecastCommand extends $Command + .classBuilder< + GetPredictiveScalingForecastCommandInput, + GetPredictiveScalingForecastCommandOutput, + ApplicationAutoScalingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: ApplicationAutoScalingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AnyScaleFrontendService", "GetPredictiveScalingForecast", {}) + .n("ApplicationAutoScalingClient", "GetPredictiveScalingForecastCommand") + .f(void 0, void 0) + .ser(se_GetPredictiveScalingForecastCommand) + .de(de_GetPredictiveScalingForecastCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetPredictiveScalingForecastRequest; + output: GetPredictiveScalingForecastResponse; + }; + sdk: { + input: GetPredictiveScalingForecastCommandInput; + output: GetPredictiveScalingForecastCommandOutput; + }; + }; +} diff --git a/clients/client-application-auto-scaling/src/commands/PutScalingPolicyCommand.ts b/clients/client-application-auto-scaling/src/commands/PutScalingPolicyCommand.ts index f170f45496d9..b668885aea8b 100644 --- a/clients/client-application-auto-scaling/src/commands/PutScalingPolicyCommand.ts +++ b/clients/client-application-auto-scaling/src/commands/PutScalingPolicyCommand.ts @@ -68,7 +68,7 @@ export interface PutScalingPolicyCommandOutput extends PutScalingPolicyResponse, * ServiceNamespace: "ecs" || "elasticmapreduce" || "ec2" || "appstream" || "dynamodb" || "rds" || "sagemaker" || "custom-resource" || "comprehend" || "lambda" || "cassandra" || "kafka" || "elasticache" || "neptune" || "workspaces", // required * ResourceId: "STRING_VALUE", // required * ScalableDimension: "ecs:service:DesiredCount" || "ec2:spot-fleet-request:TargetCapacity" || "elasticmapreduce:instancegroup:InstanceCount" || "appstream:fleet:DesiredCapacity" || "dynamodb:table:ReadCapacityUnits" || "dynamodb:table:WriteCapacityUnits" || "dynamodb:index:ReadCapacityUnits" || "dynamodb:index:WriteCapacityUnits" || "rds:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredInstanceCount" || "custom-resource:ResourceType:Property" || "comprehend:document-classifier-endpoint:DesiredInferenceUnits" || "comprehend:entity-recognizer-endpoint:DesiredInferenceUnits" || "lambda:function:ProvisionedConcurrency" || "cassandra:table:ReadCapacityUnits" || "cassandra:table:WriteCapacityUnits" || "kafka:broker-storage:VolumeSize" || "elasticache:replication-group:NodeGroups" || "elasticache:replication-group:Replicas" || "neptune:cluster:ReadReplicaCount" || "sagemaker:variant:DesiredProvisionedConcurrency" || "sagemaker:inference-component:DesiredCopyCount" || "workspaces:workspacespool:DesiredUserSessions", // required - * PolicyType: "StepScaling" || "TargetTrackingScaling", + * PolicyType: "StepScaling" || "TargetTrackingScaling" || "PredictiveScaling", * StepScalingPolicyConfiguration: { // StepScalingPolicyConfiguration * AdjustmentType: "ChangeInCapacity" || "PercentChangeInCapacity" || "ExactCapacity", * StepAdjustments: [ // StepAdjustments @@ -126,6 +126,101 @@ export interface PutScalingPolicyCommandOutput extends PutScalingPolicyResponse, * ScaleInCooldown: Number("int"), * DisableScaleIn: true || false, * }, + * PredictiveScalingPolicyConfiguration: { // PredictiveScalingPolicyConfiguration + * MetricSpecifications: [ // PredictiveScalingMetricSpecifications // required + * { // PredictiveScalingMetricSpecification + * TargetValue: Number("double"), // required + * PredefinedMetricPairSpecification: { // PredictiveScalingPredefinedMetricPairSpecification + * PredefinedMetricType: "STRING_VALUE", // required + * ResourceLabel: "STRING_VALUE", + * }, + * PredefinedScalingMetricSpecification: { // PredictiveScalingPredefinedScalingMetricSpecification + * PredefinedMetricType: "STRING_VALUE", // required + * ResourceLabel: "STRING_VALUE", + * }, + * PredefinedLoadMetricSpecification: { // PredictiveScalingPredefinedLoadMetricSpecification + * PredefinedMetricType: "STRING_VALUE", // required + * ResourceLabel: "STRING_VALUE", + * }, + * CustomizedScalingMetricSpecification: { // PredictiveScalingCustomizedMetricSpecification + * MetricDataQueries: [ // PredictiveScalingMetricDataQueries // required + * { // PredictiveScalingMetricDataQuery + * Id: "STRING_VALUE", // required + * Expression: "STRING_VALUE", + * MetricStat: { // PredictiveScalingMetricStat + * Metric: { // PredictiveScalingMetric + * Dimensions: [ // PredictiveScalingMetricDimensions + * { // PredictiveScalingMetricDimension + * Name: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], + * MetricName: "STRING_VALUE", + * Namespace: "STRING_VALUE", + * }, + * Stat: "STRING_VALUE", // required + * Unit: "STRING_VALUE", + * }, + * Label: "STRING_VALUE", + * ReturnData: true || false, + * }, + * ], + * }, + * CustomizedLoadMetricSpecification: { + * MetricDataQueries: [ // required + * { + * Id: "STRING_VALUE", // required + * Expression: "STRING_VALUE", + * MetricStat: { + * Metric: { + * Dimensions: [ + * { + * Name: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], + * MetricName: "STRING_VALUE", + * Namespace: "STRING_VALUE", + * }, + * Stat: "STRING_VALUE", // required + * Unit: "STRING_VALUE", + * }, + * Label: "STRING_VALUE", + * ReturnData: true || false, + * }, + * ], + * }, + * CustomizedCapacityMetricSpecification: { + * MetricDataQueries: [ // required + * { + * Id: "STRING_VALUE", // required + * Expression: "STRING_VALUE", + * MetricStat: { + * Metric: { + * Dimensions: [ + * { + * Name: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], + * MetricName: "STRING_VALUE", + * Namespace: "STRING_VALUE", + * }, + * Stat: "STRING_VALUE", // required + * Unit: "STRING_VALUE", + * }, + * Label: "STRING_VALUE", + * ReturnData: true || false, + * }, + * ], + * }, + * }, + * ], + * Mode: "ForecastOnly" || "ForecastAndScale", + * SchedulingBufferTime: Number("int"), + * MaxCapacityBreachBehavior: "HonorMaxCapacity" || "IncreaseMaxCapacity", + * MaxCapacityBuffer: Number("int"), + * }, * }; * const command = new PutScalingPolicyCommand(input); * const response = await client.send(command); diff --git a/clients/client-application-auto-scaling/src/commands/index.ts b/clients/client-application-auto-scaling/src/commands/index.ts index f65f1360afe9..16e2dcbe4b98 100644 --- a/clients/client-application-auto-scaling/src/commands/index.ts +++ b/clients/client-application-auto-scaling/src/commands/index.ts @@ -6,6 +6,7 @@ export * from "./DescribeScalableTargetsCommand"; export * from "./DescribeScalingActivitiesCommand"; export * from "./DescribeScalingPoliciesCommand"; export * from "./DescribeScheduledActionsCommand"; +export * from "./GetPredictiveScalingForecastCommand"; export * from "./ListTagsForResourceCommand"; export * from "./PutScalingPolicyCommand"; export * from "./PutScheduledActionCommand"; diff --git a/clients/client-application-auto-scaling/src/models/models_0.ts b/clients/client-application-auto-scaling/src/models/models_0.ts index ee6ccd58e181..76f1ff36a7eb 100644 --- a/clients/client-application-auto-scaling/src/models/models_0.ts +++ b/clients/client-application-auto-scaling/src/models/models_0.ts @@ -1258,6 +1258,14 @@ export interface ScalableTarget { */ MaxCapacity: number | undefined; + /** + *

+ * The predicted capacity of the scalable target. + *

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

The ARN of an IAM role that allows Application Auto Scaling to modify the scalable target on your * behalf.

@@ -2111,6 +2119,7 @@ export interface DescribeScalingPoliciesRequest { * @enum */ export const PolicyType = { + PredictiveScaling: "PredictiveScaling", StepScaling: "StepScaling", TargetTrackingScaling: "TargetTrackingScaling", } as const; @@ -2120,6 +2129,428 @@ export const PolicyType = { */ export type PolicyType = (typeof PolicyType)[keyof typeof PolicyType]; +/** + * @public + * @enum + */ +export const PredictiveScalingMaxCapacityBreachBehavior = { + HonorMaxCapacity: "HonorMaxCapacity", + IncreaseMaxCapacity: "IncreaseMaxCapacity", +} as const; + +/** + * @public + */ +export type PredictiveScalingMaxCapacityBreachBehavior = + (typeof PredictiveScalingMaxCapacityBreachBehavior)[keyof typeof PredictiveScalingMaxCapacityBreachBehavior]; + +/** + *

+ * Describes the dimension of a metric. + *

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

+ * The name of the dimension. + *

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

+ * The value of the dimension. + *

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

+ * Describes the scaling metric. + *

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

+ * Describes the dimensions of the metric. + *

+ * @public + */ + Dimensions?: PredictiveScalingMetricDimension[] | undefined; + + /** + *

+ * The name of the metric. + *

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

+ * The namespace of the metric. + *

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

+ * This structure defines the CloudWatch metric to return, along with the statistic and unit. + *

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

+ * The CloudWatch metric to return, including the metric name, namespace, and dimensions. To + * get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics. + *

+ * @public + */ + Metric: PredictiveScalingMetric | undefined; + + /** + *

+ * The statistic to return. It can include any CloudWatch statistic or extended statistic. For + * a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide. + *

+ *

The most commonly used metrics for predictive scaling are Average and + * Sum.

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

+ * The unit to use for the returned data points. For a complete list of the units that + * CloudWatch supports, see the MetricDatum + * data type in the Amazon CloudWatch API Reference. + *

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

+ * The metric data to return. Also defines whether this call is returning data for one + * metric only, or whether it is performing a math expression on the values of returned + * metric statistics to create a new time series. A time series is a series of data points, + * each of which is associated with a timestamp. + *

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

+ * A short name that identifies the object's results in the response. This name must be + * unique among all MetricDataQuery objects specified for a single scaling + * policy. If you are performing math expressions on this set of data, this name represents + * that data and can serve as a variable in the mathematical expression. The valid + * characters are letters, numbers, and underscores. The first character must be a + * lowercase letter. + *

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

+ * The math expression to perform on the returned data, if this object is performing a + * math expression. This expression can use the Id of the other metrics to + * refer to those metrics, and can also use the Id of other expressions to use + * the result of those expressions. + *

+ *

Conditional: Within each MetricDataQuery object, you must specify either + * Expression or MetricStat, but not both.

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

+ * Information about the metric data to return. + *

+ *

Conditional: Within each MetricDataQuery object, you must specify either + * Expression or MetricStat, but not both.

+ * @public + */ + MetricStat?: PredictiveScalingMetricStat | undefined; + + /** + *

+ * A human-readable label for this metric or expression. This is especially useful if + * this is a math expression, so that you know what the value represents. + *

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

+ * Indicates whether to return the timestamps and raw data values of this metric. + *

+ *

If you use any math expressions, specify true for this value for only the + * final math expression that the metric specification is based on. You must specify + * false for ReturnData for all the other metrics and + * expressions used in the metric specification.

+ *

If you are only retrieving metrics and not performing any math expressions, do not + * specify anything for ReturnData. This sets it to its default + * (true).

+ * @public + */ + ReturnData?: boolean | undefined; +} + +/** + *

+ * Represents a CloudWatch metric of your choosing for a predictive scaling policy. + *

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

+ * One or more metric data queries to provide data points for a metric specification. + *

+ * @public + */ + MetricDataQueries: PredictiveScalingMetricDataQuery[] | undefined; +} + +/** + *

+ * Describes a load metric for a predictive scaling policy. + *

+ *

When returned in the output of DescribePolicies, it indicates that a + * predictive scaling policy uses individually specified load and scaling metrics instead + * of a metric pair.

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

+ * The metric type. + *

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

+ * A label that uniquely identifies a target group. + *

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

+ * Represents a metric pair for a predictive scaling policy. + *

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

+ * Indicates which metrics to use. There are two different types of metrics for each + * metric type: one is a load metric and one is a scaling metric. + *

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

+ * A label that uniquely identifies a specific target group from which to determine + * the total and average request count. + *

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

+ * Describes a scaling metric for a predictive scaling policy. + *

+ *

When returned in the output of DescribePolicies, it indicates that a + * predictive scaling policy uses individually specified load and scaling metrics instead + * of a metric pair.

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

+ * The metric type. + *

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

+ * A label that uniquely identifies a specific target group from which to determine + * the average request count. + *

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

+ * This structure specifies the metrics and target utilization settings for a predictive + * scaling policy. + *

+ *

You must specify either a metric pair, or a load metric and a scaling metric + * individually. Specifying a metric pair instead of individual metrics provides a simpler + * way to configure metrics for a scaling policy. You choose the metric pair, and the + * policy automatically knows the correct sum and average statistics to use for the load + * metric and the scaling metric.

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

+ * Specifies the target utilization. + *

+ * @public + */ + TargetValue: number | undefined; + + /** + *

+ * The predefined metric pair specification that determines the appropriate scaling metric and load metric to use. + *

+ * @public + */ + PredefinedMetricPairSpecification?: PredictiveScalingPredefinedMetricPairSpecification | undefined; + + /** + *

+ * The predefined scaling metric specification. + *

+ * @public + */ + PredefinedScalingMetricSpecification?: PredictiveScalingPredefinedScalingMetricSpecification | undefined; + + /** + *

+ * The predefined load metric specification. + *

+ * @public + */ + PredefinedLoadMetricSpecification?: PredictiveScalingPredefinedLoadMetricSpecification | undefined; + + /** + *

+ * The customized scaling metric specification. + *

+ * @public + */ + CustomizedScalingMetricSpecification?: PredictiveScalingCustomizedMetricSpecification | undefined; + + /** + *

+ * The customized load metric specification. + *

+ * @public + */ + CustomizedLoadMetricSpecification?: PredictiveScalingCustomizedMetricSpecification | undefined; + + /** + *

+ * The customized capacity metric specification. + *

+ * @public + */ + CustomizedCapacityMetricSpecification?: PredictiveScalingCustomizedMetricSpecification | undefined; +} + +/** + * @public + * @enum + */ +export const PredictiveScalingMode = { + ForecastAndScale: "ForecastAndScale", + ForecastOnly: "ForecastOnly", +} as const; + +/** + * @public + */ +export type PredictiveScalingMode = (typeof PredictiveScalingMode)[keyof typeof PredictiveScalingMode]; + +/** + *

+ * Represents a predictive scaling policy configuration. + *

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

+ * This structure includes the metrics and target utilization to use for predictive scaling. + *

+ *

This is an array, but we currently only support a single metric specification. That + * is, you can specify a target value and a single metric pair, or a target value and one + * scaling metric and one load metric.

+ * @public + */ + MetricSpecifications: PredictiveScalingMetricSpecification[] | undefined; + + /** + *

+ * The predictive scaling mode. Defaults to ForecastOnly if not specified. + *

+ * @public + */ + Mode?: PredictiveScalingMode | undefined; + + /** + *

+ * The amount of time, in seconds, that the start time can be advanced. + *

+ *

The value must be less than the forecast interval duration of 3600 seconds (60 + * minutes). Defaults to 300 seconds if not specified.

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

+ * Defines the behavior that should be applied if the forecast capacity approaches or + * exceeds the maximum capacity. Defaults to + * HonorMaxCapacity if not specified. + *

+ * @public + */ + MaxCapacityBreachBehavior?: PredictiveScalingMaxCapacityBreachBehavior | undefined; + + /** + *

+ * 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. + *

+ *

Required if the MaxCapacityBreachBehavior property is set to + * IncreaseMaxCapacity, and cannot be used otherwise.

+ * @public + */ + MaxCapacityBuffer?: number | undefined; +} + /** * @public * @enum @@ -2551,7 +2982,7 @@ export type MetricType = (typeof MetricType)[keyof typeof MetricType]; /** *

Represents a predefined metric for a target tracking scaling policy to use with * Application Auto Scaling.

- *

For more information, Predefined metrics for target tracking scaling policies in the + *

For more information, Predefined metrics for target tracking scaling policies in the * Application Auto Scaling User Guide.

* @public */ @@ -2886,6 +3317,14 @@ export interface ScalingPolicy { */ TargetTrackingScalingPolicyConfiguration?: TargetTrackingScalingPolicyConfiguration | undefined; + /** + *

+ * The predictive scaling policy configuration. + *

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

The CloudWatch alarms associated with the scaling policy.

* @public @@ -3476,6 +3915,149 @@ export interface DescribeScheduledActionsResponse { NextToken?: string | undefined; } +/** + * @public + */ +export interface GetPredictiveScalingForecastRequest { + /** + *

+ * The namespace of the Amazon Web Services service that provides the resource. For a resource provided + * by your own application or service, use custom-resource instead. + *

+ * @public + */ + ServiceNamespace: ServiceNamespace | undefined; + + /** + *

+ * The identifier of the resource. + *

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

+ * The scalable dimension. + *

+ * @public + */ + ScalableDimension: ScalableDimension | undefined; + + /** + *

The name of the policy.

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

+ * The inclusive start time of the time range for the forecast data to get. At most, the + * date and time can be one year before the current date and time + *

+ * @public + */ + StartTime: Date | undefined; + + /** + *

+ * The exclusive end time of the time range for the forecast data to get. The maximum + * time duration between the start and end time is 30 days. + *

+ * @public + */ + EndTime: Date | undefined; +} + +/** + *

+ * A GetPredictiveScalingForecast call returns the capacity forecast for a + * predictive scaling policy. This structure includes the data points for that capacity + * forecast, along with the timestamps of those data points. + *

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

+ * The timestamps for the data points, in UTC format. + *

+ * @public + */ + Timestamps: Date[] | undefined; + + /** + *

+ * The values of the data points. + *

+ * @public + */ + Values: number[] | undefined; +} + +/** + *

+ * A GetPredictiveScalingForecast call returns the load forecast for a + * predictive scaling policy. This structure includes the data points for that load + * forecast, along with the timestamps of those data points and the metric specification. + *

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

+ * The timestamps for the data points, in UTC format. + *

+ * @public + */ + Timestamps: Date[] | undefined; + + /** + *

+ * The values of the data points. + *

+ * @public + */ + Values: number[] | undefined; + + /** + *

+ * The metric specification for the load forecast. + *

+ * @public + */ + MetricSpecification: PredictiveScalingMetricSpecification | undefined; +} + +/** + * @public + */ +export interface GetPredictiveScalingForecastResponse { + /** + *

+ * The load forecast. + *

+ * @public + */ + LoadForecast?: LoadForecast[] | undefined; + + /** + *

+ * The capacity forecast. + *

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

+ * The time the forecast was made. + *

+ * @public + */ + UpdateTime?: Date | undefined; +} + /** * @public */ @@ -3785,6 +4367,14 @@ export interface PutScalingPolicyRequest { * @public */ TargetTrackingScalingPolicyConfiguration?: TargetTrackingScalingPolicyConfiguration | undefined; + + /** + *

+ * The configuration of the predictive scaling policy. + *

+ * @public + */ + PredictiveScalingPolicyConfiguration?: PredictiveScalingPolicyConfiguration | undefined; } /** diff --git a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts index 5f38d403a51d..6996e98017ab 100644 --- a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts @@ -51,6 +51,10 @@ import { DescribeScheduledActionsCommandInput, DescribeScheduledActionsCommandOutput, } from "../commands/DescribeScheduledActionsCommand"; +import { + GetPredictiveScalingForecastCommandInput, + GetPredictiveScalingForecastCommandOutput, +} from "../commands/GetPredictiveScalingForecastCommand"; import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput, @@ -65,6 +69,7 @@ import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/T import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; import { ApplicationAutoScalingServiceException as __BaseException } from "../models/ApplicationAutoScalingServiceException"; import { + CapacityForecast, ConcurrentUpdateException, CustomizedMetricSpecification, DeleteScalingPolicyRequest, @@ -79,13 +84,26 @@ import { DescribeScheduledActionsRequest, DescribeScheduledActionsResponse, FailedResourceAccessException, + GetPredictiveScalingForecastRequest, + GetPredictiveScalingForecastResponse, InternalServiceException, InvalidNextTokenException, LimitExceededException, ListTagsForResourceRequest, + LoadForecast, MetricDimension, ObjectNotFoundException, PredefinedMetricSpecification, + PredictiveScalingCustomizedMetricSpecification, + PredictiveScalingMetric, + PredictiveScalingMetricDataQuery, + PredictiveScalingMetricDimension, + PredictiveScalingMetricSpecification, + PredictiveScalingMetricStat, + PredictiveScalingPolicyConfiguration, + PredictiveScalingPredefinedLoadMetricSpecification, + PredictiveScalingPredefinedMetricPairSpecification, + PredictiveScalingPredefinedScalingMetricSpecification, PutScalingPolicyRequest, PutScheduledActionRequest, RegisterScalableTargetRequest, @@ -200,6 +218,19 @@ export const se_DescribeScheduledActionsCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1GetPredictiveScalingForecastCommand + */ +export const se_GetPredictiveScalingForecastCommand = async ( + input: GetPredictiveScalingForecastCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GetPredictiveScalingForecast"); + let body: any; + body = JSON.stringify(se_GetPredictiveScalingForecastRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1ListTagsForResourceCommand */ @@ -418,6 +449,26 @@ export const de_DescribeScheduledActionsCommand = async ( return response; }; +/** + * deserializeAws_json1_1GetPredictiveScalingForecastCommand + */ +export const de_GetPredictiveScalingForecastCommand = 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_GetPredictiveScalingForecastResponse(data, context); + const response: GetPredictiveScalingForecastCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -742,6 +793,23 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_DescribeScheduledActionsRequest omitted. +/** + * serializeAws_json1_1GetPredictiveScalingForecastRequest + */ +const se_GetPredictiveScalingForecastRequest = ( + input: GetPredictiveScalingForecastRequest, + context: __SerdeContext +): any => { + return take(input, { + EndTime: (_) => _.getTime() / 1_000, + PolicyName: [], + ResourceId: [], + ScalableDimension: [], + ServiceNamespace: [], + StartTime: (_) => _.getTime() / 1_000, + }); +}; + // se_ListTagsForResourceRequest omitted. // se_MetricDimension omitted. @@ -750,6 +818,74 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_PredefinedMetricSpecification omitted. +// se_PredictiveScalingCustomizedMetricSpecification omitted. + +// se_PredictiveScalingMetric omitted. + +// se_PredictiveScalingMetricDataQueries omitted. + +// se_PredictiveScalingMetricDataQuery omitted. + +// se_PredictiveScalingMetricDimension omitted. + +// se_PredictiveScalingMetricDimensions omitted. + +/** + * serializeAws_json1_1PredictiveScalingMetricSpecification + */ +const se_PredictiveScalingMetricSpecification = ( + input: PredictiveScalingMetricSpecification, + context: __SerdeContext +): any => { + return take(input, { + CustomizedCapacityMetricSpecification: _json, + CustomizedLoadMetricSpecification: _json, + CustomizedScalingMetricSpecification: _json, + PredefinedLoadMetricSpecification: _json, + PredefinedMetricPairSpecification: _json, + PredefinedScalingMetricSpecification: _json, + TargetValue: __serializeFloat, + }); +}; + +/** + * serializeAws_json1_1PredictiveScalingMetricSpecifications + */ +const se_PredictiveScalingMetricSpecifications = ( + input: PredictiveScalingMetricSpecification[], + context: __SerdeContext +): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_PredictiveScalingMetricSpecification(entry, context); + }); +}; + +// se_PredictiveScalingMetricStat omitted. + +/** + * serializeAws_json1_1PredictiveScalingPolicyConfiguration + */ +const se_PredictiveScalingPolicyConfiguration = ( + input: PredictiveScalingPolicyConfiguration, + context: __SerdeContext +): any => { + return take(input, { + MaxCapacityBreachBehavior: [], + MaxCapacityBuffer: [], + MetricSpecifications: (_) => se_PredictiveScalingMetricSpecifications(_, context), + Mode: [], + SchedulingBufferTime: [], + }); +}; + +// se_PredictiveScalingPredefinedLoadMetricSpecification omitted. + +// se_PredictiveScalingPredefinedMetricPairSpecification omitted. + +// se_PredictiveScalingPredefinedScalingMetricSpecification omitted. + /** * serializeAws_json1_1PutScalingPolicyRequest */ @@ -757,6 +893,7 @@ const se_PutScalingPolicyRequest = (input: PutScalingPolicyRequest, context: __S return take(input, { PolicyName: [], PolicyType: [], + PredictiveScalingPolicyConfiguration: (_) => se_PredictiveScalingPolicyConfiguration(_, context), ResourceId: [], ScalableDimension: [], ServiceNamespace: [], @@ -866,6 +1003,16 @@ const se_TargetTrackingScalingPolicyConfiguration = ( // de_Alarms omitted. +/** + * deserializeAws_json1_1CapacityForecast + */ +const de_CapacityForecast = (output: any, context: __SerdeContext): CapacityForecast => { + return take(output, { + Timestamps: (_: any) => de_PredictiveScalingForecastTimestamps(_, context), + Values: (_: any) => de_PredictiveScalingForecastValues(_, context), + }) as any; +}; + // de_ConcurrentUpdateException omitted. // de_CustomizedMetricSpecification omitted. @@ -924,6 +1071,20 @@ const de_DescribeScheduledActionsResponse = ( // de_FailedResourceAccessException omitted. +/** + * deserializeAws_json1_1GetPredictiveScalingForecastResponse + */ +const de_GetPredictiveScalingForecastResponse = ( + output: any, + context: __SerdeContext +): GetPredictiveScalingForecastResponse => { + return take(output, { + CapacityForecast: (_: any) => de_CapacityForecast(_, context), + LoadForecast: (_: any) => de_LoadForecasts(_, context), + UpdateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; + // de_InternalServiceException omitted. // de_InvalidNextTokenException omitted. @@ -932,6 +1093,29 @@ const de_DescribeScheduledActionsResponse = ( // de_ListTagsForResourceResponse omitted. +/** + * deserializeAws_json1_1LoadForecast + */ +const de_LoadForecast = (output: any, context: __SerdeContext): LoadForecast => { + return take(output, { + MetricSpecification: (_: any) => de_PredictiveScalingMetricSpecification(_, context), + Timestamps: (_: any) => de_PredictiveScalingForecastTimestamps(_, context), + Values: (_: any) => de_PredictiveScalingForecastValues(_, context), + }) as any; +}; + +/** + * deserializeAws_json1_1LoadForecasts + */ +const de_LoadForecasts = (output: any, context: __SerdeContext): LoadForecast[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_LoadForecast(entry, context); + }); + return retVal; +}; + // de_MetricDimension omitted. // de_MetricDimensions omitted. @@ -944,6 +1128,99 @@ const de_DescribeScheduledActionsResponse = ( // de_PredefinedMetricSpecification omitted. +// de_PredictiveScalingCustomizedMetricSpecification omitted. + +/** + * deserializeAws_json1_1PredictiveScalingForecastTimestamps + */ +const de_PredictiveScalingForecastTimestamps = (output: any, context: __SerdeContext): Date[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectNonNull(__parseEpochTimestamp(__expectNumber(entry))); + }); + return retVal; +}; + +/** + * deserializeAws_json1_1PredictiveScalingForecastValues + */ +const de_PredictiveScalingForecastValues = (output: any, context: __SerdeContext): number[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __limitedParseDouble(entry) as any; + }); + return retVal; +}; + +// de_PredictiveScalingMetric omitted. + +// de_PredictiveScalingMetricDataQueries omitted. + +// de_PredictiveScalingMetricDataQuery omitted. + +// de_PredictiveScalingMetricDimension omitted. + +// de_PredictiveScalingMetricDimensions omitted. + +/** + * deserializeAws_json1_1PredictiveScalingMetricSpecification + */ +const de_PredictiveScalingMetricSpecification = ( + output: any, + context: __SerdeContext +): PredictiveScalingMetricSpecification => { + return take(output, { + CustomizedCapacityMetricSpecification: _json, + CustomizedLoadMetricSpecification: _json, + CustomizedScalingMetricSpecification: _json, + PredefinedLoadMetricSpecification: _json, + PredefinedMetricPairSpecification: _json, + PredefinedScalingMetricSpecification: _json, + TargetValue: __limitedParseDouble, + }) as any; +}; + +/** + * deserializeAws_json1_1PredictiveScalingMetricSpecifications + */ +const de_PredictiveScalingMetricSpecifications = ( + output: any, + context: __SerdeContext +): PredictiveScalingMetricSpecification[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_PredictiveScalingMetricSpecification(entry, context); + }); + return retVal; +}; + +// de_PredictiveScalingMetricStat omitted. + +/** + * deserializeAws_json1_1PredictiveScalingPolicyConfiguration + */ +const de_PredictiveScalingPolicyConfiguration = ( + output: any, + context: __SerdeContext +): PredictiveScalingPolicyConfiguration => { + return take(output, { + MaxCapacityBreachBehavior: __expectString, + MaxCapacityBuffer: __expectInt32, + MetricSpecifications: (_: any) => de_PredictiveScalingMetricSpecifications(_, context), + Mode: __expectString, + SchedulingBufferTime: __expectInt32, + }) as any; +}; + +// de_PredictiveScalingPredefinedLoadMetricSpecification omitted. + +// de_PredictiveScalingPredefinedMetricPairSpecification omitted. + +// de_PredictiveScalingPredefinedScalingMetricSpecification omitted. + // de_PutScalingPolicyResponse omitted. // de_PutScheduledActionResponse omitted. @@ -960,6 +1237,7 @@ const de_ScalableTarget = (output: any, context: __SerdeContext): ScalableTarget CreationTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), MaxCapacity: __expectInt32, MinCapacity: __expectInt32, + PredictedCapacity: __expectInt32, ResourceId: __expectString, RoleARN: __expectString, ScalableDimension: __expectString, @@ -1037,6 +1315,7 @@ const de_ScalingPolicy = (output: any, context: __SerdeContext): ScalingPolicy = PolicyARN: __expectString, PolicyName: __expectString, PolicyType: __expectString, + PredictiveScalingPolicyConfiguration: (_: any) => de_PredictiveScalingPolicyConfiguration(_, context), ResourceId: __expectString, ScalableDimension: __expectString, ServiceNamespace: __expectString, diff --git a/codegen/sdk-codegen/aws-models/application-auto-scaling.json b/codegen/sdk-codegen/aws-models/application-auto-scaling.json index 4fff85b21cb6..2a10bdc6ede0 100644 --- a/codegen/sdk-codegen/aws-models/application-auto-scaling.json +++ b/codegen/sdk-codegen/aws-models/application-auto-scaling.json @@ -115,6 +115,9 @@ { "target": "com.amazonaws.applicationautoscaling#DescribeScheduledActions" }, + { + "target": "com.amazonaws.applicationautoscaling#GetPredictiveScalingForecast" + }, { "target": "com.amazonaws.applicationautoscaling#ListTagsForResource" }, @@ -1129,6 +1132,28 @@ } } }, + "com.amazonaws.applicationautoscaling#CapacityForecast": { + "type": "structure", + "members": { + "Timestamps": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingForecastTimestamps", + "traits": { + "smithy.api#documentation": "

\n The timestamps for the data points, in UTC format.\n

", + "smithy.api#required": {} + } + }, + "Values": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingForecastValues", + "traits": { + "smithy.api#documentation": "

\n The values of the data points.\n

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

\n A GetPredictiveScalingForecast call returns the capacity forecast for a\n predictive scaling policy. This structure includes the data points for that capacity\n forecast, along with the timestamps of those data points.\n

" + } + }, "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": { "type": "structure", "members": { @@ -1999,6 +2024,102 @@ "smithy.api#httpError": 400 } }, + "com.amazonaws.applicationautoscaling#GetPredictiveScalingForecast": { + "type": "operation", + "input": { + "target": "com.amazonaws.applicationautoscaling#GetPredictiveScalingForecastRequest" + }, + "output": { + "target": "com.amazonaws.applicationautoscaling#GetPredictiveScalingForecastResponse" + }, + "errors": [ + { + "target": "com.amazonaws.applicationautoscaling#InternalServiceException" + }, + { + "target": "com.amazonaws.applicationautoscaling#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves the forecast data for a predictive scaling policy.

\n

Load forecasts are predictions of the hourly load values using historical load data\n from CloudWatch and an analysis of historical trends. Capacity forecasts are represented as\n predicted values for the minimum capacity that is needed on an hourly basis, based on\n the hourly load forecast.

\n

A minimum of 24 hours of data is required to create the initial forecasts. However,\n having a full 14 days of historical data results in more accurate forecasts.

" + } + }, + "com.amazonaws.applicationautoscaling#GetPredictiveScalingForecastRequest": { + "type": "structure", + "members": { + "ServiceNamespace": { + "target": "com.amazonaws.applicationautoscaling#ServiceNamespace", + "traits": { + "smithy.api#documentation": "

\n The namespace of the Amazon Web Services service that provides the resource. For a resource provided\n by your own application or service, use custom-resource instead. \n

", + "smithy.api#required": {} + } + }, + "ResourceId": { + "target": "com.amazonaws.applicationautoscaling#ResourceIdMaxLen1600", + "traits": { + "smithy.api#documentation": "

\n The identifier of the resource.\n

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

\n The scalable dimension.\n

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

The name of the policy.

", + "smithy.api#required": {} + } + }, + "StartTime": { + "target": "com.amazonaws.applicationautoscaling#TimestampType", + "traits": { + "smithy.api#documentation": "

\n The inclusive start time of the time range for the forecast data to get. At most, the\n date and time can be one year before the current date and time\n

", + "smithy.api#required": {} + } + }, + "EndTime": { + "target": "com.amazonaws.applicationautoscaling#TimestampType", + "traits": { + "smithy.api#documentation": "

\n The exclusive end time of the time range for the forecast data to get. The maximum\n time duration between the start and end time is 30 days. \n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.applicationautoscaling#GetPredictiveScalingForecastResponse": { + "type": "structure", + "members": { + "LoadForecast": { + "target": "com.amazonaws.applicationautoscaling#LoadForecasts", + "traits": { + "smithy.api#documentation": "

\n The load forecast.\n

" + } + }, + "CapacityForecast": { + "target": "com.amazonaws.applicationautoscaling#CapacityForecast", + "traits": { + "smithy.api#documentation": "

\n The capacity forecast.\n

" + } + }, + "UpdateTime": { + "target": "com.amazonaws.applicationautoscaling#TimestampType", + "traits": { + "smithy.api#documentation": "

\n The time the forecast was made.\n

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.applicationautoscaling#Id": { "type": "string", "traits": { @@ -2123,6 +2244,41 @@ "smithy.api#output": {} } }, + "com.amazonaws.applicationautoscaling#LoadForecast": { + "type": "structure", + "members": { + "Timestamps": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingForecastTimestamps", + "traits": { + "smithy.api#documentation": "

\n The timestamps for the data points, in UTC format.\n

", + "smithy.api#required": {} + } + }, + "Values": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingForecastValues", + "traits": { + "smithy.api#documentation": "

\n The values of the data points.\n

", + "smithy.api#required": {} + } + }, + "MetricSpecification": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricSpecification", + "traits": { + "smithy.api#documentation": "

\n The metric specification for the load forecast.\n

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

\n A GetPredictiveScalingForecast call returns the load forecast for a\n predictive scaling policy. This structure includes the data points for that load\n forecast, along with the timestamps of those data points and the metric specification.\n

" + } + }, + "com.amazonaws.applicationautoscaling#LoadForecasts": { + "type": "list", + "member": { + "target": "com.amazonaws.applicationautoscaling#LoadForecast" + } + }, "com.amazonaws.applicationautoscaling#MaxResults": { "type": "integer" }, @@ -2480,6 +2636,12 @@ "traits": { "smithy.api#enumValue": "TargetTrackingScaling" } + }, + "PredictiveScaling": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PredictiveScaling" + } } } }, @@ -2501,7 +2663,431 @@ } }, "traits": { - "smithy.api#documentation": "

Represents a predefined metric for a target tracking scaling policy to use with\n Application Auto Scaling.

\n

For more information, Predefined metrics for target tracking scaling policies in the\n Application Auto Scaling User Guide.

" + "smithy.api#documentation": "

Represents a predefined metric for a target tracking scaling policy to use with\n Application Auto Scaling.

\n

For more information, Predefined metrics for target tracking scaling policies in the\n Application Auto Scaling User Guide.

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingCustomizedMetricSpecification": { + "type": "structure", + "members": { + "MetricDataQueries": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDataQueries", + "traits": { + "smithy.api#documentation": "

\n One or more metric data queries to provide data points for a metric specification.\n

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

\n Represents a CloudWatch metric of your choosing for a predictive scaling policy.\n

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingForecastTimestamps": { + "type": "list", + "member": { + "target": "com.amazonaws.applicationautoscaling#TimestampType" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingForecastValues": { + "type": "list", + "member": { + "target": "com.amazonaws.applicationautoscaling#MetricScale" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMaxCapacityBreachBehavior": { + "type": "enum", + "members": { + "HonorMaxCapacity": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "HonorMaxCapacity" + } + }, + "IncreaseMaxCapacity": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IncreaseMaxCapacity" + } + } + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMaxCapacityBuffer": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 100 + } + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetric": { + "type": "structure", + "members": { + "Dimensions": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDimensions", + "traits": { + "smithy.api#documentation": "

\n Describes the dimensions of the metric.\n

" + } + }, + "MetricName": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricName", + "traits": { + "smithy.api#documentation": "

\n The name of the metric.\n

" + } + }, + "Namespace": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricNamespace", + "traits": { + "smithy.api#documentation": "

\n The namespace of the metric.\n

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

\n Describes the scaling metric.\n

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDataQueries": { + "type": "list", + "member": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDataQuery" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDataQuery": { + "type": "structure", + "members": { + "Id": { + "target": "com.amazonaws.applicationautoscaling#Id", + "traits": { + "smithy.api#documentation": "

\n A short name that identifies the object's results in the response. This name must be\n unique among all MetricDataQuery objects specified for a single scaling\n policy. If you are performing math expressions on this set of data, this name represents\n that data and can serve as a variable in the mathematical expression. The valid\n characters are letters, numbers, and underscores. The first character must be a\n lowercase letter.\n

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

\n The math expression to perform on the returned data, if this object is performing a\n math expression. This expression can use the Id of the other metrics to\n refer to those metrics, and can also use the Id of other expressions to use\n the result of those expressions.\n

\n

Conditional: Within each MetricDataQuery object, you must specify either\n Expression or MetricStat, but not both.

" + } + }, + "MetricStat": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricStat", + "traits": { + "smithy.api#documentation": "

\n Information about the metric data to return.\n

\n

Conditional: Within each MetricDataQuery object, you must specify either\n Expression or MetricStat, but not both.

" + } + }, + "Label": { + "target": "com.amazonaws.applicationautoscaling#XmlString", + "traits": { + "smithy.api#documentation": "

\n A human-readable label for this metric or expression. This is especially useful if\n this is a math expression, so that you know what the value represents.\n

" + } + }, + "ReturnData": { + "target": "com.amazonaws.applicationautoscaling#ReturnData", + "traits": { + "smithy.api#documentation": "

\n Indicates whether to return the timestamps and raw data values of this metric.\n

\n

If you use any math expressions, specify true for this value for only the\n final math expression that the metric specification is based on. You must specify\n false for ReturnData for all the other metrics and\n expressions used in the metric specification.

\n

If you are only retrieving metrics and not performing any math expressions, do not\n specify anything for ReturnData. This sets it to its default\n (true).

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

\n The metric data to return. Also defines whether this call is returning data for one\n metric only, or whether it is performing a math expression on the values of returned\n metric statistics to create a new time series. A time series is a series of data points,\n each of which is associated with a timestamp.\n

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDimension": { + "type": "structure", + "members": { + "Name": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDimensionName", + "traits": { + "smithy.api#documentation": "

\n The name of the dimension.\n

", + "smithy.api#required": {} + } + }, + "Value": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDimensionValue", + "traits": { + "smithy.api#documentation": "

\n The value of the dimension.\n

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

\n Describes the dimension of a metric.\n

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDimensionName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*$" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDimensionValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*$" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDimensions": { + "type": "list", + "member": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricDimension" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*$" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricNamespace": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*$" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricSpecification": { + "type": "structure", + "members": { + "TargetValue": { + "target": "com.amazonaws.applicationautoscaling#MetricScale", + "traits": { + "smithy.api#documentation": "

\n Specifies the target utilization.\n

", + "smithy.api#required": {} + } + }, + "PredefinedMetricPairSpecification": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingPredefinedMetricPairSpecification", + "traits": { + "smithy.api#documentation": "

\n The predefined metric pair specification that determines the appropriate scaling metric and load metric to use.\n

" + } + }, + "PredefinedScalingMetricSpecification": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingPredefinedScalingMetricSpecification", + "traits": { + "smithy.api#documentation": "

\n The predefined scaling metric specification.\n

" + } + }, + "PredefinedLoadMetricSpecification": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingPredefinedLoadMetricSpecification", + "traits": { + "smithy.api#documentation": "

\n The predefined load metric specification.\n

" + } + }, + "CustomizedScalingMetricSpecification": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingCustomizedMetricSpecification", + "traits": { + "smithy.api#documentation": "

\n The customized scaling metric specification.\n

" + } + }, + "CustomizedLoadMetricSpecification": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingCustomizedMetricSpecification", + "traits": { + "smithy.api#documentation": "

\n The customized load metric specification.\n

" + } + }, + "CustomizedCapacityMetricSpecification": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingCustomizedMetricSpecification", + "traits": { + "smithy.api#documentation": "

\n The customized capacity metric specification.\n

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

\n This structure specifies the metrics and target utilization settings for a predictive\n scaling policy.\n

\n

You must specify either a metric pair, or a load metric and a scaling metric\n individually. Specifying a metric pair instead of individual metrics provides a simpler\n way to configure metrics for a scaling policy. You choose the metric pair, and the\n policy automatically knows the correct sum and average statistics to use for the load\n metric and the scaling metric.

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricSpecifications": { + "type": "list", + "member": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricSpecification" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricStat": { + "type": "structure", + "members": { + "Metric": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetric", + "traits": { + "smithy.api#documentation": "

\n The CloudWatch metric to return, including the metric name, namespace, and dimensions. To\n get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics. \n

", + "smithy.api#required": {} + } + }, + "Stat": { + "target": "com.amazonaws.applicationautoscaling#XmlString", + "traits": { + "smithy.api#documentation": "

\n The statistic to return. It can include any CloudWatch statistic or extended statistic. For\n a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide.\n

\n

The most commonly used metrics for predictive scaling are Average and\n Sum.

", + "smithy.api#required": {} + } + }, + "Unit": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricUnit", + "traits": { + "smithy.api#documentation": "

\n The unit to use for the returned data points. For a complete list of the units that\n CloudWatch supports, see the MetricDatum \n data type in the Amazon CloudWatch API Reference.\n

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

\n This structure defines the CloudWatch metric to return, along with the statistic and unit.\n

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMetricUnit": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1023 + }, + "smithy.api#pattern": "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*$" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingMode": { + "type": "enum", + "members": { + "ForecastOnly": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ForecastOnly" + } + }, + "ForecastAndScale": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ForecastAndScale" + } + } + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingPolicyConfiguration": { + "type": "structure", + "members": { + "MetricSpecifications": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricSpecifications", + "traits": { + "smithy.api#documentation": "

\n This structure includes the metrics and target utilization to use for predictive scaling.\n

\n

This is an array, but we currently only support a single metric specification. That\n is, you can specify a target value and a single metric pair, or a target value and one\n scaling metric and one load metric.

", + "smithy.api#required": {} + } + }, + "Mode": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMode", + "traits": { + "smithy.api#documentation": "

\n The predictive scaling mode. Defaults to ForecastOnly if not specified.\n

" + } + }, + "SchedulingBufferTime": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingSchedulingBufferTime", + "traits": { + "smithy.api#documentation": "

\n The amount of time, in seconds, that the start time can be advanced.\n

\n

The value must be less than the forecast interval duration of 3600 seconds (60\n minutes). Defaults to 300 seconds if not specified.

" + } + }, + "MaxCapacityBreachBehavior": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMaxCapacityBreachBehavior", + "traits": { + "smithy.api#documentation": "

\n Defines the behavior that should be applied if the forecast capacity approaches or\n exceeds the maximum capacity. Defaults to\n HonorMaxCapacity if not specified.\n

" + } + }, + "MaxCapacityBuffer": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMaxCapacityBuffer", + "traits": { + "smithy.api#documentation": "

\n The size of the capacity buffer to use when the forecast capacity is close to or\n exceeds the maximum capacity. The value is specified as a percentage relative to the\n forecast capacity. For example, if the buffer is 10, this means a 10 percent buffer,\n such that if the forecast capacity is 50, and the maximum capacity is 40, then the\n effective maximum capacity is 55.\n

\n

Required if the MaxCapacityBreachBehavior property is set to\n IncreaseMaxCapacity, and cannot be used otherwise.

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

\n Represents a predictive scaling policy configuration.\n

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingPredefinedLoadMetricSpecification": { + "type": "structure", + "members": { + "PredefinedMetricType": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricType", + "traits": { + "smithy.api#documentation": "

\n The metric type.\n

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

\n A label that uniquely identifies a target group.\n

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

\n Describes a load metric for a predictive scaling policy.\n

\n

When returned in the output of DescribePolicies, it indicates that a\n predictive scaling policy uses individually specified load and scaling metrics instead\n of a metric pair.

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingPredefinedMetricPairSpecification": { + "type": "structure", + "members": { + "PredefinedMetricType": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricType", + "traits": { + "smithy.api#documentation": "

\n Indicates which metrics to use. There are two different types of metrics for each\n metric type: one is a load metric and one is a scaling metric.\n

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

\n A label that uniquely identifies a specific target group from which to determine\n the total and average request count.\n

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

\n Represents a metric pair for a predictive scaling policy.\n

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingPredefinedScalingMetricSpecification": { + "type": "structure", + "members": { + "PredefinedMetricType": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingMetricType", + "traits": { + "smithy.api#documentation": "

\n The metric type.\n

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

\n A label that uniquely identifies a specific target group from which to determine\n the average request count. \n

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

\n Describes a scaling metric for a predictive scaling policy.\n

\n

When returned in the output of DescribePolicies, it indicates that a\n predictive scaling policy uses individually specified load and scaling metrics instead\n of a metric pair.

" + } + }, + "com.amazonaws.applicationautoscaling#PredictiveScalingSchedulingBufferTime": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 3600 + } } }, "com.amazonaws.applicationautoscaling#PutScalingPolicy": { @@ -2618,6 +3204,12 @@ "traits": { "smithy.api#documentation": "

A target tracking scaling policy. Includes support for predefined or customized\n metrics.

\n

This parameter is required if you are creating a policy and the policy type is\n TargetTrackingScaling.

" } + }, + "PredictiveScalingPolicyConfiguration": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingPolicyConfiguration", + "traits": { + "smithy.api#documentation": "

\n The configuration of the predictive scaling policy.\n

" + } } }, "traits": { @@ -3122,6 +3714,12 @@ "smithy.api#required": {} } }, + "PredictedCapacity": { + "target": "com.amazonaws.applicationautoscaling#ResourceCapacity", + "traits": { + "smithy.api#documentation": "

\n The predicted capacity of the scalable target.\n

" + } + }, "RoleARN": { "target": "com.amazonaws.applicationautoscaling#ResourceIdMaxLen1600", "traits": { @@ -3380,6 +3978,12 @@ "smithy.api#documentation": "

A target tracking scaling policy.

" } }, + "PredictiveScalingPolicyConfiguration": { + "target": "com.amazonaws.applicationautoscaling#PredictiveScalingPolicyConfiguration", + "traits": { + "smithy.api#documentation": "

\n The predictive scaling policy configuration.\n

" + } + }, "Alarms": { "target": "com.amazonaws.applicationautoscaling#Alarms", "traits": {