get_ec2_instance_recommendations
¶
get_ec2_instance_recommendations(
*,
config_overrides: Optional[ComputeOptimizerClientConfig] = 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/compute_optimizer.py
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 | |