Skip to content

get_organization_statistics

get_organization_statistics(
    *, config_overrides: Optional[GuardDutyClientConfig] = 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/guard_duty.py
def get_organization_statistics(
    self, *, config_overrides: Optional[GuardDutyClientConfig] = 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.
    """

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

        output, http_response = (
            capo_guardduty._operations.guard_duty_api_service.get_organization_statistics.get_organization_statistics(
                req.options
            )
        )
        return OperationResponse(output=output, response=http_response)

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

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