module Elasticsearch::API::MachineLearning::Actions

Public Instance Methods

clear_trained_model_deployment_cache(arguments = {}) click to toggle source

Clear the cached results from a trained model deployment

@option arguments [String] :model_id The unique identifier of the trained model. (Required) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/clear-trained-model-deployment-cache.html

# File lib/elasticsearch/api/actions/machine_learning/clear_trained_model_deployment_cache.rb, line 32
def clear_trained_model_deployment_cache(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.clear_trained_model_deployment_cache' }

  defined_params = [:model_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 'model_id' missing" unless arguments[:model_id]

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

  body = nil

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/cache/_clear"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
close_job(arguments = {}) click to toggle source

Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle.

@option arguments [String] :job_id The name of the job to close @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified) @option arguments [Boolean] :force True if the job should be forcefully closed @option arguments [Time] :timeout Controls the time to wait until a job has closed. Default to 30 minutes @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The URL params optionally sent in the body

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-close-job.html

# File lib/elasticsearch/api/actions/machine_learning/close_job.rb, line 36
def close_job(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.close_job' }

  defined_params = [:job_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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_close"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_calendar(arguments = {}) click to toggle source

Deletes a calendar.

@option arguments [String] :calendar_id The ID of the calendar to delete @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-delete-calendar.html

# File lib/elasticsearch/api/actions/machine_learning/delete_calendar.rb, line 32
def delete_calendar(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_calendar' }

  defined_params = [:calendar_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 'calendar_id' missing" unless arguments[:calendar_id]

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

  body = nil

  _calendar_id = arguments.delete(:calendar_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/calendars/#{Utils.__listify(_calendar_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_calendar_event(arguments = {}) click to toggle source

Deletes scheduled events from a calendar.

@option arguments [String] :calendar_id The ID of the calendar to modify @option arguments [String] :event_id The ID of the event to remove from the calendar @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-delete-calendar-event.html

# File lib/elasticsearch/api/actions/machine_learning/delete_calendar_event.rb, line 33
def delete_calendar_event(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_calendar_event' }

  defined_params = %i[calendar_id event_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 'calendar_id' missing" unless arguments[:calendar_id]
  raise ArgumentError, "Required argument 'event_id' missing" unless arguments[:event_id]

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

  body = nil

  _calendar_id = arguments.delete(:calendar_id)

  _event_id = arguments.delete(:event_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/calendars/#{Utils.__listify(_calendar_id)}/events/#{Utils.__listify(_event_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_calendar_job(arguments = {}) click to toggle source

Deletes anomaly detection jobs from a calendar.

@option arguments [String] :calendar_id The ID of the calendar to modify @option arguments [String] :job_id The ID of the job to remove from the calendar @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-delete-calendar-job.html

# File lib/elasticsearch/api/actions/machine_learning/delete_calendar_job.rb, line 33
def delete_calendar_job(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_calendar_job' }

  defined_params = %i[calendar_id job_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 'calendar_id' missing" unless arguments[:calendar_id]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  body = nil

  _calendar_id = arguments.delete(:calendar_id)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/calendars/#{Utils.__listify(_calendar_id)}/jobs/#{Utils.__listify(_job_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_data_frame_analytics(arguments = {}) click to toggle source

Deletes an existing data frame analytics job.

@option arguments [String] :id The ID of the data frame analytics to delete @option arguments [Boolean] :force True if the job should be forcefully deleted @option arguments [Time] :timeout Controls the time to wait until a job is deleted. Defaults to 1 minute @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/delete-dfanalytics.html

# File lib/elasticsearch/api/actions/machine_learning/delete_data_frame_analytics.rb, line 34
def delete_data_frame_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_data_frame_analytics' }

  defined_params = [: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 'id' missing" unless arguments[:id]

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

  body = nil

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/data_frame/analytics/#{Utils.__listify(_id)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_datafeed(arguments = {}) click to toggle source

Deletes an existing datafeed.

@option arguments [String] :datafeed_id The ID of the datafeed to delete @option arguments [Boolean] :force True if the datafeed should be forcefully deleted @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-delete-datafeed.html

# File lib/elasticsearch/api/actions/machine_learning/delete_datafeed.rb, line 33
def delete_datafeed(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_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 = nil

  _datafeed_id = arguments.delete(:datafeed_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_expired_data(arguments = {}) click to toggle source

Deletes expired and unused machine learning data.

@option arguments [String] :job_id The ID of the job(s) to perform expired data hygiene for @option arguments [Number] :requests_per_second The desired requests per second for the deletion processes. @option arguments [Time] :timeout How long can the underlying delete processes run until they are canceled @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body deleting expired data parameters

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-delete-expired-data.html

# File lib/elasticsearch/api/actions/machine_learning/delete_expired_data.rb, line 35
def delete_expired_data(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_expired_data' }

  defined_params = [:job_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?

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = if _job_id
             "_ml/_delete_expired_data/#{Utils.__listify(_job_id)}"
           else
             '_ml/_delete_expired_data'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_filter(arguments = {}) click to toggle source

Deletes a filter.

@option arguments [String] :filter_id The ID of the filter to delete @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-delete-filter.html

# File lib/elasticsearch/api/actions/machine_learning/delete_filter.rb, line 32
def delete_filter(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_filter' }

  defined_params = [:filter_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 'filter_id' missing" unless arguments[:filter_id]

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

  body = nil

  _filter_id = arguments.delete(:filter_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/filters/#{Utils.__listify(_filter_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_forecast(arguments = {}) click to toggle source

Deletes forecasts from a machine learning job.

@option arguments [String] :job_id The ID of the job from which to delete forecasts @option arguments [String] :forecast_id The ID of the forecast to delete, can be comma delimited list. Leaving blank implies ‘_all` @option arguments [Boolean] :allow_no_forecasts Whether to ignore if `_all` matches no forecasts @option arguments [Time] :timeout Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-delete-forecast.html

# File lib/elasticsearch/api/actions/machine_learning/delete_forecast.rb, line 35
def delete_forecast(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_forecast' }

  defined_params = %i[job_id forecast_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 'job_id' missing" unless arguments[:job_id]

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

  body = nil

  _job_id = arguments.delete(:job_id)

  _forecast_id = arguments.delete(:forecast_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = if _job_id && _forecast_id
             "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_forecast/#{Utils.__listify(_forecast_id)}"
           else
             "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_forecast"
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_job(arguments = {}) click to toggle source

Deletes an existing anomaly detection job.

@option arguments [String] :job_id The ID of the job to delete @option arguments [Boolean] :force True if the job should be forcefully deleted @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning @option arguments [Boolean] :delete_user_annotations Should annotations added by the user be deleted @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-delete-job.html

# File lib/elasticsearch/api/actions/machine_learning/delete_job.rb, line 35
def delete_job(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_job' }

  defined_params = [:job_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 'job_id' missing" unless arguments[:job_id]

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

  body = nil

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_model_snapshot(arguments = {}) click to toggle source

Deletes an existing model snapshot.

@option arguments [String] :job_id The ID of the job to fetch @option arguments [String] :snapshot_id The ID of the snapshot to delete @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-delete-snapshot.html

# File lib/elasticsearch/api/actions/machine_learning/delete_model_snapshot.rb, line 33
def delete_model_snapshot(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_model_snapshot' }

  defined_params = %i[job_id snapshot_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 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]

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

  body = nil

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_trained_model(arguments = {}) click to toggle source

Deletes an existing trained inference model that is currently not referenced by an ingest pipeline.

@option arguments [String] :model_id The ID of the trained model to delete @option arguments [Time] :timeout Controls the amount of time to wait for the model to be deleted. @option arguments [Boolean] :force True if the model should be forcefully deleted @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/delete-trained-models.html

# File lib/elasticsearch/api/actions/machine_learning/delete_trained_model.rb, line 34
def delete_trained_model(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_trained_model' }

  defined_params = [:model_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 'model_id' missing" unless arguments[:model_id]

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

  body = nil

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_trained_model_alias(arguments = {}) click to toggle source

Deletes a model alias that refers to the trained model

@option arguments [String] :model_alias The trained model alias to delete @option arguments [String] :model_id The trained model where the model alias is assigned @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/delete-trained-models-aliases.html

# File lib/elasticsearch/api/actions/machine_learning/delete_trained_model_alias.rb, line 33
def delete_trained_model_alias(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_trained_model_alias' }

  defined_params = %i[model_id model_alias].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 'model_id' missing" unless arguments[:model_id]
  raise ArgumentError, "Required argument 'model_alias' missing" unless arguments[:model_alias]

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

  body = nil

  _model_alias = arguments.delete(:model_alias)

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}/model_aliases/#{Utils.__listify(_model_alias)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
estimate_model_memory(arguments = {}) click to toggle source

Estimates the model memory

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The analysis config, plus cardinality estimates for fields it references (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-apis.html

# File lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb, line 32
def estimate_model_memory(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.estimate_model_memory' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

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

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_ml/anomaly_detectors/_estimate_model_memory'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
evaluate_data_frame(arguments = {}) click to toggle source

Evaluates the data frame analytics for an annotated index.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The evaluation definition (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/evaluate-dfanalytics.html

# File lib/elasticsearch/api/actions/machine_learning/evaluate_data_frame.rb, line 32
def evaluate_data_frame(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.evaluate_data_frame' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

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

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_ml/data_frame/_evaluate'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
explain_data_frame_analytics(arguments = {}) click to toggle source

Explains a data frame analytics config.

@option arguments [String] :id The ID of the data frame analytics to explain @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The data frame analytics config to explain

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/explain-dfanalytics.html

# File lib/elasticsearch/api/actions/machine_learning/explain_data_frame_analytics.rb, line 33
def explain_data_frame_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.explain_data_frame_analytics' }

  defined_params = [: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?

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

  body = arguments.delete(:body)

  _id = arguments.delete(:id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _id
           "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_explain"
         else
           '_ml/data_frame/analytics/_explain'
         end
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
flush_job(arguments = {}) click to toggle source

Forces any buffered data to be processed by the job.

@option arguments [String] :job_id The name of the job to flush @option arguments [Boolean] :calc_interim Calculates interim results for the most recent bucket or all buckets within the latency period @option arguments [String] :start When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results @option arguments [String] :end When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results @option arguments [String] :advance_time Advances time to the given value generating results and updating the model for the advanced interval @option arguments [String] :skip_time Skips time to the given value without generating results or updating the model for the skipped interval @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Flush parameters

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-flush-job.html

# File lib/elasticsearch/api/actions/machine_learning/flush_job.rb, line 38
def flush_job(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.flush_job' }

  defined_params = [:job_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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_flush"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
forecast(arguments = {}) click to toggle source

Predicts the future behavior of a time series by using its historical behavior.

@option arguments [String] :job_id The ID of the job to forecast for @option arguments [Time] :duration The duration of the forecast @option arguments [Time] :expires_in The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. @option arguments [String] :max_model_memory The max memory able to be used by the forecast. Default is 20mb. @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Query parameters can be specified in the body

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-forecast.html

# File lib/elasticsearch/api/actions/machine_learning/forecast.rb, line 36
def forecast(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.forecast' }

  defined_params = [:job_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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_forecast"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_buckets(arguments = {}) click to toggle source

Retrieves anomaly detection job results for one or more buckets.

@option arguments [String] :job_id ID of the job to get bucket results from @option arguments [String] :timestamp The timestamp of the desired single bucket result @option arguments [Boolean] :expand Include anomaly records @option arguments [Boolean] :exclude_interim Exclude interim results @option arguments [Integer] :from skips a number of buckets @option arguments [Integer] :size specifies a max number of buckets to get @option arguments [String] :start Start time filter for buckets @option arguments [String] :end End time filter for buckets @option arguments [Double] :anomaly_score Filter for the most anomalous buckets @option arguments [String] :sort Sort buckets by a particular field @option arguments [Boolean] :desc Set the sort direction @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Bucket selection details if not provided in URI

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-bucket.html

# File lib/elasticsearch/api/actions/machine_learning/get_buckets.rb, line 43
def get_buckets(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_buckets' }

  defined_params = %i[job_id timestamp].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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  _timestamp = arguments.delete(:timestamp)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _job_id && _timestamp
           "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/buckets/#{Utils.__listify(_timestamp)}"
         else
           "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/buckets"
         end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_calendar_events(arguments = {}) click to toggle source

Retrieves information about the scheduled events in calendars.

@option arguments [String] :calendar_id The ID of the calendar containing the events @option arguments [String] :job_id Get events for the job. When this option is used calendar_id must be ‘_all’ @option arguments [String] :start Get events after this time @option arguments [Date] :end Get events before this time @option arguments [Integer] :from Skips a number of events @option arguments [Integer] :size Specifies a max number of events to get @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-calendar-event.html

# File lib/elasticsearch/api/actions/machine_learning/get_calendar_events.rb, line 37
def get_calendar_events(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_calendar_events' }

  defined_params = [:calendar_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 'calendar_id' missing" unless arguments[:calendar_id]

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

  body = nil

  _calendar_id = arguments.delete(:calendar_id)

  method = Elasticsearch::API::HTTP_GET
  path   = "_ml/calendars/#{Utils.__listify(_calendar_id)}/events"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_calendars(arguments = {}) click to toggle source

Retrieves configuration information for calendars.

@option arguments [String] :calendar_id The ID of the calendar to fetch @option arguments [Integer] :from skips a number of calendars @option arguments [Integer] :size specifies a max number of calendars to get @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The from and size parameters optionally sent in the body

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-calendar.html

# File lib/elasticsearch/api/actions/machine_learning/get_calendars.rb, line 35
def get_calendars(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_calendars' }

  defined_params = [:calendar_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?

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

  body = arguments.delete(:body)

  _calendar_id = arguments.delete(:calendar_id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _calendar_id
           "_ml/calendars/#{Utils.__listify(_calendar_id)}"
         else
           '_ml/calendars'
         end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_categories(arguments = {}) click to toggle source

Retrieves anomaly detection job results for one or more categories.

@option arguments [String] :job_id The name of the job @option arguments [Long] :category_id The identifier of the category definition of interest @option arguments [Integer] :from skips a number of categories @option arguments [Integer] :size specifies a max number of categories to get @option arguments [String] :partition_field_value Specifies the partition to retrieve categories for. This is optional, and should never be used for jobs where per-partition categorization is disabled. @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Category selection details if not provided in URI

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-category.html

# File lib/elasticsearch/api/actions/machine_learning/get_categories.rb, line 37
def get_categories(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_categories' }

  defined_params = %i[job_id category_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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  _category_id = arguments.delete(:category_id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _job_id && _category_id
           "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/categories/#{Utils.__listify(_category_id)}"
         else
           "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/categories"
         end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_data_frame_analytics(arguments = {}) click to toggle source

Retrieves configuration information for data frame analytics jobs.

@option arguments [String] :id The ID of the data frame analytics to fetch @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no data frame analytics. (This includes ‘_all` string or when no data frame analytics have been specified) @option arguments [Integer] :from skips a number of analytics @option arguments [Integer] :size specifies a max number of analytics to get @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on data frame analytics PUT @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/get-dfanalytics.html

# File lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics.rb, line 36
def get_data_frame_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_data_frame_analytics' }

  defined_params = [: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?

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

  body = nil

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _id
             "_ml/data_frame/analytics/#{Utils.__listify(_id)}"
           else
             '_ml/data_frame/analytics'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_data_frame_analytics_stats(arguments = {}) click to toggle source

Retrieves usage information for data frame analytics jobs.

@option arguments [String] :id The ID of the data frame analytics stats to fetch @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no data frame analytics. (This includes ‘_all` string or when no data frame analytics have been specified) @option arguments [Integer] :from skips a number of analytics @option arguments [Integer] :size specifies a max number of analytics to get @option arguments [Boolean] :verbose whether the stats response should be verbose @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/get-dfanalytics-stats.html

# File lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics_stats.rb, line 36
def get_data_frame_analytics_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_data_frame_analytics_stats' }

  defined_params = [: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?

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

  body = nil

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _id
             "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_stats"
           else
             '_ml/data_frame/analytics/_stats'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_datafeed_stats(arguments = {}) click to toggle source

Retrieves usage information for datafeeds.

@option arguments [String] :datafeed_id The ID of the datafeeds stats to fetch @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no datafeeds. (This includes ‘_all` string or when no datafeeds have been specified) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-datafeed-stats.html

# File lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb, line 33
def get_datafeed_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_datafeed_stats' }

  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?

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

  body = nil

  _datafeed_id = arguments.delete(:datafeed_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _datafeed_id
             "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_stats"
           else
             '_ml/datafeeds/_stats'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_datafeeds(arguments = {}) click to toggle source

Retrieves configuration information for datafeeds.

@option arguments [String] :datafeed_id The ID of the datafeeds to fetch @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no datafeeds. (This includes ‘_all` string or when no datafeeds have been specified) @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on datafeed PUT @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-datafeed.html

# File lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb, line 34
def get_datafeeds(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_datafeeds' }

  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?

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

  body = nil

  _datafeed_id = arguments.delete(:datafeed_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _datafeed_id
             "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}"
           else
             '_ml/datafeeds'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_filters(arguments = {}) click to toggle source

Retrieves filters.

@option arguments [String] :filter_id The ID of the filter to fetch @option arguments [Integer] :from skips a number of filters @option arguments [Integer] :size specifies a max number of filters to get @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-filter.html

# File lib/elasticsearch/api/actions/machine_learning/get_filters.rb, line 34
def get_filters(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_filters' }

  defined_params = [:filter_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?

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

  body = nil

  _filter_id = arguments.delete(:filter_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _filter_id
             "_ml/filters/#{Utils.__listify(_filter_id)}"
           else
             '_ml/filters'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_influencers(arguments = {}) click to toggle source

Retrieves anomaly detection job results for one or more influencers.

@option arguments [String] :job_id Identifier for the anomaly detection job @option arguments [Boolean] :exclude_interim Exclude interim results @option arguments [Integer] :from skips a number of influencers @option arguments [Integer] :size specifies a max number of influencers to get @option arguments [String] :start start timestamp for the requested influencers @option arguments [String] :end end timestamp for the requested influencers @option arguments [Double] :influencer_score influencer score threshold for the requested influencers @option arguments [String] :sort sort field for the requested influencers @option arguments [Boolean] :desc whether the results should be sorted in decending order @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Influencer selection criteria

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-influencer.html

# File lib/elasticsearch/api/actions/machine_learning/get_influencers.rb, line 41
def get_influencers(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_influencers' }

  defined_params = [:job_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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/influencers"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_job_stats(arguments = {}) click to toggle source

Retrieves usage information for anomaly detection jobs.

@option arguments [String] :job_id The ID of the jobs stats to fetch @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-job-stats.html

# File lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb, line 33
def get_job_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_job_stats' }

  defined_params = [:job_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?

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

  body = nil

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _job_id
             "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_stats"
           else
             '_ml/anomaly_detectors/_stats'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_jobs(arguments = {}) click to toggle source

Retrieves configuration information for anomaly detection jobs.

@option arguments [String] :job_id The ID of the jobs to fetch @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified) @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on job PUT @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-job.html

# File lib/elasticsearch/api/actions/machine_learning/get_jobs.rb, line 34
def get_jobs(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_jobs' }

  defined_params = [:job_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?

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

  body = nil

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _job_id
             "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}"
           else
             '_ml/anomaly_detectors'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_memory_stats(arguments = {}) click to toggle source

Returns information on how ML is using memory.

@option arguments [String] :node_id Specifies the node or nodes to retrieve stats for. @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node @option arguments [Time] :timeout Explicit operation timeout @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/get-ml-memory.html

# File lib/elasticsearch/api/actions/machine_learning/get_memory_stats.rb, line 34
def get_memory_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_memory_stats' }

  defined_params = [:node_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?

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

  body = nil

  _node_id = arguments.delete(:node_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _node_id
             "_ml/memory/#{Utils.__listify(_node_id)}/_stats"
           else
             '_ml/memory/_stats'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_model_snapshot_upgrade_stats(arguments = {}) click to toggle source

Gets stats for anomaly detection job model snapshot upgrades that are in progress.

@option arguments [String] :job_id The ID of the job. May be a wildcard, comma separated list or ‘_all`. @option arguments [String] :snapshot_id The ID of the snapshot. May be a wildcard, comma separated list or `_all`. @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-job-model-snapshot-upgrade-stats.html

# File lib/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb, line 34
def get_model_snapshot_upgrade_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_model_snapshot_upgrade_stats' }

  defined_params = %i[job_id snapshot_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 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]

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

  body = nil

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

  method = Elasticsearch::API::HTTP_GET
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_upgrade/_stats"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_model_snapshots(arguments = {}) click to toggle source

Retrieves information about model snapshots.

@option arguments [String] :job_id The ID of the job to fetch @option arguments [String] :snapshot_id The ID of the snapshot to fetch @option arguments [Integer] :from Skips a number of documents @option arguments [Integer] :size The default number of documents returned in queries as a string. @option arguments [Date] :start The filter ‘start’ query parameter @option arguments [Date] :end The filter ‘end’ query parameter @option arguments [String] :sort Name of the field to sort on @option arguments [Boolean] :desc True if the results should be sorted in descending order @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Model snapshot selection criteria

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-snapshot.html

# File lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb, line 40
def get_model_snapshots(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_model_snapshots' }

  defined_params = %i[job_id snapshot_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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _job_id && _snapshot_id
           "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}"
         else
           "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots"
         end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_overall_buckets(arguments = {}) click to toggle source

Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs.

@option arguments [String] :job_id The job IDs for which to calculate overall bucket results @option arguments [Integer] :top_n The number of top job bucket scores to be used in the overall_score calculation @option arguments [String] :bucket_span The span of the overall buckets. Defaults to the longest job bucket_span @option arguments [Double] :overall_score Returns overall buckets with overall scores higher than this value @option arguments [Boolean] :exclude_interim If true overall buckets that include interim buckets will be excluded @option arguments [String] :start Returns overall buckets with timestamps after this time @option arguments [String] :end Returns overall buckets with timestamps earlier than this time @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Overall bucket selection details if not provided in URI

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-overall-buckets.html

# File lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb, line 40
def get_overall_buckets(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_overall_buckets' }

  defined_params = [:job_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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/overall_buckets"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_records(arguments = {}) click to toggle source

Retrieves anomaly records for an anomaly detection job.

@option arguments [String] :job_id The ID of the job @option arguments [Boolean] :exclude_interim Exclude interim results @option arguments [Integer] :from skips a number of records @option arguments [Integer] :size specifies a max number of records to get @option arguments [String] :start Start time filter for records @option arguments [String] :end End time filter for records @option arguments [Double] :record_score Returns records with anomaly scores greater or equal than this value @option arguments [String] :sort Sort records by a particular field @option arguments [Boolean] :desc Set the sort direction @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Record selection criteria

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-get-record.html

# File lib/elasticsearch/api/actions/machine_learning/get_records.rb, line 41
def get_records(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_records' }

  defined_params = [:job_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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/records"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_trained_models(arguments = {}) click to toggle source

Retrieves configuration information for a trained inference model.

@option arguments [String] :model_id The ID of the trained models to fetch @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no trained models. (This includes ‘_all` string or when no trained models have been specified) @option arguments [String] :include A comma-separate list of fields to optionally include. Valid options are ’definition’ and ‘total_feature_importance’. Default is none. @option arguments [Boolean] :include_model_definition Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false. Deprecated @option arguments [Boolean] :decompress_definition Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. @option arguments [Integer] :from skips a number of trained models @option arguments [Integer] :size specifies a max number of trained models to get @option arguments [List] :tags A comma-separated list of tags that the model must have. @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on model PUT @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/get-trained-models.html

# File lib/elasticsearch/api/actions/machine_learning/get_trained_models.rb, line 40
def get_trained_models(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_trained_models' }

  defined_params = [:model_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?

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

  body = nil

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _model_id
             "_ml/trained_models/#{Utils.__listify(_model_id)}"
           else
             '_ml/trained_models'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_trained_models_stats(arguments = {}) click to toggle source

Retrieves usage information for trained inference models.

@option arguments [String] :model_id The ID of the trained models stats to fetch @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no trained models. (This includes ‘_all` string or when no trained models have been specified) @option arguments [Integer] :from skips a number of trained models @option arguments [Integer] :size specifies a max number of trained models to get @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/get-trained-models-stats.html

# File lib/elasticsearch/api/actions/machine_learning/get_trained_models_stats.rb, line 35
def get_trained_models_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.get_trained_models_stats' }

  defined_params = [:model_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?

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

  body = nil

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _model_id
             "_ml/trained_models/#{Utils.__listify(_model_id)}/_stats"
           else
             '_ml/trained_models/_stats'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
infer_trained_model(arguments = {}) click to toggle source

Evaluate a trained model.

@option arguments [String] :model_id The unique identifier of the trained model. (Required) @option arguments [Time] :timeout Controls the amount of time to wait for inference results. @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The docs to apply inference on and inference configuration overrides (Required)

*Deprecation notice*: /_ml/trained_models/{model_id}/deployment/_infer is deprecated. Use /_ml/trained_models/{model_id}/_infer instead Deprecated since version 8.3.0

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/infer-trained-model.html

# File lib/elasticsearch/api/actions/machine_learning/infer_trained_model.rb, line 39
def infer_trained_model(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.infer_trained_model' }

  defined_params = [:model_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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]

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

  body = arguments.delete(:body)

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_POST
  path   = ("_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_infer" if _model_id)
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
info(arguments = {}) click to toggle source

Returns defaults and limits used by machine learning.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/get-ml-info.html

# File lib/elasticsearch/api/actions/machine_learning/info.rb, line 31
def info(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.info' }

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

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_ml/info'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
open_job(arguments = {}) click to toggle source

Opens one or more anomaly detection jobs.

@option arguments [String] :job_id The ID of the job to open @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Query parameters can be specified in the body

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-open-job.html

# File lib/elasticsearch/api/actions/machine_learning/open_job.rb, line 33
def open_job(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.open_job' }

  defined_params = [:job_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 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_open"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
post_calendar_events(arguments = {}) click to toggle source

Posts scheduled events in a calendar.

@option arguments [String] :calendar_id The ID of the calendar to modify @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body A list of events (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-post-calendar-event.html

# File lib/elasticsearch/api/actions/machine_learning/post_calendar_events.rb, line 33
def post_calendar_events(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.post_calendar_events' }

  defined_params = [:calendar_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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]

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

  body = arguments.delete(:body)

  _calendar_id = arguments.delete(:calendar_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/calendars/#{Utils.__listify(_calendar_id)}/events"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
post_data(arguments = {}) click to toggle source

Sends data to an anomaly detection job for analysis.

@option arguments [String] :job_id The name of the job receiving the data @option arguments [String] :reset_start Optional parameter to specify the start of the bucket resetting range @option arguments [String] :reset_end Optional parameter to specify the end of the bucket resetting range @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The data to process (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-post-data.html

# File lib/elasticsearch/api/actions/machine_learning/post_data.rb, line 35
def post_data(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.post_data' }

  defined_params = [:job_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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_data"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
preview_data_frame_analytics(arguments = {}) click to toggle source

Previews that will be analyzed given a data frame analytics config.

@option arguments [String] :id The ID of the data frame analytics to preview @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The data frame analytics config to preview

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/preview-dfanalytics.html

# File lib/elasticsearch/api/actions/machine_learning/preview_data_frame_analytics.rb, line 33
def preview_data_frame_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.preview_data_frame_analytics' }

  defined_params = [: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?

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

  body = arguments.delete(:body)

  _id = arguments.delete(:id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _id
           "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_preview"
         else
           '_ml/data_frame/analytics/_preview'
         end
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
preview_datafeed(arguments = {}) click to toggle source

Previews a datafeed.

@option arguments [String] :datafeed_id The ID of the datafeed to preview @option arguments [String] :start The start time from where the datafeed preview should begin @option arguments [String] :end The end time when the datafeed preview should stop @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The datafeed config and job config with which to execute the preview

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-preview-datafeed.html

# File lib/elasticsearch/api/actions/machine_learning/preview_datafeed.rb, line 35
def preview_datafeed(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.preview_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?

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

  body = arguments.delete(:body)

  _datafeed_id = arguments.delete(:datafeed_id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _datafeed_id
           "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_preview"
         else
           '_ml/datafeeds/_preview'
         end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_calendar(arguments = {}) click to toggle source

Instantiates a calendar.

@option arguments [String] :calendar_id The ID of the calendar to create @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The calendar details

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-put-calendar.html

# File lib/elasticsearch/api/actions/machine_learning/put_calendar.rb, line 33
def put_calendar(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_calendar' }

  defined_params = [:calendar_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 'calendar_id' missing" unless arguments[:calendar_id]

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

  body = arguments.delete(:body)

  _calendar_id = arguments.delete(:calendar_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/calendars/#{Utils.__listify(_calendar_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_calendar_job(arguments = {}) click to toggle source

Adds an anomaly detection job to a calendar.

@option arguments [String] :calendar_id The ID of the calendar to modify @option arguments [String] :job_id The ID of the job to add to the calendar @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-put-calendar-job.html

# File lib/elasticsearch/api/actions/machine_learning/put_calendar_job.rb, line 33
def put_calendar_job(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_calendar_job' }

  defined_params = %i[calendar_id job_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 'calendar_id' missing" unless arguments[:calendar_id]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  body = nil

  _calendar_id = arguments.delete(:calendar_id)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/calendars/#{Utils.__listify(_calendar_id)}/jobs/#{Utils.__listify(_job_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_data_frame_analytics(arguments = {}) click to toggle source

Instantiates a data frame analytics job.

@option arguments [String] :id The ID of the data frame analytics to create @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The data frame analytics configuration (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/put-dfanalytics.html

# File lib/elasticsearch/api/actions/machine_learning/put_data_frame_analytics.rb, line 33
def put_data_frame_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_data_frame_analytics' }

  defined_params = [: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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

  body = arguments.delete(:body)

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/data_frame/analytics/#{Utils.__listify(_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_datafeed(arguments = {}) click to toggle source

Instantiates a datafeed.

@option arguments [String] :datafeed_id The ID of the datafeed to create @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false) @option arguments [Boolean] :allow_no_indices Ignore if the source indices expressions resolves to no concrete indices (default: true) @option arguments [Boolean] :ignore_throttled Ignore indices that are marked as throttled (default: true) @option arguments [String] :expand_wildcards Whether source index expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The datafeed config (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-put-datafeed.html

# File lib/elasticsearch/api/actions/machine_learning/put_datafeed.rb, line 37
def put_datafeed(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_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 'body' missing" unless arguments[:body]
  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_PUT
  path   = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_filter(arguments = {}) click to toggle source

Instantiates a filter.

@option arguments [String] :filter_id The ID of the filter to create @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The filter details (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-put-filter.html

# File lib/elasticsearch/api/actions/machine_learning/put_filter.rb, line 33
def put_filter(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_filter' }

  defined_params = [:filter_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 '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_PUT
  path   = "_ml/filters/#{Utils.__listify(_filter_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_job(arguments = {}) click to toggle source

Instantiates an anomaly detection job.

@option arguments [String] :job_id The ID of the job to create @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false). Only set if datafeed_config is provided. @option arguments [Boolean] :allow_no_indices Ignore if the source indices expressions resolves to no concrete indices (default: true). Only set if datafeed_config is provided. @option arguments [Boolean] :ignore_throttled Ignore indices that are marked as throttled (default: true). Only set if datafeed_config is provided. @option arguments [String] :expand_wildcards Whether source index expressions should get expanded to open or closed indices (default: open). Only set if datafeed_config is provided. (options: open, closed, hidden, none, all) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The job (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-put-job.html

# File lib/elasticsearch/api/actions/machine_learning/put_job.rb, line 37
def put_job(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_job' }

  defined_params = [:job_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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_trained_model(arguments = {}) click to toggle source

Creates an inference trained model.

@option arguments [String] :model_id The ID of the trained models to store @option arguments [Boolean] :defer_definition_decompression If set to ‘true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations. @option arguments [Boolean] :wait_for_completion Whether to wait for all child operations(e.g. model download) to complete, before returning or not. Default to false @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The trained model configuration (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/put-trained-models.html

# File lib/elasticsearch/api/actions/machine_learning/put_trained_model.rb, line 35
def put_trained_model(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model' }

  defined_params = [:model_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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]

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

  body = arguments.delete(:body)

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_trained_model_alias(arguments = {}) click to toggle source

Creates a new model alias (or reassigns an existing one) to refer to the trained model

@option arguments [String] :model_alias The trained model alias to update @option arguments [String] :model_id The trained model where the model alias should be assigned @option arguments [Boolean] :reassign If the model_alias already exists and points to a separate model_id, this parameter must be true. Defaults to false. @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/put-trained-models-aliases.html

# File lib/elasticsearch/api/actions/machine_learning/put_trained_model_alias.rb, line 34
def put_trained_model_alias(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_alias' }

  defined_params = %i[model_id model_alias].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 'model_id' missing" unless arguments[:model_id]
  raise ArgumentError, "Required argument 'model_alias' missing" unless arguments[:model_alias]

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

  body = nil

  _model_alias = arguments.delete(:model_alias)

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}/model_aliases/#{Utils.__listify(_model_alias)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_trained_model_definition_part(arguments = {}) click to toggle source

Creates part of a trained model definition

@option arguments [String] :model_id The ID of the trained model for this definition part @option arguments [Integer] :part The part number @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The trained model definition part (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/put-trained-model-definition-part.html

# File lib/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part.rb, line 34
def put_trained_model_definition_part(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_definition_part' }

  defined_params = %i[model_id part].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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
  raise ArgumentError, "Required argument 'part' missing" unless arguments[:part]

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

  body = arguments.delete(:body)

  _model_id = arguments.delete(:model_id)

  _part = arguments.delete(:part)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}/definition/#{Utils.__listify(_part)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_trained_model_vocabulary(arguments = {}) click to toggle source

Creates a trained model vocabulary

@option arguments [String] :model_id The ID of the trained model for this vocabulary @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The trained model vocabulary (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/put-trained-model-vocabulary.html

# File lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb, line 33
def put_trained_model_vocabulary(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_vocabulary' }

  defined_params = [:model_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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]

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

  body = arguments.delete(:body)

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}/vocabulary"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
reset_job(arguments = {}) click to toggle source

Resets an existing anomaly detection job.

@option arguments [String] :job_id The ID of the job to reset @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning @option arguments [Boolean] :delete_user_annotations Should annotations added by the user be deleted @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-reset-job.html

# File lib/elasticsearch/api/actions/machine_learning/reset_job.rb, line 34
def reset_job(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.reset_job' }

  defined_params = [:job_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 'job_id' missing" unless arguments[:job_id]

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

  body = nil

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_reset"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
revert_model_snapshot(arguments = {}) click to toggle source

Reverts to a specific snapshot.

@option arguments [String] :job_id The ID of the job to fetch @option arguments [String] :snapshot_id The ID of the snapshot to revert to @option arguments [Boolean] :delete_intervening_results Should we reset the results back to the time of the snapshot? @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Reversion options

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-revert-snapshot.html

# File lib/elasticsearch/api/actions/machine_learning/revert_model_snapshot.rb, line 35
def revert_model_snapshot(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.revert_model_snapshot' }

  defined_params = %i[job_id snapshot_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 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_revert"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
set_upgrade_mode(arguments = {}) click to toggle source

Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade.

@option arguments [Boolean] :enabled Whether to enable upgrade_mode ML setting or not. Defaults to false. @option arguments [Time] :timeout Controls the time to wait before action times out. Defaults to 30 seconds @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-set-upgrade-mode.html

# File lib/elasticsearch/api/actions/machine_learning/set_upgrade_mode.rb, line 33
def set_upgrade_mode(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.set_upgrade_mode' }

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

  body   = nil

  method = Elasticsearch::API::HTTP_POST
  path   = '_ml/set_upgrade_mode'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
start_data_frame_analytics(arguments = {}) click to toggle source

Starts a data frame analytics job.

@option arguments [String] :id The ID of the data frame analytics to start @option arguments [Time] :timeout Controls the time to wait until the task has started. Defaults to 20 seconds @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The start data frame analytics parameters

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/start-dfanalytics.html

# File lib/elasticsearch/api/actions/machine_learning/start_data_frame_analytics.rb, line 34
def start_data_frame_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.start_data_frame_analytics' }

  defined_params = [: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 'id' missing" unless arguments[:id]

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

  body = arguments.delete(:body)

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_start"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
start_datafeed(arguments = {}) click to toggle source

Starts one or more datafeeds.

@option arguments [String] :datafeed_id The ID of the datafeed to start @option arguments [String] :start The start time from where the datafeed should begin @option arguments [String] :end The end time when the datafeed should stop. When not set, the datafeed continues in real time @option arguments [Time] :timeout Controls the time to wait until a datafeed has started. Default to 20 seconds @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The start datafeed parameters

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-start-datafeed.html

# File lib/elasticsearch/api/actions/machine_learning/start_datafeed.rb, line 36
def start_datafeed(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.start_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)}/_start"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
start_trained_model_deployment(arguments = {}) click to toggle source

Start a trained model deployment.

@option arguments [String] :model_id The unique identifier of the trained model. (Required) @option arguments [String] :cache_size A byte-size value for configuring the inference cache size. For example, 20mb. @option arguments [String] :deployment_id The Id of the new deployment. Defaults to the model_id if not set. @option arguments [Integer] :number_of_allocations The total number of allocations this model is assigned across machine learning nodes. @option arguments [Integer] :threads_per_allocation The number of threads used by each model allocation during inference. @option arguments [String] :priority The deployment priority. @option arguments [Integer] :queue_capacity Controls how many inference requests are allowed in the queue at a time. @option arguments [Time] :timeout Controls the amount of time to wait for the model to deploy. @option arguments [String] :wait_for The allocation status for which to wait (options: starting, started, fully_allocated) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/start-trained-model-deployment.html

# File lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb, line 40
def start_trained_model_deployment(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.start_trained_model_deployment' }

  defined_params = [:model_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 'model_id' missing" unless arguments[:model_id]

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

  body = nil

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_start"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
stop_data_frame_analytics(arguments = {}) click to toggle source

Stops one or more data frame analytics jobs.

@option arguments [String] :id The ID of the data frame analytics to stop @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no data frame analytics. (This includes ‘_all` string or when no data frame analytics have been specified) @option arguments [Boolean] :force True if the data frame analytics should be forcefully stopped @option arguments [Time] :timeout Controls the time to wait until the task has stopped. Defaults to 20 seconds @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The stop data frame analytics parameters

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/stop-dfanalytics.html

# File lib/elasticsearch/api/actions/machine_learning/stop_data_frame_analytics.rb, line 36
def stop_data_frame_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_data_frame_analytics' }

  defined_params = [: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 'id' missing" unless arguments[:id]

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

  body = arguments.delete(:body)

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_stop"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
stop_datafeed(arguments = {}) click to toggle source

Stops one or more datafeeds.

@option arguments [String] :datafeed_id The ID of the datafeed to stop @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no datafeeds. (This includes ‘_all` string or when no datafeeds have been specified) @option arguments [Boolean] :allow_no_datafeeds Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) Deprecated @option arguments [Boolean] :force True if the datafeed should be forcefully stopped. @option arguments [Time] :timeout Controls the time to wait until a datafeed has stopped. Default to 20 seconds @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The URL params optionally sent in the body

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-stop-datafeed.html

# File lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb, line 37
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
stop_trained_model_deployment(arguments = {}) click to toggle source

Stop a trained model deployment.

@option arguments [String] :model_id The unique identifier of the trained model. (Required) @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no deployments. (This includes ‘_all` string or when no deployments have been specified) @option arguments [Boolean] :force True if the deployment should be forcefully stopped @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The stop deployment parameters

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/stop-trained-model-deployment.html

# File lib/elasticsearch/api/actions/machine_learning/stop_trained_model_deployment.rb, line 35
def stop_trained_model_deployment(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_trained_model_deployment' }

  defined_params = [:model_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 'model_id' missing" unless arguments[:model_id]

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

  body = arguments.delete(:body)

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_stop"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_data_frame_analytics(arguments = {}) click to toggle source

Updates certain properties of a data frame analytics job.

@option arguments [String] :id The ID of the data frame analytics to update @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The data frame analytics settings to update (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/update-dfanalytics.html

# File lib/elasticsearch/api/actions/machine_learning/update_data_frame_analytics.rb, line 33
def update_data_frame_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.update_data_frame_analytics' }

  defined_params = [: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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

  body = arguments.delete(:body)

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_update"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_datafeed(arguments = {}) click to toggle source

Updates certain properties of a datafeed.

@option arguments [String] :datafeed_id The ID of the datafeed to update @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false) @option arguments [Boolean] :allow_no_indices Ignore if the source indices expressions resolves to no concrete indices (default: true) @option arguments [Boolean] :ignore_throttled Ignore indices that are marked as throttled (default: true) @option arguments [String] :expand_wildcards Whether source index expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The datafeed update settings (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-update-datafeed.html

# File lib/elasticsearch/api/actions/machine_learning/update_datafeed.rb, line 37
def update_datafeed(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.update_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 'body' missing" unless arguments[:body]
  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)}/_update"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_filter(arguments = {}) click to toggle source

Updates the description of a filter, adds items, or removes items.

@option arguments [String] :filter_id The ID of the filter to update @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The filter update (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-update-filter.html

# 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].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 '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
update_job(arguments = {}) click to toggle source

Updates certain properties of an anomaly detection job.

@option arguments [String] :job_id The ID of the job to create @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The job update settings (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-update-job.html

# File lib/elasticsearch/api/actions/machine_learning/update_job.rb, line 33
def update_job(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.update_job' }

  defined_params = [:job_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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_update"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_model_snapshot(arguments = {}) click to toggle source

Updates certain properties of a snapshot.

@option arguments [String] :job_id The ID of the job to fetch @option arguments [String] :snapshot_id The ID of the snapshot to update @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The model snapshot properties to update (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-update-snapshot.html

# File lib/elasticsearch/api/actions/machine_learning/update_model_snapshot.rb, line 34
def update_model_snapshot(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.update_model_snapshot' }

  defined_params = %i[job_id snapshot_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 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]

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

  body = arguments.delete(:body)

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_update"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_trained_model_deployment(arguments = {}) click to toggle source

Updates certain properties of trained model deployment.

@option arguments [String] :model_id The unique identifier of the trained model. @option arguments [Integer] :number_of_allocations Update the model deployment to this number of allocations. @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The updated trained model deployment settings

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/update-trained-model-deployment.html

# File lib/elasticsearch/api/actions/machine_learning/update_trained_model_deployment.rb, line 34
def update_trained_model_deployment(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.update_trained_model_deployment' }

  defined_params = [:model_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 'model_id' missing" unless arguments[:model_id]

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

  body = arguments.delete(:body)

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_update"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
upgrade_job_snapshot(arguments = {}) click to toggle source

Upgrades a given job snapshot to the current major version.

@option arguments [String] :job_id The ID of the job @option arguments [String] :snapshot_id The ID of the snapshot @option arguments [Time] :timeout How long should the API wait for the job to be opened and the old snapshot to be loaded. @option arguments [Boolean] :wait_for_completion Should the request wait until the task is complete before responding to the caller. Default is false. @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/ml-upgrade-job-model-snapshot.html

# File lib/elasticsearch/api/actions/machine_learning/upgrade_job_snapshot.rb, line 35
def upgrade_job_snapshot(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.upgrade_job_snapshot' }

  defined_params = %i[job_id snapshot_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 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]

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

  body = nil

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_upgrade"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
validate(arguments = {}) click to toggle source

Validates an anomaly detection job.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The job config (Required)

@see www.elastic.co/guide/en/machine-learning/8.16/ml-jobs.html

# File lib/elasticsearch/api/actions/machine_learning/validate.rb, line 32
def validate(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.validate' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

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

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_ml/anomaly_detectors/_validate'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
validate_detector(arguments = {}) click to toggle source

Validates an anomaly detection detector.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The detector (Required)

@see www.elastic.co/guide/en/machine-learning/8.16/ml-jobs.html

# File lib/elasticsearch/api/actions/machine_learning/validate_detector.rb, line 32
def validate_detector(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.validate_detector' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

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

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_ml/anomaly_detectors/_validate/detector'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end