Skip to content

delete_filter

delete_filter(
    detector_id: DetectorId,
    filter_name: String,
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
) -> DeleteFilterResponse

Deletes the filter specified by the filter name.

Parameters:

  • detector_id (DetectorId) –

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

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

  • filter_name (String) –

    The name of the filter that you want to delete.

Raises:

Source code in docs_src/capo_guardduty/_services/guard_duty.py
def delete_filter(
    self,
    detector_id: "capo_guardduty.types.detector_id.DetectorId",
    filter_name: "capo_guardduty.types.string.String",
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
) -> "capo_guardduty.types.delete_filter_response.DeleteFilterResponse":
    """<p>Deletes the filter specified by the filter name.</p>

    Args:
        detector_id: <p>The unique ID of the detector that is associated with the filter.</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_name: <p>The name of the filter that you want to delete.</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.delete_filter_request.DeleteFilterRequest]",
    ) -> OperationResponse[
        "capo_guardduty.types.delete_filter_response.DeleteFilterResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.delete_filter

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteFilter")
    )
    input_: capo_guardduty.types.delete_filter_request.DeleteFilterRequest = {
        "detector_id": detector_id,
        "filter_name": filter_name,
    }

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