Skip to content

update_filter

update_filter(
    filter_arn: FilterArn,
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    action: Optional[FilterAction] = None,
    description: Optional[FilterDescription] = None,
    filter_criteria: Optional[FilterCriteria] = None,
    name: Optional[FilterName] = None,
    reason: Optional[FilterReason] = None,
) -> UpdateFilterResponse

Specifies the action that is to be applied to the findings that match the filter.

Parameters:

  • action (Optional[FilterAction], default: None ) –

    Specifies the action that is to be applied to the findings that match the filter.

  • description (Optional[FilterDescription], default: None ) –

    A description of the filter.

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

    Defines the criteria to be update in the filter.

  • name (Optional[FilterName], default: None ) –

    The name of the filter.

  • filter_arn (FilterArn) –

    The Amazon Resource Number (ARN) of the filter to update.

  • reason (Optional[FilterReason], default: None ) –

    The reason the filter was updated.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

    For Enable, you receive this error if you attempt to use a feature in an unsupported Amazon Web Services Region.

  • InternalServerException –

    The request has failed due to an internal failure of the Amazon Inspector service.

  • ResourceNotFoundException –

    The operation tried to access an invalid resource. Make sure the resource is specified correctly.

  • ThrottlingException –

    The limit on the number of requests per second was exceeded.

  • ValidationException –

    The request has failed validation due to missing required fields or having invalid inputs.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_inspector2/_services/inspector2.py
def update_filter(
    self,
    filter_arn: "capo_inspector2.types.filter_arn.FilterArn",
    *,
    config_overrides: Optional[Inspector2ClientConfig] = None,
    action: Optional["capo_inspector2.types.filter_action.FilterAction"] = None,
    description: Optional[
        "capo_inspector2.types.filter_description.FilterDescription"
    ] = None,
    filter_criteria: Optional[
        "capo_inspector2.types.filter_criteria.FilterCriteria"
    ] = None,
    name: Optional["capo_inspector2.types.filter_name.FilterName"] = None,
    reason: Optional["capo_inspector2.types.filter_reason.FilterReason"] = None,
) -> "capo_inspector2.types.update_filter_response.UpdateFilterResponse":
    """<p>Specifies the action that is to be applied to the findings that match the filter.</p>

    Args:
        action: <p>Specifies the action that is to be applied to the findings that match the filter.</p>
        description: <p>A description of the filter.</p>
        filter_criteria: <p>Defines the criteria to be update in the filter.</p>
        name: <p>The name of the filter.</p>
        filter_arn: <p>The Amazon Resource Number (ARN) of the filter to update.</p>
        reason: <p>The reason the filter was updated.</p>

    Raises:
        capo_inspector2.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p> <p> For <code>Enable</code>, you receive this error if you attempt to use a feature in an unsupported Amazon Web Services Region. </p>
        capo_inspector2.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal failure of the Amazon Inspector service.</p>
        capo_inspector2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access an invalid resource. Make sure the resource is specified correctly.</p>
        capo_inspector2.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_inspector2.errors.validation_exception.ValidationException: <p>The request has failed validation due to missing required fields or having invalid inputs.</p>
        capo_inspector2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_inspector2.types.update_filter_request.UpdateFilterRequest]",
    ) -> OperationResponse[
        "capo_inspector2.types.update_filter_response.UpdateFilterResponse"
    ]:
        import capo_inspector2._operations.inspector2.update_filter

        output, http_response = (
            capo_inspector2._operations.inspector2.update_filter.update_filter(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFilter")
    )
    input_: capo_inspector2.types.update_filter_request.UpdateFilterRequest = {
        "filter_arn": filter_arn
    }
    if action is not None:
        input_["action"] = action
    if description is not None:
        input_["description"] = description
    if filter_criteria is not None:
        input_["filter_criteria"] = filter_criteria
    if name is not None:
        input_["name"] = name
    if reason is not None:
        input_["reason"] = reason

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