Skip to content

list_coverage async

list_coverage(
    detector_id: DetectorId,
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    next_token: Optional[String] = None,
    max_results: Optional[MaxResults] = None,
    filter_criteria: Optional[CoverageFilterCriteria] = None,
    sort_criteria: Optional[CoverageSortCriteria] = None,
) -> ListCoverageResponse

Lists coverage details for your GuardDuty account. If you're a GuardDuty administrator, you can retrieve all resources associated with the active member accounts in your organization.

Make sure the accounts have Runtime Monitoring enabled and GuardDuty agent running on their resources.

Parameters:

  • detector_id (DetectorId) –

    The unique ID of the detector whose coverage details you want to retrieve.

    To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.

  • next_token (Optional[String], default: None ) –

    A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return in the response.

  • filter_criteria (Optional[CoverageFilterCriteria], default: None ) –

    Represents the criteria used to filter the coverage details.

  • sort_criteria (Optional[CoverageSortCriteria], default: None ) –

    Represents the criteria used to sort the coverage details.

Raises:

Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
async def list_coverage(
    self,
    detector_id: "capo_guardduty.types.detector_id.DetectorId",
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    next_token: Optional["capo_guardduty.types.string.String"] = None,
    max_results: Optional["capo_guardduty.types.max_results.MaxResults"] = None,
    filter_criteria: Optional[
        "capo_guardduty.types.coverage_filter_criteria.CoverageFilterCriteria"
    ] = None,
    sort_criteria: Optional[
        "capo_guardduty.types.coverage_sort_criteria.CoverageSortCriteria"
    ] = None,
) -> "capo_guardduty.types.list_coverage_response.ListCoverageResponse":
    """<p>Lists coverage details for your GuardDuty account. If you're a GuardDuty administrator, you can retrieve all resources associated with the active member accounts in your organization.</p> <p>Make sure the accounts have Runtime Monitoring enabled and GuardDuty agent running on their resources.</p>

    Args:
        detector_id: <p>The unique ID of the detector whose coverage details you want to retrieve.</p> <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
        next_token: <p>A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page.</p>
        max_results: <p>The maximum number of results to return in the response.</p>
        filter_criteria: <p>Represents the criteria used to filter the coverage details.</p>
        sort_criteria: <p>Represents the criteria used to sort the coverage details.</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[capo_guardduty.types.list_coverage_request.ListCoverageRequest]",
    ) -> AsyncOperationResponse[
        "capo_guardduty.types.list_coverage_response.ListCoverageResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.list_coverage

        (
            output,
            http_response,
        ) = await capo_guardduty._operations.guard_duty_api_service.list_coverage.async_list_coverage(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCoverage")
    )
    input_: capo_guardduty.types.list_coverage_request.ListCoverageRequest = {
        "detector_id": detector_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if filter_criteria is not None:
        input_["filter_criteria"] = filter_criteria
    if sort_criteria is not None:
        input_["sort_criteria"] = sort_criteria

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