Module: Elasticsearch::XPack::API::MachineLearning::Actions

Included in:
MachineLearningClient
Defined in:
lib/elasticsearch/xpack/api/namespace/machine_learning.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/info.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/put_job.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/forecast.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_jobs.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/open_job.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/validate.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/close_job.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/flush_job.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/post_data.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/reset_job.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_job.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/put_filter.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/update_job.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_buckets.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_filters.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/put_datafeed.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_filter.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_calendars.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeeds.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_job_stats.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/stop_datafeed.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/update_filter.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_categories.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/start_datafeed.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_datafeed.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_forecast.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_influencers.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/params_registry.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/update_datafeed.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/preview_datafeed.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar_job.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/set_upgrade_mode.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/put_trained_model.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/validate_detector.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeed_stats.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_trained_models.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_job.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_expired_data.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/evaluate_data_frame.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/find_file_structure.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_calendar_events.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_model_snapshots.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_overall_buckets.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_trained_model.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/post_calendar_events.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/upgrade_job_snapshot.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_event.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_model_snapshot.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/estimate_memory_usage.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/estimate_model_memory.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/revert_model_snapshot.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/update_model_snapshot.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/put_trained_model_alias.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_data_frame_analytics.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_trained_models_stats.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/put_data_frame_analytics.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/stop_data_frame_analytics.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_trained_model_alias.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/start_data_frame_analytics.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/delete_data_frame_analytics.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/update_data_frame_analytics.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/explain_data_frame_analytics.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/preview_data_frame_analytics.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/stop_trained_model_deployment.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_data_frame_analytics_stats.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/infer_trained_model_deployment.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/start_trained_model_deployment.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb

Defined Under Namespace

Modules: ParamsRegistry

Instance Method Summary collapse

Instance Method Details

#close_job(arguments = {}) ⇒ Object

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

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The name of the job to close

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified)

  • :allow_no_jobs (Boolean)

    Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified) Deprecated

  • :force (Boolean)

    True if the job should be forcefully closed

  • :timeout (Time)

    Controls the time to wait until a job has closed. Default to 30 minutes

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The URL params optionally sent in the body

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

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

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

#delete_calendar(arguments = {}) ⇒ Object

