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/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/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/validate_detector.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeed_stats.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/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/post_calendar_events.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/revert_model_snapshot.rb,
lib/elasticsearch/xpack/api/actions/machine_learning/update_model_snapshot.rb

Instance Method Summary collapse

Instance Method Details

#close_job(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The name of the job to close (Required)

  • :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)

  • :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

Raises:

  • (ArgumentError)

See Also:



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

def close_job(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  valid_params = [
    :allow_no_jobs,
    :force,
    :timeout ]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_close"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#delete_calendar(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to delete (Required)

Raises:

  • (ArgumentError)

See Also:

  • [TODO]


30
31
32
33
34
35
36
37
38
# 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]
  method = Elasticsearch::API::HTTP_DELETE
  path   = "_xpack/ml/calendars/#{arguments[:calendar_id]}"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end

#delete_calendar_event(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to modify (Required)

  • :event_id (String)

    The ID of the event to remove from the calendar (Required)

Raises:

  • (ArgumentError)

See Also:

  • [TODO]


31
32
33
34
35
36
37
38
39
40
# 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]
  method = Elasticsearch::API::HTTP_DELETE
  path   = "_xpack/ml/calendars/#{arguments[:calendar_id]}/events/#{URI.escape(arguments[:event_id])}"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end

#delete_calendar_job(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to modify (Required)

  • :job_id (String)

    The ID of the job to remove from the calendar (Required)

Raises:

  • (ArgumentError)

See Also:

  • [TODO]


31
32
33
34
35
36
37
38
39
40
# 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]
  method = Elasticsearch::API::HTTP_DELETE
  path   = "_xpack/ml/calendars/#{arguments[:calendar_id]}/jobs/#{arguments[:job_id]}"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end

#delete_datafeed(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to delete (Required)

  • :force (Boolean)

    True if the datafeed should be forcefully deleted

Raises:

  • (ArgumentError)

See Also:



31
32
33
34
35
36
37
38
39
40
41
# 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]
  valid_params = [
    :force ]
  method = Elasticsearch::API::HTTP_DELETE
  path   = "_xpack/ml/datafeeds/#{arguments[:datafeed_id]}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#delete_expired_data(arguments = {}) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_expired_data.rb', line 24

def delete_expired_data(arguments={})
  method = Elasticsearch::API::HTTP_DELETE
  path   = "_xpack/ml/_delete_expired_data"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end

#delete_filter(arguments = {}) ⇒ Object

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :filter_id (String)

    The ID of the filter to delete (Required)

Raises:

  • (ArgumentError)


26
27
28
29
30
31
32
33
34
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_filter.rb', line 26

def delete_filter(arguments={})
  raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id]
  method = Elasticsearch::API::HTTP_DELETE
  path   = "_xpack/ml/filters/#{arguments[:filter_id]}"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end

#delete_forecast(arguments = {}) ⇒ Object

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 (Required)

  • :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.

Raises:

  • (ArgumentError)


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_forecast.rb', line 14

def delete_forecast(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ml/anomaly_detectors/#{arguments[:job_id]}/_forecast/#{arguments[:forecast_id]}"

  valid_params = [
      :forecast_id,
      :allow_no_forecasts,
      :timeout ]

  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#delete_job(arguments = {}) ⇒ Object

Delete 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 (Required)

  • :force (Boolean)

    True if the job should be forcefully deleted

Raises:

  • (ArgumentError)

See Also:



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

def delete_job(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  valid_params = [
    :force ]
  method = Elasticsearch::API::HTTP_DELETE
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#delete_model_snapshot(arguments = {}) ⇒ Object

Delete 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 (Required)

  • :snapshot_id (String)

    The ID of the snapshot to delete (Required)

Raises:

  • (ArgumentError)

See Also:



31
32
33
34
35
36
37
38
39
40
# 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]
  method = Elasticsearch::API::HTTP_DELETE
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/model_snapshots/#{arguments[:snapshot_id]}"
  params = {}
  body   = nil

  perform_request(method, path, params, body).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.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :body (Hash)

    The contents of the file to be analyzed (Required)

Raises:

  • (ArgumentError)

See Also:



14
15
16
17
18
19
20
21
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/find_file_structure.rb', line 14

def find_file_structure(arguments={})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/find_file_structure"
  body = Elasticsearch::API::Utils.__bulkify(arguments.delete(:body))

  perform_request(method, path, arguments, body).body
end

#flush_job(arguments = {}) ⇒ Object

Force 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 (Required)

  • :body (Hash)

    Flush parameters

  • :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)

    Setting this tells the Engine API that no data prior to advance_time is expected

  • :skip_time (String)

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

Raises:

  • (ArgumentError)

See Also:



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 37

def flush_job(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  valid_params = [
    :calc_interim,
    :start,
    :end,
    :advance_time,
    :skip_time ]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_flush"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#forecast(arguments = {}) ⇒ Object

Predict the future behavior of a time series

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to forecast for (Required)

  • :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.

Raises:

  • (ArgumentError)

See Also:



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

def forecast(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  valid_params = [
    :duration,
    :expires_in ]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_forecast"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#get_buckets(arguments = {}) ⇒ Object

Retrieve 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 (Required)

  • :timestamp (String)

    The timestamp of the desired single bucket result

  • :body (Hash)

    Bucket selection details if not provided in URI

  • :expand (Boolean)

    Include anomaly records

  • :exclude_interim (Boolean)

    Exclude interim results

  • :from (Int)

    skips a number of buckets

  • :size (Int)

    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

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
# 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]
  valid_params = [
    :timestamp,
    :expand,
    :exclude_interim,
    :from,
    :size,
    :start,
    :end,
    :anomaly_score,
    :sort,
    :desc ]

  arguments = arguments.clone
  timestamp = arguments.delete(:timestamp)

  method = Elasticsearch::API::HTTP_GET
  path   = Elasticsearch::API::Utils.__pathify "_xpack/ml/anomaly_detectors", arguments[:job_id], "results/buckets", timestamp
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#get_calendar_events(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar containing the events (Required)

  • :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 (Int)

    Skips a number of events

  • :size (Int)

    Specifies a max number of events to get

Raises:

  • (ArgumentError)

See Also:

  • [TODO]


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/get_calendar_events.rb', line 35

def get_calendar_events(arguments={})
  raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
  valid_params = [
    :calendar_id,
    :job_id,
    :start,
    :end,
    :from,
    :size ]

  arguments = arguments.clone
  calendar_id = arguments.delete(:calendar_id)

  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/calendars/#{calendar_id}/events"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#get_calendars(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to fetch

  • :from (Int)

    skips a number of calendars

  • :size (Int)

    specifies a max number of calendars to get

See Also:

  • [TODO]


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

def get_calendars(arguments={})
  valid_params = [
    :calendar_id,
    :from,
    :size ]

  arguments = arguments.clone
  calendar_id = arguments.delete(:calendar_id)

  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/calendars/#{calendar_id}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#get_categories(arguments = {}) ⇒ Object

Retrieve 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 (Required)

  • :category_id (Long)

    The identifier of the category definition of interest

  • :body (Hash)

    Category selection details if not provided in URI

  • :from (Int)

    skips a number of categories

  • :size (Int)

    specifies a max number of categories to get

Raises:

  • (ArgumentError)

See Also:



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

def get_categories(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  valid_params = [
    :from,
    :size ]
  method = Elasticsearch::API::HTTP_GET
  path   = Elasticsearch::API::Utils.__pathify "_xpack/ml/anomaly_detectors", arguments[:job_id], "results/categories", arguments[:category_id]
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#get_datafeed_stats(arguments = {}) ⇒ Object

Retrieve 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_datafeeds (Boolean)

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

See Also:



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

def get_datafeed_stats(arguments={})
  valid_params = [
    :allow_no_datafeeds ]

  method = Elasticsearch::API::HTTP_GET
  path   = Elasticsearch::API::Utils.__pathify "_xpack/ml/datafeeds", arguments[:datafeed_id], "/_stats"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#get_datafeeds(arguments = {}) ⇒ Object

Retrieve 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 stats to fetch

  • :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)

See Also:



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

def get_datafeeds(arguments={})
  valid_params = [
    :allow_no_datafeeds ]

  method = Elasticsearch::API::HTTP_GET
  path   = Elasticsearch::API::Utils.__pathify "_xpack/ml/datafeeds", arguments[:datafeed_id]
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#get_filters(arguments = {}) ⇒ Object

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :filter_id (String)

    The ID of the filter to fetch

  • :from (Int)

    skips a number of filters

  • :size (Int)

    specifies a max number of filters to get



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

def get_filters(arguments={})
  valid_params = [
    :from,
    :size ]
  method = Elasticsearch::API::HTTP_GET
  path   = Elasticsearch::API::Utils.__pathify "_xpack/ml/filters", arguments[:filter_id]
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#get_influencers(arguments = {}) ⇒ Object

Retrieve job results for one or more influencers

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)
    TODO

    (Required)

  • :body (Hash)

    Influencer selection criteria

  • :exclude_interim (Boolean)

    Exclude interim results

  • :from (Int)

    skips a number of influencers

  • :size (Int)

    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

Raises:

  • (ArgumentError)

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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]
  valid_params = [
    :exclude_interim,
    :from,
    :size,
    :start,
    :end,
    :influencer_score,
    :sort,
    :desc ]
  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/results/influencers"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#get_job_stats(arguments = {}) ⇒ Object

TODO: Description

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_jobs (Boolean)

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

See Also:



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

def get_job_stats(arguments={})
  valid_params = [
    :allow_no_jobs ]

  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_stats"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#get_jobs(arguments = {}) ⇒ Object

Retrieve configuration information for 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_jobs (Boolean)

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

See Also:



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

def get_jobs(arguments={})
  valid_params = [
    :allow_no_jobs ]

  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#get_model_snapshots(arguments = {}) ⇒ Object

Retrieve 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 (Required)

  • :snapshot_id (String)

    The ID of the snapshot to fetch

  • :body (Hash)

    Model snapshot selection criteria

  • :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

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 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]
  valid_params = [
    :from,
    :size,
    :start,
    :end,
    :sort,
    :desc ]
  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/model_snapshots/#{arguments[:snapshot_id]}"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#get_overall_buckets(arguments = {}) ⇒ Object

