getAutoScalingGroupRecommendations method
Returns Auto Scaling group recommendations.
Compute Optimizer generates recommendations for Amazon EC2 Auto Scaling groups that meet a specific set of requirements. For more information, see the Supported resources and requirements in the Compute Optimizer User Guide.
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 accountIds :
The ID of the Amazon Web Services account for which to return Auto Scaling
group recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to return Auto Scaling group recommendations.
Only one account ID can be specified per request.
Parameter autoScalingGroupArns :
The Amazon Resource Name (ARN) of the Auto Scaling groups for which to
return recommendations.
Parameter filters :
An array of objects to specify a filter that returns a more specific list
of Auto Scaling group recommendations.
Parameter maxResults :
The maximum number of Auto Scaling group recommendations to return with a
single request.
To retrieve the remaining results, make another request with the returned
nextToken value.
Parameter nextToken :
The token to advance to the next page of Auto Scaling group
recommendations.
Parameter recommendationPreferences :
An object to specify the preferences for the Auto Scaling group
recommendations to return in the response.
Implementation
Future<GetAutoScalingGroupRecommendationsResponse>
getAutoScalingGroupRecommendations({
List<String>? accountIds,
List<String>? autoScalingGroupArns,
List<Filter>? filters,
int? maxResults,
String? nextToken,
RecommendationPreferences? recommendationPreferences,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
0,
1000,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target':
'ComputeOptimizerService.GetAutoScalingGroupRecommendations'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (accountIds != null) 'accountIds': accountIds,
if (autoScalingGroupArns != null)
'autoScalingGroupArns': autoScalingGroupArns,
if (filters != null) 'filters': filters,
if (maxResults != null) 'maxResults': maxResults,
if (nextToken != null) 'nextToken': nextToken,
if (recommendationPreferences != null)
'recommendationPreferences': recommendationPreferences,
},
);
return GetAutoScalingGroupRecommendationsResponse.fromJson(
jsonResponse.body);
}