Skip to content

Commit

Permalink
feat(client-auto-scaling): Now, Amazon EC2 Auto Scaling customers can…
Browse files Browse the repository at this point in the history
… enable target tracking policies to take quicker scaling decisions, enhancing their application performance and EC2 utilization. To get started, specify target tracking to monitor a metric that is available on Amazon CloudWatch at seconds-level interval.
  • Loading branch information
awstools committed Nov 22, 2024
1 parent a83926c commit 26d5f85
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export interface DescribePoliciesCommandOutput extends PoliciesType, __MetadataB
* // ],
* // Statistic: "Average" || "Minimum" || "Maximum" || "SampleCount" || "Sum",
* // Unit: "STRING_VALUE",
* // Period: Number("int"),
* // Metrics: [ // TargetTrackingMetricDataQueries
* // { // TargetTrackingMetricDataQuery
* // Id: "STRING_VALUE", // required
Expand All @@ -108,8 +109,10 @@ export interface DescribePoliciesCommandOutput extends PoliciesType, __MetadataB
* // },
* // Stat: "STRING_VALUE", // required
* // Unit: "STRING_VALUE",
* // Period: Number("int"),
* // },
* // Label: "STRING_VALUE",
* // Period: Number("int"),
* // ReturnData: true || false,
* // },
* // ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface PutScalingPolicyCommandOutput extends PolicyARNType, __Metadata
* ],
* Statistic: "Average" || "Minimum" || "Maximum" || "SampleCount" || "Sum",
* Unit: "STRING_VALUE",
* Period: Number("int"),
* Metrics: [ // TargetTrackingMetricDataQueries
* { // TargetTrackingMetricDataQuery
* Id: "STRING_VALUE", // required
Expand All @@ -96,8 +97,10 @@ export interface PutScalingPolicyCommandOutput extends PolicyARNType, __Metadata
* },
* Stat: "STRING_VALUE", // required
* Unit: "STRING_VALUE",
* Period: Number("int"),
* },
* Label: "STRING_VALUE",
* Period: Number("int"),
* ReturnData: true || false,
* },
* ],
Expand Down
27 changes: 27 additions & 0 deletions clients/client-auto-scaling/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6010,6 +6010,15 @@ export interface TargetTrackingMetricStat {
* @public
*/
Unit?: string | undefined;

/**
* <p>
* The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see
* <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html">Create a target tracking policy using high-resolution metrics for faster response</a>.
* </p>
* @public
*/
Period?: number | undefined;
}

/**
Expand Down Expand Up @@ -6057,6 +6066,15 @@ export interface TargetTrackingMetricDataQuery {
*/
Label?: string | undefined;

/**
* <p>
* The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see
* <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html">Create a target tracking policy using high-resolution metrics for faster response</a>.
* </p>
* @public
*/
Period?: number | undefined;

/**
* <p>Indicates whether to return the timestamps and raw data values of this metric. </p>
* <p>If you use any math expressions, specify <code>true</code> for this value for only the
Expand Down Expand Up @@ -6153,6 +6171,15 @@ export interface CustomizedMetricSpecification {
*/
Unit?: string | undefined;

/**
* <p>
* The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see
* <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html">Create a target tracking policy using high-resolution metrics for faster response</a>.
* </p>
* @public
*/
Period?: number | undefined;

