Skip to content

get_recommendation_summaries async

get_recommendation_summaries(
    *,
    config_overrides: Optional[AsyncComputeOptimizerClientConfig] = None,
    account_ids: Optional[AccountIds] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> GetRecommendationSummariesResponse

Returns the optimization findings for an account.

It returns the number of:

  • Amazon EC2 instances in an account that are Underprovisioned, Overprovisioned, or Optimized.

  • EC2Auto Scaling groups in an account that are NotOptimized, or Optimized.

  • Amazon EBS volumes in an account that are NotOptimized, or Optimized.

  • Lambda functions in an account that are NotOptimized, or Optimized.

  • Amazon ECS services in an account that are Underprovisioned, Overprovisioned, or Optimized.

  • Commercial software licenses in an account that are InsufficientMetrics, NotOptimized or Optimized.

  • Amazon Aurora and Amazon RDS databases in an account that are Underprovisioned, Overprovisioned, Optimized, or NotOptimized.

Parameters:

  • account_ids (Optional[AccountIds], default: None ) –

    The ID of the Amazon Web Services account for which to return recommendation summaries.

    If your account is the management account of an organization, use this parameter to specify the member account for which you want to return recommendation summaries.

    Only one account ID can be specified per request.

  • next_token (Optional[NextToken], default: None ) –

    The token to advance to the next page of recommendation summaries.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of recommendation summaries to return with a single request.

    To retrieve the remaining results, make another request with the returned nextToken value.

Raises:

Source code in docs_src/capo_compute_optimizer/_services/async_compute_optimizer.py
async def get_recommendation_summaries(
    self,
    *,
    config_overrides: Optional[AsyncComputeOptimizerClientConfig] = None,
    account_ids: Optional[
        "capo_compute_optimizer.types.account_ids.AccountIds"
    ] = None,
    next_token: Optional[
        "capo_compute_optimizer.types.next_token.NextToken"
    ] = None,
    max_results: Optional[
        "capo_compute_optimizer.types.max_results.MaxResults"
    ] = None,
) -> "capo_compute_optimizer.types.get_recommendation_summaries_response.GetRecommendationSummariesResponse":
    """<p>Returns the optimization findings for an account.</p> <p>It returns the number of:</p> <ul> <li> <p>Amazon EC2 instances in an account that are <code>Underprovisioned</code>, <code>Overprovisioned</code>, or <code>Optimized</code>.</p> </li> <li> <p>EC2Auto Scaling groups in an account that are <code>NotOptimized</code>, or <code>Optimized</code>.</p> </li> <li> <p>Amazon EBS volumes in an account that are <code>NotOptimized</code>, or <code>Optimized</code>.</p> </li> <li> <p>Lambda functions in an account that are <code>NotOptimized</code>, or <code>Optimized</code>.</p> </li> <li> <p>Amazon ECS services in an account that are <code>Underprovisioned</code>, <code>Overprovisioned</code>, or <code>Optimized</code>.</p> </li> <li> <p>Commercial software licenses in an account that are <code>InsufficientMetrics</code>, <code>NotOptimized</code> or <code>Optimized</code>.</p> </li> <li> <p>Amazon Aurora and Amazon RDS databases in an account that are <code>Underprovisioned</code>, <code>Overprovisioned</code>, <code>Optimized</code>, or <code>NotOptimized</code>.</p> </li> </ul>

    Args:
        account_ids: <p>The ID of the Amazon Web Services account for which to return recommendation summaries.</p> <p>If your account is the management account of an organization, use this parameter to specify the member account for which you want to return recommendation summaries.</p> <p>Only one account ID can be specified per request.</p>
        next_token: <p>The token to advance to the next page of recommendation summaries.</p>
        max_results: <p>The maximum number of recommendation summaries to return with a single request.</p> <p>To retrieve the remaining results, make another request with the returned <code>nextToken</code> value.</p>

    Raises:
        capo_compute_optimizer.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_compute_optimizer.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred. Try your call again.</p>
        capo_compute_optimizer.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value supplied for the input parameter is out of range or not valid.</p>
        capo_compute_optimizer.errors.missing_authentication_token.MissingAuthenticationToken: <p>The request must contain either a valid (registered) Amazon Web Services access key ID or X.509 certificate.</p>
        capo_compute_optimizer.errors.opt_in_required_exception.OptInRequiredException: <p>The account is not opted in to Compute Optimizer.</p>
        capo_compute_optimizer.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed due to a temporary failure of the server.</p>
        capo_compute_optimizer.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_compute_optimizer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_compute_optimizer.types.get_recommendation_summaries_request.GetRecommendationSummariesRequest]",
    ) -> AsyncOperationResponse[
        "capo_compute_optimizer.types.get_recommendation_summaries_response.GetRecommendationSummariesResponse"
    ]:
        import capo_compute_optimizer._operations.compute_optimizer_service.get_recommendation_summaries

        (
            output,
            http_response,
        ) = await capo_compute_optimizer._operations.compute_optimizer_service.get_recommendation_summaries.async_get_recommendation_summaries(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetRecommendationSummaries")
    )
    input_: capo_compute_optimizer.types.get_recommendation_summaries_request.GetRecommendationSummariesRequest = {}
    if account_ids is not None:
        input_["account_ids"] = account_ids
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output