elasticsearch-serverless 0.1.0.20231031.pre → 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 +13 -2
  3. data/lib/elasticsearch-serverless/api/async_search/get.rb +19 -4
  4. data/lib/elasticsearch-serverless/api/async_search/status.rb +12 -2
  5. data/lib/elasticsearch-serverless/api/async_search/submit.rb +20 -5
  6. data/lib/elasticsearch-serverless/api/bulk.rb +19 -5
  7. data/lib/elasticsearch-serverless/api/cat/aliases.rb +24 -6
  8. data/lib/elasticsearch-serverless/api/cat/component_templates.rb +25 -6
  9. data/lib/elasticsearch-serverless/api/cat/count.rb +27 -7
  10. data/lib/elasticsearch-serverless/api/cat/help.rb +16 -6
  11. data/lib/elasticsearch-serverless/api/cat/indices.rb +34 -7
  12. data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +27 -7
  13. data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +35 -7
  14. data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +35 -7
  15. data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +28 -7
  16. data/lib/elasticsearch-serverless/api/cat/transforms.rb +30 -8
  17. data/lib/elasticsearch-serverless/api/clear_scroll.rb +13 -4
  18. data/lib/elasticsearch-serverless/api/close_point_in_time.rb +4 -2
  19. data/lib/elasticsearch-serverless/api/cluster/delete_component_template.rb +16 -4
  20. data/lib/elasticsearch-serverless/api/cluster/exists_component_template.rb +18 -5
  21. data/lib/elasticsearch-serverless/api/cluster/get_component_template.rb +17 -5
  22. data/lib/elasticsearch-serverless/api/cluster/info.rb +11 -2
  23. data/lib/elasticsearch-serverless/api/cluster/put_component_template.rb +28 -4
  24. data/lib/elasticsearch-serverless/api/connector/check_in.rb +65 -0
  25. data/lib/elasticsearch-serverless/api/connector/delete.rb +66 -0
  26. data/lib/elasticsearch-serverless/api/connector/get.rb +65 -0
  27. data/lib/elasticsearch-serverless/api/connector/list.rb +60 -0
  28. data/lib/elasticsearch-serverless/api/connector/post.rb +55 -0
  29. data/lib/elasticsearch-serverless/api/connector/put.rb +68 -0
  30. data/lib/elasticsearch-serverless/api/connector/sync_job_cancel.rb +66 -0
  31. data/lib/elasticsearch-serverless/api/connector/sync_job_delete.rb +66 -0
  32. data/lib/elasticsearch-serverless/api/connector/sync_job_get.rb +66 -0
  33. data/lib/elasticsearch-serverless/api/connector/sync_job_list.rb +59 -0
  34. data/lib/elasticsearch-serverless/api/connector/sync_job_post.rb +57 -0
  35. data/lib/elasticsearch-serverless/api/connector/update_active_filtering.rb +65 -0
  36. data/lib/elasticsearch-serverless/api/connector/update_api_key_id.rb +67 -0
  37. data/lib/elasticsearch-serverless/api/connector/update_configuration.rb +67 -0
  38. data/lib/elasticsearch-serverless/api/connector/update_error.rb +67 -0
  39. data/lib/elasticsearch-serverless/api/connector/update_filtering.rb +67 -0
  40. data/lib/elasticsearch-serverless/api/connector/update_filtering_validation.rb +67 -0
  41. data/lib/elasticsearch-serverless/api/connector/update_index_name.rb +67 -0
  42. data/lib/elasticsearch-serverless/api/connector/update_name.rb +67 -0
  43. data/lib/elasticsearch-serverless/api/connector/update_native.rb +67 -0
  44. data/lib/elasticsearch-serverless/api/connector/update_pipeline.rb +67 -0
  45. data/lib/elasticsearch-serverless/api/connector/update_scheduling.rb +67 -0
  46. data/lib/elasticsearch-serverless/api/connector/update_service_type.rb +67 -0
  47. data/lib/elasticsearch-serverless/api/connector/update_status.rb +67 -0
  48. data/lib/elasticsearch-serverless/api/count.rb +30 -10
  49. data/lib/elasticsearch-serverless/api/create.rb +23 -8
  50. data/lib/elasticsearch-serverless/api/delete.rb +18 -6
  51. data/lib/elasticsearch-serverless/api/delete_by_query.rb +39 -12
  52. data/lib/elasticsearch-serverless/api/delete_script.rb +15 -4
  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 +13 -3
  56. data/lib/elasticsearch-serverless/api/enrich/put_policy.rb +11 -2
  57. data/lib/elasticsearch-serverless/api/enrich/stats.rb +5 -2
  58. data/lib/elasticsearch-serverless/api/eql/delete.rb +14 -3
  59. data/lib/elasticsearch-serverless/api/eql/get.rb +14 -4
  60. data/lib/elasticsearch-serverless/api/eql/get_status.rb +10 -2
  61. data/lib/elasticsearch-serverless/api/eql/search.rb +9 -1
  62. data/lib/elasticsearch-serverless/api/esql/query.rb +57 -0
  63. data/lib/elasticsearch-serverless/api/exists.rb +20 -6
  64. data/lib/elasticsearch-serverless/api/exists_source.rb +17 -5
  65. data/lib/elasticsearch-serverless/api/explain.rb +17 -5
  66. data/lib/elasticsearch-serverless/api/field_caps.rb +16 -3
  67. data/lib/elasticsearch-serverless/api/get.rb +18 -4
  68. data/lib/elasticsearch-serverless/api/get_script.rb +11 -2
  69. data/lib/elasticsearch-serverless/api/get_source.rb +10 -1
  70. data/lib/elasticsearch-serverless/api/graph/explore.rb +13 -3
  71. data/lib/elasticsearch-serverless/api/index.rb +27 -7
  72. data/lib/elasticsearch-serverless/api/indices/add_block.rb +11 -2
  73. data/lib/elasticsearch-serverless/api/indices/analyze.rb +13 -3
  74. data/lib/elasticsearch-serverless/api/indices/create.rb +17 -5
  75. data/lib/elasticsearch-serverless/api/indices/create_data_stream.rb +18 -3
  76. data/lib/elasticsearch-serverless/api/indices/data_streams_stats.rb +16 -4
  77. data/lib/elasticsearch-serverless/api/indices/delete.rb +26 -8
  78. data/lib/elasticsearch-serverless/api/indices/delete_alias.rb +19 -6
  79. data/lib/elasticsearch-serverless/api/indices/delete_data_lifecycle.rb +11 -2
  80. data/lib/elasticsearch-serverless/api/indices/delete_data_stream.rb +11 -2
  81. data/lib/elasticsearch-serverless/api/indices/delete_index_template.rb +13 -2
  82. data/lib/elasticsearch-serverless/api/indices/exists.rb +17 -4
  83. data/lib/elasticsearch-serverless/api/indices/exists_alias.rb +19 -5
  84. data/lib/elasticsearch-serverless/api/indices/exists_index_template.rb +9 -1
  85. data/lib/elasticsearch-serverless/api/indices/explain_data_lifecycle.rb +11 -2
  86. data/lib/elasticsearch-serverless/api/indices/get.rb +20 -5
  87. data/lib/elasticsearch-serverless/api/indices/get_alias.rb +23 -6
  88. data/lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb +17 -4
  89. data/lib/elasticsearch-serverless/api/indices/get_data_stream.rb +15 -4
  90. data/lib/elasticsearch-serverless/api/indices/get_index_template.rb +11 -2
  91. data/lib/elasticsearch-serverless/api/indices/get_mapping.rb +23 -6
  92. data/lib/elasticsearch-serverless/api/indices/get_settings.rb +28 -7
  93. data/lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb +20 -2
  94. data/lib/elasticsearch-serverless/api/indices/modify_data_stream.rb +5 -2
  95. data/lib/elasticsearch-serverless/api/indices/put_alias.rb +21 -6
  96. data/lib/elasticsearch-serverless/api/indices/put_data_lifecycle.rb +22 -6
  97. data/lib/elasticsearch-serverless/api/indices/put_index_template.rb +14 -2
  98. data/lib/elasticsearch-serverless/api/indices/put_mapping.rb +23 -6
  99. data/lib/elasticsearch-serverless/api/indices/put_settings.rb +29 -7
  100. data/lib/elasticsearch-serverless/api/indices/put_template.rb +71 -0
  101. data/lib/elasticsearch-serverless/api/indices/refresh.rb +21 -5
  102. data/lib/elasticsearch-serverless/api/indices/resolve_index.rb +17 -4
  103. data/lib/elasticsearch-serverless/api/indices/rollover.rb +20 -7
  104. data/lib/elasticsearch-serverless/api/indices/simulate_index_template.rb +13 -6
  105. data/lib/elasticsearch-serverless/api/indices/simulate_template.rb +14 -4
  106. data/lib/elasticsearch-serverless/api/indices/update_aliases.rb +9 -4
  107. data/lib/elasticsearch-serverless/api/indices/validate_query.rb +24 -7
  108. data/lib/elasticsearch-serverless/api/inference/delete.rb +74 -0
  109. data/lib/elasticsearch-serverless/api/inference/get.rb +72 -0
  110. data/lib/elasticsearch-serverless/api/inference/inference.rb +74 -0
  111. data/lib/elasticsearch-serverless/api/inference/put.rb +74 -0
  112. data/lib/elasticsearch-serverless/api/info.rb +4 -1
  113. data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +16 -5
  114. data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +16 -4
  115. data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +6 -2
  116. data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +11 -2
  117. data/lib/elasticsearch-serverless/api/ingest/simulate.rb +12 -3
  118. data/lib/elasticsearch-serverless/api/license/get.rb +8 -3
  119. data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +10 -2
  120. data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +10 -2
  121. data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +10 -2
  122. data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +18 -4
  123. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +11 -2
  124. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +12 -3
  125. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +12 -3
  126. data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +10 -2
  127. data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +16 -4
  128. data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +12 -2
  129. data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +23 -5
  130. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +11 -2
  131. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +13 -2
  132. data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +7 -2
  133. data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +8 -2
  134. data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +27 -6
  135. data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +9 -1
  136. data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +9 -1
  137. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +27 -4
  138. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +21 -3
  139. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +26 -3
  140. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +28 -4
  141. data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +10 -1
  142. data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +21 -3
  143. data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +27 -4
  144. data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +46 -7
  145. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +29 -8
  146. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +19 -4
  147. data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +71 -0
  148. data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +17 -2
  149. data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +10 -2
  150. data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +10 -2
  151. data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +21 -2
  152. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +10 -2
  153. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +10 -2
  154. data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +14 -2
  155. data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +25 -4
  156. data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +11 -1
  157. data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +11 -2
  158. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +15 -3
  159. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +28 -3
  160. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +12 -3
  161. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +12 -2
  162. data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +19 -4
  163. data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +25 -3
  164. data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +35 -4
  165. data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +26 -6
  166. data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +25 -4
  167. data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +21 -3
  168. data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +16 -4
  169. data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +13 -3
  170. data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +26 -5
  171. data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +10 -2
  172. data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +9 -1
  173. data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +68 -0
  174. data/lib/elasticsearch-serverless/api/mget.rb +17 -3
  175. data/lib/elasticsearch-serverless/api/msearch.rb +15 -1
  176. data/lib/elasticsearch-serverless/api/msearch_template.rb +17 -5
  177. data/lib/elasticsearch-serverless/api/mtermvectors.rb +14 -8
  178. data/lib/elasticsearch-serverless/api/open_point_in_time.rb +20 -4
  179. data/lib/elasticsearch-serverless/api/ping.rb +4 -1
  180. data/lib/elasticsearch-serverless/api/put_script.rb +19 -6
  181. data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +65 -0
  182. data/lib/elasticsearch-serverless/api/{query_ruleset/delete.rb → query_rules/delete_ruleset.rb} +11 -7
  183. data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +65 -0
  184. data/lib/elasticsearch-serverless/api/{query_ruleset/get.rb → query_rules/get_ruleset.rb} +12 -8
  185. data/lib/elasticsearch-serverless/api/{query_ruleset/list.rb → query_rules/list_rulesets.rb} +6 -8
  186. data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +67 -0
  187. data/lib/elasticsearch-serverless/api/{query_ruleset/put.rb → query_rules/put_ruleset.rb} +11 -7
  188. data/lib/elasticsearch-serverless/api/rank_eval.rb +12 -3
  189. data/lib/elasticsearch-serverless/api/reindex.rb +11 -7
  190. data/lib/elasticsearch-serverless/api/render_search_template.rb +12 -3
  191. data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +5 -2
  192. data/lib/elasticsearch-serverless/api/scroll.rb +9 -1
  193. data/lib/elasticsearch-serverless/api/search.rb +110 -30
  194. data/lib/elasticsearch-serverless/api/search_application/delete.rb +9 -1
  195. data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +9 -1
  196. data/lib/elasticsearch-serverless/api/search_application/get.rb +10 -2
  197. data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +9 -1
  198. data/lib/elasticsearch-serverless/api/search_application/list.rb +3 -1
  199. data/lib/elasticsearch-serverless/api/search_application/put.rb +9 -1
  200. data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +9 -1
  201. data/lib/elasticsearch-serverless/api/search_application/search.rb +12 -3
  202. data/lib/elasticsearch-serverless/api/search_mvt.rb +27 -7
  203. data/lib/elasticsearch-serverless/api/search_template.rb +23 -7
  204. data/lib/elasticsearch-serverless/api/security/authenticate.rb +8 -2
  205. data/lib/elasticsearch-serverless/api/security/create_api_key.rb +7 -1
  206. data/lib/elasticsearch-serverless/api/security/get_api_key.rb +23 -7
  207. data/lib/elasticsearch-serverless/api/security/has_privileges.rb +10 -1
  208. data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +10 -1
  209. data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +9 -3
  210. data/lib/elasticsearch-serverless/api/security/update_api_key.rb +75 -0
  211. data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +3 -1
  212. data/lib/elasticsearch-serverless/api/sql/delete_async.rb +9 -1
  213. data/lib/elasticsearch-serverless/api/sql/get_async.rb +15 -4
  214. data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +9 -1
  215. data/lib/elasticsearch-serverless/api/sql/query.rb +3 -1
  216. data/lib/elasticsearch-serverless/api/sql/translate.rb +3 -1
  217. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +9 -1
  218. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +9 -1
  219. data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +9 -1
  220. data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +9 -1
  221. data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +3 -1
  222. data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +10 -2
  223. data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -1
  224. data/lib/elasticsearch-serverless/api/tasks/get.rb +67 -0
  225. data/lib/elasticsearch-serverless/api/terms_enum.rb +9 -1
  226. data/lib/elasticsearch-serverless/api/termvectors.rb +21 -9
  227. data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +15 -4
  228. data/lib/elasticsearch-serverless/api/transform/get_transform.rb +23 -4
  229. data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +20 -3
  230. data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +18 -4
  231. data/lib/elasticsearch-serverless/api/transform/put_transform.rb +34 -4
  232. data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +17 -4
  233. data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +15 -2
  234. data/lib/elasticsearch-serverless/api/transform/start_transform.rb +24 -2
  235. data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +23 -6
  236. data/lib/elasticsearch-serverless/api/transform/update_transform.rb +20 -3
  237. data/lib/elasticsearch-serverless/api/update.rb +23 -7
  238. data/lib/elasticsearch-serverless/api/update_by_query.rb +38 -11
  239. data/lib/elasticsearch-serverless/api.rb +9 -6
  240. data/lib/elasticsearch-serverless/version.rb +3 -3
  241. data/lib/elasticsearch-serverless.rb +16 -7
  242. metadata +46 -65
@@ -22,7 +22,8 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Enrich
24
24
  module Actions
25
- # Creates a new enrich policy.
25
+ # Create an enrich policy.
26
+ # Creates an enrich policy.
26
27
  #
27
28
  # @option arguments [String] :name Name of the enrich policy to create or update. (*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/put-enrich-policy-api.html
32
33
  #
33
34
  def put_policy(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || "enrich.put_policy" }
36
+
37
+ defined_params = [:name].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 'name' missing" unless arguments[:name]
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
@@ -22,13 +22,16 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Enrich
24
24
  module Actions
25
- # Gets enrich coordinator statistics and information about enrich policies that are currently executing.
25
+ # Get enrich stats.
26
+ # Returns enrich coordinator statistics and information about enrich policies that are currently executing.
26
27
  #
27
28
  # @option arguments [Hash] :headers Custom HTTP headers
28
29
  #
29
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html
30
31
  #
31
32
  def stats(arguments = {})
33
+ request_opts = { endpoint: arguments[:endpoint] || "enrich.stats" }
34
+
32
35
  arguments = arguments.clone
33
36
  headers = arguments.delete(:headers) || {}
34
37
 
@@ -39,7 +42,7 @@ module ElasticsearchServerless
39
42
  params = {}
40
43
 
41
44
  ElasticsearchServerless::API::Response.new(
42
- perform_request(method, path, params, body, headers)
45
+ perform_request(method, path, params, body, headers, request_opts)
43
46
  )
44
47
  end
45
48
  end
@@ -22,14 +22,25 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Eql
24
24
  module Actions
25
- # Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
25
+ # Deletes an async EQL search or a stored synchronous EQL search.
26
+ # The API also deletes results for the search.
26
27
  #
27
- # @option arguments [String] :id Identifier for the search to delete. A search ID is provided in the EQL search API's response for an async search. A search ID is also provided if the request’s +keep_on_completion+ parameter is +true+. (*Required*)
28
+ # @option arguments [String] :id Identifier for the search to delete.
29
+ # A search ID is provided in the EQL search API's response for an async search.
30
+ # A search ID is also provided if the request’s +keep_on_completion+ parameter is +true+. (*Required*)
28
31
  # @option arguments [Hash] :headers Custom HTTP headers
29
32
  #
30
33
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html
31
34
  #
32
35
  def delete(arguments = {})
36
+ request_opts = { endpoint: arguments[:endpoint] || "eql.delete" }
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
+
33
44
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
34
45
 
35
46
  arguments = arguments.clone
@@ -44,7 +55,7 @@ module ElasticsearchServerless
44
55
  params = {}
45
56
 
46
57
  ElasticsearchServerless::API::Response.new(
47
- perform_request(method, path, params, body, headers)
58
+ perform_request(method, path, params, body, headers, request_opts)
48
59
  )
