Method: Elasticsearch::XPack::API::MachineLearning::Actions#start_datafeed

Defined in:
lib/elasticsearch/xpack/api/actions/machine_learning/start_datafeed.rb

#start_datafeed(arguments = {}) ⇒ Object

Starts one or more datafeeds.

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to start

  • :start (String)

    The start time from where the datafeed should begin

  • :end (String)

    The end time when the datafeed should stop. When not set, the datafeed continues in real time

  • :timeout (Time)

    Controls the time to wait until a datafeed has started. Default to 20 seconds

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The start datafeed parameters

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/start_datafeed.rb', line 34

def start_datafeed(arguments = {})
  raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id]

  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _datafeed_id = arguments.delete(:datafeed_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/datafeeds/#{Elasticsearch::API::Utils.__listify(_datafeed_id)}/_start"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end