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.
May throw InternalServiceException.
May throw ValidationException.
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.
Parameter policyName :
The name of the policy.
Parameter resourceId :
The identifier of the resource.
Parameter scalableDimension :
The scalable dimension.
Parameter serviceNamespace :
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.
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<GetPredictiveScalingForecastResponse> getPredictiveScalingForecast({
required DateTime endTime,
required String policyName,
required String resourceId,
required ScalableDimension scalableDimension,
required ServiceNamespace serviceNamespace,
required DateTime startTime,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AnyScaleFrontendService.GetPredictiveScalingForecast'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'EndTime': unixTimestampToJson(endTime),
'PolicyName': policyName,
'ResourceId': resourceId,
'ScalableDimension': scalableDimension.value,
'ServiceNamespace': serviceNamespace.value,
'StartTime': unixTimestampToJson(startTime),
},
);
return GetPredictiveScalingForecastResponse.fromJson(jsonResponse.body);
}