Module: Elasticsearch::API::MachineLearning::Actions
- Included in:
- MachineLearningClient
- Defined in:
- lib/elasticsearch/api/namespace/machine_learning.rb,
lib/elasticsearch/api/actions/machine_learning/info.rb,
lib/elasticsearch/api/actions/machine_learning/put_job.rb,
lib/elasticsearch/api/actions/machine_learning/forecast.rb,
lib/elasticsearch/api/actions/machine_learning/get_jobs.rb,
lib/elasticsearch/api/actions/machine_learning/open_job.rb,
lib/elasticsearch/api/actions/machine_learning/validate.rb,
lib/elasticsearch/api/actions/machine_learning/close_job.rb,
lib/elasticsearch/api/actions/machine_learning/flush_job.rb,
lib/elasticsearch/api/actions/machine_learning/post_data.rb,
lib/elasticsearch/api/actions/machine_learning/reset_job.rb,
lib/elasticsearch/api/actions/machine_learning/delete_job.rb,
lib/elasticsearch/api/actions/machine_learning/put_filter.rb,
lib/elasticsearch/api/actions/machine_learning/update_job.rb,
lib/elasticsearch/api/actions/machine_learning/get_buckets.rb,
lib/elasticsearch/api/actions/machine_learning/get_filters.rb,
lib/elasticsearch/api/actions/machine_learning/get_records.rb,
lib/elasticsearch/api/actions/machine_learning/put_calendar.rb,
lib/elasticsearch/api/actions/machine_learning/put_datafeed.rb,
lib/elasticsearch/api/actions/machine_learning/delete_filter.rb,
lib/elasticsearch/api/actions/machine_learning/get_calendars.rb,
lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb,
lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb,
lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb,
lib/elasticsearch/api/actions/machine_learning/update_filter.rb,
lib/elasticsearch/api/actions/machine_learning/get_categories.rb,
lib/elasticsearch/api/actions/machine_learning/start_datafeed.rb,
lib/elasticsearch/api/actions/machine_learning/delete_calendar.rb,
lib/elasticsearch/api/actions/machine_learning/delete_datafeed.rb,
lib/elasticsearch/api/actions/machine_learning/delete_forecast.rb,
lib/elasticsearch/api/actions/machine_learning/get_influencers.rb,
lib/elasticsearch/api/actions/machine_learning/update_datafeed.rb,
lib/elasticsearch/api/actions/machine_learning/get_memory_stats.rb,
lib/elasticsearch/api/actions/machine_learning/preview_datafeed.rb,
lib/elasticsearch/api/actions/machine_learning/put_calendar_job.rb,
lib/elasticsearch/api/actions/machine_learning/set_upgrade_mode.rb,
lib/elasticsearch/api/actions/machine_learning/put_trained_model.rb,
lib/elasticsearch/api/actions/machine_learning/validate_detector.rb,
lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb,
lib/elasticsearch/api/actions/machine_learning/get_trained_models.rb,
lib/elasticsearch/api/actions/machine_learning/delete_calendar_job.rb,
lib/elasticsearch/api/actions/machine_learning/delete_expired_data.rb,
lib/elasticsearch/api/actions/machine_learning/evaluate_data_frame.rb,
lib/elasticsearch/api/actions/machine_learning/get_calendar_events.rb,
lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb,
lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb,
lib/elasticsearch/api/actions/machine_learning/infer_trained_model.rb,
lib/elasticsearch/api/actions/machine_learning/delete_trained_model.rb,
lib/elasticsearch/api/actions/machine_learning/post_calendar_events.rb,
lib/elasticsearch/api/actions/machine_learning/upgrade_job_snapshot.rb,
lib/elasticsearch/api/actions/machine_learning/delete_calendar_event.rb,
lib/elasticsearch/api/actions/machine_learning/delete_model_snapshot.rb,
lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb,
lib/elasticsearch/api/actions/machine_learning/revert_model_snapshot.rb,
lib/elasticsearch/api/actions/machine_learning/update_model_snapshot.rb,
lib/elasticsearch/api/actions/machine_learning/put_trained_model_alias.rb,
lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics.rb,
lib/elasticsearch/api/actions/machine_learning/get_trained_models_stats.rb,
lib/elasticsearch/api/actions/machine_learning/put_data_frame_analytics.rb,
lib/elasticsearch/api/actions/machine_learning/stop_data_frame_analytics.rb,
lib/elasticsearch/api/actions/machine_learning/delete_trained_model_alias.rb,
lib/elasticsearch/api/actions/machine_learning/start_data_frame_analytics.rb,
lib/elasticsearch/api/actions/machine_learning/delete_data_frame_analytics.rb,
lib/elasticsearch/api/actions/machine_learning/update_data_frame_analytics.rb,
lib/elasticsearch/api/actions/machine_learning/explain_data_frame_analytics.rb,
lib/elasticsearch/api/actions/machine_learning/preview_data_frame_analytics.rb,
lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb,
lib/elasticsearch/api/actions/machine_learning/stop_trained_model_deployment.rb,
lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics_stats.rb,
lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb,
lib/elasticsearch/api/actions/machine_learning/update_trained_model_deployment.rb,
lib/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb,
lib/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part.rb,
lib/elasticsearch/api/actions/machine_learning/clear_trained_model_deployment_cache.rb
Instance Method Summary collapse
-
#clear_trained_model_deployment_cache(arguments = {}) ⇒ Object
Clear trained model deployment cache.
-
#close_job(arguments = {}) ⇒ Object
Close anomaly detection jobs.
-
#delete_calendar(arguments = {}) ⇒ Object
Delete a calendar.
-
#delete_calendar_event(arguments = {}) ⇒ Object
Delete events from a calendar.
-
#delete_calendar_job(arguments = {}) ⇒ Object
Delete anomaly jobs from a calendar.
-
#delete_data_frame_analytics(arguments = {}) ⇒ Object
Delete a data frame analytics job.
-
#delete_datafeed(arguments = {}) ⇒ Object
Delete a datafeed.
-
#delete_expired_data(arguments = {}) ⇒ Object
Delete expired ML data.
-
#delete_filter(arguments = {}) ⇒ Object
Delete a filter.
-
#delete_forecast(arguments = {}) ⇒ Object
Delete forecasts from a job.
-
#delete_job(arguments = {}) ⇒ Object
Delete an anomaly detection job.
-
#delete_model_snapshot(arguments = {}) ⇒ Object
Delete a model snapshot.
-
#delete_trained_model(arguments = {}) ⇒ Object
Delete an unreferenced trained model.
-
#delete_trained_model_alias(arguments = {}) ⇒ Object
Delete a trained model alias.
-
#estimate_model_memory(arguments = {}) ⇒ Object
Estimate job model memory usage.
-
#evaluate_data_frame(arguments = {}) ⇒ Object
Evaluate data frame analytics.
-
#explain_data_frame_analytics(arguments = {}) ⇒ Object
Explain data frame analytics config.
-
#flush_job(arguments = {}) ⇒ Object
Force buffered data to be processed.
-
#forecast(arguments = {}) ⇒ Object
Predict future behavior of a time series.
-
#get_buckets(arguments = {}) ⇒ Object
Get anomaly detection job results for buckets.
-
#get_calendar_events(arguments = {}) ⇒ Object
Get info about events in calendars.
-
#get_calendars(arguments = {}) ⇒ Object
Get calendar configuration info.
-
#get_categories(arguments = {}) ⇒ Object
Get anomaly detection job results for categories.
-
#get_data_frame_analytics(arguments = {}) ⇒ Object
Get data frame analytics job configuration info.
-
#get_data_frame_analytics_stats(arguments = {}) ⇒ Object
Get data frame analytics job stats.
-
#get_datafeed_stats(arguments = {}) ⇒ Object
Get datafeed stats.
-
#get_datafeeds(arguments = {}) ⇒ Object
Get datafeeds configuration info.
-
#get_filters(arguments = {}) ⇒ Object
Get filters.
-
#get_influencers(arguments = {}) ⇒ Object
Get anomaly detection job results for influencers.
-
#get_job_stats(arguments = {}) ⇒ Object
Get anomaly detection job stats.
-
#get_jobs(arguments = {}) ⇒ Object
Get anomaly detection jobs configuration info.
-
#get_memory_stats(arguments = {}) ⇒ Object
Get machine learning memory usage info.
-
#get_model_snapshot_upgrade_stats(arguments = {}) ⇒ Object
Get anomaly detection job model snapshot upgrade usage info.
-
#get_model_snapshots(arguments = {}) ⇒ Object
Get model snapshots info.
-
#get_overall_buckets(arguments = {}) ⇒ Object
Get overall bucket results.
-
#get_records(arguments = {}) ⇒ Object
Get anomaly records for an anomaly detection job.
-
#get_trained_models(arguments = {}) ⇒ Object
Get trained model configuration info.
-
#get_trained_models_stats(arguments = {}) ⇒ Object
Get trained models usage info.
-
#infer_trained_model(arguments = {}) ⇒ Object
Evaluate a trained model.
-
#info(arguments = {}) ⇒ Object
Get machine learning information.
-
#open_job(arguments = {}) ⇒ Object
Open anomaly detection jobs.
-
#post_calendar_events(arguments = {}) ⇒ Object
Add scheduled events to the calendar.
-
#post_data(arguments = {}) ⇒ Object
Send data to an anomaly detection job for analysis.
-
#preview_data_frame_analytics(arguments = {}) ⇒ Object
Preview features used by data frame analytics.
-
#preview_datafeed(arguments = {}) ⇒ Object
Preview a datafeed.
-
#put_calendar(arguments = {}) ⇒ Object
Create a calendar.
-
#put_calendar_job(arguments = {}) ⇒ Object
Add anomaly detection job to calendar.
-
#put_data_frame_analytics(arguments = {}) ⇒ Object
Create a data frame analytics job.
-
#put_datafeed(arguments = {}) ⇒ Object
Create a datafeed.
-
#put_filter(arguments = {}) ⇒ Object
Create a filter.
-
#put_job(arguments = {}) ⇒ Object
Create an anomaly detection job.
-
#put_trained_model(arguments = {}) ⇒ Object
Create a trained model.
-
#put_trained_model_alias(arguments = {}) ⇒ Object
Create or update a trained model alias.
-
#put_trained_model_definition_part(arguments = {}) ⇒ Object
Create part of a trained model definition.
-
#put_trained_model_vocabulary(arguments = {}) ⇒ Object
Create a trained model vocabulary.
-
#reset_job(arguments = {}) ⇒ Object
Reset an anomaly detection job.
-
#revert_model_snapshot(arguments = {}) ⇒ Object
Revert to a snapshot.
-
#set_upgrade_mode(arguments = {}) ⇒ Object
Set upgrade_mode for ML indices.
-
#start_data_frame_analytics(arguments = {}) ⇒ Object
Start a data frame analytics job.
-
#start_datafeed(arguments = {}) ⇒ Object
Start datafeeds.
-
#start_trained_model_deployment(arguments = {}) ⇒ Object
Start a trained model deployment.
-
#stop_data_frame_analytics(arguments = {}) ⇒ Object
Stop data frame analytics jobs.
-
#stop_datafeed(arguments = {}) ⇒ Object
Stop datafeeds.
-
#stop_trained_model_deployment(arguments = {}) ⇒ Object
Stop a trained model deployment.
-
#update_data_frame_analytics(arguments = {}) ⇒ Object
Update a data frame analytics job.
-
#update_datafeed(arguments = {}) ⇒ Object
Update a datafeed.
-
#update_filter(arguments = {}) ⇒ Object
Update a filter.
-
#update_job(arguments = {}) ⇒ Object
Update an anomaly detection job.
-
#update_model_snapshot(arguments = {}) ⇒ Object
Update a snapshot.
-
#update_trained_model_deployment(arguments = {}) ⇒ Object
Update a trained model deployment.
-
#upgrade_job_snapshot(arguments = {}) ⇒ Object
Upgrade a snapshot.
-
#validate(arguments = {}) ⇒ Object
Validate an anomaly detection job.
-
#validate_detector(arguments = {}) ⇒ Object
Validate an anomaly detection job.
Instance Method Details
#clear_trained_model_deployment_cache(arguments = {}) ⇒ Object
Clear trained model deployment cache
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/elasticsearch/api/actions/machine_learning/clear_trained_model_deployment_cache.rb', line 32 def clear_trained_model_deployment_cache(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.clear_trained_model_deployment_cache' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/cache/_clear" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#close_job(arguments = {}) ⇒ Object
Close anomaly detection jobs
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/close_job.rb', line 36 def close_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.close_job' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_close" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_calendar(arguments = {}) ⇒ Object
Delete a calendar
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_calendar.rb', line 32 def delete_calendar(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_calendar' } defined_params = [:calendar_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _calendar_id = arguments.delete(:calendar_id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/calendars/#{Utils.__listify(_calendar_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_calendar_event(arguments = {}) ⇒ Object
Delete events from a calendar
33 34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_calendar_event.rb', line 33 def delete_calendar_event(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_calendar_event' } defined_params = %i[calendar_id event_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id] raise ArgumentError, "Required argument 'event_id' missing" unless arguments[:event_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _calendar_id = arguments.delete(:calendar_id) _event_id = arguments.delete(:event_id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/events/#{Utils.__listify(_event_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_calendar_job(arguments = {}) ⇒ Object
Delete anomaly jobs from a calendar
33 34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_calendar_job.rb', line 33 def delete_calendar_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_calendar_job' } defined_params = %i[calendar_id job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id] raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _calendar_id = arguments.delete(:calendar_id) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/jobs/#{Utils.__listify(_job_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_data_frame_analytics(arguments = {}) ⇒ Object
Delete a data frame analytics job
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_data_frame_analytics.rb', line 34 def delete_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_data_frame_analytics' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_datafeed(arguments = {}) ⇒ Object
Delete a datafeed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_datafeed.rb', line 33 def delete_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_datafeed' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_expired_data(arguments = {}) ⇒ Object
Delete expired ML data
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/api/actions/machine_learning/delete_expired_data.rb', line 35 def delete_expired_data(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_expired_data' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_DELETE path = if _job_id "_ml/_delete_expired_data/#{Utils.__listify(_job_id)}" else '_ml/_delete_expired_data' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_filter(arguments = {}) ⇒ Object
Delete a filter
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_filter.rb', line 32 def delete_filter(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_filter' } defined_params = [:filter_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _filter_id = arguments.delete(:filter_id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/filters/#{Utils.__listify(_filter_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_forecast(arguments = {}) ⇒ Object
Delete forecasts from a job
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 62 63 64 65 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_forecast.rb', line 35 def delete_forecast(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_forecast' } defined_params = %i[job_id forecast_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _job_id = arguments.delete(:job_id) _forecast_id = arguments.delete(:forecast_id) method = Elasticsearch::API::HTTP_DELETE path = if _job_id && _forecast_id "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_forecast/#{Utils.__listify(_forecast_id)}" else "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_forecast" end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_job(arguments = {}) ⇒ Object
Delete an anomaly detection job
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_job.rb', line 35 def delete_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_job' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_model_snapshot(arguments = {}) ⇒ Object
Delete a model snapshot
33 34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_model_snapshot.rb', line 33 def delete_model_snapshot(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_model_snapshot' } defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _job_id = arguments.delete(:job_id) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_trained_model(arguments = {}) ⇒ Object
Delete an unreferenced trained model
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_trained_model.rb', line 34 def delete_trained_model(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_trained_model' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/trained_models/#{Utils.__listify(_model_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_trained_model_alias(arguments = {}) ⇒ Object
Delete a trained model alias
33 34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/delete_trained_model_alias.rb', line 33 def delete_trained_model_alias(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_trained_model_alias' } defined_params = %i[model_id model_alias].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] raise ArgumentError, "Required argument 'model_alias' missing" unless arguments[:model_alias] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _model_alias = arguments.delete(:model_alias) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_DELETE path = "_ml/trained_models/#{Utils.__listify(_model_id)}/model_aliases/#{Utils.__listify(_model_alias)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#estimate_model_memory(arguments = {}) ⇒ Object
Estimate job model memory usage
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb', line 32 def estimate_model_memory(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.estimate_model_memory' } raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_ml/anomaly_detectors/_estimate_model_memory' params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#evaluate_data_frame(arguments = {}) ⇒ Object
Evaluate data frame analytics
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/elasticsearch/api/actions/machine_learning/evaluate_data_frame.rb', line 32 def evaluate_data_frame(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.evaluate_data_frame' } raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_ml/data_frame/_evaluate' params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#explain_data_frame_analytics(arguments = {}) ⇒ Object
Explain data frame analytics config
33 34 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 62 63 64 |
# File 'lib/elasticsearch/api/actions/machine_learning/explain_data_frame_analytics.rb', line 33 def explain_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.explain_data_frame_analytics' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = if _id "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_explain" else '_ml/data_frame/analytics/_explain' end params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#flush_job(arguments = {}) ⇒ Object
Force buffered data to be processed
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/flush_job.rb', line 38 def flush_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.flush_job' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_flush" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#forecast(arguments = {}) ⇒ Object
Predict future behavior of a time series
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/forecast.rb', line 36 def forecast(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.forecast' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_forecast" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_buckets(arguments = {}) ⇒ Object
Get anomaly detection job results for buckets
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 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_buckets.rb', line 43 def get_buckets(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_buckets' } defined_params = %i[job_id timestamp].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) = arguments.delete(:timestamp) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = if _job_id && "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/buckets/#{Utils.__listify()}" else "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/buckets" end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_calendar_events(arguments = {}) ⇒ Object
Get info about events in calendars
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/api/actions/machine_learning/get_calendar_events.rb', line 37 def get_calendar_events(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_calendar_events' } defined_params = [:calendar_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _calendar_id = arguments.delete(:calendar_id) method = Elasticsearch::API::HTTP_GET path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/events" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_calendars(arguments = {}) ⇒ Object
Get calendar configuration info
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 62 63 64 65 66 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_calendars.rb', line 35 def get_calendars(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_calendars' } defined_params = [:calendar_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _calendar_id = arguments.delete(:calendar_id) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = if _calendar_id "_ml/calendars/#{Utils.__listify(_calendar_id)}" else '_ml/calendars' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_categories(arguments = {}) ⇒ Object
Get anomaly detection job results for categories
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 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_categories.rb', line 37 def get_categories(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_categories' } defined_params = %i[job_id category_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) _category_id = arguments.delete(:category_id) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = if _job_id && _category_id "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/categories/#{Utils.__listify(_category_id)}" else "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/categories" end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_data_frame_analytics(arguments = {}) ⇒ Object
Get data frame analytics job configuration info
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 62 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics.rb', line 36 def get_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_data_frame_analytics' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET path = if _id "_ml/data_frame/analytics/#{Utils.__listify(_id)}" else '_ml/data_frame/analytics' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_data_frame_analytics_stats(arguments = {}) ⇒ Object
Get data frame analytics job stats
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 62 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics_stats.rb', line 36 def get_data_frame_analytics_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_data_frame_analytics_stats' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET path = if _id "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_stats" else '_ml/data_frame/analytics/_stats' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_datafeed_stats(arguments = {}) ⇒ Object
Get datafeed stats
33 34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb', line 33 def get_datafeed_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_datafeed_stats' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_GET path = if _datafeed_id "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_stats" else '_ml/datafeeds/_stats' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_datafeeds(arguments = {}) ⇒ Object
Get datafeeds configuration info
34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb', line 34 def get_datafeeds(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_datafeeds' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_GET path = if _datafeed_id "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}" else '_ml/datafeeds' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_filters(arguments = {}) ⇒ Object
Get filters
34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_filters.rb', line 34 def get_filters(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_filters' } defined_params = [:filter_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _filter_id = arguments.delete(:filter_id) method = Elasticsearch::API::HTTP_GET path = if _filter_id "_ml/filters/#{Utils.__listify(_filter_id)}" else '_ml/filters' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_influencers(arguments = {}) ⇒ Object
Get anomaly detection job results for influencers
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 68 69 70 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_influencers.rb', line 41 def get_influencers(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_influencers' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/influencers" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_job_stats(arguments = {}) ⇒ Object
Get anomaly detection job stats
33 34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb', line 33 def get_job_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_job_stats' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_GET path = if _job_id "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_stats" else '_ml/anomaly_detectors/_stats' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_jobs(arguments = {}) ⇒ Object
Get anomaly detection jobs configuration info
34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_jobs.rb', line 34 def get_jobs(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_jobs' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_GET path = if _job_id "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}" else '_ml/anomaly_detectors' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_memory_stats(arguments = {}) ⇒ Object
Get machine learning memory usage info
34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_memory_stats.rb', line 34 def get_memory_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_memory_stats' } defined_params = [:node_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _node_id = arguments.delete(:node_id) method = Elasticsearch::API::HTTP_GET path = if _node_id "_ml/memory/#{Utils.__listify(_node_id)}/_stats" else '_ml/memory/_stats' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_model_snapshot_upgrade_stats(arguments = {}) ⇒ Object
Get anomaly detection job model snapshot upgrade usage info
34 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/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb', line 34 def get_model_snapshot_upgrade_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_model_snapshot_upgrade_stats' } defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _job_id = arguments.delete(:job_id) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_GET path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_upgrade/_stats" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_model_snapshots(arguments = {}) ⇒ Object
Get model snapshots info
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 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb', line 40 def get_model_snapshots(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_model_snapshots' } defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) _snapshot_id = arguments.delete(:snapshot_id) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = if _job_id && _snapshot_id "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}" else "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots" end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_overall_buckets(arguments = {}) ⇒ Object
Get overall bucket results
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 65 66 67 68 69 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb', line 40 def get_overall_buckets(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_overall_buckets' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/overall_buckets" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_records(arguments = {}) ⇒ Object
Get anomaly records for an anomaly detection job
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 68 69 70 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_records.rb', line 41 def get_records(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_records' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/records" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_trained_models(arguments = {}) ⇒ Object
Get trained model configuration info
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 65 66 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_trained_models.rb', line 40 def get_trained_models(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_trained_models' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_GET path = if _model_id "_ml/trained_models/#{Utils.__listify(_model_id)}" else '_ml/trained_models' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_trained_models_stats(arguments = {}) ⇒ Object
Get trained models usage info
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/api/actions/machine_learning/get_trained_models_stats.rb', line 35 def get_trained_models_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_trained_models_stats' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_GET path = if _model_id "_ml/trained_models/#{Utils.__listify(_model_id)}/_stats" else '_ml/trained_models/_stats' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#infer_trained_model(arguments = {}) ⇒ Object
Evaluate a trained model
34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/infer_trained_model.rb', line 34 def infer_trained_model(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.infer_trained_model' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST path = "_ml/trained_models/#{Utils.__listify(_model_id)}/_infer" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#info(arguments = {}) ⇒ Object
Get machine learning information
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/api/actions/machine_learning/info.rb', line 31 def info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.info' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_GET path = '_ml/info' params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#open_job(arguments = {}) ⇒ Object
Open anomaly detection jobs
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/open_job.rb', line 34 def open_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.open_job' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_open" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#post_calendar_events(arguments = {}) ⇒ Object
Add scheduled events to the calendar
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/post_calendar_events.rb', line 33 def post_calendar_events(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.post_calendar_events' } defined_params = [:calendar_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _calendar_id = arguments.delete(:calendar_id) method = Elasticsearch::API::HTTP_POST path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/events" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#post_data(arguments = {}) ⇒ Object
Send data to an anomaly detection job for analysis
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/post_data.rb', line 35 def post_data(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.post_data' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_data" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#preview_data_frame_analytics(arguments = {}) ⇒ Object
Preview features used by data frame analytics
33 34 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 62 63 64 |
# File 'lib/elasticsearch/api/actions/machine_learning/preview_data_frame_analytics.rb', line 33 def preview_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.preview_data_frame_analytics' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = if _id "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_preview" else '_ml/data_frame/analytics/_preview' end params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#preview_datafeed(arguments = {}) ⇒ Object
Preview a datafeed
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 62 63 64 65 66 |
# File 'lib/elasticsearch/api/actions/machine_learning/preview_datafeed.rb', line 35 def preview_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.preview_datafeed' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _datafeed_id = arguments.delete(:datafeed_id) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = if _datafeed_id "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_preview" else '_ml/datafeeds/_preview' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_calendar(arguments = {}) ⇒ Object
Create a calendar
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_calendar.rb', line 33 def put_calendar(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_calendar' } defined_params = [:calendar_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _calendar_id = arguments.delete(:calendar_id) method = Elasticsearch::API::HTTP_PUT path = "_ml/calendars/#{Utils.__listify(_calendar_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_calendar_job(arguments = {}) ⇒ Object
Add anomaly detection job to calendar
33 34 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 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_calendar_job.rb', line 33 def put_calendar_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_calendar_job' } defined_params = %i[calendar_id job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id] raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _calendar_id = arguments.delete(:calendar_id) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_PUT path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/jobs/#{Utils.__listify(_job_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_data_frame_analytics(arguments = {}) ⇒ Object
Create a data frame analytics job
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_data_frame_analytics.rb', line 33 def put_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_data_frame_analytics' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_datafeed(arguments = {}) ⇒ Object
Create a datafeed
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 62 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_datafeed.rb', line 37 def put_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_datafeed' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_PUT path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_filter(arguments = {}) ⇒ Object
Create a filter
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_filter.rb', line 33 def put_filter(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_filter' } defined_params = [:filter_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _filter_id = arguments.delete(:filter_id) method = Elasticsearch::API::HTTP_PUT path = "_ml/filters/#{Utils.__listify(_filter_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_job(arguments = {}) ⇒ Object
Create an anomaly detection job
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 62 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_job.rb', line 37 def put_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_job' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_PUT path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_trained_model(arguments = {}) ⇒ Object
Create a trained model
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_trained_model.rb', line 35 def put_trained_model(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_PUT path = "_ml/trained_models/#{Utils.__listify(_model_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_trained_model_alias(arguments = {}) ⇒ Object
Create or update a trained model alias
34 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/api/actions/machine_learning/put_trained_model_alias.rb', line 34 def put_trained_model_alias(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_alias' } defined_params = %i[model_id model_alias].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] raise ArgumentError, "Required argument 'model_alias' missing" unless arguments[:model_alias] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _model_alias = arguments.delete(:model_alias) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_PUT path = "_ml/trained_models/#{Utils.__listify(_model_id)}/model_aliases/#{Utils.__listify(_model_alias)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_trained_model_definition_part(arguments = {}) ⇒ Object
Create part of a trained model definition
34 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 62 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part.rb', line 34 def put_trained_model_definition_part(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_definition_part' } defined_params = %i[model_id part].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] raise ArgumentError, "Required argument 'part' missing" unless arguments[:part] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _model_id = arguments.delete(:model_id) _part = arguments.delete(:part) method = Elasticsearch::API::HTTP_PUT path = "_ml/trained_models/#{Utils.__listify(_model_id)}/definition/#{Utils.__listify(_part)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_trained_model_vocabulary(arguments = {}) ⇒ Object
Create a trained model vocabulary
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb', line 33 def put_trained_model_vocabulary(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_vocabulary' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_PUT path = "_ml/trained_models/#{Utils.__listify(_model_id)}/vocabulary" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#reset_job(arguments = {}) ⇒ Object
Reset an anomaly detection job
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/reset_job.rb', line 34 def reset_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.reset_job' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_reset" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#revert_model_snapshot(arguments = {}) ⇒ Object
Revert to a snapshot
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 62 |
# File 'lib/elasticsearch/api/actions/machine_learning/revert_model_snapshot.rb', line 35 def revert_model_snapshot(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.revert_model_snapshot' } defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_revert" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#set_upgrade_mode(arguments = {}) ⇒ Object
Set upgrade_mode for ML indices
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/machine_learning/set_upgrade_mode.rb', line 33 def set_upgrade_mode(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.set_upgrade_mode' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_POST path = '_ml/set_upgrade_mode' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#start_data_frame_analytics(arguments = {}) ⇒ Object
Start a data frame analytics job
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/start_data_frame_analytics.rb', line 34 def start_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.start_data_frame_analytics' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_POST path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_start" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#start_datafeed(arguments = {}) ⇒ Object
Start datafeeds
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/start_datafeed.rb', line 36 def start_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.start_datafeed' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_POST path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_start" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#start_trained_model_deployment(arguments = {}) ⇒ Object
Start a trained model deployment
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb', line 41 def start_trained_model_deployment(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.start_trained_model_deployment' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_start" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#stop_data_frame_analytics(arguments = {}) ⇒ Object
Stop data frame analytics jobs
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/stop_data_frame_analytics.rb', line 36 def stop_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_data_frame_analytics' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_POST path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#stop_datafeed(arguments = {}) ⇒ Object
Stop datafeeds
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb', line 36 def stop_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_datafeed' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_POST path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#stop_trained_model_deployment(arguments = {}) ⇒ Object
Stop a trained model deployment
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 |
# File 'lib/elasticsearch/api/actions/machine_learning/stop_trained_model_deployment.rb', line 35 def stop_trained_model_deployment(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_trained_model_deployment' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#update_data_frame_analytics(arguments = {}) ⇒ Object
Update a data frame analytics job
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/update_data_frame_analytics.rb', line 33 def update_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_data_frame_analytics' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_POST path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_update" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#update_datafeed(arguments = {}) ⇒ Object
Update a datafeed
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 62 |
# File 'lib/elasticsearch/api/actions/machine_learning/update_datafeed.rb', line 37 def update_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_datafeed' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_POST path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_update" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#update_filter(arguments = {}) ⇒ Object
Update a filter
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/update_filter.rb', line 33 def update_filter(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_filter' } defined_params = [:filter_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _filter_id = arguments.delete(:filter_id) method = Elasticsearch::API::HTTP_POST path = "_ml/filters/#{Utils.__listify(_filter_id)}/_update" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#update_job(arguments = {}) ⇒ Object
Update an anomaly detection job
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/update_job.rb', line 33 def update_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_job' } defined_params = [:job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_update" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#update_model_snapshot(arguments = {}) ⇒ Object
Update a snapshot
34 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 62 |
# File 'lib/elasticsearch/api/actions/machine_learning/update_model_snapshot.rb', line 34 def update_model_snapshot(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_model_snapshot' } defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _job_id = arguments.delete(:job_id) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_update" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#update_trained_model_deployment(arguments = {}) ⇒ Object
Update a trained model deployment
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/machine_learning/update_trained_model_deployment.rb', line 34 def update_trained_model_deployment(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_trained_model_deployment' } defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_update" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#upgrade_job_snapshot(arguments = {}) ⇒ Object
Upgrade a snapshot
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 62 |
# File 'lib/elasticsearch/api/actions/machine_learning/upgrade_job_snapshot.rb', line 35 def upgrade_job_snapshot(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.upgrade_job_snapshot' } defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _job_id = arguments.delete(:job_id) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_POST path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_upgrade" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#validate(arguments = {}) ⇒ Object
Validate an anomaly detection job
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/elasticsearch/api/actions/machine_learning/validate.rb', line 32 def validate(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.validate' } raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_ml/anomaly_detectors/_validate' params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#validate_detector(arguments = {}) ⇒ Object
Validate an anomaly detection job
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/elasticsearch/api/actions/machine_learning/validate_detector.rb', line 32 def validate_detector(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.validate_detector' } raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_ml/anomaly_detectors/_validate/detector' params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |