Returns a summary of metrics for an account from a specified date, including number of open findings, the categories with most findings, the scans with most open findings, and scans with most open critical findings.
Parameters:
-
date
(datetime)
–
The date you want to retrieve summary metrics from, rounded to the nearest day. The date must be within the past two years.
Raises:
Source code in docs_src/capo_codeguru_security/_services/code_guru_security.py
| def get_metrics_summary(
self,
date: datetime.datetime,
*,
config_overrides: Optional[CodeGuruSecurityClientConfig] = None,
) -> "capo_codeguru_security.types.get_metrics_summary_response.GetMetricsSummaryResponse":
"""<p>Returns a summary of metrics for an account from a specified date, including number of open findings, the categories with most findings, the scans with most open findings, and scans with most open critical findings. </p>
Args:
date: <p>The date you want to retrieve summary metrics from, rounded to the nearest day. The date must be within the past two years.</p>
Raises:
capo_codeguru_security.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_codeguru_security.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
capo_codeguru_security.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_codeguru_security.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
capo_codeguru_security.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_codeguru_security.types.get_metrics_summary_request.GetMetricsSummaryRequest]",
) -> OperationResponse[
"capo_codeguru_security.types.get_metrics_summary_response.GetMetricsSummaryResponse"
]:
import capo_codeguru_security._operations.aws_code_guru_security.get_metrics_summary
output, http_response = (
capo_codeguru_security._operations.aws_code_guru_security.get_metrics_summary.get_metrics_summary(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetMetricsSummary")
)
input_: capo_codeguru_security.types.get_metrics_summary_request.GetMetricsSummaryRequest = {
"date": date
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|