Skip to content

get_findings async

get_findings(
    detector_id: DetectorId,
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    finding_ids: Optional[FindingIds] = None,
    sort_criteria: Optional[SortCriteria] = None,
) -> GetFindingsResponse

Describes Amazon GuardDuty findings specified by finding IDs.

Parameters:

  • detector_id (DetectorId) –

    The ID of the detector that specifies the GuardDuty service whose findings 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.

  • finding_ids (Optional[FindingIds], default: None ) –

    The IDs of the findings that you want to retrieve.

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

    Represents the criteria used for sorting findings.

Raises:

Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
async def get_findings(
    self,
    detector_id: "capo_guardduty.types.detector_id.DetectorId",
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    finding_ids: Optional["capo_guardduty.types.finding_ids.FindingIds"] = None,
    sort_criteria: Optional[
        "capo_guardduty.types.sort_criteria.SortCriteria"
    ] = None,
) -> "capo_guardduty.types.get_findings_response.GetFindingsResponse":
    """<p>Describes Amazon GuardDuty findings specified by finding IDs.</p>

    Args:
        detector_id: <p>The ID of the detector that specifies the GuardDuty service whose findings 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>
        finding_ids: <p>The IDs of the findings that you want to retrieve.</p>
        sort_criteria: <p>Represents the criteria used for sorting findings.</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.get_findings_request.GetFindingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_guardduty.types.get_findings_response.GetFindingsResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.get_findings

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

    def _redact_output(
        output: "capo_guardduty.types.get_findings_response.GetFindingsResponse",
    ) -> dict[str, Any]:
        import capo_guardduty.types.get_findings_response

        return capo_guardduty.types.get_findings_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetFindings", redact_output=_redact_output),
    )
    input_: capo_guardduty.types.get_findings_request.GetFindingsRequest = {
        "detector_id": detector_id
    }
    if finding_ids is not None:
        input_["finding_ids"] = finding_ids
    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