Retrieve overall bucket results that summarize the bucket results of multiple 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 (Required)

  • :body (Hash)

    Overall bucket selection details if not provided in URI

  • :top_n (Int)

    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_jobs (Boolean)

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

Raises:

  • (ArgumentError)

See Also:



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

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

  valid_params = [
    :top_n,
    :bucket_span,
    :overall_score,
    :exclude_interim,
    :start,
    :end,
    :allow_no_jobs ]

  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/results/overall_buckets"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#get_records(arguments = {}) ⇒ Object

Retrieve anomaly records for a job

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)
    TODO

    (Required)

  • :body (Hash)

    Record selection criteria

  • :exclude_interim (Boolean)

    Exclude interim results

  • :from (Int)

    skips a number of records

  • :size (Int)

    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)
    TODO
  • :sort (String)

    Sort records by a particular field

  • :desc (Boolean)

    Set the sort direction

Raises:

  • (ArgumentError)

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 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]

  valid_params = [
    :exclude_interim,
    :from,
    :size,
    :start,
    :end,
    :record_score,
    :sort,
    :desc ]

  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/results/records"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#info(arguments = {}) ⇒ Object

TODO: Description

See Also:

  • [TODO]


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

def info(arguments={})
  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/info"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end

#open_job(arguments = {}) ⇒ Object

Open a job to receive and analyze data

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to open (Required)

  • :ignore_downtime (Boolean)

    Controls if gaps in data are treated as anomalous or as a maintenance window after a job re-start

  • :timeout (Time)

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

Raises:

  • (ArgumentError)

See Also:



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

def open_job(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_open"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end

#post_calendar_events(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to modify (Required)

  • :body (Hash)

    A list of events (Required)

Raises:

  • (ArgumentError)

See Also:

  • [TODO]


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

def post_calendar_events(arguments={})
  raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/calendars/#{arguments[:calendar_id]}/events"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#post_data(arguments = {}) ⇒ Object

Send 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 (Required)

  • :body (Hash)

    The data to process (Required)

  • :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

Raises:

  • (ArgumentError)

See Also:



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

def post_data(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  valid_params = [
    :reset_start,
    :reset_end ]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_data"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#preview_datafeed(arguments = {}) ⇒ Object

Preview 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 (Required)

Raises:

  • (ArgumentError)

See Also:



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

def preview_datafeed(arguments={})
  raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id]
  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/ml/datafeeds/#{arguments[:datafeed_id]}/_preview"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end

#put_calendar(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to create (Required)

  • :body (Hash)

    The calendar details

Raises:

  • (ArgumentError)

See Also:

  • [TODO]


31
32
33
34
35
36
37
38
39
# 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]
  method = Elasticsearch::API::HTTP_PUT
  path   = "_xpack/ml/calendars/#{arguments[:calendar_id]}"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#put_calendar_job(arguments = {}) ⇒ Object

TODO: Description

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :calendar_id (String)

    The ID of the calendar to modify (Required)

  • :job_id (String)

    The ID of the job to add to the calendar (Required)

Raises:

  • (ArgumentError)

See Also:

  • [TODO]


31
32
33
34
35
36
37
38
39
40
# 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]
  method = Elasticsearch::API::HTTP_PUT
  path   = "_xpack/ml/calendars/#{arguments[:calendar_id]}/jobs/#{arguments[:job_id]}"
  params = {}
  body   = nil

  perform_request(method, path, params, body).body
end

#put_datafeed(arguments = {}) ⇒ Object

Create a new datafeed

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to create (Required)

  • :body (Hash)

    The datafeed config (Required)

Raises:

  • (ArgumentError)

See Also:



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

def put_datafeed(arguments={})
  raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id]
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  method = Elasticsearch::API::HTTP_PUT
  path   = "_xpack/ml/datafeeds/#{arguments[:datafeed_id]}"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#put_filter(arguments = {}) ⇒ Object

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :filter_id (String)

    The ID of the filter to create (Required)

  • :body (Hash)

    The filter details (Required)

