getPredictiveScalingForecast method
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.
For more information, see Predictive scaling for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
May throw ResourceContentionFault.
Parameter autoScalingGroupName :
The name of the Auto Scaling group.
Parameter endTime :
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.
Although this parameter can accept a date and time that is more than two days in the future, the availability of forecast data has limits. Amazon EC2 Auto Scaling only issues forecasts for periods of two days in advance.
Parameter policyName :
The name of the policy.
Parameter startTime :
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.
Implementation
Future<GetPredictiveScalingForecastAnswer> getPredictiveScalingForecast({
required String autoScalingGroupName,
required DateTime endTime,
required String policyName,
required DateTime startTime,
}) async {
final $request = <String, String>{
'AutoScalingGroupName': autoScalingGroupName,
'EndTime': _s.iso8601ToJson(endTime),
'PolicyName': policyName,
'StartTime': _s.iso8601ToJson(startTime),
};
final $result = await _protocol.send(
$request,
action: 'GetPredictiveScalingForecast',
version: '2011-01-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'GetPredictiveScalingForecastResult',
);
return GetPredictiveScalingForecastAnswer.fromXml($result);
}