Deletes a calendar.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to delete

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar.rb', line 30

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

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

  arguments = arguments.clone

  _calendar_id = arguments.delete(:calendar_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_calendar_event(arguments = {}) ⇒ Object

Deletes scheduled events from a calendar.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to modify

  • :event_id (String)

    The ID of the event to remove from the calendar

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

def delete_calendar_event(arguments = {})
  raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
  raise ArgumentError, "Required argument 'event_id' missing" unless arguments[:event_id]

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

  arguments = arguments.clone

  _calendar_id = arguments.delete(:calendar_id)

  _event_id = arguments.delete(:event_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_calendar_job(arguments = {}) ⇒ Object

Deletes anomaly detection jobs from a calendar.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to modify

  • :job_id (String)

    The ID of the job to remove from the calendar

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

def delete_calendar_job(arguments = {})
  raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  arguments = arguments.clone

  _calendar_id = arguments.delete(:calendar_id)

  _job_id = arguments.delete(:job_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_data_frame_analytics(arguments = {}) ⇒ Object

Deletes an existing data frame analytics job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics to delete

  • :force (Boolean)

    True if the job should be forcefully deleted

  • :timeout (Time)

    Controls the time to wait until a job is deleted. Defaults to 1 minute

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/data_frame/analytics/#{Elasticsearch::API::Utils.__listify(_id)}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_datafeed(arguments = {}) ⇒ Object

Deletes an existing datafeed.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to delete

  • :force (Boolean)

    True if the datafeed should be forcefully deleted

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_datafeed.rb', line 31

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

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

  arguments = arguments.clone

  _datafeed_id = arguments.delete(:datafeed_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_expired_data(arguments = {}) ⇒ Object

Deletes expired and unused machine learning data.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job(s) to perform expired data hygiene for

  • :requests_per_second (Number)

    The desired requests per second for the deletion processes.

  • :timeout (Time)

    How long can the underlying delete processes run until they are canceled

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    deleting expired data parameters

See Also:



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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = if _job_id
             "_ml/_delete_expired_data/#{Elasticsearch::API::Utils.__listify(_job_id)}"
           else
             "_ml/_delete_expired_data"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#delete_filter(arguments = {}) ⇒ Object

Deletes a filter.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :filter_id (String)

    The ID of the filter to delete

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_filter.rb', line 30

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

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

  arguments = arguments.clone

  _filter_id = arguments.delete(:filter_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_forecast(arguments = {}) ⇒ Object

Deletes forecasts from a machine learning job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job from which to delete forecasts

  • :forecast_id (String)

    The ID of the forecast to delete, can be comma delimited list. Leaving blank implies ‘_all`

  • :allow_no_forecasts (Boolean)

    Whether to ignore if ‘_all` matches no forecasts

  • :timeout (Time)

    Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_forecast.rb', line 33

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

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

  arguments = arguments.clone

  _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/#{Elasticsearch::API::Utils.__listify(_job_id)}/_forecast/#{Elasticsearch::API::Utils.__listify(_forecast_id)}"
           else
             "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/_forecast"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_job(arguments = {}) ⇒ Object

Deletes an existing anomaly detection job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to delete

  • :force (Boolean)

    True if the job should be forcefully deleted

  • :wait_for_completion (Boolean)

    Should this request wait until the operation has completed before returning

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_model_snapshot(arguments = {}) ⇒ Object

Deletes an existing model snapshot.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to fetch

  • :snapshot_id (String)

    The ID of the snapshot to delete

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

def delete_model_snapshot(arguments = {})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_trained_model(arguments = {}) ⇒ Object

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

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :model_id (String)

    The ID of the trained model to delete

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_trained_model.rb', line 30

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

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

  arguments = arguments.clone

  _model_id = arguments.delete(:model_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#delete_trained_model_alias(arguments = {}) ⇒ Object

Deletes a model alias that refers to the trained model

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :model_alias (String)

    The trained model alias to delete

  • :model_id (String)

    The trained model where the model alias is assigned

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

def delete_trained_model_alias(arguments = {})
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
  raise ArgumentError, "Required argument 'model_alias' missing" unless arguments[:model_alias]

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

  arguments = arguments.clone

  _model_alias = arguments.delete(:model_alias)

  _model_id = arguments.delete(:model_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#estimate_memory_usage(arguments = {}) ⇒ Object

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :body (Hash)

    Memory usage estimation definition (Required)

Raises:

  • (ArgumentError)

See Also:



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/estimate_memory_usage.rb', line 29

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

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/data_frame/analytics/_estimate_memory_usage"
  params = {}

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

#estimate_model_memory(arguments = {}) ⇒ Object

Estimates the model memory

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The analysis config, plus cardinality estimates for fields it references (Required)

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/estimate_model_memory.rb', line 30

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

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

  arguments = arguments.clone

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

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

#evaluate_data_frame(arguments = {}) ⇒ Object

Evaluates the data frame analytics for an annotated index.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The evaluation definition (Required)

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/evaluate_data_frame.rb', line 30

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

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

  arguments = arguments.clone

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

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

#explain_data_frame_analytics(arguments = {}) ⇒ Object

Explains a data frame analytics config.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics to explain

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The data frame analytics config to explain

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/explain_data_frame_analytics.rb', line 31

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

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

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

#find_file_structure(arguments = {}) ⇒ Object

Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

*Deprecation notice*: This endpoint has changed to _text_structure/find_structure, please use that API instead Deprecated since version 7.12.0

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :lines_to_sample (Integer)

    How many lines of the file should be included in the analysis

  • :line_merge_size_limit (Integer)

    Maximum number of characters permitted in a single message when lines are merged to create messages.

  • :timeout (Time)

    Timeout after which the analysis will be aborted

  • :charset (String)

    Optional parameter to specify the character set of the file

  • :format (String)

    Optional parameter to specify the high level file format (options: ndjson, xml, delimited, semi_structured_text)

  • :has_header_row (Boolean)

    Optional parameter to specify whether a delimited file includes the column names in its first row

  • :column_names (List)

    Optional parameter containing a comma separated list of the column names for a delimited file

  • :delimiter (String)

    Optional parameter to specify the delimiter character for a delimited file - must be a single character

  • :quote (String)

    Optional parameter to specify the quote character for a delimited file - must be a single character

  • :should_trim_fields (Boolean)

    Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them

  • :grok_pattern (String)

    Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file

  • :timestamp_field (String)

    Optional parameter to specify the timestamp field in the file

  • :timestamp_format (String)

    Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format

  • :explain (Boolean)

    Whether to include a commentary on how the structure was derived

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The contents of the file to be analyzed (Required)

Raises:

  • (ArgumentError)

See Also:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/find_file_structure.rb', line 53

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

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

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/find_file_structure"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = Elasticsearch::API::Utils.__bulkify(arguments.delete(:body))
  perform_request(method, path, params, body, headers).body
end

#flush_job(arguments = {}) ⇒ Object

Forces any buffered data to be processed by the job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The name of the job to flush

  • :calc_interim (Boolean)

    Calculates interim results for the most recent bucket or all buckets within the latency period

  • :start (String)

    When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results

  • :end (String)

    When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results

  • :advance_time (String)

    Advances time to the given value generating results and updating the model for the advanced interval

  • :skip_time (String)

    Skips time to the given value without generating results or updating the model for the skipped interval

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Flush parameters

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

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

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

#forecast(arguments = {}) ⇒ Object

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

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to forecast for

  • :duration (Time)

    The duration of the forecast

  • :expires_in (Time)

    The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity.

  • :max_model_memory (String)

    The max memory able to be used by the forecast. Default is 20mb.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Query parameters can be specified in the body

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

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

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

#get_buckets(arguments = {}) ⇒ Object

Retrieves anomaly detection job results for one or more buckets.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    ID of the job to get bucket results from

  • :timestamp (String)

    The timestamp of the desired single bucket result

  • :expand (Boolean)

    Include anomaly records

  • :exclude_interim (Boolean)

    Exclude interim results

  • :from (Integer)

    skips a number of buckets

  • :size (Integer)

    specifies a max number of buckets to get

  • :start (String)

    Start time filter for buckets

  • :end (String)

    End time filter for buckets

  • :anomaly_score (Double)

    Filter for the most anomalous buckets

  • :sort (String)

    Sort buckets by a particular field

  • :desc (Boolean)

    Set the sort direction

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Bucket selection details if not provided in URI

Raises:

  • (ArgumentError)

See Also:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_buckets.rb', line 41

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  _timestamp = arguments.delete(:timestamp)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _job_id && _timestamp
           "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/results/buckets/#{Elasticsearch::API::Utils.__listify(_timestamp)}"
         else
           "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/results/buckets"
         end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#get_calendar_events(arguments = {}) ⇒ Object

Retrieves information about the scheduled events in calendars.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar containing the events

  • :job_id (String)

    Get events for the job. When this option is used calendar_id must be ‘_all’

  • :start (String)

    Get events after this time

  • :end (Date)

    Get events before this time

  • :from (Integer)

    Skips a number of events

  • :size (Integer)

    Specifies a max number of events to get

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _calendar_id = arguments.delete(:calendar_id)

  method = Elasticsearch::API::HTTP_GET
  path   = "_ml/calendars/#{Elasticsearch::API::Utils.__listify(_calendar_id)}/events"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_calendars(arguments = {}) ⇒ Object

Retrieves configuration information for calendars.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to fetch

  • :from (Integer)

    skips a number of calendars

  • :size (Integer)

    specifies a max number of calendars to get

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The from and size parameters optionally sent in the body

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_calendars.rb', line 33

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

  arguments = arguments.clone

  _calendar_id = arguments.delete(:calendar_id)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _calendar_id
           "_ml/calendars/#{Elasticsearch::API::Utils.__listify(_calendar_id)}"
         else
           "_ml/calendars"
         end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#get_categories(arguments = {}) ⇒ Object

Retrieves anomaly detection job results for one or more categories.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The name of the job

  • :category_id (Long)

    The identifier of the category definition of interest

  • :from (Integer)

    skips a number of categories

  • :size (Integer)

    specifies a max number of categories to get

  • :partition_field_value (String)

    Specifies the partition to retrieve categories for. This is optional, and should never be used for jobs where per-partition categorization is disabled.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Category selection details if not provided in URI

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_categories.rb', line 35

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  _category_id = arguments.delete(:category_id)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _job_id && _category_id
           "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/results/categories/#{Elasticsearch::API::Utils.__listify(_category_id)}"
         else
           "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/results/categories"
         end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#get_data_frame_analytics(arguments = {}) ⇒ Object

Retrieves configuration information for data frame analytics jobs.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics to fetch

  • :allow_no_match (Boolean)

    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)

  • :from (Integer)

    skips a number of analytics

  • :size (Integer)

    specifies a max number of analytics to get

  • :exclude_generated (Boolean)

    Omits fields that are illegal to set on data frame analytics PUT

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _id
             "_ml/data_frame/analytics/#{Elasticsearch::API::Utils.__listify(_id)}"
           else
             "_ml/data_frame/analytics"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_data_frame_analytics_stats(arguments = {}) ⇒ Object

Retrieves usage information for data frame analytics jobs.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics stats to fetch

  • :allow_no_match (Boolean)

    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)

  • :from (Integer)

    skips a number of analytics

  • :size (Integer)

    specifies a max number of analytics to get

  • :verbose (Boolean)

    whether the stats response should be verbose

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _id
             "_ml/data_frame/analytics/#{Elasticsearch::API::Utils.__listify(_id)}/_stats"
           else
             "_ml/data_frame/analytics/_stats"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_datafeed_stats(arguments = {}) ⇒ Object

Retrieves usage information for datafeeds.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeeds stats to fetch

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no datafeeds. (This includes ‘_all` string or when no datafeeds have been specified)

  • :allow_no_datafeeds (Boolean)

    Whether to ignore if a wildcard expression matches no datafeeds. (This includes ‘_all` string or when no datafeeds have been specified) Deprecated

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  arguments = arguments.clone

  _datafeed_id = arguments.delete(:datafeed_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _datafeed_id
             "_ml/datafeeds/#{Elasticsearch::API::Utils.__listify(_datafeed_id)}/_stats"
           else
             "_ml/datafeeds/_stats"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_datafeeds(arguments = {}) ⇒ Object

Retrieves configuration information for datafeeds.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeeds to fetch

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no datafeeds. (This includes ‘_all` string or when no datafeeds have been specified)

  • :allow_no_datafeeds (Boolean)

    Whether to ignore if a wildcard expression matches no datafeeds. (This includes ‘_all` string or when no datafeeds have been specified) Deprecated

  • :exclude_generated (Boolean)

    Omits fields that are illegal to set on datafeed PUT

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  arguments = arguments.clone

  _datafeed_id = arguments.delete(:datafeed_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_filters(arguments = {}) ⇒ Object

Retrieves filters.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :filter_id (String)

    The ID of the filter to fetch

  • :from (Integer)

    skips a number of filters

  • :size (Integer)

    specifies a max number of filters to get

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  arguments = arguments.clone

  _filter_id = arguments.delete(:filter_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _filter_id
             "_ml/filters/#{Elasticsearch::API::Utils.__listify(_filter_id)}"
           else
             "_ml/filters"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_influencers(arguments = {}) ⇒ Object

Retrieves anomaly detection job results for one or more influencers.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    Identifier for the anomaly detection job

  • :exclude_interim (Boolean)

    Exclude interim results

  • :from (Integer)

    skips a number of influencers

  • :size (Integer)

    specifies a max number of influencers to get

  • :start (String)

    start timestamp for the requested influencers

  • :end (String)

    end timestamp for the requested influencers

  • :influencer_score (Double)

    influencer score threshold for the requested influencers

  • :sort (String)

    sort field for the requested influencers

  • :desc (Boolean)

    whether the results should be sorted in decending order

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Influencer selection criteria

Raises:

  • (ArgumentError)

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_influencers.rb', line 39

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/results/influencers"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#get_job_stats(arguments = {}) ⇒ Object

Retrieves usage information for anomaly detection jobs.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the jobs stats to fetch

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified)

  • :allow_no_jobs (Boolean)

    Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified) Deprecated

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _job_id
             "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/_stats"
           else
             "_ml/anomaly_detectors/_stats"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_jobs(arguments = {}) ⇒ Object

Retrieves configuration information for anomaly detection jobs.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the jobs to fetch

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified)

  • :allow_no_jobs (Boolean)

    Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified) Deprecated

  • :exclude_generated (Boolean)

    Omits fields that are illegal to set on job PUT

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _job_id
             "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}"
           else
             "_ml/anomaly_detectors"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_model_snapshot_upgrade_stats(arguments = {}) ⇒ Object

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

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job. May be a wildcard, comma separated list or ‘_all`.

  • :snapshot_id (String)

    The ID of the snapshot. May be a wildcard, comma separated list or ‘_all`.

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the ‘_all` string.)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

def get_model_snapshot_upgrade_stats(arguments = {})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_model_snapshots(arguments = {}) ⇒ Object

Retrieves information about model snapshots.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to fetch

  • :snapshot_id (String)

    The ID of the snapshot to fetch

  • :from (Integer)

    Skips a number of documents

  • :size (Integer)

    The default number of documents returned in queries as a string.

  • :start (Date)

    The filter ‘start’ query parameter

  • :end (Date)

    The filter ‘end’ query parameter

  • :sort (String)

    Name of the field to sort on

  • :desc (Boolean)

    True if the results should be sorted in descending order

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Model snapshot selection criteria

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_model_snapshots.rb', line 38

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _job_id && _snapshot_id
           "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/model_snapshots/#{Elasticsearch::API::Utils.__listify(_snapshot_id)}"
         else
           "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/model_snapshots"
         end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#get_overall_buckets(arguments = {}) ⇒ Object

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

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The job IDs for which to calculate overall bucket results

  • :top_n (Integer)

    The number of top job bucket scores to be used in the overall_score calculation

  • :bucket_span (String)

    The span of the overall buckets. Defaults to the longest job bucket_span

  • :overall_score (Double)

    Returns overall buckets with overall scores higher than this value

  • :exclude_interim (Boolean)

    If true overall buckets that include interim buckets will be excluded

  • :start (String)

    Returns overall buckets with timestamps after this time

  • :end (String)

    Returns overall buckets with timestamps earlier than this time

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified)

  • :allow_no_jobs (Boolean)

    Whether to ignore if a wildcard expression matches no jobs. (This includes ‘_all` string or when no jobs have been specified) Deprecated

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Overall bucket selection details if not provided in URI

Raises:

  • (ArgumentError)

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_overall_buckets.rb', line 39

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/results/overall_buckets"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#get_records(arguments = {}) ⇒ Object

Retrieves anomaly records for an anomaly detection job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job

  • :exclude_interim (Boolean)

    Exclude interim results

  • :from (Integer)

    skips a number of records

  • :size (Integer)

    specifies a max number of records to get

  • :start (String)

    Start time filter for records

  • :end (String)

    End time filter for records

  • :record_score (Double)

    Returns records with anomaly scores greater or equal than this value

  • :sort (String)

    Sort records by a particular field

  • :desc (Boolean)

    Set the sort direction

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Record selection criteria

Raises:

  • (ArgumentError)

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb', line 39

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/results/records"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#get_trained_models(arguments = {}) ⇒ Object

Retrieves configuration information for a trained inference model.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :model_id (String)

    The ID of the trained models to fetch

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no trained models. (This includes ‘_all` string or when no trained models have been specified)

  • :include (String)

    A comma-separate list of fields to optionally include. Valid options are ‘definition’ and ‘total_feature_importance’. Default is none.

  • :include_model_definition (Boolean)

    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

  • :decompress_definition (Boolean)

    Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true.

  • :from (Integer)

    skips a number of trained models

  • :size (Integer)

    specifies a max number of trained models to get

  • :tags (List)

    A comma-separated list of tags that the model must have.

  • :exclude_generated (Boolean)

    Omits fields that are illegal to set on model PUT

  • :headers (Hash)

    Custom HTTP headers

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_trained_models.rb', line 38

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

  arguments = arguments.clone

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _model_id
             "_ml/trained_models/#{Elasticsearch::API::Utils.__listify(_model_id)}"
           else
             "_ml/trained_models"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#get_trained_models_stats(arguments = {}) ⇒ Object

Retrieves usage information for trained inference models.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :model_id (String)

    The ID of the trained models stats to fetch

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no trained models. (This includes ‘_all` string or when no trained models have been specified)

  • :from (Integer)

    skips a number of trained models

  • :size (Integer)

    specifies a max number of trained models to get

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  arguments = arguments.clone

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _model_id
             "_ml/trained_models/#{Elasticsearch::API::Utils.__listify(_model_id)}/_stats"
           else
             "_ml/trained_models/_stats"
           end
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#infer_trained_model_deployment(arguments = {}) ⇒ Object

Evaluate a trained model. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :model_id (String)

    The ID of the model to perform inference on

  • :timeout (Time)

    Controls the time to wait for the inference result

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/trained_models/#{Elasticsearch::API::Utils.__listify(_model_id)}/deployment/_infer"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
                                                                   ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#info(arguments = {}) ⇒ Object

Returns defaults and limits used by machine learning.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

See Also:



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/info.rb', line 29

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

  arguments = arguments.clone

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#open_job(arguments = {}) ⇒ Object

Opens one or more anomaly detection jobs.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to open

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Query parameters can be specified in the body

Raises:

  • (ArgumentError)

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/open_job.rb', line 31

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

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

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

#post_calendar_events(arguments = {}) ⇒ Object

Posts scheduled events in a calendar.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to modify

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    A list of events (Required)

Raises:

  • (ArgumentError)

See Also:



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

def post_calendar_events(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]

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

  arguments = arguments.clone

  _calendar_id = arguments.delete(:calendar_id)

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

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

#post_data(arguments = {}) ⇒ Object

Sends data to an anomaly detection job for analysis.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The name of the job receiving the data

  • :reset_start (String)

    Optional parameter to specify the start of the bucket resetting range

  • :reset_end (String)

    Optional parameter to specify the end of the bucket resetting range

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The data to process (Required)

Raises:

  • (ArgumentError)

See Also:



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

def post_data(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

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

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

#preview_data_frame_analytics(arguments = {}) ⇒ Object

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

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics to preview

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The data frame analytics config to preview

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/preview_data_frame_analytics.rb', line 31

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

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

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

#preview_datafeed(arguments = {}) ⇒ Object

Previews a datafeed.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to preview

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The datafeed config and job config with which to execute the preview

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/preview_datafeed.rb', line 31

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

  arguments = arguments.clone

  _datafeed_id = arguments.delete(:datafeed_id)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path   = if _datafeed_id
             "_ml/datafeeds/#{Elasticsearch::API::Utils.__listify(_datafeed_id)}/_preview"
           else
             "_ml/datafeeds/_preview"
           end
  params = {}

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

#put_calendar(arguments = {}) ⇒ Object

Instantiates a calendar.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to create

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The calendar details

Raises:

  • (ArgumentError)

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar.rb', line 31

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

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

  arguments = arguments.clone

  _calendar_id = arguments.delete(:calendar_id)

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

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

#put_calendar_job(arguments = {}) ⇒ Object

Adds an anomaly detection job to a calendar.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to modify

  • :job_id (String)

    The ID of the job to add to the calendar

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

def put_calendar_job(arguments = {})
  raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  arguments = arguments.clone

  _calendar_id = arguments.delete(:calendar_id)

  _job_id = arguments.delete(:job_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#put_data_frame_analytics(arguments = {}) ⇒ Object

Instantiates a data frame analytics job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics to create

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The data frame analytics configuration (Required)

Raises:

  • (ArgumentError)

See Also:



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

def put_data_frame_analytics(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

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

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

#put_datafeed(arguments = {}) ⇒ Object

Instantiates a datafeed.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to create

  • :ignore_unavailable (Boolean)

    Ignore unavailable indexes (default: false)

  • :allow_no_indices (Boolean)

    Ignore if the source indices expressions resolves to no concrete indices (default: true)

  • :ignore_throttled (Boolean)

    Ignore indices that are marked as throttled (default: true)

  • :expand_wildcards (String)

    Whether source index expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The datafeed config (Required)

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _datafeed_id = arguments.delete(:datafeed_id)

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

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

#put_filter(arguments = {}) ⇒ Object

Instantiates a filter.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :filter_id (String)

    The ID of the filter to create

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The filter details (Required)

Raises:

  • (ArgumentError)

See Also:



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

def put_filter(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id]

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

  arguments = arguments.clone

  _filter_id = arguments.delete(:filter_id)

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

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

#put_job(arguments = {}) ⇒ Object

Instantiates an anomaly detection job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to create

  • :ignore_unavailable (Boolean)

    Ignore unavailable indexes (default: false). Only set if datafeed_config is provided.

  • :allow_no_indices (Boolean)

    Ignore if the source indices expressions resolves to no concrete indices (default: true). Only set if datafeed_config is provided.

  • :ignore_throttled (Boolean)

    Ignore indices that are marked as throttled (default: true). Only set if datafeed_config is provided.

  • :expand_wildcards (String)

    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)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The job (Required)

Raises:

  • (ArgumentError)

See Also:



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

def put_job(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#put_trained_model(arguments = {}) ⇒ Object

Creates an inference trained model.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :model_id (String)

    The ID of the trained models to store

  • :defer_definition_decompression (Boolean)

    If set to ‘true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The trained model configuration (Required)

Raises:

  • (ArgumentError)

See Also:



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

def put_trained_model(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]

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

  arguments = arguments.clone

  _model_id = arguments.delete(:model_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ml/trained_models/#{Elasticsearch::API::Utils.__listify(_model_id)}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#put_trained_model_alias(arguments = {}) ⇒ Object

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

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :model_alias (String)

    The trained model alias to update

  • :model_id (String)

    The trained model where the model alias should be assigned

  • :reassign (Boolean)

    If the model_alias already exists and points to a separate model_id, this parameter must be true. Defaults to false.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

def put_trained_model_alias(arguments = {})
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
  raise ArgumentError, "Required argument 'model_alias' missing" unless arguments[:model_alias]

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

  arguments = arguments.clone

  _model_alias = arguments.delete(:model_alias)

  _model_id = arguments.delete(:model_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#reset_job(arguments = {}) ⇒ Object

Resets an existing anomaly detection job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to reset

  • :wait_for_completion (Boolean)

    Should this request wait until the operation has completed before returning

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/reset_job.rb', line 31

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

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#revert_model_snapshot(arguments = {}) ⇒ Object

Reverts to a specific snapshot.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to fetch

  • :snapshot_id (String)

    The ID of the snapshot to revert to

  • :delete_intervening_results (Boolean)

    Should we reset the results back to the time of the snapshot?

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Reversion options

Raises:

  • (ArgumentError)

See Also:



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

def revert_model_snapshot(arguments = {})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

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

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

#set_upgrade_mode(arguments = {}) ⇒ Object

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

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :enabled (Boolean)

    Whether to enable upgrade_mode ML setting or not. Defaults to false.

  • :timeout (Time)

    Controls the time to wait before action times out. Defaults to 30 seconds

  • :headers (Hash)

    Custom HTTP headers

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/set_upgrade_mode.rb', line 31

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

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_POST
  path   = "_ml/set_upgrade_mode"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end

#start_data_frame_analytics(arguments = {}) ⇒ Object

Starts a data frame analytics job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics to start

  • :timeout (Time)

    Controls the time to wait until the task has started. Defaults to 20 seconds

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The start data frame analytics parameters

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

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

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

#start_datafeed(arguments = {}) ⇒ Object

Starts one or more datafeeds.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to start

  • :start (String)

    The start time from where the datafeed should begin

  • :end (String)

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

  • :timeout (Time)

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

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The start datafeed parameters

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _datafeed_id = arguments.delete(:datafeed_id)

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

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

#start_trained_model_deployment(arguments = {}) ⇒ Object

Start a trained model deployment. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :model_id (String)

    The ID of the model to deploy

  • :timeout (Time)

    Controls the time to wait until the model is deployed

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _model_id = arguments.delete(:model_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#stop_data_frame_analytics(arguments = {}) ⇒ Object

Stops one or more data frame analytics jobs.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics to stop

  • :allow_no_match (Boolean)

    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)

  • :force (Boolean)

    True if the data frame analytics should be forcefully stopped

  • :timeout (Time)

    Controls the time to wait until the task has stopped. Defaults to 20 seconds

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The stop data frame analytics parameters

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

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

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

#stop_datafeed(arguments = {}) ⇒ Object

Stops one or more datafeeds.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to stop

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no datafeeds. (This includes ‘_all` string or when no datafeeds have been specified)

  • :allow_no_datafeeds (Boolean)

    Whether to ignore if a wildcard expression matches no datafeeds. (This includes ‘_all` string or when no datafeeds have been specified) Deprecated

  • :force (Boolean)

    True if the datafeed should be forcefully stopped.

  • :timeout (Time)

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

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The URL params optionally sent in the body

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _datafeed_id = arguments.delete(:datafeed_id)

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

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

#stop_trained_model_deployment(arguments = {}) ⇒ Object

Stop a trained model deployment. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :model_id (String)

    The ID of the model to undeploy

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _model_id = arguments.delete(:model_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#update_data_frame_analytics(arguments = {}) ⇒ Object

Updates certain properties of a data frame analytics job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics to update

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The data frame analytics settings to update (Required)

Raises:

  • (ArgumentError)

See Also:



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

def update_data_frame_analytics(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

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

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

#update_datafeed(arguments = {}) ⇒ Object

Updates certain properties of a datafeed.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to update

  • :ignore_unavailable (Boolean)

    Ignore unavailable indexes (default: false)

  • :allow_no_indices (Boolean)

    Ignore if the source indices expressions resolves to no concrete indices (default: true)

  • :ignore_throttled (Boolean)

    Ignore indices that are marked as throttled (default: true)

  • :expand_wildcards (String)

    Whether source index expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The datafeed update settings (Required)

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _datafeed_id = arguments.delete(:datafeed_id)

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

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

#update_filter(arguments = {}) ⇒ Object

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

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :filter_id (String)

    The ID of the filter to update

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The filter update (Required)

Raises:

  • (ArgumentError)

See Also:



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

def update_filter(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id]

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

  arguments = arguments.clone

  _filter_id = arguments.delete(:filter_id)

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

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

#update_job(arguments = {}) ⇒ Object

Updates certain properties of an anomaly detection job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to create

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The job update settings (Required)

Raises:

  • (ArgumentError)

See Also:



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

def update_job(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

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

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

#update_model_snapshot(arguments = {}) ⇒ Object

Updates certain properties of a snapshot.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to fetch

  • :snapshot_id (String)

    The ID of the snapshot to update

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The model snapshot properties to update (Required)

Raises:

  • (ArgumentError)

See Also:



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

def update_model_snapshot(arguments = {})
  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]

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

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

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

#upgrade_job_snapshot(arguments = {}) ⇒ Object

Upgrades a given job snapshot to the current major version.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job

  • :snapshot_id (String)

    The ID of the snapshot

  • :timeout (Time)

    How long should the API wait for the job to be opened and the old snapshot to be loaded.

  • :wait_for_completion (Boolean)

    Should the request wait until the task is complete before responding to the caller. Default is false.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



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

def upgrade_job_snapshot(arguments = {})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]

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

  arguments = arguments.clone

  _job_id = arguments.delete(:job_id)

  _snapshot_id = arguments.delete(:snapshot_id)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end

#validate(arguments = {}) ⇒ Object

Validates an anomaly detection job.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The job config (Required)

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/validate.rb', line 30

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

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

  arguments = arguments.clone

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

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

#validate_detector(arguments = {}) ⇒ Object

Validates an anomaly detection detector.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The detector (Required)

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/validate_detector.rb', line 30

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

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

  arguments = arguments.clone

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

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