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
-
#close_job(arguments = {}) ⇒ Object
TODO: Description.
-
#delete_calendar(arguments = {}) ⇒ Object
TODO: Description.
-
#delete_calendar_event(arguments = {}) ⇒ Object
TODO: Description.
-
#delete_calendar_job(arguments = {}) ⇒ Object
TODO: Description.
-
#delete_datafeed(arguments = {}) ⇒ Object
TODO: Description.
- #delete_expired_data(arguments = {}) ⇒ Object
- #delete_filter(arguments = {}) ⇒ Object
- #delete_forecast(arguments = {}) ⇒ Object
-
#delete_job(arguments = {}) ⇒ Object
Delete an existing anomaly detection job.
-
#delete_model_snapshot(arguments = {}) ⇒ Object
Delete an existing model snapshot.
-
#find_file_structure(arguments = {}) ⇒ Object
Finds the structure of a text file.
-
#flush_job(arguments = {}) ⇒ Object
Force any buffered data to be processed by the job.
-
#forecast(arguments = {}) ⇒ Object
Predict the future behavior of a time series.
-
#get_buckets(arguments = {}) ⇒ Object
Retrieve job results for one or more buckets.
-
#get_calendar_events(arguments = {}) ⇒ Object
TODO: Description.
-
#get_calendars(arguments = {}) ⇒ Object
TODO: Description.
-
#get_categories(arguments = {}) ⇒ Object
Retrieve job results for one or more categories.
-
#get_datafeed_stats(arguments = {}) ⇒ Object
Retrieve usage information for datafeeds.
-
#get_datafeeds(arguments = {}) ⇒ Object
Retrieve configuration information for datafeeds.
- #get_filters(arguments = {}) ⇒ Object
-
#get_influencers(arguments = {}) ⇒ Object
Retrieve job results for one or more influencers.
-
#get_job_stats(arguments = {}) ⇒ Object
TODO: Description.
-
#get_jobs(arguments = {}) ⇒ Object
Retrieve configuration information for jobs.
-
#get_model_snapshots(arguments = {}) ⇒ Object
Retrieve information about model snapshots.
-
#get_overall_buckets(arguments = {}) ⇒ Object
Retrieve overall bucket results that summarize the bucket results of multiple jobs.
-
#get_records(arguments = {}) ⇒ Object
Retrieve anomaly records for a job.
-
#info(arguments = {}) ⇒ Object
TODO: Description.
-
#open_job(arguments = {}) ⇒ Object
Open a job to receive and analyze data.
-
#post_calendar_events(arguments = {}) ⇒ Object
TODO: Description.
-
#post_data(arguments = {}) ⇒ Object
Send data to an anomaly detection job for analysis.
-
#preview_datafeed(arguments = {}) ⇒ Object
Preview a datafeed.
-
#put_calendar(arguments = {}) ⇒ Object
TODO: Description.
-
#put_calendar_job(arguments = {}) ⇒ Object
TODO: Description.
-
#put_datafeed(arguments = {}) ⇒ Object
Create a new datafeed.
- #put_filter(arguments = {}) ⇒ Object
-
#put_job(arguments = {}) ⇒ Object
Create a new job.
-
#revert_model_snapshot(arguments = {}) ⇒ Object
Revert to a specific snapshot (eg. before a highly-anomalous, but insignificant event).
-
#set_upgrade_mode(arguments = {}) ⇒ Object
When enabled=true this API temporarily halts all job and datafeed tasks and prohibits new job and datafeed tasks from starting.
-
#start_datafeed(arguments = {}) ⇒ Object
Start a datafeed.
-
#stop_datafeed(arguments = {}) ⇒ Object
Stop a datafeed.
-
#update_datafeed(arguments = {}) ⇒ Object
Update certain properties of a datafeed.
-
#update_filter(arguments = {}) ⇒ Object
Updates the description of a filter, adds items, or removes items.
-
#update_job(arguments = {}) ⇒ Object
Update certain properties of a job.
-
#update_model_snapshot(arguments = {}) ⇒ Object
Update certain properties of a snapshot.
- #validate(arguments = {}) ⇒ Object
- #validate_detector(arguments = {}) ⇒ Object
Instance Method Details
#close_job(arguments = {}) ⇒ Object
TODO: Description
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/close_job.rb', line 16 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 = arguments[:body] perform_request(method, path, params, body).body end |
#delete_calendar(arguments = {}) ⇒ Object
TODO: Description
13 14 15 16 17 18 19 20 21 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar.rb', line 13 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
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_event.rb', line 14 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
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_job.rb', line 14 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
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_datafeed.rb', line 14 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
7 8 9 10 11 12 13 14 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_expired_data.rb', line 7 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
9 10 11 12 13 14 15 16 17 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_filter.rb', line 9 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
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 = "_xpack/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
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_job.rb', line 14 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
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/delete_model_snapshot.rb', line 14 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.
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
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/flush_job.rb', line 20 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
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/forecast.rb', line 15 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
24 25 26 27 28 29 30 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/get_buckets.rb', line 24 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 = arguments.delete(:timestamp) method = Elasticsearch::API::HTTP_GET path = Elasticsearch::API::Utils.__pathify "_xpack/ml/anomaly_detectors", arguments[:job_id], "results/buckets", 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
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_calendar_events.rb', line 18 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
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_calendars.rb', line 15 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
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_categories.rb', line 17 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
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeed_stats.rb', line 14 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
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeeds.rb', line 14 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
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_filters.rb', line 11 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
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_influencers.rb', line 22 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
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_job_stats.rb', line 14 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
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_jobs.rb', line 14 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
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_model_snapshots.rb', line 21 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
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_overall_buckets.rb', line 21 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
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb', line 22 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
12 13 14 15 16 17 18 19 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/info.rb', line 12 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
15 16 17 18 19 20 21 22 23 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/open_job.rb', line 15 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
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/post_calendar_events.rb', line 14 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
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/post_data.rb', line 16 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
13 14 15 16 17 18 19 20 21 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/preview_datafeed.rb', line 13 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
14 15 16 17 18 19 20 21 22 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar.rb', line 14 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
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar_job.rb', line 14 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
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/put_datafeed.rb', line 14 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
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/put_filter.rb', line 10 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
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/put_job.rb', line 14 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)
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/revert_model_snapshot.rb', line 16 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
When enabled=true this API temporarily halts all job and datafeed tasks and prohibits new job and
datafeed tasks from starting.
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
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/start_datafeed.rb', line 17 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
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/stop_datafeed.rb', line 16 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
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/update_datafeed.rb', line 14 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.
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
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/elasticsearch/xpack/api/actions/machine_learning/update_job.rb', line 14 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
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
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
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 |