49
60
  end
50
61
  end
@@ -22,16 +22,26 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Eql
24
24
  module Actions
25
- # Returns async results from previously executed Event Query Language (EQL) search
25
+ # Returns the current status and available results for an async EQL search or a stored synchronous EQL search.
26
26
  #
27
27
  # @option arguments [String] :id Identifier for the search. (*Required*)
28
- # @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster. Defaults to the keep_alive value set by the search’s EQL search API request.
29
- # @option arguments [Time] :wait_for_completion_timeout Timeout duration to wait for the request to finish. Defaults to no timeout, meaning the request waits for complete search results.
28
+ # @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster.
29
+ # Defaults to the keep_alive value set by the search’s EQL search API request.
30
+ # @option arguments [Time] :wait_for_completion_timeout Timeout duration to wait for the request to finish.
31
+ # Defaults to no timeout, meaning the request waits for complete search results.
30
32
  # @option arguments [Hash] :headers Custom HTTP headers
31
33
  #
32
34
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-async-eql-search-api.html
33
35
  #
34
36
  def get(arguments = {})
37
+ request_opts = { endpoint: arguments[:endpoint] || "eql.get" }
38
+
39
+ defined_params = [:id].inject({}) do |set_variables, variable|
40
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
+ set_variables
42
+ end
43
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
44
+
35
45
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
36
46
 
