get_ec2_instance_recommendations
async
¶
get_ec2_instance_recommendations(
*,
config_overrides: Optional[AsyncComputeOptimizerClientConfig] = None,
instance_arns: Optional[InstanceArns] = None,
next_token: Optional[NextToken] = None,
max_results: Optional[MaxResults] = None,
filters: Optional[Filters] = None,
account_ids: Optional[AccountIds] = None,
recommendation_preferences: Optional[RecommendationPreferences] = None,
) -> GetEC2InstanceRecommendationsResponse
Returns Amazon EC2 instance recommendations.
Compute Optimizer generates recommendations for Amazon Elastic Compute Cloud (Amazon EC2) instances that meet a specific set of requirements. For more information, see the Supported resources and requirements in the Compute Optimizer User Guide.
Parameters:
-
instance_arns(Optional[InstanceArns], default:None) –The Amazon Resource Name (ARN) of the instances for which to return recommendations.
-
next_token(Optional[NextToken], default:None) –The token to advance to the next page of instance recommendations.
-
max_results(Optional[MaxResults], default:None) –The maximum number of instance recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned
nextTokenvalue. -
filters(Optional[Filters], default:None) –An array of objects to specify a filter that returns a more specific list of instance recommendations.
-
account_ids(Optional[AccountIds], default:None) –The ID of the Amazon Web Services account for which to return instance 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 instance recommendations.
Only one account ID can be specified per request.
-
recommendation_preferences(Optional[RecommendationPreferences], default:None) –An object to specify the preferences for the Amazon EC2 instance recommendations to return in the response.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–An internal error has occurred. Try your call again.
-
InvalidParameterValueException–The value supplied for the input parameter is out of range or not valid.
-
MissingAuthenticationToken–The request must contain either a valid (registered) Amazon Web Services access key ID or X.509 certificate.
-
OptInRequiredException–The account is not opted in to Compute Optimizer.
-
ResourceNotFoundException–A resource that is required for the action doesn't exist.
-
ServiceUnavailableException–The request has failed due to a temporary failure of the server.
-
ThrottlingException–The request was denied due to request throttling.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_compute_optimizer/_services/async_compute_optimizer.py
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 | |