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,17 +22,28 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
+ # Delete a transform.
25
26
  # Deletes a transform.
26
27
  #
27
28
  # @option arguments [String] :transform_id Identifier for the transform. (*Required*)
28
- # @option arguments [Boolean] :force If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state.
29
- # @option arguments [Boolean] :delete_dest_index If this value is true, the destination index is deleted together with the transform. If false, the destination index will not be deleted
29
+ # @option arguments [Boolean] :force If this value is false, the transform must be stopped before it can be deleted. If true, the transform is
30
+ # deleted regardless of its current state.
31
+ # @option arguments [Boolean] :delete_dest_index If this value is true, the destination index is deleted together with the transform. If false, the destination
32
+ # index will not be deleted
30
33
  # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
31
34
  # @option arguments [Hash] :headers Custom HTTP headers
32
35
  #
33
36
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html
34
37
  #
35
38
  def delete_transform(arguments = {})
39
+ request_opts = { endpoint: arguments[:endpoint] || "transform.delete_transform" }
40
+
41
+ defined_params = [:transform_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 'transform_id' missing" unless arguments[:transform_id]
37
48
 
38
49
  arguments = arguments.clone
@@ -47,7 +58,7 @@ module ElasticsearchServerless
47
58
  params = Utils.process_params(arguments)
48
59
 
49
60
  ElasticsearchServerless::API::Response.new(
50
- perform_request(method, path, params, body, headers)
61
+ perform_request(method, path, params, body, headers, request_opts)
51
62
  )
52
63
  end
53
64
  end
@@ -22,18 +22,37 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
+ # Get transforms.
25
26
  # Retrieves configuration information for transforms.
26
27
  #
27
- # @option arguments [String, Array<String>] :transform_id Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using +_all+, by specifying +*+ as the +<transform_id>+, or by omitting the +<transform_id>+.
28
- # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms 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. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.
28
+ # @option arguments [String, Array<String>] :transform_id Identifier for the transform. It can be a transform identifier or a
29
+ # wildcard expression. You can get information for all transforms by using
30
+ # +_all+, by specifying +*+ as the +<transform_id>+, or by omitting the
31
+ # +<transform_id>+.
32
+ # @option arguments [Boolean] :allow_no_match Specifies what to do when the request:
33
+ # - Contains wildcard expressions and there are no transforms 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 this parameter is false, the request returns a 404 status code when
37
+ # there are no matches or only partial matches. Server default: true.
29
38
  # @option arguments [Integer] :from Skips the specified number of transforms. Server default: 0.
30
39
  # @option arguments [Integer] :size Specifies the maximum number of transforms to obtain. Server default: 100.
31
- # @option arguments [Boolean] :exclude_generated Excludes fields that were automatically added when creating the transform. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.
40
+ # @option arguments [Boolean] :exclude_generated Excludes fields that were automatically added when creating the
41
+ # transform. This allows the configuration to be in an acceptable format to
42
+ # be retrieved and then added to another cluster.
32
43
  # @option arguments [Hash] :headers Custom HTTP headers
33
44
  #
34
45
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html
35
46
  #
36
47
  def get_transform(arguments = {})
48
+ request_opts = { endpoint: arguments[:endpoint] || "transform.get_transform" }
49
+
50
+ defined_params = [:transform_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
+
37
56
  arguments = arguments.clone
38
57
  headers = arguments.delete(:headers) || {}
39
58
 
@@ -50,7 +69,7 @@ module ElasticsearchServerless
50
69
  params = Utils.process_params(arguments)
51
70
 
52
71
  ElasticsearchServerless::API::Response.new(
53
- perform_request(method, path, params, body, headers)
72
+ perform_request(method, path, params, body, headers, request_opts)
54
73
  )
55
74
  end
56
75
  end
@@ -22,10 +22,19 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
+ # Get transform stats.
25
26
  # Retrieves usage information for transforms.
26
27
  #
27
- # @option arguments [String, Array<String>] :transform_id Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using +_all+, by specifying +*+ as the +<transform_id>+, or by omitting the +<transform_id>+. (*Required*)
28
- # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms 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. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.
28
+ # @option arguments [String, Array<String>] :transform_id Identifier for the transform. It can be a transform identifier or a
29
+ # wildcard expression. You can get information for all transforms by using
30
+ # +_all+, by specifying +*+ as the +<transform_id>+, or by omitting the
31
+ # +<transform_id>+. (*Required*)
32
+ # @option arguments [Boolean] :allow_no_match Specifies what to do when the request:
33
+ # - Contains wildcard expressions and there are no transforms 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 this parameter is false, the request returns a 404 status code when
37
+ # there are no matches or only partial matches. Server default: true.
29
38
  # @option arguments [Integer] :from Skips the specified number of transforms. Server default: 0.
30
39
  # @option arguments [Integer] :size Specifies the maximum number of transforms to obtain. Server default: 100.
31
40
  # @option arguments [Time] :timeout Controls the time to wait for the stats
@@ -34,6 +43,14 @@ module ElasticsearchServerless
34
43
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html
35
44
  #
36
45
  def get_transform_stats(arguments = {})
46
+ request_opts = { endpoint: arguments[:endpoint] || "transform.get_transform_stats" }
47
+
48
+ defined_params = [:transform_id].inject({}) do |set_variables, variable|
49
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
50
+ set_variables
51
+ end
52
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
53
+
37
54
  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
38
55
 
39
56
  arguments = arguments.clone
@@ -48,7 +65,7 @@ module ElasticsearchServerless
48
65
  params = Utils.process_params(arguments)
49
66
 
50
67
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
68
+ perform_request(method, path, params, body, headers, request_opts)
52
69
  )
53
70
  end
54
71
  end
@@ -22,20 +22,30 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
- # Previews a transform.
26
- #
25
+ # Preview a transform.
26
+ # Generates a preview of the results that you will get when you create a transform with the same configuration.
27
27
  # It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
28
28
  # generates a list of mappings and settings for the destination index. These values are determined based on the field
29
29
  # types of the source index and the transform aggregations.
30
30
  #
31
- # @option arguments [String] :transform_id Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform configuration details in the request body.
32
- # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
31
+ # @option arguments [String] :transform_id Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform
32
+ # configuration details in the request body.
33
+ # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the
34
+ # timeout expires, the request fails and returns an error. Server default: 30s.
33
35
  # @option arguments [Hash] :headers Custom HTTP headers
34
36
  # @option arguments [Hash] :body request body
35
37
  #
36
38
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html
37
39
  #
38
40
  def preview_transform(arguments = {})
41
+ request_opts = { endpoint: arguments[:endpoint] || "transform.preview_transform" }
42
+
43
+ defined_params = [:transform_id].inject({}) do |set_variables, variable|
44
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
45
+ set_variables
46
+ end
47
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
48
+
39
49
  arguments = arguments.clone
40
50
  headers = arguments.delete(:headers) || {}
41
51
 
@@ -57,7 +67,7 @@ module ElasticsearchServerless
57
67
  params = Utils.process_params(arguments)
58
68
 
59
69
  ElasticsearchServerless::API::Response.new(
60
- perform_request(method, path, params, body, headers)
70
+ perform_request(method, path, params, body, headers, request_opts)
61
71
  )
62
72
  end
63
73
  end
@@ -22,30 +22,32 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
+ # Create a transform.
25
26
  # Creates a transform.
26
- #
27
27
  # A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
28
28
  # a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
29
29
  # unique row per entity.
30
- #
31
30
  # You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
32
31
  # you choose to use the pivot method for your transform, the entities are defined by the set of +group_by+ fields in
33
32
  # the pivot object. If you choose to use the latest method, the entities are defined by the +unique_key+ field values
34
33
  # in the latest object.
35
- #
36
34
  # You must have +create_index+, +index+, and +read+ privileges on the destination index and +read+ and
37
35
  # +view_index_metadata+ privileges on the source indices. When Elasticsearch security features are enabled, the
38
36
  # transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
39
37
  # those roles do not have the required privileges on the source and destination indices, the transform fails when it
40
38
  # attempts unauthorized operations.
41
- #
42
39
  # NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
43
40
  # +.transform-internal*+ indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
44
41
  # not give users any privileges on +.transform-internal*+ indices. If you used transforms prior to 7.5, also do not
45
42
  # give users any privileges on +.data-frame-internal*+ indices.
46
43
  #
47
- # @option arguments [String] :transform_id Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (*Required*)
48
- # @option arguments [Boolean] :defer_validation When the transform is created, a series of validations occur to ensure its success. For example, there is a check for the existence of the source indices and a check that the destination index is not part of the source index pattern. You can use this parameter to skip the checks, for example when the source index does not exist until after the transform is created. The validations are always run when you start the transform, however, with the exception of privilege checks.
44
+ # @option arguments [String] :transform_id Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9),
45
+ # hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (*Required*)
46
+ # @option arguments [Boolean] :defer_validation When the transform is created, a series of validations occur to ensure its success. For example, there is a
47
+ # check for the existence of the source indices and a check that the destination index is not part of the source
48
+ # index pattern. You can use this parameter to skip the checks, for example when the source index does not exist
49
+ # until after the transform is created. The validations are always run when you start the transform, however, with
50
+ # the exception of privilege checks.
49
51
  # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
50
52
  # @option arguments [Hash] :headers Custom HTTP headers
51
53
  # @option arguments [Hash] :body request body
@@ -53,6 +55,14 @@ module ElasticsearchServerless
53
55
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html
54
56
  #
55
57
  def put_transform(arguments = {})
58
+ request_opts = { endpoint: arguments[:endpoint] || "transform.put_transform" }
59
+
60
+ defined_params = [:transform_id].inject({}) do |set_variables, variable|
61
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
62
+ set_variables
63
+ end
64
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
65
+
56
66
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
57
67
  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
58
68
 
@@ -68,7 +78,7 @@ module ElasticsearchServerless
68
78
  params = Utils.process_params(arguments)
69
79
 
70
80
  ElasticsearchServerless::API::Response.new(
71
- perform_request(method, path, params, body, headers)
81
+ perform_request(method, path, params, body, headers, request_opts)
72
82
  )
73
83
  end
74
84
  end
@@ -22,17 +22,28 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
+ # Reset a transform.
25
26
  # Resets a transform.
26
27
  # Before you can reset it, you must stop it; alternatively, use the +force+ query parameter.
27
28
  # If the destination index was created by the transform, it is deleted.
28
29
  #
29
- # @option arguments [String] :transform_id Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (*Required*)
30
- # @option arguments [Boolean] :force If this value is +true+, the transform is reset regardless of its current state. If it's +false+, the transform must be stopped before it can be reset.
30
+ # @option arguments [String] :transform_id Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9),
31
+ # hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (*Required*)
32
+ # @option arguments [Boolean] :force If this value is +true+, the transform is reset regardless of its current state. If it's +false+, the transform
33
+ # must be stopped before it can be reset.
31
34
  # @option arguments [Hash] :headers Custom HTTP headers
32
35
  #
33
36
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html
34
37
  #
35
38
  def reset_transform(arguments = {})
39
+ request_opts = { endpoint: arguments[:endpoint] || "transform.reset_transform" }
40
+
41
+ defined_params = [:transform_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 'transform_id' missing" unless arguments[:transform_id]
37
48
 
38
49
  arguments = arguments.clone
@@ -47,7 +58,7 @@ module ElasticsearchServerless
47
58
  params = Utils.process_params(arguments)
48
59
 
49
60
  ElasticsearchServerless::API::Response.new(
50
- perform_request(method, path, params, body, headers)
61
+ perform_request(method, path, params, body, headers, request_opts)
51
62
  )
52
63
  end
53
64
  end
@@ -22,8 +22,8 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
- # Schedules now a transform.
26
- #
25
+ # Schedule a transform to start now.
26
+ # Instantly runs a transform to process data.
27
27
  # If you _schedule_now a transform, it will process the new data instantly,
28
28
  # without waiting for the configured frequency interval. After _schedule_now API is called,
29
29
  # the transform will be processed again at now + frequency unless _schedule_now API
@@ -36,6 +36,14 @@ module ElasticsearchServerless
36
36
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html
37
37
  #
38
38
  def schedule_now_transform(arguments = {})
39
+ request_opts = { endpoint: arguments[:endpoint] || "transform.schedule_now_transform" }
40
+
41
+ defined_params = [:transform_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
+
39
47
  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
40
48
 
41
49
  arguments = arguments.clone
@@ -50,7 +58,7 @@ module ElasticsearchServerless
50
58
  params = Utils.process_params(arguments)
51
59
 
52
60
  ElasticsearchServerless::API::Response.new(
53
- perform_request(method, path, params, body, headers)
61
+ perform_request(method, path, params, body, headers, request_opts)
54
62
  )
55
63
  end
56
64
  end
@@ -22,8 +22,8 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
+ # Start a transform.
25
26
  # Starts a transform.
26
- #
27
27
  # When you start a transform, it creates the destination index if it does not already exist. The +number_of_shards+ is
28
28
  # set to +1+ and the +auto_expand_replicas+ is set to +0-1+. If it is a pivot transform, it deduces the mapping
29
29
  # definitions for the destination index from the source indices and the transform aggregations. If fields in the
@@ -32,7 +32,6 @@ module ElasticsearchServerless
32
32
  # mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
33
33
  # start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
34
34
  # in a pivot transform.
35
- #
36
35
  # When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
37
36
  # created the transform, they occur when you start the transform—​with the exception of privilege checks. When
38
37
  # Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
@@ -47,6 +46,14 @@ module ElasticsearchServerless
47
46
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html
48
47
  #
49
48
  def start_transform(arguments = {})
49
+ request_opts = { endpoint: arguments[:endpoint] || "transform.start_transform" }
50
+
51
+ defined_params = [:transform_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
+
50
57
  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
51
58
 
52
59
  arguments = arguments.clone
@@ -61,7 +68,7 @@ module ElasticsearchServerless
61
68
  params = Utils.process_params(arguments)
62
69
 
63
70
  ElasticsearchServerless::API::Response.new(
64
- perform_request(method, path, params, body, headers)
71
+ perform_request(method, path, params, body, headers, request_opts)
65
72
  )
66
73
  end
67
74
  end
@@ -22,19 +22,36 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
+ # Stop transforms.
25
26
  # Stops one or more transforms.
26
27
  #
27
- # @option arguments [String] :transform_id Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression. To stop all transforms, use +_all+ or +*+ as the identifier. (*Required*)
28
- # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the +_all+ string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If it is true, the API returns a successful acknowledgement message when there are no matches. When there are only partial matches, the API stops the appropriate transforms. If it is false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.
28
+ # @option arguments [String] :transform_id Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression.
29
+ # To stop all transforms, use +_all+ or +*+ 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 transforms that match;
31
+ # contains the +_all+ string or no identifiers and there are no matches; contains wildcard expressions and there
32
+ # are only partial matches.If it is true, the API returns a successful acknowledgement message when there are no matches. When there are
33
+ # only partial matches, the API stops the appropriate transforms.If it is false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.
29
34
  # @option arguments [Boolean] :force If it is true, the API forcefully stops the transforms.
30
- # @option arguments [Time] :timeout Period to wait for a response when +wait_for_completion+ is +true+. If no response is received before the timeout expires, the request returns a timeout exception. However, the request continues processing and eventually moves the transform to a STOPPED state. Server default: 30s.
31
- # @option arguments [Boolean] :wait_for_checkpoint If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false, the transform stops as soon as possible.
32
- # @option arguments [Boolean] :wait_for_completion If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns immediately and the indexer is stopped asynchronously in the background.
35
+ # @option arguments [Time] :timeout Period to wait for a response when +wait_for_completion+ is +true+. If no response is received before the
36
+ # timeout expires, the request returns a timeout exception. However, the request continues processing and
37
+ # eventually moves the transform to a STOPPED state. Server default: 30s.
38
+ # @option arguments [Boolean] :wait_for_checkpoint If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false,
39
+ # the transform stops as soon as possible.
40
+ # @option arguments [Boolean] :wait_for_completion If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns
41
+ # immediately and the indexer is stopped asynchronously in the background.
33
42
  # @option arguments [Hash] :headers Custom HTTP headers
34
43
  #
35
44
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html
36
45
  #
37
46
  def stop_transform(arguments = {})
47
+ request_opts = { endpoint: arguments[:endpoint] || "transform.stop_transform" }
48
+
49
+ defined_params = [:transform_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
+
38
55
  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
39
56
 
40
57
  arguments = arguments.clone
@@ -49,7 +66,7 @@ module ElasticsearchServerless
49
66
  params = Utils.process_params(arguments)
50
67
 
51
68
  ElasticsearchServerless::API::Response.new(
52
- perform_request(method, path, params, body, headers)
69
+ perform_request(method, path, params, body, headers, request_opts)
53
70
  )
54
71
  end
55
72
  end
@@ -22,8 +22,8 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Transform
24
24
  module Actions
25
+ # Update a transform.
25
26
  # Updates certain properties of a transform.
26
- #
27
27
  # All updated properties except +description+ do not take effect until after the transform starts the next checkpoint,
28
28
  # thus there is data consistency in each checkpoint. To use this API, you must have +read+ and +view_index_metadata+
29
29
  # privileges for the source indices. You must also have +index+ and +read+ privileges for the destination index. When
@@ -31,14 +31,25 @@ module ElasticsearchServerless
31
31
  # time of update and runs with those privileges.
32
32
  #
33
33
  # @option arguments [String] :transform_id Identifier for the transform. (*Required*)
34
- # @option arguments [Boolean] :defer_validation When true, deferrable validations are not run. This behavior may be desired if the source index does not exist until after the transform is created.
35
- # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
34
+ # @option arguments [Boolean] :defer_validation When true, deferrable validations are not run. This behavior may be
35
+ # desired if the source index does not exist until after the transform is
36
+ # created.
37
+ # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the
38
+ # timeout expires, the request fails and returns an error. Server default: 30s.
36
39
  # @option arguments [Hash] :headers Custom HTTP headers
37
40
  # @option arguments [Hash] :body request body
38
41
  #
39
42
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html
40
43
  #
41
44
  def update_transform(arguments = {})
45
+ request_opts = { endpoint: arguments[:endpoint] || "transform.update_transform" }
46
+
47
+ defined_params = [:transform_id].inject({}) do |set_variables, variable|
48
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
49
+ set_variables
50
+ end
51
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
52
+
42
53
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
43
54
  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
44
55
 
@@ -54,7 +65,7 @@ module ElasticsearchServerless
54
65
  params = Utils.process_params(arguments)
55
66
 
56
67
  ElasticsearchServerless::API::Response.new(
57
- perform_request(method, path, params, body, headers)
68
+ perform_request(method, path, params, body, headers, request_opts)
58
69
  )
59
70
  end
60
71
  end
@@ -21,20 +21,28 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Updates a document with a script or partial document.
24
+ # Update a document.
25
+ # Updates a document by running a script or passing a partial document.
25
26
  #
26
27
  # @option arguments [String] :id Document ID (*Required*)
27
28
  # @option arguments [String] :index The name of the index (*Required*)
28
29
  # @option arguments [Integer] :if_primary_term Only perform the operation if the document has this primary term.
29
30
  # @option arguments [Integer] :if_seq_no Only perform the operation if the document has this sequence number.
30
31
  # @option arguments [String] :lang The script language. Server default: painless.
31
- # @option arguments [String] :refresh If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search, if 'wait_for' then wait for a refresh to make this operation visible to search, if 'false' do nothing with refreshes. Server default: false.
32
+ # @option arguments [String] :refresh If 'true', Elasticsearch refreshes the affected shards to make this operation
33
+ # visible to search, if 'wait_for' then wait for a refresh to make this operation
34
+ # visible to search, if 'false' do nothing with refreshes. Server default: false.
32
35
  # @option arguments [Boolean] :require_alias If true, the destination must be an index alias.
33
36
  # @option arguments [Integer] :retry_on_conflict Specify how many times should the operation be retried when a conflict occurs. Server default: 0.
34
37
  # @option arguments [String] :routing Custom value used to route operations to a specific shard.
35
- # @option arguments [Time] :timeout Period to wait for dynamic mapping updates and active shards. This guarantees Elasticsearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m.
36
- # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operations. Set to 'all' or any positive integer up to the total number of shards in the index (number_of_replicas+1). Defaults to 1 meaning the primary shard. Server default: 1.
37
- # @option arguments [Boolean, String, Array<String>] :_source Set to false to disable source retrieval. You can also specify a comma-separated list of the fields you want to retrieve. Server default: true.
38
+ # @option arguments [Time] :timeout Period to wait for dynamic mapping updates and active shards.
39
+ # This guarantees Elasticsearch waits for at least the timeout before failing.
40
+ # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m.
41
+ # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operations.
42
+ # Set to 'all' or any positive integer up to the total number of shards in the index
43
+ # (number_of_replicas+1). Defaults to 1 meaning the primary shard. Server default: 1.
44
+ # @option arguments [Boolean, String, Array<String>] :_source Set to false to disable source retrieval. You can also specify a comma-separated
45
+ # list of the fields you want to retrieve. Server default: true.
38
46
  # @option arguments [String, Array<String>] :_source_excludes Specify the source fields you want to exclude.
39
47
  # @option arguments [String, Array<String>] :_source_includes Specify the source fields you want to retrieve.
40
48
  # @option arguments [Hash] :headers Custom HTTP headers
@@ -43,6 +51,14 @@ module ElasticsearchServerless
43
51
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html
44
52
  #
45
53
  def update(arguments = {})
54
+ request_opts = { endpoint: arguments[:endpoint] || "update" }
55
+
56
+ defined_params = [:index, :id].inject({}) do |set_variables, variable|
57
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
58
+ set_variables
59
+ end
60
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
61
+
46
62
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
47
63
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
48
64
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -63,12 +79,12 @@ module ElasticsearchServerless
63
79
  if Array(arguments[:ignore]).include?(404)
64
80
  Utils.rescue_from_not_found {
65
81
  ElasticsearchServerless::API::Response.new(
66
- perform_request(method, path, params, body, headers)
82
+ perform_request(method, path, params, body, headers, request_opts)
67
83
  )
68
84
  }
69
85
  else
70
86
  ElasticsearchServerless::API::Response.new(
71
- perform_request(method, path, params, body, headers)
87
+ perform_request(method, path, params, body, headers, request_opts)
72
88
  )
73
89
  end
74
90
  end
@@ -21,23 +21,35 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
+ # Update documents.
24
25
  # Updates documents that match the specified query.
25
26
  # If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.
26
27
  #
27
- # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (+*+). To search all data streams or indices, omit this parameter or use +*+ or +_all+. (*Required*)
28
- # @option arguments [Boolean] :allow_no_indices If +false+, the request returns an error if any wildcard expression, index alias, or +_all+ value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true.
28
+ # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search.
29
+ # Supports wildcards (+*+).
30
+ # To search all data streams or indices, omit this parameter or use +*+ or +_all+. (*Required*)
31
+ # @option arguments [Boolean] :allow_no_indices If +false+, the request returns an error if any wildcard expression, index alias, or +_all+ value targets only missing or closed indices.
32
+ # This behavior applies even if the request targets other open indices.
33
+ # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true.
29
34
  # @option arguments [String] :analyzer Analyzer to use for the query string.
30
35
  # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed.
31
36
  # @option arguments [String] :conflicts What to do if update by query hits version conflicts: +abort+ or +proceed+. Server default: abort.
32
37
  # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. Server default: OR.
33
38
  # @option arguments [String] :df Field to use as default where no field prefix is given in the query string.
34
- # @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, such as +open,hidden+. Valid values are: +all+, +open+, +closed+, +hidden+, +none+.
39
+ # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match.
40
+ # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
41
+ # Supports comma-separated values, such as +open,hidden+.
42
+ # Valid values are: +all+, +open+, +closed+, +hidden+, +none+.
35
43
  # @option arguments [Integer] :from Starting offset (default: 0)
36
44
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
37
45
  # @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
38
- # @option arguments [Integer] :max_docs Maximum number of documents to process. Defaults to all documents.
39
- # @option arguments [String] :pipeline ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to +_none+ disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.
40
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default.
46
+ # @option arguments [Integer] :max_docs Maximum number of documents to process.
47
+ # Defaults to all documents.
48
+ # @option arguments [String] :pipeline ID of the pipeline to use to preprocess incoming documents.
49
+ # If the index has a default ingest pipeline specified, then setting the value to +_none+ disables the default ingest pipeline for this request.
50
+ # If a final pipeline is configured it will always run, regardless of the value of this parameter.
51
+ # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
52
+ # Random by default.
41
53
  # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes affected shards to make the operation visible to search.
42
54
  # @option arguments [Boolean] :request_cache If +true+, the request cache is used for this request.
43
55
  # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. Server default: -1.
@@ -49,11 +61,18 @@ module ElasticsearchServerless
49
61
  # @option arguments [Integer, String] :slices The number of slices this task should be divided into. Server default: 1.
50
62
  # @option arguments [Array<String>] :sort A comma-separated list of <field>:<direction> pairs.
51
63
  # @option arguments [Array<String>] :stats Specific +tag+ of the request for logging and statistical purposes.
52
- # @option arguments [Integer] :terminate_after Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
64
+ # @option arguments [Integer] :terminate_after Maximum number of documents to collect for each shard.
65
+ # If a query reaches this limit, Elasticsearch terminates the query early.
66
+ # Elasticsearch collects documents before sorting.
67
+ # Use with caution.
68
+ # Elasticsearch applies this parameter to each shard handling the request.
69
+ # When possible, let Elasticsearch perform early termination automatically.
70
+ # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
53
71
  # @option arguments [Time] :timeout Period each update request waits for the following operations: dynamic mapping updates, waiting for active shards. Server default: 1m.
54
72
  # @option arguments [Boolean] :version If +true+, returns the document version as part of a hit.
55
73
  # @option arguments [Boolean] :version_type Should the document increment the version number (internal) on hit or not (reindex)
56
- # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1.
74
+ # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
75
+ # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1.
57
76
  # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete. Server default: true.
58
77
  # @option arguments [Hash] :headers Custom HTTP headers
59
78
  # @option arguments [Hash] :body request body
@@ -61,6 +80,14 @@ module ElasticsearchServerless
61
80
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html
62
81
  #
63
82
  def update_by_query(arguments = {})
83
+ request_opts = { endpoint: arguments[:endpoint] || "update_by_query" }
84
+
85
+ defined_params = [:index].inject({}) do |set_variables, variable|
86
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
87
+ set_variables
88
+ end
89
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
90
+
64
91
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
65
92
 
66
93
  arguments = arguments.clone
@@ -75,7 +102,7 @@ module ElasticsearchServerless
75
102
  params = Utils.process_params(arguments)
76
103
 
77
104
  ElasticsearchServerless::API::Response.new(
78
- perform_request(method, path, params, body, headers)
105
+ perform_request(method, path, params, body, headers, request_opts)
79
106
  )
80
107
  end
81
108
  end