37
47
  arguments = arguments.clone
@@ -46,7 +56,7 @@ module ElasticsearchServerless
46
56
  params = Utils.process_params(arguments)
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
@@ -22,7 +22,7 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Eql
24
24
  module Actions
25
- # Returns the status of a previously submitted async or stored Event Query Language (EQL) search
25
+ # Returns the current status for an async EQL search or a stored synchronous EQL search without returning results.
26
26
  #
27
27
  # @option arguments [String] :id Identifier for the search. (*Required*)
28
28
  # @option arguments [Hash] :headers Custom HTTP headers
@@ -30,6 +30,14 @@ module ElasticsearchServerless
30
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-async-eql-status-api.html
31
31
  #
32
32
  def get_status(arguments = {})
33
+ request_opts = { endpoint: arguments[:endpoint] || "eql.get_status" }
34
+
35
+ defined_params = [:id].inject({}) do |set_variables, variable|
36
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
37
+ set_variables
38
+ end
39
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
40
+
33
41
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
34
42
 
35
43
  arguments = arguments.clone
@@ -44,7 +52,7 @@ module ElasticsearchServerless
44
52
  params = {}
45
53
 
46
54
  ElasticsearchServerless::API::Response.new(
47
- perform_request(method, path, params, body, headers)
55
+ perform_request(method, path, params, body, headers, request_opts)
48
56
  )
49
57
  end
50
58
  end
@@ -37,6 +37,14 @@ module ElasticsearchServerless
37
37
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html
38
38
  #
39
39
  def search(arguments = {})
40
+ request_opts = { endpoint: arguments[:endpoint] || "eql.search" }
41
+
42
+ defined_params = [:index].inject({}) do |set_variables, variable|
43
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
44
+ set_variables
45
+ end
46
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
47
+
40
48
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
41
49
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
42
50
 
@@ -52,7 +60,7 @@ module ElasticsearchServerless
52
60
  params = Utils.process_params(arguments)
53
61
 
54
62
  ElasticsearchServerless::API::Response.new(
55
- perform_request(method, path, params, body, headers)
63
+ perform_request(method, path, params, body, headers, request_opts)
56
64
  )
57
65
  end
58
66
  end
@@ -0,0 +1,57 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
19
+ # @see https://github.com/elastic/elasticsearch-specification
20
+ #
21
+ module ElasticsearchServerless
22
+ module API
23
+ module Esql
24
+ module Actions
25
+ # Executes an ES|QL request
26
+ # This functionality is Experimental and may be changed or removed
27
+ # completely in a future release. Elastic will take a best effort approach
28
+ # to fix any issues, but experimental features are not subject to the
29
+ # support SLA of official GA features.
30
+ #
31
+ # @option arguments [String] :format A short version of the Accept header, e.g. json, yaml.
32
+ # @option arguments [String] :delimiter The character to use between values within a CSV row. Only valid for the CSV format.
33
+ # @option arguments [Hash] :headers Custom HTTP headers
34
+ # @option arguments [Hash] :body request body
35
+ #
36
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-rest.html
37
+ #
38
+ def query(arguments = {})
39
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
40
+
41
+ arguments = arguments.clone
42
+ headers = arguments.delete(:headers) || {}
43
+
44
+ body = arguments.delete(:body)
45
+
46
+ method = ElasticsearchServerless::API::HTTP_POST
47
+ path = "_query"
48
+ params = Utils.process_params(arguments)
49
+
50
+ ElasticsearchServerless::API::Response.new(
51
+ perform_request(method, path, params, body, headers)
52
+ )
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -21,25 +21,39 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Returns information about whether a document exists in an index.
24
+ # Check a document.
25
+ # Checks if a specified document exists.
25
26
  #
