Skip to content

list_performance_analysis_report_recommendations async

list_performance_analysis_report_recommendations(
    service_type: ServiceType,
    identifier: IdentifierString,
    analysis_report_id: AnalysisReportId,
    *,
    config_overrides: Optional[AsyncPIClientConfig] = None,
    recommendation_ids: Optional[RecommendationIdList] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListPerformanceAnalysisReportRecommendationsResponse

Retrieves recommendations for a performance analysis report.

Parameters:

  • service_type (ServiceType) –

    The Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS.

  • identifier (IdentifierString) –

    An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId.

    To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.

  • analysis_report_id (AnalysisReportId) –

    A unique identifier of the created analysis report. For example, report-12345678901234567

  • recommendation_ids (Optional[RecommendationIdList], default: None ) –

    A list of recommendation identifiers to filter the results.

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

    The maximum number of items to return in the response. If more items exist than the specified MaxResults value, a pagination token is included in the response so that the remaining results can be retrieved.

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

    An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxResults.

Raises:

Source code in docs_src/capo_pi/_services/async_pi.py
async def list_performance_analysis_report_recommendations(
    self,
    service_type: "capo_pi.types.service_type.ServiceType",
    identifier: "capo_pi.types.identifier_string.IdentifierString",
    analysis_report_id: "capo_pi.types.analysis_report_id.AnalysisReportId",
    *,
    config_overrides: Optional[AsyncPIClientConfig] = None,
    recommendation_ids: Optional[
        "capo_pi.types.recommendation_id_list.RecommendationIdList"
    ] = None,
    max_results: Optional["capo_pi.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_pi.types.next_token.NextToken"] = None,
) -> "capo_pi.types.list_performance_analysis_report_recommendations_response.ListPerformanceAnalysisReportRecommendationsResponse":
    """<p>Retrieves recommendations for a performance analysis report.</p>

    Args:
        service_type: <p>The Amazon Web Services service for which Performance Insights returns metrics. Valid value is <code>RDS</code>.</p>
        identifier: <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p> <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p>
        analysis_report_id: <p>A unique identifier of the created analysis report. For example, <code>report-12345678901234567</code> </p>
        recommendation_ids: <p>A list of recommendation identifiers to filter the results.</p>
        max_results: <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxResults</code> value, a pagination token is included in the response so that the remaining results can be retrieved. </p>
        next_token: <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxResults</code>.</p>

    Raises:
        capo_pi.errors.internal_service_error.InternalServiceError: <p>The request failed due to an unknown error.</p>
        capo_pi.errors.invalid_argument_exception.InvalidArgumentException: <p>One of the arguments provided is invalid for this request.</p>
        capo_pi.errors.not_authorized_exception.NotAuthorizedException: <p>The user is not authorized to perform this request.</p>
        capo_pi.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_pi.types.list_performance_analysis_report_recommendations_request.ListPerformanceAnalysisReportRecommendationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_pi.types.list_performance_analysis_report_recommendations_response.ListPerformanceAnalysisReportRecommendationsResponse"
    ]:
        import capo_pi._operations.performance_insightsv20180227.list_performance_analysis_report_recommendations

        (
            output,
            http_response,
        ) = await capo_pi._operations.performance_insightsv20180227.list_performance_analysis_report_recommendations.async_list_performance_analysis_report_recommendations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_pi.types.list_performance_analysis_report_recommendations_response.ListPerformanceAnalysisReportRecommendationsResponse",
    ) -> dict[str, Any]:
        import capo_pi.types.list_performance_analysis_report_recommendations_response

        return capo_pi.types.list_performance_analysis_report_recommendations_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListPerformanceAnalysisReportRecommendations",
            redact_output=_redact_output,
        ),
    )
    input_: capo_pi.types.list_performance_analysis_report_recommendations_request.ListPerformanceAnalysisReportRecommendationsRequest = {
        "service_type": service_type,
        "identifier": identifier,
        "analysis_report_id": analysis_report_id,
    }
    if recommendation_ids is not None:
        input_["recommendation_ids"] = recommendation_ids
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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