async 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[AsyncPIClientConfig] = 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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_pi.types.create_performance_analysis_report_request.CreatePerformanceAnalysisReportRequest]",
) -> AsyncOperationResponse[
"capo_pi.types.create_performance_analysis_report_response.CreatePerformanceAnalysisReportResponse"
]:
if req.options.protocol == "awsJson1_1":
import capo_pi._operations.performance_insightsv20180227.aws_json1_1.create_performance_analysis_report
(
output,
http_response,
) = await capo_pi._operations.performance_insightsv20180227.aws_json1_1.create_performance_analysis_report.async_create_performance_analysis_report(
req.options, req.input
)
elif req.options.protocol == "rpcv2Cbor":
import capo_pi._operations.performance_insightsv20180227.rpcv2_cbor.create_performance_analysis_report
(
output,
http_response,
) = await capo_pi._operations.performance_insightsv20180227.rpcv2_cbor.create_performance_analysis_report.async_create_performance_analysis_report(
req.options, req.input
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return AsyncOperationResponse(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 = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output