Skip to content

get_ip_set

get_ip_set(
    detector_id: DetectorId,
    ip_set_id: String,
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
) -> GetIPSetResponse

Retrieves the IPSet specified by the ipSetId.

Parameters:

  • detector_id (DetectorId) –

    The unique ID of the detector that is associated with the IPSet.

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

  • ip_set_id (String) –

    The unique ID of the IPSet to retrieve.

Raises:

Source code in docs_src/capo_guardduty/_services/guard_duty.py
def get_ip_set(
    self,
    detector_id: "capo_guardduty.types.detector_id.DetectorId",
    ip_set_id: "capo_guardduty.types.string.String",
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
) -> "capo_guardduty.types.get_ip_set_response.GetIPSetResponse":
    """<p>Retrieves the IPSet specified by the <code>ipSetId</code>.</p>

    Args:
        detector_id: <p>The unique ID of the detector that is associated with the IPSet.</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>
        ip_set_id: <p>The unique ID of the IPSet to retrieve.</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[capo_guardduty.types.get_ip_set_request.GetIPSetRequest]",
    ) -> OperationResponse[
        "capo_guardduty.types.get_ip_set_response.GetIPSetResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.get_ip_set

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetIPSet")
    )
    input_: capo_guardduty.types.get_ip_set_request.GetIPSetRequest = {
        "detector_id": detector_id,
        "ip_set_id": ip_set_id,
    }

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