Skip to content

get_performance_analysis_report async

get_performance_analysis_report(
    service_type: ServiceType,
    identifier: IdentifierString,
    analysis_report_id: AnalysisReportId,
    *,
    config_overrides: Optional[AsyncPIClientConfig] = None,
    text_format: Optional[TextFormat] = None,
    accept_language: Optional[AcceptLanguage] = None,
) -> GetPerformanceAnalysisReportResponse

Retrieves the report including the report ID, status, time details, and the insights with recommendations. The report status can be RUNNING, SUCCEEDED, or FAILED. The insights include the description and recommendation fields.

Parameters:

  • service_type (ServiceType) –

    The Amazon Web Services service for which Performance Insights will return 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

  • text_format (Optional[TextFormat], default: None ) –

    Indicates the text format in the report. The options are PLAIN_TEXT or MARKDOWN. The default value is plain text.

  • accept_language (Optional[AcceptLanguage], default: None ) –

    The text language in the report. The default language is EN_US (English).

Raises:

Source code in docs_src/capo_pi/_services/async_pi.py
async def get_performance_analysis_report(
    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,
    text_format: Optional["capo_pi.types.text_format.TextFormat"] = None,
    accept_language: Optional[
        "capo_pi.types.accept_language.AcceptLanguage"
    ] = None,
) -> "capo_pi.types.get_performance_analysis_report_response.GetPerformanceAnalysisReportResponse":
    """<p>Retrieves the report including the report ID, status, time details, and the insights with recommendations. The report status can be <code>RUNNING</code>, <code>SUCCEEDED</code>, or <code>FAILED</code>. The insights include the <code>description</code> and <code>recommendation</code> fields. </p>

    Args:
        service_type: <p>The Amazon Web Services service for which Performance Insights will return 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>
        text_format: <p>Indicates the text format in the report. The options are <code>PLAIN_TEXT</code> or <code>MARKDOWN</code>. The default value is <code>plain text</code>.</p>
        accept_language: <p>The text language in the report. The default language is <code>EN_US</code> (English). </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.get_performance_analysis_report_request.GetPerformanceAnalysisReportRequest]",
    ) -> AsyncOperationResponse[
        "capo_pi.types.get_performance_analysis_report_response.GetPerformanceAnalysisReportResponse"
    ]:
        import capo_pi._operations.performance_insightsv20180227.get_performance_analysis_report

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

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

        return (
            capo_pi.types.get_performance_analysis_report_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetPerformanceAnalysisReport", redact_output=_redact_output
        ),
    )
    input_: capo_pi.types.get_performance_analysis_report_request.GetPerformanceAnalysisReportRequest = {
        "service_type": service_type,
        "identifier": identifier,
        "analysis_report_id": analysis_report_id,
    }
    if text_format is not None:
        input_["text_format"] = text_format
    if accept_language is not None:
        input_["accept_language"] = accept_language

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