elasticsearch-xpack 7.4.0 → 7.5.0.pre.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch/xpack/api/actions/{data_frame/delete_data_frame_transform.rb → data_frame_transform_deprecated/delete_transform.rb} +24 -16
  3. data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/get_transform.rb +55 -0
  4. data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/get_transform_stats.rb +53 -0
  5. data/lib/elasticsearch/xpack/api/actions/{data_frame → data_frame_transform_deprecated}/params_registry.rb +1 -2
  6. data/lib/elasticsearch/xpack/api/actions/{data_frame/preview_data_frame_transform.rb → data_frame_transform_deprecated/preview_transform.rb} +15 -9
  7. data/lib/elasticsearch/xpack/api/actions/{data_frame/put_data_frame_transform.rb → data_frame_transform_deprecated/put_transform.rb} +23 -16
  8. data/lib/elasticsearch/xpack/api/actions/{data_frame/start_data_frame_transform.rb → data_frame_transform_deprecated/start_transform.rb} +22 -13
  9. data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/stop_transform.rb +53 -0
  10. data/lib/elasticsearch/xpack/api/actions/{data_frame/update_data_frame_transform.rb → data_frame_transform_deprecated/update_transform.rb} +23 -17
  11. data/lib/elasticsearch/xpack/api/actions/graph/explore.rb +30 -16
  12. data/lib/elasticsearch/xpack/api/actions/graph/params_registry.rb +0 -1
  13. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/delete_lifecycle.rb +36 -0
  14. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/delete_policy.rb +4 -5
  15. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/explain.rb +4 -5
  16. data/lib/elasticsearch/xpack/api/actions/{migration/upgrade.rb → index_lifecycle_management/explain_lifecycle.rb} +22 -12
  17. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_lifecycle.rb +38 -0
  18. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_policy.rb +3 -5
  19. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_status.rb +7 -14
  20. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/move_to_step.rb +14 -18
  21. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/params_registry.rb +0 -1
  22. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/put_lifecycle.rb +37 -0
  23. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/put_policy.rb +4 -4
  24. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/remove_policy.rb +13 -15
  25. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/retry.rb +36 -0
  26. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/retry_policy.rb +5 -5
  27. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/start.rb +7 -14
  28. data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/stop.rb +7 -14
  29. data/lib/elasticsearch/xpack/api/actions/info.rb +14 -13
  30. data/lib/elasticsearch/xpack/api/actions/license/delete.rb +8 -6
  31. data/lib/elasticsearch/xpack/api/actions/license/get.rb +14 -9
  32. data/lib/elasticsearch/xpack/api/actions/license/get_basic_status.rb +8 -7
  33. data/lib/elasticsearch/xpack/api/actions/license/get_trial_status.rb +8 -7
  34. data/lib/elasticsearch/xpack/api/actions/license/params_registry.rb +0 -1
  35. data/lib/elasticsearch/xpack/api/actions/license/post.rb +15 -11
  36. data/lib/elasticsearch/xpack/api/actions/license/post_start_basic.rb +13 -8
  37. data/lib/elasticsearch/xpack/api/actions/license/post_start_trial.rb +14 -9
  38. data/lib/elasticsearch/xpack/api/actions/machine_learning/close_job.rb +19 -10
  39. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar.rb +12 -6
  40. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_event.rb +15 -7
  41. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_job.rb +15 -7
  42. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_data_frame_analytics.rb +36 -0
  43. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_datafeed.rb +16 -8
  44. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_expired_data.rb +10 -4
  45. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_filter.rb +15 -5
  46. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_forecast.rb +32 -14
  47. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_job.rb +18 -8
  48. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_model_snapshot.rb +15 -7
  49. data/lib/elasticsearch/xpack/api/actions/machine_learning/estimate_memory_usage.rb +7 -5
  50. data/lib/elasticsearch/xpack/api/actions/machine_learning/evaluate_data_frame.rb +32 -0
  51. data/lib/elasticsearch/xpack/api/actions/machine_learning/find_file_structure.rb +52 -8
  52. data/lib/elasticsearch/xpack/api/actions/machine_learning/flush_job.rb +22 -15
  53. data/lib/elasticsearch/xpack/api/actions/machine_learning/forecast.rb +18 -10
  54. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_buckets.rb +29 -19
  55. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_calendar_events.rb +18 -14
  56. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_calendars.rb +18 -10
  57. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_categories.rb +24 -10
  58. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_data_frame_analytics.rb +50 -0
  59. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_data_frame_analytics_stats.rb +50 -0
  60. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeed_stats.rb +18 -7
  61. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeeds.rb +19 -8
  62. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_filters.rb +22 -7
  63. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_influencers.rb +24 -16
  64. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_job_stats.rb +19 -8
  65. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_jobs.rb +18 -7
  66. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_model_snapshots.rb +30 -16
  67. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_overall_buckets.rb +23 -15
  68. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb +24 -16
  69. data/lib/elasticsearch/xpack/api/actions/machine_learning/info.rb +7 -6
  70. data/lib/elasticsearch/xpack/api/actions/machine_learning/open_job.rb +12 -8
  71. data/lib/elasticsearch/xpack/api/actions/machine_learning/params_registry.rb +0 -1
  72. data/lib/elasticsearch/xpack/api/actions/machine_learning/post_calendar_events.rb +13 -7
  73. data/lib/elasticsearch/xpack/api/actions/machine_learning/post_data.rb +19 -11
  74. data/lib/elasticsearch/xpack/api/actions/machine_learning/preview_datafeed.rb +12 -6
  75. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar.rb +12 -6
  76. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar_job.rb +15 -7
  77. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_data_frame_analytics.rb +38 -0
  78. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_datafeed.rb +13 -7
  79. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_filter.rb +16 -6
  80. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_job.rb +13 -7
  81. data/lib/elasticsearch/xpack/api/actions/machine_learning/revert_model_snapshot.rb +20 -9
  82. data/lib/elasticsearch/xpack/api/actions/machine_learning/set_upgrade_mode.rb +16 -13
  83. data/lib/elasticsearch/xpack/api/actions/machine_learning/start_data_frame_analytics.rb +45 -0
  84. data/lib/elasticsearch/xpack/api/actions/machine_learning/start_datafeed.rb +19 -11
  85. data/lib/elasticsearch/xpack/api/actions/machine_learning/stop_data_frame_analytics.rb +49 -0
  86. data/lib/elasticsearch/xpack/api/actions/machine_learning/stop_datafeed.rb +18 -10
  87. data/lib/elasticsearch/xpack/api/actions/machine_learning/update_datafeed.rb +12 -7
  88. data/lib/elasticsearch/xpack/api/actions/machine_learning/update_filter.rb +15 -7
  89. data/lib/elasticsearch/xpack/api/actions/machine_learning/update_job.rb +13 -7
  90. data/lib/elasticsearch/xpack/api/actions/machine_learning/update_model_snapshot.rb +15 -8
  91. data/lib/elasticsearch/xpack/api/actions/machine_learning/validate.rb +9 -4
  92. data/lib/elasticsearch/xpack/api/actions/machine_learning/validate_detector.rb +10 -4
  93. data/lib/elasticsearch/xpack/api/actions/migration/deprecations.rb +16 -8
  94. data/lib/elasticsearch/xpack/api/actions/migration/params_registry.rb +0 -1
  95. data/lib/elasticsearch/xpack/api/actions/params_registry.rb +0 -1
  96. data/lib/elasticsearch/xpack/api/actions/rollup/delete_job.rb +12 -6
  97. data/lib/elasticsearch/xpack/api/actions/rollup/get_jobs.rb +14 -5
  98. data/lib/elasticsearch/xpack/api/actions/rollup/get_rollup_caps.rb +16 -5
  99. data/lib/elasticsearch/xpack/api/actions/rollup/get_rollup_index_caps.rb +12 -6
  100. data/lib/elasticsearch/xpack/api/actions/rollup/params_registry.rb +0 -1
  101. data/lib/elasticsearch/xpack/api/actions/rollup/put_job.rb +13 -7
  102. data/lib/elasticsearch/xpack/api/actions/rollup/rollup_search.rb +31 -11
  103. data/lib/elasticsearch/xpack/api/actions/rollup/start_job.rb +12 -6
  104. data/lib/elasticsearch/xpack/api/actions/rollup/stop_job.rb +23 -7
  105. data/lib/elasticsearch/xpack/api/actions/security/authenticate.rb +8 -6
  106. data/lib/elasticsearch/xpack/api/actions/security/change_password.rb +20 -10
  107. data/lib/elasticsearch/xpack/api/actions/security/clear_cached_realms.rb +16 -11
  108. data/lib/elasticsearch/xpack/api/actions/security/clear_cached_roles.rb +13 -8
  109. data/lib/elasticsearch/xpack/api/actions/security/create_api_key.rb +16 -11
  110. data/lib/elasticsearch/xpack/api/actions/security/delete_privileges.rb +24 -9
  111. data/lib/elasticsearch/xpack/api/actions/security/delete_role.rb +20 -15
  112. data/lib/elasticsearch/xpack/api/actions/security/delete_role_mapping.rb +17 -12
  113. data/lib/elasticsearch/xpack/api/actions/security/delete_user.rb +19 -17
  114. data/lib/elasticsearch/xpack/api/actions/security/disable_user.rb +17 -13
  115. data/lib/elasticsearch/xpack/api/actions/security/enable_user.rb +17 -13
  116. data/lib/elasticsearch/xpack/api/actions/security/get_api_key.rb +21 -16
  117. data/lib/elasticsearch/xpack/api/actions/security/get_builtin_privileges.rb +6 -4
  118. data/lib/elasticsearch/xpack/api/actions/security/get_privileges.rb +21 -9
  119. data/lib/elasticsearch/xpack/api/actions/security/get_role.rb +15 -6
  120. data/lib/elasticsearch/xpack/api/actions/security/get_role_mapping.rb +15 -6
  121. data/lib/elasticsearch/xpack/api/actions/security/get_token.rb +9 -7
  122. data/lib/elasticsearch/xpack/api/actions/security/get_user.rb +15 -6
  123. data/lib/elasticsearch/xpack/api/actions/security/get_user_privileges.rb +10 -5
  124. data/lib/elasticsearch/xpack/api/actions/security/has_privileges.rb +17 -7
  125. data/lib/elasticsearch/xpack/api/actions/security/invalidate_api_key.rb +8 -6
  126. data/lib/elasticsearch/xpack/api/actions/security/invalidate_token.rb +9 -7
  127. data/lib/elasticsearch/xpack/api/actions/security/params_registry.rb +0 -1
  128. data/lib/elasticsearch/xpack/api/actions/security/put_privileges.rb +17 -9
  129. data/lib/elasticsearch/xpack/api/actions/security/put_role.rb +20 -11
  130. data/lib/elasticsearch/xpack/api/actions/security/put_role_mapping.rb +19 -16
  131. data/lib/elasticsearch/xpack/api/actions/security/put_user.rb +18 -12
  132. data/lib/elasticsearch/xpack/api/actions/sql/clear_cursor.rb +8 -6
  133. data/lib/elasticsearch/xpack/api/actions/sql/params_registry.rb +0 -1
  134. data/lib/elasticsearch/xpack/api/actions/sql/query.rb +14 -8
  135. data/lib/elasticsearch/xpack/api/actions/sql/translate.rb +8 -6
  136. data/lib/elasticsearch/xpack/api/actions/ssl/certificates.rb +10 -4
  137. data/lib/elasticsearch/xpack/api/actions/ssl/params_registry.rb +0 -1
  138. data/lib/elasticsearch/xpack/api/actions/usage.rb +14 -9
  139. data/lib/elasticsearch/xpack/api/actions/watcher/ack_watch.rb +18 -19
  140. data/lib/elasticsearch/xpack/api/actions/watcher/activate_watch.rb +12 -15
  141. data/lib/elasticsearch/xpack/api/actions/watcher/deactivate_watch.rb +12 -15
  142. data/lib/elasticsearch/xpack/api/actions/watcher/delete_watch.rb +14 -16
  143. data/lib/elasticsearch/xpack/api/actions/watcher/execute_watch.rb +19 -10
  144. data/lib/elasticsearch/xpack/api/actions/watcher/get_watch.rb +12 -7
  145. data/lib/elasticsearch/xpack/api/actions/watcher/params_registry.rb +0 -1
  146. data/lib/elasticsearch/xpack/api/actions/watcher/put_watch.rb +24 -16
  147. data/lib/elasticsearch/xpack/api/actions/watcher/start.rb +8 -7
  148. data/lib/elasticsearch/xpack/api/actions/watcher/stats.rb +27 -11
  149. data/lib/elasticsearch/xpack/api/actions/watcher/stop.rb +8 -7
  150. data/lib/elasticsearch/xpack/api/namespace/data_frame.rb +1 -1
  151. data/lib/elasticsearch/xpack/version.rb +1 -1
  152. metadata +25 -16
  153. data/lib/elasticsearch/xpack/api/actions/data_frame/get_data_frame_transform.rb +0 -43
  154. data/lib/elasticsearch/xpack/api/actions/data_frame/get_data_frame_transform_stats.rb +0 -42
  155. data/lib/elasticsearch/xpack/api/actions/data_frame/stop_data_frame_transform.rb +0 -46
  156. data/lib/elasticsearch/xpack/api/actions/migration/get_assistance.rb +0 -39
  157. data/lib/elasticsearch/xpack/api/actions/watcher/restart.rb +0 -27
@@ -7,26 +7,34 @@ module Elasticsearch
7
7
  module API
8
8
  module MachineLearning
9
9
  module Actions
10
+ # TODO: Description
10
11
 
11
- # Delete an existing model snapshot
12
12
  #
13
- # @option arguments [String] :job_id The ID of the job to fetch (*Required*)
14
- # @option arguments [String] :snapshot_id The ID of the snapshot to delete (*Required*)
13
+ # @option arguments [String] :job_id The ID of the job to fetch
14
+ # @option arguments [String] :snapshot_id The ID of the snapshot to delete
15
+
15
16
  #
16
17
  # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html
17
18
  #
18
- def delete_model_snapshot(arguments={})
19
+ def delete_model_snapshot(arguments = {})
19
20
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
20
21
  raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]
22
+
23
+ arguments = arguments.clone
24
+
25
+ _job_id = arguments.delete(:job_id)
26
+
27
+ _snapshot_id = arguments.delete(:snapshot_id)
28
+
21
29
  method = Elasticsearch::API::HTTP_DELETE
22
- path = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/model_snapshots/#{arguments[:snapshot_id]}"
30
+ path = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/model_snapshots/#{Elasticsearch::API::Utils.__listify(_snapshot_id)}"
23
31
  params = {}
24
- body = nil
25
32
 
33
+ body = nil
26
34
  perform_request(method, path, params, body).body
27
35
  end
28
- end
29
36
  end
30
37
  end
38
+ end
31
39
  end
32
40
  end
@@ -7,24 +7,26 @@ module Elasticsearch
7
7
  module API
8
8
  module MachineLearning
9
9
  module Actions
10
+ # TODO: Description
10
11
 
11
- # Estimates memory usage for the given data frame analytics config.
12
- #
13
12
  # @option arguments [Hash] :body Memory usage estimation definition (*Required*)
14
13
  #
15
14
  # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/estimate-memory-usage-dfanalytics.html
16
15
  #
17
- def estimate_memory_usage(arguments={})
16
+ def estimate_memory_usage(arguments = {})
18
17
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
18
+
19
+ arguments = arguments.clone
20
+
19
21
  method = Elasticsearch::API::HTTP_POST
20
22
  path = "_ml/data_frame/analytics/_estimate_memory_usage"
21
23
  params = {}
22
- body = arguments[:body]
23
24
 
25
+ body = arguments[:body]
24
26
  perform_request(method, path, params, body).body
25
27
  end
26
- end
27
28
  end
28
29
  end
30
+ end
29
31
  end
30
32
  end
@@ -0,0 +1,32 @@
1
+ # Licensed to Elasticsearch B.V under one or more agreements.
2
+ # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
+ # See the LICENSE file in the project root for more information
4
+
5
+ module Elasticsearch
6
+ module XPack
7
+ module API
8
+ module MachineLearning
9
+ module Actions
10
+ # TODO: Description
11
+
12
+ # @option arguments [Hash] :body The evaluation definition (*Required*)
13
+ #
14
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html
15
+ #
16
+ def evaluate_data_frame(arguments = {})
17
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
18
+
19
+ arguments = arguments.clone
20
+
21
+ method = Elasticsearch::API::HTTP_POST
22
+ path = "_ml/data_frame/_evaluate"
23
+ params = {}
24
+
25
+ body = arguments[:body]
26
+ perform_request(method, path, params, body).body
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,26 +1,70 @@
1
+ # Licensed to Elasticsearch B.V under one or more agreements.
2
+ # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
+ # See the LICENSE file in the project root for more information
4
+
1
5
  module Elasticsearch
2
6
  module XPack
3
7
  module API
4
8
  module MachineLearning
5
9
  module Actions
10
+ # TODO: Description
6
11
 
7
- # Finds the structure of a text file. The text file must contain data that is suitable to be
8
- # ingested into Elasticsearch.
9
12
  #
13
+ # @option arguments [Int] :lines_to_sample How many lines of the file should be included in the analysis
14
+ # @option arguments [Int] :line_merge_size_limit Maximum number of characters permitted in a single message when lines are merged to create messages.
15
+ # @option arguments [Time] :timeout Timeout after which the analysis will be aborted
16
+ # @option arguments [String] :charset Optional parameter to specify the character set of the file
17
+ # @option arguments [String] :format Optional parameter to specify the high level file format
18
+ # (options: ndjson,xml,delimited,semi_structured_text)
19
+
20
+ # @option arguments [Boolean] :has_header_row Optional parameter to specify whether a delimited file includes the column names in its first row
21
+ # @option arguments [List] :column_names Optional parameter containing a comma separated list of the column names for a delimited file
22
+ # @option arguments [String] :delimiter Optional parameter to specify the delimiter character for a delimited file - must be a single character
23
+ # @option arguments [String] :quote Optional parameter to specify the quote character for a delimited file - must be a single character
24
+ # @option arguments [Boolean] :should_trim_fields Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them
25
+ # @option arguments [String] :grok_pattern Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file
26
+ # @option arguments [String] :timestamp_field Optional parameter to specify the timestamp field in the file
27
+ # @option arguments [String] :timestamp_format Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format
28
+ # @option arguments [Boolean] :explain Whether to include a commentary on how the structure was derived
29
+
10
30
  # @option arguments [Hash] :body The contents of the file to be analyzed (*Required*)
11
31
  #
12
- # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html
32
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html
13
33
  #
14
- def find_file_structure(arguments={})
34
+ def find_file_structure(arguments = {})
15
35
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
36
+
37
+ arguments = arguments.clone
38
+
16
39
  method = Elasticsearch::API::HTTP_POST
17
- path = "_xpack/ml/find_file_structure"
18
- body = Elasticsearch::API::Utils.__bulkify(arguments.delete(:body))
40
+ path = "_ml/find_file_structure"
41
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
19
42
 
20
- perform_request(method, path, arguments, body).body
43
+ body = Elasticsearch::API::Utils.__bulkify(arguments.delete(:body))
44
+ perform_request(method, path, params, body).body
21
45
  end
22
- end
46
+
47
+ # Register this action with its valid params when the module is loaded.
48
+ #
49
+ # @since 6.2.0
50
+ ParamsRegistry.register(:find_file_structure, [
51
+ :lines_to_sample,
52
+ :line_merge_size_limit,
53
+ :timeout,
54
+ :charset,
55
+ :format,
56
+ :has_header_row,
57
+ :column_names,
58
+ :delimiter,
59
+ :quote,
60
+ :should_trim_fields,
61
+ :grok_pattern,
62
+ :timestamp_field,
63
+ :timestamp_format,
64
+ :explain
65
+ ].freeze)
23
66
  end
24
67
  end
68
+ end
25
69
  end
26
70
  end
@@ -7,40 +7,47 @@ module Elasticsearch
7
7
  module API
8
8
  module MachineLearning
9
9
  module Actions
10
+ # TODO: Description
10
11
 
11
- # Force any buffered data to be processed by the job
12
12
  #
13
- # @option arguments [String] :job_id The name of the job to flush (*Required*)
14
- # @option arguments [Hash] :body Flush parameters
13
+ # @option arguments [String] :job_id The name of the job to flush
15
14
  # @option arguments [Boolean] :calc_interim Calculates interim results for the most recent bucket or all buckets within the latency period
16
15
  # @option arguments [String] :start When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results
17
16
  # @option arguments [String] :end When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results
18
- # @option arguments [String] :advance_time Setting this tells the Engine API that no data prior to advance_time is expected
17
+ # @option arguments [String] :advance_time Advances time to the given value generating results and updating the model for the advanced interval
19
18
  # @option arguments [String] :skip_time Skips time to the given value without generating results or updating the model for the skipped interval
20
- #
19
+
20
+ # @option arguments [Hash] :body Flush parameters
21
21
  #
22
22
  # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html
23
23
  #
24
- def flush_job(arguments={})
24
+ def flush_job(arguments = {})
25
25
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
26
+
27
+ arguments = arguments.clone
28
+
29
+ _job_id = arguments.delete(:job_id)
30
+
26
31
  method = Elasticsearch::API::HTTP_POST
27
- path = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_flush"
32
+ path = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/_flush"
28
33
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
29
- body = arguments[:body]
30
34
 
35
+ body = arguments[:body]
31
36
  perform_request(method, path, params, body).body
32
37
  end
33
38
 
34
39
  # Register this action with its valid params when the module is loaded.
35
40
  #
36
- # @since 7.4.0
37
- ParamsRegistry.register(:flush_job, [ :calc_interim,
38
- :start,
39
- :end,
40
- :advance_time,
41
- :skip_time ].freeze)
42
- end
41
+ # @since 6.2.0
42
+ ParamsRegistry.register(:flush_job, [
43
+ :calc_interim,
44
+ :start,
45
+ :end,
46
+ :advance_time,
47
+ :skip_time
48
+ ].freeze)
43
49
  end
44
50
  end
51
+ end
45
52
  end
46
53
  end
@@ -7,32 +7,40 @@ module Elasticsearch
7
7
  module API
8
8
  module MachineLearning
9
9
  module Actions
10
+ # TODO: Description
10
11
 
11
- # Predict the future behavior of a time series
12
12
  #
13
- # @option arguments [String] :job_id The ID of the job to forecast for (*Required*)
13
+ # @option arguments [String] :job_id The ID of the job to forecast for
14
14
  # @option arguments [Time] :duration The duration of the forecast
15
15
  # @option arguments [Time] :expires_in The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity.
16
+
16
17
  #
17
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html
18
+ # @see [TODO]
18
19
  #
19
- def forecast(arguments={})
20
+ def forecast(arguments = {})
20
21
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
22
+
23
+ arguments = arguments.clone
24
+
25
+ _job_id = arguments.delete(:job_id)
26
+
21
27
  method = Elasticsearch::API::HTTP_POST
22
- path = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_forecast"
28
+ path = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/_forecast"
23
29
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
24
- body = nil
25
30
 
31
+ body = nil
26
32
  perform_request(method, path, params, body).body
27
33
  end
28
34
 
29
35
  # Register this action with its valid params when the module is loaded.
30
36
  #
31
- # @since 7.4.0
32
- ParamsRegistry.register(:forecast, [ :duration,
33
- :expires_in ].freeze)
34
- end
37
+ # @since 6.2.0
38
+ ParamsRegistry.register(:forecast, [
39
+ :duration,
40
+ :expires_in
41
+ ].freeze)
35
42
  end
36
43
  end
44
+ end
37
45
  end
38
46
  end
@@ -7,12 +7,11 @@ module Elasticsearch
7
7
  module API
8
8
  module MachineLearning
9
9
  module Actions
10
+ # TODO: Description
10
11
 
11
- # Retrieve job results for one or more buckets
12
12
  #
13
- # @option arguments [String] :job_id ID of the job to get bucket results from (*Required*)
13
+ # @option arguments [String] :job_id ID of the job to get bucket results from
14
14
  # @option arguments [String] :timestamp The timestamp of the desired single bucket result
15
- # @option arguments [Hash] :body Bucket selection details if not provided in URI
16
15
  # @option arguments [Boolean] :expand Include anomaly records
17
16
  # @option arguments [Boolean] :exclude_interim Exclude interim results
18
17
  # @option arguments [Int] :from skips a number of buckets
@@ -22,37 +21,48 @@ module Elasticsearch
22
21
  # @option arguments [Double] :anomaly_score Filter for the most anomalous buckets
23
22
  # @option arguments [String] :sort Sort buckets by a particular field
24
23
  # @option arguments [Boolean] :desc Set the sort direction
24
+
25
+ # @option arguments [Hash] :body Bucket selection details if not provided in URI
25
26
  #
26
27
  # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html
27
28
  #
28
- def get_buckets(arguments={})
29
+ def get_buckets(arguments = {})
29
30
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
31
+
30
32
  arguments = arguments.clone
31
- timestamp = arguments.delete(:timestamp)
33
+
34
+ _job_id = arguments.delete(:job_id)
35
+
36
+ _timestamp = arguments.delete(:timestamp)
32
37
 
33
38
  method = Elasticsearch::API::HTTP_GET
34
- path = Elasticsearch::API::Utils.__pathify "_xpack/ml/anomaly_detectors", arguments[:job_id], "results/buckets", timestamp
39
+ path = if _job_id && _timestamp
40
+ "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/results/buckets/#{Elasticsearch::API::Utils.__listify(_timestamp)}"
41
+ else
42
+ "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/results/buckets"
43
+ end
35
44
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
36
- body = arguments[:body]
37
45
 
46
+ body = arguments[:body]
38
47
  perform_request(method, path, params, body).body
39
48
  end
40
49
 
41
50
  # Register this action with its valid params when the module is loaded.
42
51
  #
43
- # @since 7.4.0
44
- ParamsRegistry.register(:get_buckets, [ :timestamp,
45
- :expand,
46
- :exclude_interim,
47
- :from,
48
- :size,
49
- :start,
50
- :end,
51
- :anomaly_score,
52
- :sort,
53
- :desc ].freeze)
54
- end
52
+ # @since 6.2.0
53
+ ParamsRegistry.register(:get_buckets, [
54
+ :expand,
55
+ :exclude_interim,
56
+ :from,
57
+ :size,
58
+ :start,
59
+ :end,
60
+ :anomaly_score,
61
+ :sort,
62
+ :desc
63
+ ].freeze)
55
64
  end
56
65
  end
66
+ end
57
67
  end
58
68
  end
@@ -7,42 +7,46 @@ module Elasticsearch
7
7
  module API
8
8
  module MachineLearning
9
9
  module Actions
10
-
11
10
  # TODO: Description
11
+
12
12
  #
13
- # @option arguments [String] :calendar_id The ID of the calendar containing the events (*Required*)
13
+ # @option arguments [String] :calendar_id The ID of the calendar containing the events
14
14
  # @option arguments [String] :job_id Get events for the job. When this option is used calendar_id must be '_all'
15
15
  # @option arguments [String] :start Get events after this time
16
16
  # @option arguments [Date] :end Get events before this time
17
17
  # @option arguments [Int] :from Skips a number of events
18
18
  # @option arguments [Int] :size Specifies a max number of events to get
19
+
19
20
  #
20
21
  # @see [TODO]
21
22
  #
22
- def get_calendar_events(arguments={})
23
+ def get_calendar_events(arguments = {})
23
24
  raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
25
+
24
26
  arguments = arguments.clone
25
- calendar_id = arguments.delete(:calendar_id)
27
+
28
+ _calendar_id = arguments.delete(:calendar_id)
26
29
 
27
30
  method = Elasticsearch::API::HTTP_GET
28
- path = "_xpack/ml/calendars/#{calendar_id}/events"
31
+ path = "_ml/calendars/#{Elasticsearch::API::Utils.__listify(_calendar_id)}/events"
29
32
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
30
- body = nil
31
33
 
34
+ body = nil
32
35
  perform_request(method, path, params, body).body
33
36
  end
34
37
 
35
38
  # Register this action with its valid params when the module is loaded.
36
39
  #
37
- # @since 7.4.0
38
- ParamsRegistry.register(:get_calendar_events, [ :calendar_id,
39
- :job_id,
40
- :start,
41
- :end,
42
- :from,
43
- :size ].freeze)
44
- end
40
+ # @since 6.2.0
41
+ ParamsRegistry.register(:get_calendar_events, [
42
+ :job_id,
43
+ :start,
44
+ :end,
45
+ :from,
46
+ :size
47
+ ].freeze)
45
48
  end
46
49
  end
50
+ end
47
51
  end
48
52
  end
@@ -7,35 +7,43 @@ module Elasticsearch
7
7
  module API
8
8
  module MachineLearning
9
9
  module Actions
10
-
11
10
  # TODO: Description
11
+
12
12
  #
13
13
  # @option arguments [String] :calendar_id The ID of the calendar to fetch
14
14
  # @option arguments [Int] :from skips a number of calendars
15
15
  # @option arguments [Int] :size specifies a max number of calendars to get
16
+
17
+ # @option arguments [Hash] :body The from and size parameters optionally sent in the body
16
18
  #
17
19
  # @see [TODO]
18
20
  #
19
- def get_calendars(arguments={})
21
+ def get_calendars(arguments = {})
20
22
  arguments = arguments.clone
21
- calendar_id = arguments.delete(:calendar_id)
23
+
24
+ _calendar_id = arguments.delete(:calendar_id)
22
25
 
23
26
  method = Elasticsearch::API::HTTP_GET
24
- path = "_xpack/ml/calendars/#{calendar_id}"
27
+ path = if _calendar_id
28
+ "_ml/calendars/#{Elasticsearch::API::Utils.__listify(_calendar_id)}"
29
+ else
30
+ "_ml/calendars"
31
+ end
25
32
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
26
- body = nil
27
33
 
34
+ body = arguments[:body]
28
35
  perform_request(method, path, params, body).body
29
36
  end
30
37
 
31
38
  # Register this action with its valid params when the module is loaded.
32
39
  #
33
- # @since 7.4.0
34
- ParamsRegistry.register(:get_calendars, [ :calendar_id,
35
- :from,
36
- :size ].freeze)
37
- end
40
+ # @since 6.2.0
41
+ ParamsRegistry.register(:get_calendars, [
42
+ :from,
43
+ :size
44
+ ].freeze)
38
45
  end
39
46
  end
47
+ end
40
48
  end
41
49
  end