/**
* <p>The metrics to include in the target tracking scaling policy, as a metric data query.
* This can include both raw metric and metric math expressions.</p>
Expand Down
43 changes: 31 additions & 12 deletions clients/client-auto-scaling/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3913,6 +3913,9 @@ const se_CustomizedMetricSpecification = (input: CustomizedMetricSpecification,
if (input[_U] != null) {
entries[_U] = input[_U];
}
if (input[_P] != null) {
entries[_P] = input[_P];
}
if (input[_Me] != null) {
const memberEntries = se_TargetTrackingMetricDataQueries(input[_Me], context);
if (input[_Me]?.length === 0) {
Expand Down Expand Up @@ -6199,8 +6202,8 @@ const se_StartInstanceRefreshType = (input: StartInstanceRefreshType, context: _
entries[loc] = value;
});
}
if (input[_P] != null) {
const memberEntries = se_RefreshPreferences(input[_P], context);
if (input[_Pr] != null) {
const memberEntries = se_RefreshPreferences(input[_Pr], context);
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `Preferences.${key}`;
entries[loc] = value;
Expand Down Expand Up @@ -6371,6 +6374,9 @@ const se_TargetTrackingMetricDataQuery = (input: TargetTrackingMetricDataQuery,
if (input[_L] != null) {
entries[_L] = input[_L];
}
if (input[_P] != null) {
entries[_P] = input[_P];
}
if (input[_RD] != null) {
entries[_RD] = input[_RD];
}
Expand All @@ -6395,6 +6401,9 @@ const se_TargetTrackingMetricStat = (input: TargetTrackingMetricStat, context: _
if (input[_U] != null) {
entries[_U] = input[_U];
}
if (input[_P] != null) {
entries[_P] = input[_P];
}
return entries;
};

Expand Down Expand Up @@ -6766,8 +6775,8 @@ const de_Activity = (output: any, context: __SerdeContext): Activity => {
if (output[_SMt] != null) {
contents[_SMt] = __expectString(output[_SMt]);
}
if (output[_Pr] != null) {
contents[_Pr] = __strictParseInt32(output[_Pr]) as number;
if (output[_Pro] != null) {
contents[_Pro] = __strictParseInt32(output[_Pro]) as number;
}
if (output[_Det] != null) {
contents[_Det] = __expectString(output[_Det]);
Expand Down Expand Up @@ -7450,6 +7459,9 @@ const de_CustomizedMetricSpecification = (output: any, context: __SerdeContext):
if (output[_U] != null) {
contents[_U] = __expectString(output[_U]);
}
if (output[_P] != null) {
contents[_P] = __strictParseInt32(output[_P]) as number;
}
if (output.Metrics === "") {
contents[_Me] = [];
} else if (output[_Me] != null && output[_Me][_me] != null) {
Expand Down Expand Up @@ -8015,8 +8027,8 @@ const de_InstanceRefresh = (output: any, context: __SerdeContext): InstanceRefre
if (output[_PD] != null) {
contents[_PD] = de_InstanceRefreshProgressDetails(output[_PD], context);
}
if (output[_P] != null) {
contents[_P] = de_RefreshPreferences(output[_P], context);
if (output[_Pr] != null) {
contents[_Pr] = de_RefreshPreferences(output[_Pr], context);
}
if (output[_DCes] != null) {
contents[_DCes] = de_DesiredConfiguration(output[_DCes], context);
Expand Down Expand Up @@ -9109,9 +9121,9 @@ const de_Processes = (output: any, context: __SerdeContext): ProcessType[] => {
const de_ProcessesType = (output: any, context: __SerdeContext): ProcessesType => {
const contents: any = {};
if (output.Processes === "") {
contents[_Pro] = [];
} else if (output[_Pro] != null && output[_Pro][_me] != null) {
contents[_Pro] = de_Processes(__getArrayIfSingleItem(output[_Pro][_me]), context);
contents[_Proc] = [];
} else if (output[_Proc] != null && output[_Proc][_me] != null) {
contents[_Proc] = de_Processes(__getArrayIfSingleItem(output[_Proc][_me]), context);
}
return contents;
};
Expand Down Expand Up @@ -9606,6 +9618,9 @@ const de_TargetTrackingMetricDataQuery = (output: any, context: __SerdeContext):
if (output[_L] != null) {
contents[_L] = __expectString(output[_L]);
}
if (output[_P] != null) {
contents[_P] = __strictParseInt32(output[_P]) as number;
}
if (output[_RD] != null) {
contents[_RD] = __parseBoolean(output[_RD]);
}
Expand All @@ -9626,6 +9641,9 @@ const de_TargetTrackingMetricStat = (output: any, context: __SerdeContext): Targ
if (output[_U] != null) {
contents[_U] = __expectString(output[_U]);
}
if (output[_P] != null) {
contents[_P] = __strictParseInt32(output[_P]) as number;
}
return contents;
};

Expand Down Expand Up @@ -10041,7 +10059,7 @@ const _ODAS = "OnDemandAllocationStrategy";
const _ODBC = "OnDemandBaseCapacity";
const _ODMPPOLP = "OnDemandMaxPricePercentageOverLowestPrice";
const _ODPABC = "OnDemandPercentageAboveBaseCapacity";
const _P = "Preferences";
const _P = "Period";
const _PAL = "PropagateAtLaunch";
const _PARN = "PolicyARN";
const _PC = "PredictedCapacity";
Expand Down Expand Up @@ -10069,8 +10087,9 @@ const _PT = "PlacementTenancy";
const _PTo = "PolicyTypes";
const _PTol = "PolicyType";
const _PWP = "PutWarmPool";
const _Pr = "Progress";
const _Pro = "Processes";
const _Pr = "Preferences";
const _Pro = "Progress";
const _Proc = "Processes";
const _R = "References";
const _RARN = "RoleARN";
const _RD = "ReturnData";
Expand Down
26 changes: 26 additions & 0 deletions codegen/sdk-codegen/aws-models/auto-scaling.json
Original file line number Diff line number Diff line change
Expand Up @@ -3563,6 +3563,12 @@
"smithy.api#documentation": "<p>The unit of the metric. For a complete list of the units that CloudWatch supports, see the\n <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a>\n data type in the <i>Amazon CloudWatch API Reference</i>.</p>"
}
},
"Period": {
"target": "com.amazonaws.autoscaling#MetricGranularityInSeconds",
"traits": {
"smithy.api#documentation": "<p>\n The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see\n <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html\">Create a target tracking policy using high-resolution metrics for faster response</a>.\n </p>"
}
},
"Metrics": {
"target": "com.amazonaws.autoscaling#TargetTrackingMetricDataQueries",
"traits": {
Expand Down Expand Up @@ -8112,6 +8118,14 @@
"target": "com.amazonaws.autoscaling#MetricDimension"
}
},
"com.amazonaws.autoscaling#MetricGranularityInSeconds": {
"type": "integer",
"traits": {
"smithy.api#range": {
"min": 1
}
}
},
"com.amazonaws.autoscaling#MetricGranularityType": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -10808,6 +10822,12 @@
"smithy.api#documentation": "<p>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.</p>"
}
},
"Period": {
"target": "com.amazonaws.autoscaling#MetricGranularityInSeconds",
"traits": {
"smithy.api#documentation": "<p>\n The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see\n <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html\">Create a target tracking policy using high-resolution metrics for faster response</a>.\n </p>"
}
},
"ReturnData": {
"target": "com.amazonaws.autoscaling#ReturnData",
"traits": {
Expand Down Expand Up @@ -10843,6 +10863,12 @@
"traits": {
"smithy.api#documentation": "<p>The unit to use for the returned data points. For a complete list of the units that\n CloudWatch supports, see the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a>\n data type in the <i>Amazon CloudWatch API Reference</i>.</p>"
}
},
"Period": {
"target": "com.amazonaws.autoscaling#MetricGranularityInSeconds",
"traits": {
"smithy.api#documentation": "<p>\n The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see\n <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html\">Create a target tracking policy using high-resolution metrics for faster response</a>.\n </p>"
}
}
},
"traits": {
Expand Down

0 comments on commit 26d5f85

Please sign in to comment.