Raises:

  • (ArgumentError)


27
28
29
30
31
32
33
34
35
36
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/put_filter.rb', line 27

def put_filter(arguments={})
  raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id]
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  method = Elasticsearch::API::HTTP_PUT
  path   = "_xpack/ml/filters/#{arguments[:filter_id]}"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#put_job(arguments = {}) ⇒ Object

Create a new job

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to create (Required)

  • :body (Hash)

    The job (Required)

Raises:

  • (ArgumentError)

See Also:



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

def put_job(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  method = Elasticsearch::API::HTTP_PUT
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#revert_model_snapshot(arguments = {}) ⇒ Object

Revert to a specific snapshot (eg. before a highly-anomalous, but insignificant event)

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to fetch (Required)

  • :snapshot_id (String)

    The ID of the snapshot to revert to

  • :body (Hash)

    Reversion options

  • :delete_intervening_results (Boolean)

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

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
# 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]

  valid_params = [
    :delete_intervening_results ]

  method = Elasticsearch::API::HTTP_POST
  path   = Elasticsearch::API::Utils.__pathify "_xpack/ml/anomaly_detectors", arguments[:job_id], "model_snapshots", arguments[:snapshot_id], "_revert"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#set_upgrade_mode(arguments = {}) ⇒ Object

Temporarily halt tasks associated with the jobs and datafeeds and prevent new jobs from opening. When enabled=true this API temporarily halts all job and datafeed tasks and prohibits new job and

datafeed tasks from starting.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :enabled (true, false)

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

  • :timeout (String)

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

See Also:



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

def set_upgrade_mode(arguments={})

  valid_params = [
      :enabled,
      :timeout ]

  method = Elasticsearch::API::HTTP_POST
  path   = '_ml/set_upgrade_mode'
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params

  perform_request(method, path, params).body
end

#start_datafeed(arguments = {}) ⇒ Object

Start a datafeed

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to start (Required)

  • :body (Hash)

    The start datafeed parameters

  • :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

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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]

  valid_params = [
    :start,
    :end,
    :timeout ]

  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/datafeeds/#{arguments[:datafeed_id]}/_start"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#stop_datafeed(arguments = {}) ⇒ Object

Stop a datafeed

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :datafeed_id (String)

    The ID of the datafeed to stop (Required)

  • :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)

  • :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

Raises:

  • (ArgumentError)

See Also:



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

def stop_datafeed(arguments={})
  raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id]
  valid_params = [
    :allow_no_datafeeds,
    :force,
    :timeout ]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/datafeeds/#{arguments[:datafeed_id]}/_stop"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#update_datafeed(arguments = {}) ⇒ Object

Update 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 (Required)

  • :body (Hash)

    The datafeed update settings (Required)

Raises:

  • (ArgumentError)

See Also:



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

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

  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/datafeeds/#{arguments[:datafeed_id]}/_update"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).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 (Required)

  • :body (Hash)

    The filter update (Required)

Raises:

  • (ArgumentError)


12
13
14
15
16
17
18
19
20
21
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/update_filter.rb', line 12

def update_filter(arguments={})
  raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id]
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  method = Elasticsearch::API::HTTP_POST
  path = "_xpack/ml/filters/#{arguments[:filter_id]}/_update"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#update_job(arguments = {}) ⇒ Object

Update certain properties of a job

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :job_id (String)

    The ID of the job to create (Required)

  • :body (Hash)

    The job update settings (Required)

Raises:

  • (ArgumentError)

See Also:



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

def update_job(arguments={})
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_update"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#update_model_snapshot(arguments = {}) ⇒ Object

Update 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 (Required)

  • :snapshot_id (String)

    The ID of the snapshot to update (Required)

  • :body (Hash)

    The model snapshot properties to update (Required)

Raises:

  • (ArgumentError)

See Also:



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/update_model_snapshot.rb', line 15

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

  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/model_snapshots/#{arguments[:snapshot_id]}/_update"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#validate(arguments = {}) ⇒ Object

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :body (Hash)

    The job config (Required)

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
17
18
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/validate.rb', line 9

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

  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/anomaly_detectors/_validate"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end

#validate_detector(arguments = {}) ⇒ Object

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :body (Hash)

    The detector (Required)

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
17
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/validate_detector.rb', line 9

def validate_detector(arguments={})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  method = Elasticsearch::API::HTTP_POST
  path   = "_xpack/ml/anomaly_detectors/_validate/detector"
  params = {}
  body   = arguments[:body]

  perform_request(method, path, params, body).body
end