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
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 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 | |