Method: Elasticsearch::API::MachineLearning::Actions#stop_datafeed
- Defined in:
- lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb
#stop_datafeed(arguments = {}) ⇒ Object
Stop datafeeds. A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped multiple times throughout its lifecycle.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb', line 58 def stop_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_datafeed' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_POST path = "_ml/datafeeds/#{Utils.listify(_datafeed_id)}/_stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |