Skip to content

get_metrics_summary async

get_metrics_summary(
    date: datetime,
    *,
    config_overrides: Optional[AsyncCodeGuruSecurityClientConfig] = None,
) -> GetMetricsSummaryResponse

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/async_code_guru_security.py
async def get_metrics_summary(
    self,
    date: datetime.datetime,
    *,
    config_overrides: Optional[AsyncCodeGuruSecurityClientConfig] = 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codeguru_security.types.get_metrics_summary_request.GetMetricsSummaryRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguru_security.types.get_metrics_summary_response.GetMetricsSummaryResponse"
    ]:
        import capo_codeguru_security._operations.aws_code_guru_security.get_metrics_summary

        (
            output,
            http_response,
        ) = await capo_codeguru_security._operations.aws_code_guru_security.get_metrics_summary.async_get_metrics_summary(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output