getECSServiceRecommendationProjectedMetrics method
Returns the projected metrics of Amazon ECS service recommendations.
May throw AccessDeniedException.
May throw InternalServerException.
May throw InvalidParameterValueException.
May throw MissingAuthenticationToken.
May throw OptInRequiredException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
Parameter endTime :
The timestamp of the last projected metrics data point to return.
Parameter period :
The granularity, in seconds, of the projected metrics data points.
Parameter serviceArn :
The ARN that identifies the Amazon ECS service.
The following is the format of the ARN:
arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name
Parameter startTime :
The timestamp of the first projected metrics data point to return.
Parameter stat :
The statistic of the projected metrics.
Implementation
Future<GetECSServiceRecommendationProjectedMetricsResponse>
getECSServiceRecommendationProjectedMetrics({
required DateTime endTime,
required int period,
required String serviceArn,
required DateTime startTime,
required MetricStatistic stat,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target':
'ComputeOptimizerService.GetECSServiceRecommendationProjectedMetrics'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'endTime': unixTimestampToJson(endTime),
'period': period,
'serviceArn': serviceArn,
'startTime': unixTimestampToJson(startTime),
'stat': stat.value,
},
);
return GetECSServiceRecommendationProjectedMetricsResponse.fromJson(
jsonResponse.body);
}