26
27
  # @option arguments [String] :id Identifier of the document. (*Required*)
27
- # @option arguments [String] :index Comma-separated list of data streams, indices, and aliases. Supports wildcards (+*+). (*Required*)
28
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default.
28
+ # @option arguments [String] :index Comma-separated list of data streams, indices, and aliases.
29
+ # Supports wildcards (+*+). (*Required*)
30
+ # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
31
+ # Random by default.
29
32
  # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true.
30
33
  # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes all shards involved in the delete by query after the request completes.
31
34
  # @option arguments [String] :routing Target the specified primary shard.
32
35
  # @option arguments [Boolean, String, Array<String>] :_source +true+ or +false+ to return the +_source+ field or not, or a list of fields to return.
33
36
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
34
37
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
35
- # @option arguments [String, Array<String>] :stored_fields List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the +_source+ parameter defaults to false.
36
- # @option arguments [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
38
+ # @option arguments [String, Array<String>] :stored_fields List of stored fields to return as part of a hit.
39
+ # If no fields are specified, no stored fields are included in the response.
40
+ # If this field is specified, the +_source+ parameter defaults to false.
41
+ # @option arguments [Integer] :version Explicit version number for concurrency control.
42
+ # The specified version must match the current version of the document for the request to succeed.
37
43
  # @option arguments [String] :version_type Specific version type: +external+, +external_gte+.
38
44
  # @option arguments [Hash] :headers Custom HTTP headers
39
45
  #
40
46
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
41
47
  #
42
48
  def exists(arguments = {})
