Skip to content

list_investigations async

list_investigations(
    detector_id: DetectorId,
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    filter_criteria: Optional[InvestigationFilterCriteria] = None,
    sort_criteria: Optional[InvestigationSortCriteria] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListInvestigationsResponse

This API is currently available as a preview. This feature is available in the following Amazon Web Services Regions: US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), Europe (Frankfurt), Europe (Ireland), Europe (London), Europe (Paris), Europe (Stockholm), and Asia Pacific (Tokyo).

Returns a list of investigations associated with the specified GuardDuty detector. You can filter the investigations by status, risk level, confidence, finding ID, and investigation type, and sort them by start time, end time, status, risk level, or confidence.

An administrator account sees all investigations across the organization. Member accounts see only the investigations that belong to them.

Parameters:

  • detector_id (DetectorId) –

    The unique ID of the GuardDuty detector whose investigations you want to list.

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

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

    The criteria used to filter investigations. GuardDuty returns only the investigations that match all of the specified criteria.

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

    Represents the criteria used for sorting investigations.

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

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 50.

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

    You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the list action. For subsequent calls to the action, fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

Raises:

Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
async def list_investigations(
    self,
    detector_id: "capo_guardduty.types.detector_id.DetectorId",
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    filter_criteria: Optional[
        "capo_guardduty.types.investigation_filter_criteria.InvestigationFilterCriteria"
    ] = None,
    sort_criteria: Optional[
        "capo_guardduty.types.investigation_sort_criteria.InvestigationSortCriteria"
    ] = None,
    max_results: Optional["capo_guardduty.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_guardduty.types.next_token.NextToken"] = None,
) -> "capo_guardduty.types.list_investigations_response.ListInvestigationsResponse":
    """<p>This API is currently available as a preview. This feature is available in the following Amazon Web Services Regions: US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), Europe (Frankfurt), Europe (Ireland), Europe (London), Europe (Paris), Europe (Stockholm), and Asia Pacific (Tokyo).</p> <p>Returns a list of investigations associated with the specified GuardDuty detector. You can filter the investigations by status, risk level, confidence, finding ID, and investigation type, and sort them by start time, end time, status, risk level, or confidence.</p> <p>An administrator account sees all investigations across the organization. Member accounts see only the investigations that belong to them.</p>

    Args:
        detector_id: <p>The unique ID of the GuardDuty detector whose investigations you want to list.</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>
        filter_criteria: <p>The criteria used to filter investigations. GuardDuty returns only the investigations that match all of the specified criteria.</p>
        sort_criteria: <p>Represents the criteria used for sorting investigations.</p>
        max_results: <p>You can use this parameter to indicate the maximum number of items you want in the response. The default value is 50.</p>
        next_token: <p>You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the list action. For subsequent calls to the action, fill nextToken in the request with the value of NextToken from the previous response to continue listing data.</p>

    Raises:
        capo_guardduty.errors.access_denied_exception.AccessDeniedException: <p>An access denied exception object.</p>
        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_investigations_request.ListInvestigationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_guardduty.types.list_investigations_response.ListInvestigationsResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.list_investigations

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

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

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