Method: Elasticsearch::API::MachineLearning::Actions#update_filter
- Defined in:
- lib/elasticsearch/api/actions/machine_learning/update_filter.rb
#update_filter(arguments = {}) ⇒ Object
Updates the description of a filter, adds items, or removes items.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/elasticsearch/api/actions/machine_learning/update_filter.rb', line 33 def update_filter(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "ml.update_filter" } defined_params = [:filter_id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _filter_id = arguments.delete(:filter_id) method = Elasticsearch::API::HTTP_POST path = "_ml/filters/#{Utils.__listify(_filter_id)}/_update" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |