elasticsearch-serverless 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch-serverless/api/async_search/delete.rb +9 -1
  3. data/lib/elasticsearch-serverless/api/async_search/get.rb +17 -3
  4. data/lib/elasticsearch-serverless/api/async_search/status.rb +9 -1
  5. data/lib/elasticsearch-serverless/api/async_search/submit.rb +15 -4
  6. data/lib/elasticsearch-serverless/api/bulk.rb +17 -4
  7. data/lib/elasticsearch-serverless/api/cat/aliases.rb +22 -6
  8. data/lib/elasticsearch-serverless/api/cat/component_templates.rb +22 -6
  9. data/lib/elasticsearch-serverless/api/cat/count.rb +25 -8
  10. data/lib/elasticsearch-serverless/api/cat/help.rb +16 -6
  11. data/lib/elasticsearch-serverless/api/cat/indices.rb +31 -9
  12. data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +24 -8
  13. data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +29 -8
  14. data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +29 -8
  15. data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +25 -8
  16. data/lib/elasticsearch-serverless/api/cat/transforms.rb +27 -9
  17. data/lib/elasticsearch-serverless/api/clear_scroll.rb +12 -3
  18. data/lib/elasticsearch-serverless/api/close_point_in_time.rb +3 -1
  19. data/lib/elasticsearch-serverless/api/cluster/delete_component_template.rb +14 -3
  20. data/lib/elasticsearch-serverless/api/cluster/exists_component_template.rb +18 -5
  21. data/lib/elasticsearch-serverless/api/cluster/get_component_template.rb +16 -4
  22. data/lib/elasticsearch-serverless/api/cluster/info.rb +11 -2
  23. data/lib/elasticsearch-serverless/api/cluster/put_component_template.rb +17 -7
  24. data/lib/elasticsearch-serverless/api/connector/check_in.rb +9 -1
  25. data/lib/elasticsearch-serverless/api/connector/delete.rb +14 -6
  26. data/lib/elasticsearch-serverless/api/connector/get.rb +13 -5
  27. data/lib/elasticsearch-serverless/api/connector/list.rb +7 -5
  28. data/lib/elasticsearch-serverless/api/connector/post.rb +7 -5
  29. data/lib/elasticsearch-serverless/api/connector/put.rb +14 -6
  30. data/lib/elasticsearch-serverless/api/connector/sync_job_cancel.rb +13 -5
  31. data/lib/elasticsearch-serverless/api/connector/sync_job_delete.rb +13 -5
  32. data/lib/elasticsearch-serverless/api/connector/sync_job_get.rb +13 -5
  33. data/lib/elasticsearch-serverless/api/connector/sync_job_list.rb +8 -6
  34. data/lib/elasticsearch-serverless/api/connector/sync_job_post.rb +7 -5
  35. data/lib/elasticsearch-serverless/api/connector/update_active_filtering.rb +9 -1
  36. data/lib/elasticsearch-serverless/api/connector/update_api_key_id.rb +13 -5
  37. data/lib/elasticsearch-serverless/api/connector/update_configuration.rb +13 -5
  38. data/lib/elasticsearch-serverless/api/connector/update_error.rb +9 -1
  39. data/lib/elasticsearch-serverless/api/connector/update_filtering.rb +13 -5
  40. data/lib/elasticsearch-serverless/api/connector/update_filtering_validation.rb +9 -1
  41. data/lib/elasticsearch-serverless/api/connector/update_index_name.rb +13 -5
  42. data/lib/elasticsearch-serverless/api/connector/update_name.rb +13 -5
  43. data/lib/elasticsearch-serverless/api/connector/update_native.rb +13 -5
  44. data/lib/elasticsearch-serverless/api/connector/update_pipeline.rb +13 -5
  45. data/lib/elasticsearch-serverless/api/connector/update_scheduling.rb +13 -5
  46. data/lib/elasticsearch-serverless/api/connector/update_service_type.rb +13 -5
  47. data/lib/elasticsearch-serverless/api/connector/update_status.rb +9 -1
  48. data/lib/elasticsearch-serverless/api/count.rb +30 -10
  49. data/lib/elasticsearch-serverless/api/create.rb +21 -5
  50. data/lib/elasticsearch-serverless/api/delete.rb +17 -5
  51. data/lib/elasticsearch-serverless/api/delete_by_query.rb +38 -11
  52. data/lib/elasticsearch-serverless/api/delete_script.rb +14 -3
  53. data/lib/elasticsearch-serverless/api/enrich/delete_policy.rb +10 -1
  54. data/lib/elasticsearch-serverless/api/enrich/execute_policy.rb +9 -1
  55. data/lib/elasticsearch-serverless/api/enrich/get_policy.rb +12 -2
  56. data/lib/elasticsearch-serverless/api/enrich/put_policy.rb +10 -1
  57. data/lib/elasticsearch-serverless/api/enrich/stats.rb +4 -1
  58. data/lib/elasticsearch-serverless/api/eql/delete.rb +12 -2
  59. data/lib/elasticsearch-serverless/api/eql/get.rb +13 -3
  60. data/lib/elasticsearch-serverless/api/eql/get_status.rb +9 -1
  61. data/lib/elasticsearch-serverless/api/eql/search.rb +9 -1
  62. data/lib/elasticsearch-serverless/api/exists.rb +20 -6
  63. data/lib/elasticsearch-serverless/api/exists_source.rb +16 -4
  64. data/lib/elasticsearch-serverless/api/explain.rb +17 -5
  65. data/lib/elasticsearch-serverless/api/field_caps.rb +12 -2
  66. data/lib/elasticsearch-serverless/api/get.rb +18 -5
  67. data/lib/elasticsearch-serverless/api/get_script.rb +10 -1
  68. data/lib/elasticsearch-serverless/api/get_source.rb +10 -1
  69. data/lib/elasticsearch-serverless/api/graph/explore.rb +12 -2
  70. data/lib/elasticsearch-serverless/api/index.rb +25 -6
  71. data/lib/elasticsearch-serverless/api/indices/add_block.rb +11 -2
  72. data/lib/elasticsearch-serverless/api/indices/analyze.rb +12 -2
  73. data/lib/elasticsearch-serverless/api/indices/create.rb +16 -4
  74. data/lib/elasticsearch-serverless/api/indices/create_data_stream.rb +16 -2
  75. data/lib/elasticsearch-serverless/api/indices/data_streams_stats.rb +15 -3
  76. data/lib/elasticsearch-serverless/api/indices/delete.rb +25 -7
  77. data/lib/elasticsearch-serverless/api/indices/delete_alias.rb +18 -5
  78. data/lib/elasticsearch-serverless/api/indices/delete_data_lifecycle.rb +11 -2
  79. data/lib/elasticsearch-serverless/api/indices/delete_data_stream.rb +10 -1
  80. data/lib/elasticsearch-serverless/api/indices/delete_index_template.rb +9 -1
  81. data/lib/elasticsearch-serverless/api/indices/exists.rb +17 -4
  82. data/lib/elasticsearch-serverless/api/indices/exists_alias.rb +19 -5
  83. data/lib/elasticsearch-serverless/api/indices/exists_index_template.rb +9 -1
  84. data/lib/elasticsearch-serverless/api/indices/explain_data_lifecycle.rb +11 -2
  85. data/lib/elasticsearch-serverless/api/indices/get.rb +18 -4
  86. data/lib/elasticsearch-serverless/api/indices/get_alias.rb +23 -6
  87. data/lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb +16 -3
  88. data/lib/elasticsearch-serverless/api/indices/get_data_stream.rb +14 -3
  89. data/lib/elasticsearch-serverless/api/indices/get_index_template.rb +9 -1
  90. data/lib/elasticsearch-serverless/api/indices/get_mapping.rb +21 -5
  91. data/lib/elasticsearch-serverless/api/indices/get_settings.rb +26 -6
  92. data/lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb +10 -1
  93. data/lib/elasticsearch-serverless/api/indices/modify_data_stream.rb +4 -1
  94. data/lib/elasticsearch-serverless/api/indices/put_alias.rb +20 -5
  95. data/lib/elasticsearch-serverless/api/indices/put_data_lifecycle.rb +22 -6
  96. data/lib/elasticsearch-serverless/api/indices/put_index_template.rb +11 -2
  97. data/lib/elasticsearch-serverless/api/indices/put_mapping.rb +20 -5
  98. data/lib/elasticsearch-serverless/api/indices/put_settings.rb +28 -7
  99. data/lib/elasticsearch-serverless/api/indices/put_template.rb +14 -3
  100. data/lib/elasticsearch-serverless/api/indices/refresh.rb +19 -4
  101. data/lib/elasticsearch-serverless/api/indices/resolve_index.rb +15 -3
  102. data/lib/elasticsearch-serverless/api/indices/rollover.rb +19 -5
  103. data/lib/elasticsearch-serverless/api/indices/simulate_index_template.rb +9 -1
  104. data/lib/elasticsearch-serverless/api/indices/simulate_template.rb +11 -2
  105. data/lib/elasticsearch-serverless/api/indices/update_aliases.rb +8 -3
  106. data/lib/elasticsearch-serverless/api/indices/validate_query.rb +24 -7
  107. data/lib/elasticsearch-serverless/api/inference/delete.rb +9 -1
  108. data/lib/elasticsearch-serverless/api/inference/get.rb +9 -1
  109. data/lib/elasticsearch-serverless/api/inference/inference.rb +9 -1
  110. data/lib/elasticsearch-serverless/api/inference/put.rb +9 -1
  111. data/lib/elasticsearch-serverless/api/info.rb +4 -1
  112. data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +15 -4
  113. data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +14 -3
  114. data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +3 -1
  115. data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +9 -1
  116. data/lib/elasticsearch-serverless/api/ingest/simulate.rb +11 -2
  117. data/lib/elasticsearch-serverless/api/license/get.rb +8 -4
  118. data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +9 -1
  119. data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +9 -1
  120. data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +9 -1
  121. data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +14 -4
  122. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +10 -1
  123. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +12 -3
  124. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +12 -3
  125. data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +10 -2
  126. data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +16 -4
  127. data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +10 -2
  128. data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +17 -6
  129. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +11 -3
  130. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +10 -2
  131. data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +4 -1
  132. data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +4 -2
  133. data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +19 -6
  134. data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +9 -1
  135. data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +9 -1
  136. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +24 -4
  137. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +21 -3
  138. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +20 -3
  139. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +23 -4
  140. data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +9 -1
  141. data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +21 -3
  142. data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +23 -4
  143. data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +30 -7
  144. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +28 -7
  145. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +17 -3
  146. data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +9 -1
  147. data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +10 -2
  148. data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +9 -1
  149. data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +9 -1
  150. data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +13 -2
  151. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +9 -1
  152. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +9 -1
  153. data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +12 -2
  154. data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +17 -5
  155. data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +9 -1
  156. data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +11 -2
  157. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +14 -3
  158. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +12 -2
  159. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +11 -2
  160. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +9 -1
  161. data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +14 -3
  162. data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +14 -3
  163. data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +27 -8
  164. data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +25 -5
  165. data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +23 -4
  166. data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +19 -3
  167. data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +15 -3
  168. data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +12 -2
  169. data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +21 -4
  170. data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +9 -1
  171. data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +9 -1
  172. data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +15 -2
  173. data/lib/elasticsearch-serverless/api/mget.rb +17 -4
  174. data/lib/elasticsearch-serverless/api/msearch.rb +15 -1
  175. data/lib/elasticsearch-serverless/api/msearch_template.rb +16 -4
  176. data/lib/elasticsearch-serverless/api/mtermvectors.rb +14 -8
  177. data/lib/elasticsearch-serverless/api/open_point_in_time.rb +14 -3
  178. data/lib/elasticsearch-serverless/api/ping.rb +4 -1
  179. data/lib/elasticsearch-serverless/api/put_script.rb +18 -5
  180. data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +9 -1
  181. data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +9 -1
  182. data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +9 -1
  183. data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +9 -1
  184. data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +3 -1
  185. data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +9 -1
  186. data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +9 -1
  187. data/lib/elasticsearch-serverless/api/rank_eval.rb +11 -2
  188. data/lib/elasticsearch-serverless/api/reindex.rb +11 -7
  189. data/lib/elasticsearch-serverless/api/render_search_template.rb +11 -2
  190. data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +4 -1
  191. data/lib/elasticsearch-serverless/api/scroll.rb +9 -1
  192. data/lib/elasticsearch-serverless/api/search.rb +107 -30
  193. data/lib/elasticsearch-serverless/api/search_application/delete.rb +9 -1
  194. data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +9 -1
  195. data/lib/elasticsearch-serverless/api/search_application/get.rb +9 -1
  196. data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +9 -1
  197. data/lib/elasticsearch-serverless/api/search_application/list.rb +3 -1
  198. data/lib/elasticsearch-serverless/api/search_application/put.rb +9 -1
  199. data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +9 -1
  200. data/lib/elasticsearch-serverless/api/search_application/search.rb +9 -1
  201. data/lib/elasticsearch-serverless/api/search_mvt.rb +27 -7
  202. data/lib/elasticsearch-serverless/api/search_template.rb +22 -6
  203. data/lib/elasticsearch-serverless/api/security/authenticate.rb +6 -2
  204. data/lib/elasticsearch-serverless/api/security/create_api_key.rb +4 -1
  205. data/lib/elasticsearch-serverless/api/security/get_api_key.rb +19 -7
  206. data/lib/elasticsearch-serverless/api/security/has_privileges.rb +10 -1
  207. data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +4 -1
  208. data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +7 -3
  209. data/lib/elasticsearch-serverless/api/security/update_api_key.rb +10 -1
  210. data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +3 -1
  211. data/lib/elasticsearch-serverless/api/sql/delete_async.rb +9 -1
  212. data/lib/elasticsearch-serverless/api/sql/get_async.rb +15 -4
  213. data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +9 -1
  214. data/lib/elasticsearch-serverless/api/sql/query.rb +3 -1
  215. data/lib/elasticsearch-serverless/api/sql/translate.rb +3 -1
  216. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +9 -1
  217. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +9 -1
  218. data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +9 -1
  219. data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +9 -1
  220. data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +3 -1
  221. data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -1
  222. data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -1
  223. data/lib/elasticsearch-serverless/api/tasks/get.rb +13 -3
  224. data/lib/elasticsearch-serverless/api/terms_enum.rb +9 -1
  225. data/lib/elasticsearch-serverless/api/termvectors.rb +21 -9
  226. data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +14 -3
  227. data/lib/elasticsearch-serverless/api/transform/get_transform.rb +23 -4
  228. data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +20 -3
  229. data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +15 -5
  230. data/lib/elasticsearch-serverless/api/transform/put_transform.rb +17 -7
  231. data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +14 -3
  232. data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +11 -3
  233. data/lib/elasticsearch-serverless/api/transform/start_transform.rb +10 -3
  234. data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +23 -6
  235. data/lib/elasticsearch-serverless/api/transform/update_transform.rb +15 -4
  236. data/lib/elasticsearch-serverless/api/update.rb +23 -7
  237. data/lib/elasticsearch-serverless/api/update_by_query.rb +36 -9
  238. data/lib/elasticsearch-serverless/api.rb +3 -2
  239. data/lib/elasticsearch-serverless/version.rb +1 -1
  240. data/lib/elasticsearch-serverless.rb +4 -3
  241. metadata +5 -76
  242. data/lib/elasticsearch-serverless/api/connector/last_sync.rb +0 -59
@@ -22,7 +22,8 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module MachineLearning
24
24
  module Actions
25
- # Instantiates an anomaly detection job. If you include a +datafeed_config+, you must have read index privileges on the source index.
25
+ # Create an anomaly detection job.
26
+ # If you include a +datafeed_config+, you must have read index privileges on the source index.
26
27
  #
27
28
  # @option arguments [String] :job_id The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. (*Required*)
28
29
  # @option arguments [Hash] :headers Custom HTTP headers
@@ -31,6 +32,14 @@ module ElasticsearchServerless
31
32
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html
32
33
  #
33
34
  def put_job(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || "ml.put_job" }
36
+
37
+ defined_params = [:job_id].inject({}) do |set_variables, variable|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ set_variables
40
+ end
41
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
42
+
34
43
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
35
44
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
36
45
 
@@ -46,7 +55,7 @@ module ElasticsearchServerless
46
55
  params = {}
47
56
 
48
57
  ElasticsearchServerless::API::Response.new(
49
- perform_request(method, path, params, body, headers)
58
+ perform_request(method, path, params, body, headers, request_opts)
50
59
  )
51
60
  end
52
61
  end
@@ -25,14 +25,25 @@ module ElasticsearchServerless
25
25
  # Enables you to supply a trained model that is not created by data frame analytics.
26
26
  #
27
27
  # @option arguments [String] :model_id The unique identifier of the trained model. (*Required*)
28
- # @option arguments [Boolean] :defer_definition_decompression If set to +true+ and a +compressed_definition+ is provided, the request defers definition decompression and skips relevant validations.
29
- # @option arguments [Boolean] :wait_for_completion Whether to wait for all child operations (e.g. model download) to complete.
28
+ # @option arguments [Boolean] :defer_definition_decompression If set to +true+ and a +compressed_definition+ is provided,
29
+ # the request defers definition decompression and skips relevant
30
+ # validations.
31
+ # @option arguments [Boolean] :wait_for_completion Whether to wait for all child operations (e.g. model download)
32
+ # to complete.
30
33
  # @option arguments [Hash] :headers Custom HTTP headers
31
34
  # @option arguments [Hash] :body request body
32
35
  #
33
36
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html
34
37
  #
35
38
  def put_trained_model(arguments = {})
39
+ request_opts = { endpoint: arguments[:endpoint] || "ml.put_trained_model" }
40
+
41
+ defined_params = [:model_id].inject({}) do |set_variables, variable|
42
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
+ set_variables
44
+ end
45
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
46
+
36
47
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
37
48
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
38
49
 
@@ -48,7 +59,7 @@ module ElasticsearchServerless
48
59
  params = Utils.process_params(arguments)
49
60
 
50
61
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
62
+ perform_request(method, path, params, body, headers, request_opts)
52
63
  )
53
64
  end
54
65
  end
@@ -41,12 +41,22 @@ module ElasticsearchServerless
41
41
  #
42
42
  # @option arguments [String] :model_alias The alias to create or update. This value cannot end in numbers. (*Required*)
43
43
  # @option arguments [String] :model_id The identifier for the trained model that the alias refers to. (*Required*)
44
- # @option arguments [Boolean] :reassign Specifies whether the alias gets reassigned to the specified trained model if it is already assigned to a different model. If the alias is already assigned and this parameter is false, the API returns an error.
44
+ # @option arguments [Boolean] :reassign Specifies whether the alias gets reassigned to the specified trained
45
+ # model if it is already assigned to a different model. If the alias is
46
+ # already assigned and this parameter is false, the API returns an error.
45
47
  # @option arguments [Hash] :headers Custom HTTP headers
46
48
  #
47
49
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html
48
50
  #
49
51
  def put_trained_model_alias(arguments = {})
52
+ request_opts = { endpoint: arguments[:endpoint] || "ml.put_trained_model_alias" }
53
+
54
+ defined_params = [:model_id, :model_alias].inject({}) do |set_variables, variable|
55
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
56
+ set_variables
57
+ end
58
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
59
+
50
60
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
51
61
  raise ArgumentError, "Required argument 'model_alias' missing" unless arguments[:model_alias]
52
62
 
@@ -64,7 +74,7 @@ module ElasticsearchServerless
64
74
  params = Utils.process_params(arguments)
65
75
 
66
76
  ElasticsearchServerless::API::Response.new(
67
- perform_request(method, path, params, body, headers)
77
+ perform_request(method, path, params, body, headers, request_opts)
68
78
  )
69
79
  end
70
80
  end
@@ -25,13 +25,22 @@ module ElasticsearchServerless
25
25
  # Creates part of a trained model definition.
26
26
  #
27
27
  # @option arguments [String] :model_id The unique identifier of the trained model. (*Required*)
28
- # @option arguments [Integer] :part The definition part number. When the definition is loaded for inference the definition parts are streamed in the order of their part number. The first part must be +0+ and the final part must be +total_parts - 1+. (*Required*)
28
+ # @option arguments [Integer] :part The definition part number. When the definition is loaded for inference the definition parts are streamed in the
29
+ # order of their part number. The first part must be +0+ and the final part must be +total_parts - 1+. (*Required*)
29
30
  # @option arguments [Hash] :headers Custom HTTP headers
30
31
  # @option arguments [Hash] :body request body
31
32
  #
32
33
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html
33
34
  #
34
35
  def put_trained_model_definition_part(arguments = {})
36
+ request_opts = { endpoint: arguments[:endpoint] || "ml.put_trained_model_definition_part" }
37
+
38
+ defined_params = [:model_id, :part].inject({}) do |set_variables, variable|
39
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
40
+ set_variables
41
+ end
42
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
43
+
35
44
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
36
45
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
37
46
  raise ArgumentError, "Required argument 'part' missing" unless arguments[:part]
@@ -50,7 +59,7 @@ module ElasticsearchServerless
50
59
  params = {}
51
60
 
52
61
  ElasticsearchServerless::API::Response.new(
53
- perform_request(method, path, params, body, headers)
62
+ perform_request(method, path, params, body, headers, request_opts)
54
63
  )
55
64
  end
56
65
  end
@@ -33,6 +33,14 @@ module ElasticsearchServerless
33
33
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html
34
34
  #
35
35
  def put_trained_model_vocabulary(arguments = {})
36
+ request_opts = { endpoint: arguments[:endpoint] || "ml.put_trained_model_vocabulary" }
37
+
38
+ defined_params = [:model_id].inject({}) do |set_variables, variable|
39
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
40
+ set_variables
41
+ end
42
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
43
+
36
44
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
37
45
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
38
46
 
@@ -48,7 +56,7 @@ module ElasticsearchServerless
48
56
  params = {}
49
57
 
50
58
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
59
+ perform_request(method, path, params, body, headers, request_opts)
52
60
  )
53
61
  end
54
62
  end
@@ -29,13 +29,24 @@ module ElasticsearchServerless
29
29
  # comma separated list.
30
30
  #
31
31
  # @option arguments [String] :job_id The ID of the job to reset. (*Required*)
32
- # @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning. Server default: true.
33
- # @option arguments [Boolean] :delete_user_annotations Specifies whether annotations that have been added by the user should be deleted along with any auto-generated annotations when the job is reset.
32
+ # @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before
33
+ # returning. Server default: true.
34
+ # @option arguments [Boolean] :delete_user_annotations Specifies whether annotations that have been added by the
35
+ # user should be deleted along with any auto-generated annotations when the job is
36
+ # reset.
34
37
  # @option arguments [Hash] :headers Custom HTTP headers
35
38
  #
36
39
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html
37
40
  #
38
41
  def reset_job(arguments = {})
42
+ request_opts = { endpoint: arguments[:endpoint] || "ml.reset_job" }
43
+
44
+ defined_params = [:job_id].inject({}) do |set_variables, variable|
45
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
46
+ set_variables
47
+ end
48
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
49
+
39
50
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
40
51
 
41
52
  arguments = arguments.clone
@@ -50,7 +61,7 @@ module ElasticsearchServerless
50
61
  params = Utils.process_params(arguments)
51
62
 
52
63
  ElasticsearchServerless::API::Response.new(
53
- perform_request(method, path, params, body, headers)
64
+ perform_request(method, path, params, body, headers, request_opts)
54
65
  )
55
66
  end
56
67
  end
@@ -35,13 +35,24 @@ module ElasticsearchServerless
35
35
  # If the destination index exists, it is used as is. You can therefore set up
36
36
  # the destination index in advance with custom settings and mappings.
37
37
  #
38
- # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. (*Required*)
39
- # @option arguments [Time] :timeout Controls the amount of time to wait until the data frame analytics job starts. Server default: 20s.
38
+ # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain
39
+ # lowercase alphanumeric characters (a-z and 0-9), hyphens, and
40
+ # underscores. It must start and end with alphanumeric characters. (*Required*)
41
+ # @option arguments [Time] :timeout Controls the amount of time to wait until the data frame analytics job
42
+ # starts. Server default: 20s.
40
43
  # @option arguments [Hash] :headers Custom HTTP headers
41
44
  #
42
45
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html
43
46
  #
44
47
  def start_data_frame_analytics(arguments = {})
48
+ request_opts = { endpoint: arguments[:endpoint] || "ml.start_data_frame_analytics" }
49
+
50
+ defined_params = [:id].inject({}) do |set_variables, variable|
51
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
+ set_variables
53
+ end
54
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
55
+
45
56
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
46
57
 
47
58
  arguments = arguments.clone
@@ -56,7 +67,7 @@ module ElasticsearchServerless
56
67
  params = Utils.process_params(arguments)
57
68
 
58
69
  ElasticsearchServerless::API::Response.new(
59
- perform_request(method, path, params, body, headers)
70
+ perform_request(method, path, params, body, headers, request_opts)
60
71
  )
61
72
  end
62
73
  end
@@ -23,22 +23,33 @@ module ElasticsearchServerless
23
23
  module MachineLearning
24
24
  module Actions
25
25
  # Starts one or more datafeeds.
26
- #
27
26
  # A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped
28
27
  # multiple times throughout its lifecycle.
29
- #
30
28
  # Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs.
31
- #
32
29
  # If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped.
33
30
  # If new data was indexed for that exact millisecond between stopping and starting, it will be ignored.
34
- #
35
31
  # When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or
36
32
  # update it had at the time of creation or update and runs the query using those same roles. If you provided secondary
37
33
  # authorization headers when you created or updated the datafeed, those credentials are used instead.
38
34
  #
39
- # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. (*Required*)
40
- # @option arguments [String, Time] :end The time that the datafeed should end, which can be specified by using one of the following formats: * ISO 8601 format with milliseconds, for example +2017-01-22T06:00:00.000Z+ * ISO 8601 format without milliseconds, for example +2017-01-22T06:00:00+00:00+ * Milliseconds since the epoch, for example +1485061200000+ Date-time arguments using either of the ISO 8601 formats must have a time zone designator, where +Z+ is accepted as an abbreviation for UTC time. When a URL is expected (for example, in browsers), the +++ used in time zone designators must be encoded as +%2B+. The end time value is exclusive. If you do not specify an end time, the datafeed runs continuously.
41
- # @option arguments [String, Time] :start The time that the datafeed should begin, which can be specified by using the same formats as the +end+ parameter. This value is inclusive. If you do not specify a start time and the datafeed is associated with a new anomaly detection job, the analysis starts from the earliest time for which data is available. If you restart a stopped datafeed and specify a start value that is earlier than the timestamp of the latest processed record, the datafeed continues from 1 millisecond after the timestamp of the latest processed record.
35
+ # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase
36
+ # alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric
37
+ # characters. (*Required*)
38
+ # @option arguments [String, Time] :end The time that the datafeed should end, which can be specified by using one of the following formats:
39
+ # - ISO 8601 format with milliseconds, for example +2017-01-22T06:00:00.000Z+
40
+ # - ISO 8601 format without milliseconds, for example +2017-01-22T06:00:00+00:00+
41
+ # - Milliseconds since the epoch, for example +1485061200000+
42
+ # Date-time arguments using either of the ISO 8601 formats must have a time zone designator, where +Z+ is accepted
43
+ # as an abbreviation for UTC time. When a URL is expected (for example, in browsers), the +++ used in time zone
44
+ # designators must be encoded as +%2B+.
45
+ # The end time value is exclusive. If you do not specify an end time, the datafeed
46
+ # runs continuously.
47
+ # @option arguments [String, Time] :start The time that the datafeed should begin, which can be specified by using the same formats as the +end+ parameter.
48
+ # This value is inclusive.
49
+ # If you do not specify a start time and the datafeed is associated with a new anomaly detection job, the analysis
50
+ # starts from the earliest time for which data is available.
51
+ # If you restart a stopped datafeed and specify a start value that is earlier than the timestamp of the latest
52
+ # processed record, the datafeed continues from 1 millisecond after the timestamp of the latest processed record.
42
53
  # @option arguments [Time] :timeout Specifies the amount of time to wait until a datafeed starts. Server default: 20s.
43
54
  # @option arguments [Hash] :headers Custom HTTP headers
44
55
  # @option arguments [Hash] :body request body
@@ -46,6 +57,14 @@ module ElasticsearchServerless
46
57
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html
47
58
  #
48
59
  def start_datafeed(arguments = {})
60
+ request_opts = { endpoint: arguments[:endpoint] || "ml.start_datafeed" }
61
+
62
+ defined_params = [:datafeed_id].inject({}) do |set_variables, variable|
63
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
64
+ set_variables
65
+ end
66
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
67
+
49
68
  raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id]
50
69
 
51
70
  arguments = arguments.clone
@@ -60,7 +79,7 @@ module ElasticsearchServerless
60
79
  params = Utils.process_params(arguments)
61
80
 
62
81
  ElasticsearchServerless::API::Response.new(
63
- perform_request(method, path, params, body, headers)
82
+ perform_request(method, path, params, body, headers, request_opts)
64
83
  )
65
84
  end
66
85
  end
@@ -25,12 +25,24 @@ module ElasticsearchServerless
25
25
  # Starts a trained model deployment, which allocates the model to every machine learning node.
26
26
  #
27
27
  # @option arguments [String] :model_id The unique identifier of the trained model. Currently, only PyTorch models are supported. (*Required*)
28
- # @option arguments [Integer, String] :cache_size The inference cache size (in memory outside the JVM heap) per node for the model. The default value is the same size as the +model_size_bytes+. To disable the cache, +0b+ can be provided.
28
+ # @option arguments [Integer, String] :cache_size The inference cache size (in memory outside the JVM heap) per node for the model.
29
+ # The default value is the same size as the +model_size_bytes+. To disable the cache,
30
+ # +0b+ can be provided.
29
31
  # @option arguments [String] :deployment_id A unique identifier for the deployment of the model.
30
- # @option arguments [Integer] :number_of_allocations The number of model allocations on each node where the model is deployed. All allocations on a node share the same copy of the model in memory but use a separate set of threads to evaluate the model. Increasing this value generally increases the throughput. If this setting is greater than the number of hardware threads it will automatically be changed to a value less than the number of hardware threads. Server default: 1.
32
+ # @option arguments [Integer] :number_of_allocations The number of model allocations on each node where the model is deployed.
33
+ # All allocations on a node share the same copy of the model in memory but use
34
+ # a separate set of threads to evaluate the model.
35
+ # Increasing this value generally increases the throughput.
36
+ # If this setting is greater than the number of hardware threads
37
+ # it will automatically be changed to a value less than the number of hardware threads. Server default: 1.
31
38
  # @option arguments [String] :priority The deployment priority.
32
- # @option arguments [Integer] :queue_capacity Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds this value, new requests are rejected with a 429 error. Server default: 1024.
33
- # @option arguments [Integer] :threads_per_allocation Sets the number of threads used by each model allocation during inference. This generally increases the inference speed. The inference process is a compute-bound process; any number greater than the number of available hardware threads on the machine does not increase the inference speed. If this setting is greater than the number of hardware threads it will automatically be changed to a value less than the number of hardware threads. Server default: 1.
39
+ # @option arguments [Integer] :queue_capacity Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds
40
+ # this value, new requests are rejected with a 429 error. Server default: 1024.
41
+ # @option arguments [Integer] :threads_per_allocation Sets the number of threads used by each model allocation during inference. This generally increases
42
+ # the inference speed. The inference process is a compute-bound process; any number
43
+ # greater than the number of available hardware threads on the machine does not increase the
44
+ # inference speed. If this setting is greater than the number of hardware threads
45
+ # it will automatically be changed to a value less than the number of hardware threads. Server default: 1.
34
46
  # @option arguments [Time] :timeout Specifies the amount of time to wait for the model to deploy. Server default: 20s.
35
47
  # @option arguments [String] :wait_for Specifies the allocation status to wait for before returning. Server default: started.
36
48
  # @option arguments [Hash] :headers Custom HTTP headers
@@ -38,6 +50,14 @@ module ElasticsearchServerless
38
50
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html
39
51
  #
40
52
  def start_trained_model_deployment(arguments = {})
53
+ request_opts = { endpoint: arguments[:endpoint] || "ml.start_trained_model_deployment" }
54
+
55
+ defined_params = [:model_id].inject({}) do |set_variables, variable|
56
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
57
+ set_variables
58
+ end
59
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
60
+
41
61
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
42
62
 
43
63
  arguments = arguments.clone
@@ -52,7 +72,7 @@ module ElasticsearchServerless
52
72
  params = Utils.process_params(arguments)
53
73
 
54
74
  ElasticsearchServerless::API::Response.new(
55
- perform_request(method, path, params, body, headers)
75
+ perform_request(method, path, params, body, headers, request_opts)
56
76
  )
57
77
  end
58
78
  end
@@ -26,15 +26,34 @@ module ElasticsearchServerless
26
26
  # A data frame analytics job can be started and stopped multiple times
27
27
  # throughout its lifecycle.
28
28
  #
29
- # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. (*Required*)
30
- # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: 1. Contains wildcard expressions and there are no data frame analytics jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value is true, which returns an empty data_frame_analytics array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.
29
+ # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain
30
+ # lowercase alphanumeric characters (a-z and 0-9), hyphens, and
31
+ # underscores. It must start and end with alphanumeric characters. (*Required*)
32
+ # @option arguments [Boolean] :allow_no_match Specifies what to do when the request:
33
+ # - Contains wildcard expressions and there are no data frame analytics
34
+ # jobs that match.
35
+ # - Contains the _all string or no identifiers and there are no matches.
36
+ # - Contains wildcard expressions and there are only partial matches.
37
+ # The default value is true, which returns an empty data_frame_analytics
38
+ # array when there are no matches and the subset of results when there are
39
+ # partial matches. If this parameter is false, the request returns a 404
40
+ # status code when there are no matches or only partial matches. Server default: true.
31
41
  # @option arguments [Boolean] :force If true, the data frame analytics job is stopped forcefully.
32
- # @option arguments [Time] :timeout Controls the amount of time to wait until the data frame analytics job stops. Defaults to 20 seconds. Server default: 20s.
42
+ # @option arguments [Time] :timeout Controls the amount of time to wait until the data frame analytics job
43
+ # stops. Defaults to 20 seconds. Server default: 20s.
33
44
  # @option arguments [Hash] :headers Custom HTTP headers
34
45
  #
35
46
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html
36
47
  #
37
48
  def stop_data_frame_analytics(arguments = {})
49
+ request_opts = { endpoint: arguments[:endpoint] || "ml.stop_data_frame_analytics" }
50
+
51
+ defined_params = [:id].inject({}) do |set_variables, variable|
52
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
53
+ set_variables
54
+ end
55
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
56
+
38
57
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
39
58
 
40
59
  arguments = arguments.clone
@@ -49,7 +68,7 @@ module ElasticsearchServerless
49
68
  params = Utils.process_params(arguments)
50
69
 
51
70
  ElasticsearchServerless::API::Response.new(
52
- perform_request(method, path, params, body, headers)
71
+ perform_request(method, path, params, body, headers, request_opts)
53
72
  )
54
73
  end
55
74
  end
@@ -26,8 +26,16 @@ module ElasticsearchServerless
26
26
  # A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped
27
27
  # multiple times throughout its lifecycle.
28
28
  #
29
- # @option arguments [String] :datafeed_id Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a wildcard expression. You can close all datafeeds by using +_all+ or by specifying +*+ as the identifier. (*Required*)
30
- # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: * Contains wildcard expressions and there are no datafeeds that match. * Contains the +_all+ string or no identifiers and there are no matches. * Contains wildcard expressions and there are only partial matches. If +true+, the API returns an empty datafeeds array when there are no matches and the subset of results when there are partial matches. If +false+, the API returns a 404 status code when there are no matches or only partial matches. Server default: true.
29
+ # @option arguments [String] :datafeed_id Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated
30
+ # list of datafeeds or a wildcard expression. You can close all datafeeds by using +_all+ or by specifying +*+ as
31
+ # the identifier. (*Required*)
32
+ # @option arguments [Boolean] :allow_no_match Specifies what to do when the request:
33
+ # - Contains wildcard expressions and there are no datafeeds that match.
34
+ # - Contains the +_all+ string or no identifiers and there are no matches.
35
+ # - Contains wildcard expressions and there are only partial matches.
36
+ # If +true+, the API returns an empty datafeeds array when there are no matches and the subset of results when
37
+ # there are partial matches. If +false+, the API returns a 404 status code when there are no matches or only
38
+ # partial matches. Server default: true.
31
39
  # @option arguments [Boolean] :force If +true+, the datafeed is stopped forcefully.
32
40
  # @option arguments [Time] :timeout Specifies the amount of time to wait until a datafeed stops. Server default: 20s.
33
41
  # @option arguments [Hash] :headers Custom HTTP headers
@@ -36,6 +44,14 @@ module ElasticsearchServerless
36
44
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html
37
45
  #
38
46
  def stop_datafeed(arguments = {})
47
+ request_opts = { endpoint: arguments[:endpoint] || "ml.stop_datafeed" }
48
+
49
+ defined_params = [:datafeed_id].inject({}) do |set_variables, variable|
50
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
51
+ set_variables
52
+ end
53
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
54
+
39
55
  raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id]
40
56
 
41
57
  arguments = arguments.clone
@@ -50,7 +66,7 @@ module ElasticsearchServerless
50
66
  params = Utils.process_params(arguments)
51
67
 
52
68
  ElasticsearchServerless::API::Response.new(
53
- perform_request(method, path, params, body, headers)
69
+ perform_request(method, path, params, body, headers, request_opts)
54
70
  )
55
71
  end
56
72
  end
@@ -25,13 +25,25 @@ module ElasticsearchServerless
25
25
  # Stops a trained model deployment.
26
26
  #
27
27
  # @option arguments [String] :model_id The unique identifier of the trained model. (*Required*)
28
- # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: contains wildcard expressions and there are no deployments that match; contains the +_all+ string or no identifiers and there are no matches; or contains wildcard expressions and there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches. If +false+, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.
29
- # @option arguments [Boolean] :force Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you restart the model deployment.
28
+ # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;
29
+ # contains the +_all+ string or no identifiers and there are no matches; or contains wildcard expressions and
30
+ # there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.
31
+ # If +false+, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.
32
+ # @option arguments [Boolean] :force Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you
33
+ # restart the model deployment.
30
34
  # @option arguments [Hash] :headers Custom HTTP headers
31
35
  #
32
36
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html
33
37
  #
34
38
  def stop_trained_model_deployment(arguments = {})
39
+ request_opts = { endpoint: arguments[:endpoint] || "ml.stop_trained_model_deployment" }
40
+
41
+ defined_params = [:model_id].inject({}) do |set_variables, variable|
42
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
+ set_variables
44
+ end
45
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
46
+
35
47
  raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
36
48
 
37
49
  arguments = arguments.clone
@@ -46,7 +58,7 @@ module ElasticsearchServerless
46
58
  params = Utils.process_params(arguments)
47
59
 
48
60
  ElasticsearchServerless::API::Response.new(
49
- perform_request(method, path, params, body, headers)
61
+ perform_request(method, path, params, body, headers, request_opts)
50
62
  )
51
63
  end
52
64
  end
@@ -24,13 +24,23 @@ module ElasticsearchServerless
24
24
  module Actions
25
25
  # Updates an existing data frame analytics job.
26
26
  #
27
- # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. (*Required*)
27
+ # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain
28
+ # lowercase alphanumeric characters (a-z and 0-9), hyphens, and
29
+ # underscores. It must start and end with alphanumeric characters. (*Required*)
28
30
  # @option arguments [Hash] :headers Custom HTTP headers
29
31
  # @option arguments [Hash] :body request body
30
32
  #
31
33
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html
32
34
  #
33
35
  def update_data_frame_analytics(arguments = {})
36
+ request_opts = { endpoint: arguments[:endpoint] || "ml.update_data_frame_analytics" }
37
+
38
+ defined_params = [:id].inject({}) do |set_variables, variable|
39
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
40
+ set_variables
41
+ end
42
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
43
+
34
44
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
35
45
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
36
46
 
@@ -46,7 +56,7 @@ module ElasticsearchServerless
46
56
  params = {}
47
57
 
48
58
  ElasticsearchServerless::API::Response.new(
49
- perform_request(method, path, params, body, headers)
59
+ perform_request(method, path, params, body, headers, request_opts)
50
60
  )
51
61
  end
52
62
  end
@@ -28,9 +28,18 @@ module ElasticsearchServerless
28
28
  # the time of the update and runs the query using those same roles. If you provide secondary authorization headers,
29
29
  # those credentials are used instead.
30
30
  #
31
- # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. (*Required*)
32
- # @option arguments [Boolean] :allow_no_indices If +true+, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the +_all+ string or when no indices are specified. Server default: true.
33
- # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values. Valid values are: * +all+: Match any data stream or index, including hidden ones. * +closed+: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. * +hidden+: Match hidden data streams and hidden indices. Must be combined with +open+, +closed+, or both. * +none+: Wildcard patterns are not accepted. * +open+: Match open, non-hidden indices. Also matches any non-hidden data stream. Server default: open.
31
+ # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed.
32
+ # This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
33
+ # It must start and end with alphanumeric characters. (*Required*)
34
+ # @option arguments [Boolean] :allow_no_indices If +true+, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the
35
+ # +_all+ string or when no indices are specified. Server default: true.
36
+ # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines
37
+ # whether wildcard expressions match hidden data streams. Supports comma-separated values. Valid values are:
38
+ # - +all+: Match any data stream or index, including hidden ones.
39
+ # - +closed+: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
40
+ # - +hidden+: Match hidden data streams and hidden indices. Must be combined with +open+, +closed+, or both.
41
+ # - +none+: Wildcard patterns are not accepted.
42
+ # - +open+: Match open, non-hidden indices. Also matches any non-hidden data stream. Server default: open.
34
43
  # @option arguments [Boolean] :ignore_throttled If +true+, concrete, expanded or aliased indices are ignored when frozen. Server default: true.
35
44
  # @option arguments [Boolean] :ignore_unavailable If +true+, unavailable indices (missing or closed) are ignored.
36
45
  # @option arguments [Hash] :headers Custom HTTP headers
@@ -39,6 +48,14 @@ module ElasticsearchServerless
39
48
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html
40
49
  #
41
50
  def update_datafeed(arguments = {})
51
+ request_opts = { endpoint: arguments[:endpoint] || "ml.update_datafeed" }
52
+
53
+ defined_params = [:datafeed_id].inject({}) do |set_variables, variable|
54
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
55
+ set_variables
56
+ end
57
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
58
+
42
59
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
43
60
  raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id]
44
61
 
@@ -54,7 +71,7 @@ module ElasticsearchServerless
54
71
  params = Utils.process_params(arguments)
55
72
 
56
73
  ElasticsearchServerless::API::Response.new(
57
- perform_request(method, path, params, body, headers)
74
+ perform_request(method, path, params, body, headers, request_opts)
58
75
  )
59
76
  end
60
77
  end
@@ -31,6 +31,14 @@ module ElasticsearchServerless
31
31
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html
32
32
  #
33
33
  def update_filter(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || "ml.update_filter" }
35
+
36
+ defined_params = [:filter_id].inject({}) do |set_variables, variable|
37
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
+ set_variables
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
34
42
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
35
43
  raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id]
36
44
 
@@ -46,7 +54,7 @@ module ElasticsearchServerless
46
54
  params = {}
47
55
 
48
56
  ElasticsearchServerless::API::Response.new(
49
- perform_request(method, path, params, body, headers)
57
+ perform_request(method, path, params, body, headers, request_opts)
50
58
  )
51
59
  end
52
60
  end
@@ -31,6 +31,14 @@ module ElasticsearchServerless
31
31
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html
32
32
  #
33
33
  def update_job(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || "ml.update_job" }
35
+
36
+ defined_params = [:job_id].inject({}) do |set_variables, variable|
37
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
+ set_variables
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
34
42
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
35
43
  raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
36
44
 
@@ -46,7 +54,7 @@ module ElasticsearchServerless
46
54
  params = {}
47
55
 
48
56
  ElasticsearchServerless::API::Response.new(
49
- perform_request(method, path, params, body, headers)
57
+ perform_request(method, path, params, body, headers, request_opts)
50
58
  )
51
59
  end
52
60
  end