Skip to content

get_organization_statistics async

get_organization_statistics(
    *, config_overrides: Optional[AsyncGuardDutyClientConfig] = None
) -> GetOrganizationStatisticsResponse

Retrieves how many active member accounts have each feature enabled within GuardDuty. Only a delegated GuardDuty administrator of an organization can run this API.

When you create a new organization, it might take up to 24 hours to generate the statistics for the entire organization.

Raises:

Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
async def get_organization_statistics(
    self, *, config_overrides: Optional[AsyncGuardDutyClientConfig] = None
) -> "capo_guardduty.types.get_organization_statistics_response.GetOrganizationStatisticsResponse":
    """<p>Retrieves how many active member accounts have each feature enabled within GuardDuty. Only a delegated GuardDuty administrator of an organization can run this API.</p> <p>When you create a new organization, it might take up to 24 hours to generate the statistics for the entire organization.</p>

    Raises:
        capo_guardduty.errors.bad_request_exception.BadRequestException: <p>A bad request exception object.</p>
        capo_guardduty.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error exception object.</p>
        capo_guardduty.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[None]",
    ) -> AsyncOperationResponse[
        "capo_guardduty.types.get_organization_statistics_response.GetOrganizationStatisticsResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.get_organization_statistics

        (
            output,
            http_response,
        ) = await capo_guardduty._operations.guard_duty_api_service.get_organization_statistics.async_get_organization_statistics(
            req.options
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetOrganizationStatistics")
    )

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