49
+ request_opts = { endpoint: arguments[:endpoint] || "exists" }
50
+
51
+ defined_params = [:index, :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
+
43
57
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
44
58
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
45
59
 
@@ -57,7 +71,7 @@ module ElasticsearchServerless
57
71
  params = Utils.process_params(arguments)
58
72
 
59
73
  Utils.rescue_from_not_found do
60
- perform_request(method, path, params, body, headers).status == 200 ? true : false
74
+ perform_request(method, path, params, body, headers, request_opts).status == 200 ? true : false
61
75
  end
62
76
  end
63
77
 
@@ -21,24 +21,36 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Returns information about whether a document source exists in an index.
24
+ # Check for a document source.
25
+ # Checks if a document's +_source+ is stored.
25
26
  #
26
27
  # @option arguments [String] :id Identifier of the document. (*Required*)
27
- # @option arguments [String] :index Comma-separated list of data streams, indices, and aliases. Supports wildcards (+*+). (*Required*)
28
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default.
28
+ # @option arguments [String] :index Comma-separated list of data streams, indices, and aliases.
29
+ # Supports wildcards (+*+). (*Required*)
30
+ # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
31
+ # Random by default.
29
32
  # @option arguments [Boolean] :realtime If true, the request is real-time as opposed to near-real-time. Server default: true.
30
33
  # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes all shards involved in the delete by query after the request completes.
31
34
  # @option arguments [String] :routing Target the specified primary shard.
32
35
  # @option arguments [Boolean, String, Array<String>] :_source +true+ or +false+ to return the +_source+ field or not, or a list of fields to return.
33
36
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
34
37
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
35
- # @option arguments [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
38
+ # @option arguments [Integer] :version Explicit version number for concurrency control.
39
+ # The specified version must match the current version of the document for the request to succeed.
36
40
  # @option arguments [String] :version_type Specific version type: +external+, +external_gte+.
37
41
  # @option arguments [Hash] :headers Custom HTTP headers
38
42
  #
39
43
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
40
44
  #
41
45
  def exists_source(arguments = {})
46
+ request_opts = { endpoint: arguments[:endpoint] || "exists_source" }
47
+
48
+ defined_params = [:index, :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
+
42
54
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
43
55
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
44
56
 
@@ -56,7 +68,7 @@ module ElasticsearchServerless
56
68
  params = Utils.process_params(arguments)
57
69
 
58
70
  ElasticsearchServerless::API::Response.new(
59
- perform_request(method, path, params, body, headers)
71
+ perform_request(method, path, params, body, headers, request_opts)
60
72
  )
61
73
  end
62
74
 
@@ -21,16 +21,20 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Returns information about why a specific matches (or doesn't match) a query.
24
+ # Explain a document match result.
25
+ # Returns information about why a specific document matches, or doesn’t match, a query.
25
26
  #
26
27
  # @option arguments [String] :id Defines the document ID. (*Required*)
27
- # @option arguments [String] :index Index names used to limit the request. Only a single index name can be provided to this parameter. (*Required*)
28
- # @option arguments [String] :analyzer Analyzer to use for the query string. This parameter can only be used when the +q+ query string parameter is specified.
28
+ # @option arguments [String] :index Index names used to limit the request.
29
+ # Only a single index name can be provided to this parameter. (*Required*)
30
+ # @option arguments [String] :analyzer Analyzer to use for the query string.
31
+ # This parameter can only be used when the +q+ query string parameter is specified.
29
32
  # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed.
30
33
  # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. Server default: OR.
31
34
  # @option arguments [String] :df Field to use as default where no field prefix is given in the query string.
32
35
  # @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.
33
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default.
36
+ # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
37
+ # Random by default.
34
38
  # @option arguments [String] :routing Custom value used to route operations to a specific shard.
35
39
  # @option arguments [Boolean, String, Array<String>] :_source True or false to return the +_source+ field or not, or a list of fields to return.
36
40
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
@@ -43,6 +47,14 @@ module ElasticsearchServerless
43
47
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html
44
48
  #
45
49
  def explain(arguments = {})
50
+ request_opts = { endpoint: arguments[:endpoint] || "explain" }
51
+
52
+ defined_params = [:index, :id].inject({}) do |set_variables, variable|
53
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
54
+ set_variables
55
+ end
56
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
57
+
46
58
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
47
59
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
48
60
 
@@ -65,7 +77,7 @@ module ElasticsearchServerless
65
77
  params = Utils.process_params(arguments)
66
78
 
67
79
  ElasticsearchServerless::API::Response.new(
68
- perform_request(method, path, params, body, headers)
80
+ perform_request(method, path, params, body, headers, request_opts)
69
81
  )
70
82
  end
71
83
  end
@@ -21,22 +21,35 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Returns the information about the capabilities of fields among multiple indices.
24
+ # The field capabilities API returns the information about the capabilities of fields among multiple indices.
25
+ # The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type
26
+ # of keyword is returned as any other field that belongs to the +keyword+ family.
25
27
  #
26
28
  # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.
27
- # @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.
29
+ # @option arguments [Boolean] :allow_no_indices If false, the request returns an error if any wildcard expression, index alias,
30
+ # or +_all+ value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request
31
+ # targeting +foo*,bar*+ returns an error if an index starts with foo but no index starts with bar. Server default: true.
28
32
  # @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+. Server default: open.
29
33
  # @option arguments [String, Array<String>] :fields Comma-separated list of fields to retrieve capabilities for. Wildcard (+*+) expressions are supported.
30
34
  # @option arguments [Boolean] :ignore_unavailable If +true+, missing or closed indices are not included in the response.
31
35
  # @option arguments [Boolean] :include_unmapped If true, unmapped fields are included in the response.
32
36
  # @option arguments [String] :filters An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent
33
37
  # @option arguments [Array<String>] :types Only return results for fields that have one of the types in the list
38
+ # @option arguments [Boolean] :include_empty_fields If false, empty fields are not included in the response. Server default: true.
34
39
  # @option arguments [Hash] :headers Custom HTTP headers
35
40
  # @option arguments [Hash] :body request body
36
41
  #
37
42
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html
38
43
  #
39
44
  def field_caps(arguments = {})
45
+ request_opts = { endpoint: arguments[:endpoint] || "field_caps" }
46
+
47
+ defined_params = [:index].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
+
40
53
  arguments = arguments.clone
41
54
  headers = arguments.delete(:headers) || {}
42
55
 
@@ -58,7 +71,7 @@ module ElasticsearchServerless
58
71
  params = Utils.process_params(arguments)
59
72
 
60
73
  ElasticsearchServerless::API::Response.new(
61
- perform_request(method, path, params, body, headers)
74
+ perform_request(method, path, params, body, headers, request_opts)
62
75
  )
63
76
  end
64
77
  end
@@ -21,10 +21,14 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Returns a document.
24
+ # Get a document by its ID.
25
+ # Retrieves the document with the specified ID from an index.
25
26
  #
26
27
  # @option arguments [String] :id Unique identifier of the document. (*Required*)
27
28
  # @option arguments [String] :index Name of the index that contains the document. (*Required*)
29
+ # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source?
30
+ # Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance.
31
+ # Fetches with this enabled will be slower the enabling synthetic source natively in the index.
28
32
  # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default.
29
33
  # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true.
30
34
  # @option arguments [Boolean] :refresh If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes.
@@ -32,7 +36,9 @@ module ElasticsearchServerless
32
36
  # @option arguments [Boolean, String, Array<String>] :_source True or false to return the _source field or not, or a list of fields to return.
33
37
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
34
38
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
35
- # @option arguments [String, Array<String>] :stored_fields List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the +_source+ parameter defaults to false.
39
+ # @option arguments [String, Array<String>] :stored_fields List of stored fields to return as part of a hit.
40
+ # If no fields are specified, no stored fields are included in the response.
41
+ # If this field is specified, the +_source+ parameter defaults to false.
36
42
  # @option arguments [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
37
43
  # @option arguments [String] :version_type Specific version type: internal, external, external_gte.
38
44
  # @option arguments [Hash] :headers Custom HTTP headers
@@ -40,6 +46,14 @@ module ElasticsearchServerless
40
46
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
41
47
  #
42
48
  def get(arguments = {})
49
+ request_opts = { endpoint: arguments[:endpoint] || "get" }
50
+
51
+ defined_params = [:index, :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
+
43
57
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
44
58
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
45
59
 
@@ -59,12 +73,12 @@ module ElasticsearchServerless
59
73
  if Array(arguments[:ignore]).include?(404)
60
74
  Utils.rescue_from_not_found {
61
75
  ElasticsearchServerless::API::Response.new(
62
- perform_request(method, path, params, body, headers)
76
+ perform_request(method, path, params, body, headers, request_opts)
63
77
  )
64
78
  }
65
79
  else
66
80
  ElasticsearchServerless::API::Response.new(
67
- perform_request(method, path, params, body, headers)
81
+ perform_request(method, path, params, body, headers, request_opts)
68
82
  )
69
83
  end
70
84
  end
@@ -21,7 +21,8 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Returns a script.
24
+ # Get a script or search template.
25
+ # Retrieves a stored script or search template.
25
26
  #
26
27
  # @option arguments [String] :id Identifier for the stored script or search template. (*Required*)
27
28
  # @option arguments [Time] :master_timeout Specify timeout for connection to master
@@ -30,6 +31,14 @@ module ElasticsearchServerless
30
31
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
31
32
  #
32
33
  def get_script(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || "get_script" }
35
+
36
+ defined_params = [: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
+
33
42
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
34
43
 
35
44
  arguments = arguments.clone
@@ -44,7 +53,7 @@ module ElasticsearchServerless
44
53
  params = Utils.process_params(arguments)
45
54
 
46
55
  ElasticsearchServerless::API::Response.new(
47
- perform_request(method, path, params, body, headers)
56
+ perform_request(method, path, params, body, headers, request_opts)
48
57
  )
49
58
  end
50
59
  end
@@ -21,6 +21,7 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
+ # Get a document's source.
24
25
  # Returns the source of a document.
25
26
  #
26
27
  # @option arguments [String] :id Unique identifier of the document. (*Required*)
@@ -40,6 +41,14 @@ module ElasticsearchServerless
40
41
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
41
42
  #
42
43
  def get_source(arguments = {})
44
+ request_opts = { endpoint: arguments[:endpoint] || "get_source" }
45
+
46
+ defined_params = [:index, :id].inject({}) do |set_variables, variable|
47
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
48
+ set_variables
49
+ end
50
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
51
+
43
52
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
44
53
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
45
54
 
@@ -57,7 +66,7 @@ module ElasticsearchServerless
57
66
  params = Utils.process_params(arguments)
58
67
 
59
68
  ElasticsearchServerless::API::Response.new(
60
- perform_request(method, path, params, body, headers)
69
+ perform_request(method, path, params, body, headers, request_opts)
61
70
  )
62
71
  end
63
72
  end
@@ -22,17 +22,27 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Graph
24
24
  module Actions
25
- # Explore extracted and summarized information about the documents and terms in an index.
25
+ # Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index.
26
26
  #
27
27
  # @option arguments [String, Array] :index Name of the index. (*Required*)
28
28
  # @option arguments [String] :routing Custom value used to route operations to a specific shard.
29
- # @option arguments [Time] :timeout Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.
29
+ # @option arguments [Time] :timeout Specifies the period of time to wait for a response from each shard.
30
+ # If no response is received before the timeout expires, the request fails and returns an error.
31
+ # Defaults to no timeout.
30
32
  # @option arguments [Hash] :headers Custom HTTP headers
31
33
  # @option arguments [Hash] :body request body
32
34
  #
33
35
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html
34
36
  #
35
37
  def explore(arguments = {})
38
+ request_opts = { endpoint: arguments[:endpoint] || "graph.explore" }
39
+
40
+ defined_params = [:index].inject({}) do |set_variables, variable|
41
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
42
+ set_variables
43
+ end
44
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
45
+
36
46
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
37
47
 
38
48
  arguments = arguments.clone
@@ -52,7 +62,7 @@ module ElasticsearchServerless
52
62
  params = Utils.process_params(arguments)
53
63
 
54
64
  ElasticsearchServerless::API::Response.new(
55
- perform_request(method, path, params, body, headers)
65
+ perform_request(method, path, params, body, headers, request_opts)
56
66
  )
57
67
  end
58
68
  end