Skip to content

get_investigation async

get_investigation(
    detector_id: DetectorId,
    investigation_id: InvestigationId,
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    summary_format: Optional[SummaryFormat] = None,
) -> GetInvestigationResponse

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).

Retrieves the results and status of a specific GuardDuty investigation.

GuardDuty returns the results, including the summary and the scope of the investigation, only when the investigation status is COMPLETED. By default, GuardDuty returns the summary as text in Summary. To return a typed summary in SummaryData instead, set SummaryFormat to STRUCTURED.

An administrator account can retrieve any investigation within the organization. Member accounts can only retrieve investigations that belong to them.

Parameters:

  • detector_id (DetectorId) –

    The unique ID of the GuardDuty detector associated with the investigation.

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

  • investigation_id (InvestigationId) –

    The unique identifier of the investigation to retrieve.

  • summary_format (Optional[SummaryFormat], default: None ) –

    The format in which to return the investigation summary. Possible values:

    • STRING – (Default) Returns the summary as text in Summary.

    • STRUCTURED – Returns a typed summary in SummaryData.

    GuardDuty returns a summary only when the investigation status is COMPLETED.

Raises:

Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
async def get_investigation(
    self,
    detector_id: "capo_guardduty.types.detector_id.DetectorId",
    investigation_id: "capo_guardduty.types.investigation_id.InvestigationId",
    *,
    config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
    summary_format: Optional[
        "capo_guardduty.types.summary_format.SummaryFormat"
    ] = None,
) -> "capo_guardduty.types.get_investigation_response.GetInvestigationResponse":
    """<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>Retrieves the results and status of a specific GuardDuty investigation.</p> <p>GuardDuty returns the results, including the summary and the scope of the investigation, only when the investigation status is <code>COMPLETED</code>. By default, GuardDuty returns the summary as text in <code>Summary</code>. To return a typed summary in <code>SummaryData</code> instead, set <code>SummaryFormat</code> to <code>STRUCTURED</code>.</p> <p>An administrator account can retrieve any investigation within the organization. Member accounts can only retrieve investigations that belong to them.</p>

    Args:
        detector_id: <p>The unique ID of the GuardDuty detector associated with the investigation.</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>
        investigation_id: <p>The unique identifier of the investigation to retrieve.</p>
        summary_format: <p>The format in which to return the investigation summary. Possible values:</p> <ul> <li> <p> <code>STRING</code> – (Default) Returns the summary as text in <code>Summary</code>.</p> </li> <li> <p> <code>STRUCTURED</code> – Returns a typed summary in <code>SummaryData</code>.</p> </li> </ul> <p>GuardDuty returns a summary only when the investigation status is <code>COMPLETED</code>.</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.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</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_investigation_request.GetInvestigationRequest]",
    ) -> AsyncOperationResponse[
        "capo_guardduty.types.get_investigation_response.GetInvestigationResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.get_investigation

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetInvestigation")
    )
    input_: capo_guardduty.types.get_investigation_request.GetInvestigationRequest = {
        "detector_id": detector_id,
        "investigation_id": investigation_id,
    }
    if summary_format is not None:
        input_["summary_format"] = summary_format

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