getEffectiveRecommendationPreferences method
- required String resourceArn,
Returns the recommendation preferences that are in effect for a given resource, such as enhanced infrastructure metrics. Considers all applicable preferences that you might have set at the resource, account, and organization level.
When you create a recommendation preference, you can set its status to
Active or Inactive. Use this action to view the
recommendation preferences that are in effect, or Active.
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 resourceArn :
The Amazon Resource Name (ARN) of the resource for which to confirm
effective recommendation preferences. Only EC2 instance and Auto Scaling
group ARNs are currently supported.
Implementation
Future<GetEffectiveRecommendationPreferencesResponse>
getEffectiveRecommendationPreferences({
required String resourceArn,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target':
'ComputeOptimizerService.GetEffectiveRecommendationPreferences'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'resourceArn': resourceArn,
},
);
return GetEffectiveRecommendationPreferencesResponse.fromJson(
jsonResponse.body);
}