Skip to content

create_performance_analysis_report

create_performance_analysis_report(
    service_type: ServiceType,
    identifier: IdentifierString,
    start_time: ISOTimestamp,
    *,
    config_overrides: Optional[PIClientConfig] = None,
    end_time: Optional[ISOTimestamp] = None,
    tags: Optional[TagList] = None,
) -> CreatePerformanceAnalysisReportResponse

Creates a new performance analysis report for a specific time period for the DB instance.

Parameters:

  • service_type (ServiceType) –

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

  • identifier (IdentifierString) –

    An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.

    To use an Amazon RDS instance as a data source, you specify its DbiResourceId value. For example, specify db-ADECBTYHKTSAUMUZQYPDS2GW4A.

  • start_time (ISOTimestamp) –

    The start time defined for the analysis report.

  • end_time (Optional[ISOTimestamp], default: None ) –

    The end time defined for the analysis report.

  • tags (Optional[TagList], default: None ) –

    The metadata assigned to the analysis report consisting of a key-value pair.

Raises:

Source code in docs_src/capo_pi/_services/pi.py
def create_performance_analysis_report(
    self,
    service_type: "capo_pi.types.service_type.ServiceType",
    identifier: "capo_pi.types.identifier_string.IdentifierString",
    start_time: "capo_pi.types.iso_timestamp.ISOTimestamp",
    *,
    config_overrides: Optional[PIClientConfig] = None,
    end_time: Optional["capo_pi.types.iso_timestamp.ISOTimestamp"] = None,
    tags: Optional["capo_pi.types.tag_list.TagList"] = None,
) -> "capo_pi.types.create_performance_analysis_report_response.CreatePerformanceAnalysisReportResponse":
    """<p>Creates a new performance analysis report for a specific time period for the DB instance.</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, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.</p> <p>To use an Amazon RDS instance as a data source, you specify its <code>DbiResourceId</code> value. For example, specify <code>db-ADECBTYHKTSAUMUZQYPDS2GW4A</code>.</p>
        start_time: <p>The start time defined for the analysis report.</p>
        end_time: <p>The end time defined for the analysis report.</p>
        tags: <p>The metadata assigned to the analysis report consisting of a key-value pair.</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.
    """

    def _handler(
        req: "OperationRequest[capo_pi.types.create_performance_analysis_report_request.CreatePerformanceAnalysisReportRequest]",
    ) -> OperationResponse[
        "capo_pi.types.create_performance_analysis_report_response.CreatePerformanceAnalysisReportResponse"
    ]:
        import capo_pi._operations.performance_insightsv20180227.create_performance_analysis_report

        output, http_response = (
            capo_pi._operations.performance_insightsv20180227.create_performance_analysis_report.create_performance_analysis_report(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePerformanceAnalysisReport")
    )
    input_: capo_pi.types.create_performance_analysis_report_request.CreatePerformanceAnalysisReportRequest = {
        "service_type": service_type,
        "identifier": identifier,
        "start_time": start_time,
    }
    if end_time is not None:
        input_["end_time"] = end_time
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output