elasticsearch-serverless 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch-serverless/api/async_search/delete.rb +3 -4
  3. data/lib/elasticsearch-serverless/api/async_search/get.rb +4 -5
  4. data/lib/elasticsearch-serverless/api/async_search/status.rb +11 -8
  5. data/lib/elasticsearch-serverless/api/async_search/submit.rb +6 -10
  6. data/lib/elasticsearch-serverless/api/bulk.rb +109 -22
  7. data/lib/elasticsearch-serverless/api/cat/aliases.rb +17 -18
  8. data/lib/elasticsearch-serverless/api/cat/component_templates.rb +17 -16
  9. data/lib/elasticsearch-serverless/api/cat/count.rb +13 -18
  10. data/lib/elasticsearch-serverless/api/cat/help.rb +5 -19
  11. data/lib/elasticsearch-serverless/api/cat/indices.rb +10 -15
  12. data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +7 -17
  13. data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +6 -16
  14. data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +6 -16
  15. data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +7 -16
  16. data/lib/elasticsearch-serverless/api/cat/transforms.rb +6 -16
  17. data/lib/elasticsearch-serverless/api/clear_scroll.rb +9 -7
  18. data/lib/elasticsearch-serverless/api/close_point_in_time.rb +8 -4
  19. data/lib/elasticsearch-serverless/api/cluster/delete_component_template.rb +3 -5
  20. data/lib/elasticsearch-serverless/api/cluster/exists_component_template.rb +4 -5
  21. data/lib/elasticsearch-serverless/api/cluster/get_component_template.rb +5 -6
  22. data/lib/elasticsearch-serverless/api/cluster/info.rb +3 -4
  23. data/lib/elasticsearch-serverless/api/cluster/put_component_template.rb +6 -5
  24. data/lib/elasticsearch-serverless/api/connector/check_in.rb +3 -4
  25. data/lib/elasticsearch-serverless/api/connector/delete.rb +4 -4
  26. data/lib/elasticsearch-serverless/api/connector/get.rb +5 -5
  27. data/lib/elasticsearch-serverless/api/connector/list.rb +4 -3
  28. data/lib/elasticsearch-serverless/api/connector/post.rb +3 -3
  29. data/lib/elasticsearch-serverless/api/connector/put.rb +4 -5
  30. data/lib/elasticsearch-serverless/api/connector/sync_job_cancel.rb +7 -6
  31. data/lib/elasticsearch-serverless/api/connector/sync_job_delete.rb +7 -6
  32. data/lib/elasticsearch-serverless/api/connector/sync_job_get.rb +7 -6
  33. data/lib/elasticsearch-serverless/api/connector/sync_job_list.rb +3 -3
  34. data/lib/elasticsearch-serverless/api/connector/sync_job_post.rb +3 -3
  35. data/lib/elasticsearch-serverless/api/connector/update_active_filtering.rb +3 -4
  36. data/lib/elasticsearch-serverless/api/connector/update_api_key_id.rb +3 -4
  37. data/lib/elasticsearch-serverless/api/connector/update_configuration.rb +3 -4
  38. data/lib/elasticsearch-serverless/api/connector/update_error.rb +3 -4
  39. data/lib/elasticsearch-serverless/api/connector/update_filtering.rb +3 -4
  40. data/lib/elasticsearch-serverless/api/connector/update_filtering_validation.rb +2 -3
  41. data/lib/elasticsearch-serverless/api/connector/update_index_name.rb +3 -4
  42. data/lib/elasticsearch-serverless/api/connector/update_name.rb +3 -4
  43. data/lib/elasticsearch-serverless/api/connector/update_native.rb +2 -3
  44. data/lib/elasticsearch-serverless/api/connector/update_pipeline.rb +3 -4
  45. data/lib/elasticsearch-serverless/api/connector/update_scheduling.rb +3 -4
  46. data/lib/elasticsearch-serverless/api/connector/update_service_type.rb +3 -4
  47. data/lib/elasticsearch-serverless/api/connector/update_status.rb +3 -4
  48. data/lib/elasticsearch-serverless/api/count.rb +36 -25
  49. data/lib/elasticsearch-serverless/api/create.rb +77 -22
  50. data/lib/elasticsearch-serverless/api/delete.rb +44 -18
  51. data/lib/elasticsearch-serverless/api/delete_by_query.rb +91 -29
  52. data/lib/elasticsearch-serverless/api/delete_script.rb +10 -9
  53. data/lib/elasticsearch-serverless/api/enrich/delete_policy.rb +5 -5
  54. data/lib/elasticsearch-serverless/api/enrich/execute_policy.rb +6 -5
  55. data/lib/elasticsearch-serverless/api/enrich/get_policy.rb +6 -6
  56. data/lib/elasticsearch-serverless/api/enrich/put_policy.rb +5 -5
  57. data/lib/elasticsearch-serverless/api/eql/delete.rb +5 -5
  58. data/lib/elasticsearch-serverless/api/eql/get.rb +5 -5
  59. data/lib/elasticsearch-serverless/api/eql/get_status.rb +5 -5
  60. data/lib/elasticsearch-serverless/api/eql/search.rb +9 -5
  61. data/lib/elasticsearch-serverless/api/exists.rb +38 -19
  62. data/lib/elasticsearch-serverless/api/exists_source.rb +23 -18
  63. data/lib/elasticsearch-serverless/api/explain.rb +25 -16
  64. data/lib/elasticsearch-serverless/api/field_caps.rb +16 -13
  65. data/lib/elasticsearch-serverless/api/get.rb +71 -21
  66. data/lib/elasticsearch-serverless/api/get_script.rb +7 -6
  67. data/lib/elasticsearch-serverless/api/get_source.rb +25 -15
  68. data/lib/elasticsearch-serverless/api/graph/explore.rb +9 -5
  69. data/lib/elasticsearch-serverless/api/index.rb +110 -21
  70. data/lib/elasticsearch-serverless/api/indices/add_block.rb +23 -12
  71. data/lib/elasticsearch-serverless/api/indices/analyze.rb +9 -6
  72. data/lib/elasticsearch-serverless/api/indices/create.rb +19 -6
  73. data/lib/elasticsearch-serverless/api/indices/create_data_stream.rb +3 -5
  74. data/lib/elasticsearch-serverless/api/indices/delete.rb +11 -8
  75. data/lib/elasticsearch-serverless/api/indices/delete_alias.rb +4 -7
  76. data/lib/elasticsearch-serverless/api/indices/delete_data_stream.rb +3 -4
  77. data/lib/elasticsearch-serverless/api/indices/delete_index_template.rb +3 -4
  78. data/lib/elasticsearch-serverless/api/indices/exists.rb +7 -8
  79. data/lib/elasticsearch-serverless/api/indices/exists_alias.rb +8 -8
  80. data/lib/elasticsearch-serverless/api/indices/exists_index_template.rb +6 -6
  81. data/lib/elasticsearch-serverless/api/indices/explain_data_lifecycle.rb +4 -5
  82. data/lib/elasticsearch-serverless/api/indices/get.rb +5 -6
  83. data/lib/elasticsearch-serverless/api/indices/get_alias.rb +6 -6
  84. data/lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb +4 -5
  85. data/lib/elasticsearch-serverless/api/indices/get_data_stream.rb +5 -6
  86. data/lib/elasticsearch-serverless/api/indices/get_index_template.rb +5 -6
  87. data/lib/elasticsearch-serverless/api/indices/get_mapping.rb +4 -6
  88. data/lib/elasticsearch-serverless/api/indices/get_settings.rb +6 -7
  89. data/lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb +3 -4
  90. data/lib/elasticsearch-serverless/api/indices/modify_data_stream.rb +3 -3
  91. data/lib/elasticsearch-serverless/api/indices/put_alias.rb +4 -7
  92. data/lib/elasticsearch-serverless/api/indices/put_data_lifecycle.rb +4 -6
  93. data/lib/elasticsearch-serverless/api/indices/put_index_template.rb +22 -4
  94. data/lib/elasticsearch-serverless/api/indices/put_mapping.rb +21 -6
  95. data/lib/elasticsearch-serverless/api/indices/put_settings.rb +17 -7
  96. data/lib/elasticsearch-serverless/api/indices/refresh.rb +11 -5
  97. data/lib/elasticsearch-serverless/api/indices/resolve_index.rb +5 -5
  98. data/lib/elasticsearch-serverless/api/indices/rollover.rb +28 -5
  99. data/lib/elasticsearch-serverless/api/indices/simulate_index_template.rb +4 -5
  100. data/lib/elasticsearch-serverless/api/indices/simulate_template.rb +5 -6
  101. data/lib/elasticsearch-serverless/api/indices/update_aliases.rb +3 -3
  102. data/lib/elasticsearch-serverless/api/indices/validate_query.rb +4 -5
  103. data/lib/elasticsearch-serverless/api/inference/chat_completion_unified.rb +62 -0
  104. data/lib/elasticsearch-serverless/api/inference/completion.rb +62 -0
  105. data/lib/elasticsearch-serverless/api/inference/delete.rb +6 -11
  106. data/lib/elasticsearch-serverless/api/inference/get.rb +4 -9
  107. data/lib/elasticsearch-serverless/api/inference/inference.rb +0 -4
  108. data/lib/elasticsearch-serverless/api/inference/put.rb +12 -9
  109. data/lib/elasticsearch-serverless/api/inference/put_watsonx.rb +78 -0
  110. data/lib/elasticsearch-serverless/api/inference/rerank.rb +62 -0
  111. data/lib/elasticsearch-serverless/api/inference/sparse_embedding.rb +62 -0
  112. data/lib/elasticsearch-serverless/api/inference/text_embedding.rb +62 -0
  113. data/lib/elasticsearch-serverless/api/info.rb +4 -4
  114. data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +5 -5
  115. data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +6 -6
  116. data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +5 -4
  117. data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +3 -4
  118. data/lib/elasticsearch-serverless/api/ingest/simulate.rb +9 -8
  119. data/lib/elasticsearch-serverless/api/license/get.rb +4 -5
  120. data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +7 -6
  121. data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +7 -7
  122. data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +7 -6
  123. data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +3 -4
  124. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +4 -5
  125. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +3 -4
  126. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +3 -4
  127. data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +3 -4
  128. data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +3 -4
  129. data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +3 -4
  130. data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +3 -4
  131. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +4 -4
  132. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +3 -4
  133. data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +5 -5
  134. data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +3 -3
  135. data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +3 -4
  136. data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +3 -4
  137. data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +4 -5
  138. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +4 -5
  139. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +4 -5
  140. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +4 -5
  141. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +4 -5
  142. data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +4 -5
  143. data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +4 -5
  144. data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +4 -5
  145. data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +3 -4
  146. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +4 -5
  147. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +4 -5
  148. data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +3 -9
  149. data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +3 -4
  150. data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +3 -4
  151. data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +5 -6
  152. data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +4 -5
  153. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +3 -4
  154. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +3 -4
  155. data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +6 -4
  156. data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +6 -6
  157. data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +3 -4
  158. data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +16 -5
  159. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +3 -4
  160. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +3 -4
  161. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +3 -4
  162. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +3 -4
  163. data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +3 -4
  164. data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +3 -4
  165. data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +3 -4
  166. data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +7 -6
  167. data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +3 -4
  168. data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +3 -4
  169. data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +3 -4
  170. data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +3 -4
  171. data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +3 -4
  172. data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +3 -4
  173. data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +3 -4
  174. data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +3 -4
  175. data/lib/elasticsearch-serverless/api/mget.rb +12 -5
  176. data/lib/elasticsearch-serverless/api/msearch.rb +16 -17
  177. data/lib/elasticsearch-serverless/api/msearch_template.rb +23 -16
  178. data/lib/elasticsearch-serverless/api/mtermvectors.rb +15 -12
  179. data/lib/elasticsearch-serverless/api/open_point_in_time.rb +33 -11
  180. data/lib/elasticsearch-serverless/api/ping.rb +8 -10
  181. data/lib/elasticsearch-serverless/api/put_script.rb +12 -11
  182. data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +6 -5
  183. data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +6 -5
  184. data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +5 -5
  185. data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +5 -5
  186. data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +7 -6
  187. data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +11 -7
  188. data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +11 -6
  189. data/lib/elasticsearch-serverless/api/query_rules/test.rb +5 -5
  190. data/lib/elasticsearch-serverless/api/rank_eval.rb +8 -7
  191. data/lib/elasticsearch-serverless/api/reindex.rb +146 -9
  192. data/lib/elasticsearch-serverless/api/render_search_template.rb +7 -7
  193. data/lib/elasticsearch-serverless/api/response.rb +1 -1
  194. data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +7 -3
  195. data/lib/elasticsearch-serverless/api/scroll.rb +4 -4
  196. data/lib/elasticsearch-serverless/api/search.rb +79 -72
  197. data/lib/elasticsearch-serverless/api/search_application/delete.rb +4 -5
  198. data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +3 -4
  199. data/lib/elasticsearch-serverless/api/search_application/get.rb +3 -4
  200. data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +4 -5
  201. data/lib/elasticsearch-serverless/api/search_application/list.rb +5 -4
  202. data/lib/elasticsearch-serverless/api/search_application/put.rb +3 -4
  203. data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +3 -4
  204. data/lib/elasticsearch-serverless/api/search_application/search.rb +3 -4
  205. data/lib/elasticsearch-serverless/api/search_mvt.rb +132 -10
  206. data/lib/elasticsearch-serverless/api/search_template.rb +13 -13
  207. data/lib/elasticsearch-serverless/api/security/authenticate.rb +3 -3
  208. data/lib/elasticsearch-serverless/api/security/create_api_key.rb +7 -3
  209. data/lib/elasticsearch-serverless/api/security/delete_role.rb +6 -5
  210. data/lib/elasticsearch-serverless/api/security/get_api_key.rb +3 -3
  211. data/lib/elasticsearch-serverless/api/security/get_builtin_privileges.rb +3 -3
  212. data/lib/elasticsearch-serverless/api/security/get_role.rb +11 -8
  213. data/lib/elasticsearch-serverless/api/security/has_privileges.rb +6 -5
  214. data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +8 -6
  215. data/lib/elasticsearch-serverless/api/security/put_role.rb +3 -4
  216. data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +12 -6
  217. data/lib/elasticsearch-serverless/api/security/query_role.rb +61 -0
  218. data/lib/elasticsearch-serverless/api/security/update_api_key.rb +74 -0
  219. data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +4 -4
  220. data/lib/elasticsearch-serverless/api/sql/delete_async.rb +10 -6
  221. data/lib/elasticsearch-serverless/api/sql/get_async.rb +16 -13
  222. data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +6 -6
  223. data/lib/elasticsearch-serverless/api/sql/query.rb +8 -5
  224. data/lib/elasticsearch-serverless/api/sql/translate.rb +6 -4
  225. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +17 -6
  226. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +7 -7
  227. data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +7 -8
  228. data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +7 -7
  229. data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +7 -6
  230. data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -6
  231. data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -7
  232. data/lib/elasticsearch-serverless/api/tasks/get.rb +9 -7
  233. data/lib/elasticsearch-serverless/api/terms_enum.rb +7 -9
  234. data/lib/elasticsearch-serverless/api/termvectors.rb +40 -17
  235. data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +3 -5
  236. data/lib/elasticsearch-serverless/api/transform/get_transform.rb +5 -6
  237. data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +4 -5
  238. data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +4 -5
  239. data/lib/elasticsearch-serverless/api/transform/put_transform.rb +3 -4
  240. data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +4 -5
  241. data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +7 -8
  242. data/lib/elasticsearch-serverless/api/transform/start_transform.rb +3 -5
  243. data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +3 -4
  244. data/lib/elasticsearch-serverless/api/transform/update_transform.rb +3 -4
  245. data/lib/elasticsearch-serverless/api/update.rb +36 -24
  246. data/lib/elasticsearch-serverless/api/update_by_query.rb +102 -31
  247. data/lib/elasticsearch-serverless/api.rb +22 -25
  248. data/lib/elasticsearch-serverless/version.rb +1 -1
  249. data/lib/elasticsearch-serverless.rb +7 -0
  250. metadata +18 -7
@@ -23,7 +23,7 @@ module ElasticsearchServerless
23
23
  module Indices
24
24
  module Actions
25
25
  # Get index information.
26
- # Returns information about one or more indices. For data streams, the API returns information about the
26
+ # Get information about one or more indices. For data streams, the API returns information about the
27
27
  # stream’s backing indices.
28
28
  #
29
29
  # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and index aliases used to limit the request.
@@ -42,14 +42,13 @@ module ElasticsearchServerless
42
42
  # @option arguments [String, Array<String>] :features Return only information on specified index features Server default: ['aliases', 'mappings', 'settings'].
43
43
  # @option arguments [Hash] :headers Custom HTTP headers
44
44
  #
45
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get
46
46
  #
47
47
  def get(arguments = {})
48
- request_opts = { endpoint: arguments[:endpoint] || "indices.get" }
48
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.get' }
49
49
 
50
- defined_params = [:index].inject({}) do |set_variables, variable|
50
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
51
51
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
- set_variables
53
52
  end
54
53
  request_opts[:defined_params] = defined_params unless defined_params.empty?
55
54
 
@@ -63,7 +62,7 @@ module ElasticsearchServerless
63
62
  _index = arguments.delete(:index)
64
63
 
65
64
  method = ElasticsearchServerless::API::HTTP_GET
66
- path = "#{Utils.listify(_index)}"
65
+ path = Utils.listify(_index).to_s
67
66
  params = Utils.process_params(arguments)
68
67
 
69
68
  ElasticsearchServerless::API::Response.new(
@@ -38,17 +38,17 @@ module ElasticsearchServerless
38
38
  # Supports comma-separated values, such as +open,hidden+.
39
39
  # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open.
40
40
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
41
- # @option arguments [Boolean] :local If +true+, the request retrieves information from the local node only.
41
+ # @option arguments [Time] :master_timeout Period to wait for a connection to the master node.
42
+ # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
42
43
  # @option arguments [Hash] :headers Custom HTTP headers
43
44
  #
44
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-alias
45
46
  #
46
47
  def get_alias(arguments = {})
47
- request_opts = { endpoint: arguments[:endpoint] || "indices.get_alias" }
48
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.get_alias' }
48
49
 
49
- defined_params = [:name, :index].inject({}) do |set_variables, variable|
50
+ defined_params = [:name, :index].each_with_object({}) do |variable, set_variables|
50
51
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
51
- set_variables
52
52
  end
53
53
  request_opts[:defined_params] = defined_params unless defined_params.empty?
54
54
 
@@ -69,7 +69,7 @@ module ElasticsearchServerless
69
69
  elsif _name
70
70
  "_alias/#{Utils.listify(_name)}"
71
71
  else
72
- "_alias"
72
+ '_alias'
73
73
  end
74
74
  params = Utils.process_params(arguments)
75
75
 
@@ -23,7 +23,7 @@ module ElasticsearchServerless
23
23
  module Indices
24
24
  module Actions
25
25
  # Get data stream lifecycles.
26
- # Retrieves the data stream lifecycle configuration of one or more data streams.
26
+ # Get the data stream lifecycle configuration of one or more data streams.
27
27
  #
28
28
  # @option arguments [String, Array<String>] :name Comma-separated list of data streams to limit the request.
29
29
  # Supports wildcards (+*+).
@@ -35,14 +35,13 @@ module ElasticsearchServerless
35
35
  # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
36
36
  # @option arguments [Hash] :headers Custom HTTP headers
37
37
  #
38
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle.html
38
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-lifecycle
39
39
  #
40
40
  def get_data_lifecycle(arguments = {})
41
- request_opts = { endpoint: arguments[:endpoint] || "indices.get_data_lifecycle" }
41
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_lifecycle' }
42
42
 
43
- defined_params = [:name].inject({}) do |set_variables, variable|
43
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
44
44
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
45
- set_variables
46
45
  end
47
46
  request_opts[:defined_params] = defined_params unless defined_params.empty?
48
47
 
@@ -23,7 +23,7 @@ module ElasticsearchServerless
23
23
  module Indices
24
24
  module Actions
25
25
  # Get data streams.
26
- # Retrieves information about one or more data streams.
26
+ # Get information about one or more data streams.
27
27
  #
28
28
  # @option arguments [String, Array<String>] :name Comma-separated list of data stream names used to limit the request.
29
29
  # Wildcard (+*+) expressions are supported. If omitted, all data streams are returned.
@@ -34,14 +34,13 @@ module ElasticsearchServerless
34
34
  # @option arguments [Boolean] :verbose Whether the maximum timestamp for each data stream should be calculated and returned.
35
35
  # @option arguments [Hash] :headers Custom HTTP headers
36
36
  #
37
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
37
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream
38
38
  #
39
39
  def get_data_stream(arguments = {})
40
- request_opts = { endpoint: arguments[:endpoint] || "indices.get_data_stream" }
40
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_stream' }
41
41
 
42
- defined_params = [:name].inject({}) do |set_variables, variable|
42
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
43
43
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
44
- set_variables
45
44
  end
46
45
  request_opts[:defined_params] = defined_params unless defined_params.empty?
47
46
 
@@ -56,7 +55,7 @@ module ElasticsearchServerless
56
55
  path = if _name
57
56
  "_data_stream/#{Utils.listify(_name)}"
58
57
  else
59
- "_data_stream"
58
+ '_data_stream'
60
59
  end
61
60
  params = Utils.process_params(arguments)
62
61
 
@@ -23,7 +23,7 @@ module ElasticsearchServerless
23
23
  module Indices
24
24
  module Actions
25
25
  # Get index templates.
26
- # Returns information about one or more index templates.
26
+ # Get information about one or more index templates.
27
27
  #
28
28
  # @option arguments [String] :name Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported.
29
29
  # @option arguments [Boolean] :local If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.
@@ -32,14 +32,13 @@ module ElasticsearchServerless
32
32
  # @option arguments [Boolean] :include_defaults If true, returns all relevant default configurations for the index template.
33
33
  # @option arguments [Hash] :headers Custom HTTP headers
34
34
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-index-template
36
36
  #
37
37
  def get_index_template(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "indices.get_index_template" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.get_index_template' }
39
39
 
40
- defined_params = [:name].inject({}) do |set_variables, variable|
40
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
41
41
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
42
- set_variables
43
42
  end
44
43
  request_opts[:defined_params] = defined_params unless defined_params.empty?
45
44
 
@@ -54,7 +53,7 @@ module ElasticsearchServerless
54
53
  path = if _name
55
54
  "_index_template/#{Utils.listify(_name)}"
56
55
  else
57
- "_index_template"
56
+ '_index_template'
58
57
  end
59
58
  params = Utils.process_params(arguments)
60
59
 
@@ -23,7 +23,6 @@ module ElasticsearchServerless
23
23
  module Indices
24
24
  module Actions
25
25
  # Get mapping definitions.
26
- # Retrieves mapping definitions for one or more indices.
27
26
  # For data streams, the API retrieves mappings for the stream’s backing indices.
28
27
  #
29
28
  # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request.
@@ -41,14 +40,13 @@ module ElasticsearchServerless
41
40
  # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
42
41
  # @option arguments [Hash] :headers Custom HTTP headers
43
42
  #
44
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html
43
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping
45
44
  #
46
45
  def get_mapping(arguments = {})
47
- request_opts = { endpoint: arguments[:endpoint] || "indices.get_mapping" }
46
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.get_mapping' }
48
47
 
49
- defined_params = [:index].inject({}) do |set_variables, variable|
48
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
50
49
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
51
- set_variables
52
50
  end
53
51
  request_opts[:defined_params] = defined_params unless defined_params.empty?
54
52
 
@@ -63,7 +61,7 @@ module ElasticsearchServerless
63
61
  path = if _index
64
62
  "#{Utils.listify(_index)}/_mapping"
65
63
  else
66
- "_mapping"
64
+ '_mapping'
67
65
  end
68
66
  params = Utils.process_params(arguments)
69
67
 
@@ -23,8 +23,8 @@ module ElasticsearchServerless
23
23
  module Indices
24
24
  module Actions
25
25
  # Get index settings.
26
- # Returns setting information for one or more indices. For data streams,
27
- # returns setting information for the streams backing indices.
26
+ # Get setting information for one or more indices.
27
+ # For data streams, it returns setting information for the stream's backing indices.
28
28
  #
29
29
  # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit
30
30
  # the request. Supports wildcards (+*+). To target all data streams and
@@ -48,14 +48,13 @@ module ElasticsearchServerless
48
48
  # error. Server default: 30s.
49
49
  # @option arguments [Hash] :headers Custom HTTP headers
50
50
  #
51
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html
51
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-settings
52
52
  #
53
53
  def get_settings(arguments = {})
54
- request_opts = { endpoint: arguments[:endpoint] || "indices.get_settings" }
54
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.get_settings' }
55
55
 
56
- defined_params = [:index, :name].inject({}) do |set_variables, variable|
56
+ defined_params = [:index, :name].each_with_object({}) do |variable, set_variables|
57
57
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
58
- set_variables
59
58
  end
60
59
  request_opts[:defined_params] = defined_params unless defined_params.empty?
61
60
 
@@ -76,7 +75,7 @@ module ElasticsearchServerless
76
75
  elsif _name
77
76
  "_settings/#{Utils.listify(_name)}"
78
77
  else
79
- "_settings"
78
+ '_settings'
80
79
  end
81
80
  params = Utils.process_params(arguments)
82
81
 
@@ -39,14 +39,13 @@ module ElasticsearchServerless
39
39
  # @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.
40
40
  # @option arguments [Hash] :headers Custom HTTP headers
41
41
  #
42
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
42
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-migrate-to-data-stream
43
43
  #
44
44
  def migrate_to_data_stream(arguments = {})
45
- request_opts = { endpoint: arguments[:endpoint] || "indices.migrate_to_data_stream" }
45
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.migrate_to_data_stream' }
46
46
 
47
- defined_params = [:name].inject({}) do |set_variables, variable|
47
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
48
48
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
49
- set_variables
50
49
  end
51
50
  request_opts[:defined_params] = defined_params unless defined_params.empty?
52
51
 
@@ -28,10 +28,10 @@ module ElasticsearchServerless
28
28
  # @option arguments [Hash] :headers Custom HTTP headers
29
29
  # @option arguments [Hash] :body request body
30
30
  #
31
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
31
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-modify-data-stream
32
32
  #
33
33
  def modify_data_stream(arguments = {})
34
- request_opts = { endpoint: arguments[:endpoint] || "indices.modify_data_stream" }
34
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.modify_data_stream' }
35
35
 
36
36
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
37
37
 
@@ -41,7 +41,7 @@ module ElasticsearchServerless
41
41
  body = arguments.delete(:body)
42
42
 
43
43
  method = ElasticsearchServerless::API::HTTP_POST
44
- path = "_data_stream/_modify"
44
+ path = '_data_stream/_modify'
45
45
  params = {}
46
46
 
47
47
  ElasticsearchServerless::API::Response.new(
@@ -38,14 +38,13 @@ module ElasticsearchServerless
38
38
  # @option arguments [Hash] :headers Custom HTTP headers
39
39
  # @option arguments [Hash] :body request body
40
40
  #
41
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html
41
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-alias
42
42
  #
43
43
  def put_alias(arguments = {})
44
- request_opts = { endpoint: arguments[:endpoint] || "indices.put_alias" }
44
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.put_alias' }
45
45
 
46
- defined_params = [:index, :name].inject({}) do |set_variables, variable|
46
+ defined_params = [:index, :name].each_with_object({}) do |variable, set_variables|
47
47
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
48
- set_variables
49
48
  end
50
49
  request_opts[:defined_params] = defined_params unless defined_params.empty?
51
50
 
@@ -62,9 +61,7 @@ module ElasticsearchServerless
62
61
  _name = arguments.delete(:name)
63
62
 
64
63
  method = ElasticsearchServerless::API::HTTP_PUT
65
- path = if _index && _name
66
- "#{Utils.listify(_index)}/_aliases/#{Utils.listify(_name)}"
67
- end
64
+ path = ("#{Utils.listify(_index)}/_aliases/#{Utils.listify(_name)}" if _index && _name)
68
65
  params = Utils.process_params(arguments)
69
66
 
70
67
  ElasticsearchServerless::API::Response.new(
@@ -37,20 +37,18 @@ module ElasticsearchServerless
37
37
  # @option arguments [Time] :timeout Period to wait for a response.
38
38
  # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
39
39
  # @option arguments [Hash] :headers Custom HTTP headers
40
- # @option arguments [Hash] :body lifecycle
40
+ # @option arguments [Hash] :body request body
41
41
  #
42
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-put-lifecycle.html
42
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-lifecycle
43
43
  #
44
44
  def put_data_lifecycle(arguments = {})
45
- request_opts = { endpoint: arguments[:endpoint] || "indices.put_data_lifecycle" }
45
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.put_data_lifecycle' }
46
46
 
47
- defined_params = [:name].inject({}) do |set_variables, variable|
47
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
48
48
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
49
- set_variables
50
49
  end
51
50
  request_opts[:defined_params] = defined_params unless defined_params.empty?
52
51
 
53
- raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
54
52
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
55
53
 
56
54
  arguments = arguments.clone
@@ -24,6 +24,25 @@ module ElasticsearchServerless
24
24
  module Actions
25
25
  # Create or update an index template.
26
26
  # Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
27
+ # Elasticsearch applies templates to new indices based on an wildcard pattern that matches the index name.
28
+ # Index templates are applied during data stream or index creation.
29
+ # For data streams, these settings and mappings are applied when the stream's backing indices are created.
30
+ # Settings and mappings specified in a create index API request override any settings or mappings specified in an index template.
31
+ # Changes to index templates do not affect existing indices, including the existing backing indices of a data stream.
32
+ # You can use C-style +/* *\/+ block comments in index templates.
33
+ # You can include comments anywhere in the request body, except before the opening curly bracket.
34
+ # **Multiple matching templates**
35
+ # If multiple index templates match the name of a new index or data stream, the template with the highest priority is used.
36
+ # Multiple templates with overlapping index patterns at the same priority are not allowed and an error will be thrown when attempting to create a template matching an existing index template at identical priorities.
37
+ # **Composing aliases, mappings, and settings**
38
+ # When multiple component templates are specified in the +composed_of+ field for an index template, they are merged in the order specified, meaning that later component templates override earlier component templates.
39
+ # Any mappings, settings, or aliases from the parent index template are merged in next.
40
+ # Finally, any configuration on the index request itself is merged.
41
+ # Mapping definitions are merged recursively, which means that later mapping components can introduce new field mappings and update the mapping configuration.
42
+ # If a field mapping is already contained in an earlier component, its definition will be completely overwritten by the later one.
43
+ # This recursive merging strategy applies not only to field mappings, but also root options like +dynamic_templates+ and +meta+.
44
+ # If an earlier component contains a +dynamic_templates+ block, then by default new +dynamic_templates+ entries are appended onto the end.
45
+ # If an entry already exists with the same key, then it is overwritten by the new definition.
27
46
  #
28
47
  # @option arguments [String] :name Index or template name (*Required*)
29
48
  # @option arguments [Boolean] :create If +true+, this request cannot replace or update existing index templates.
@@ -33,14 +52,13 @@ module ElasticsearchServerless
33
52
  # @option arguments [Hash] :headers Custom HTTP headers
34
53
  # @option arguments [Hash] :body request body
35
54
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html
55
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template
37
56
  #
38
57
  def put_index_template(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "indices.put_index_template" }
58
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.put_index_template' }
40
59
 
41
- defined_params = [:name].inject({}) do |set_variables, variable|
60
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
42
61
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
62
  end
45
63
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
64
 
@@ -23,9 +23,25 @@ module ElasticsearchServerless
23
23
  module Indices
24
24
  module Actions
25
25
  # Update field mappings.
26
- # Adds new fields to an existing data stream or index.
27
- # You can also use this API to change the search settings of existing fields.
26
+ # Add new fields to an existing data stream or index.
27
+ # You can also use this API to change the search settings of existing fields and add new properties to existing object fields.
28
28
  # For data streams, these changes are applied to all backing indices by default.
29
+ # **Add multi-fields to an existing field**
30
+ # Multi-fields let you index the same field in different ways.
31
+ # You can use this API to update the fields mapping parameter and enable multi-fields for an existing field.
32
+ # WARNING: If an index (or data stream) contains documents when you add a multi-field, those documents will not have values for the new multi-field.
33
+ # You can populate the new multi-field with the update by query API.
34
+ # **Change supported mapping parameters for an existing field**
35
+ # The documentation for each mapping parameter indicates whether you can update it for an existing field using this API.
36
+ # For example, you can use the update mapping API to update the +ignore_above+ parameter.
37
+ # **Change the mapping of an existing field**
38
+ # Except for supported mapping parameters, you can't change the mapping or field type of an existing field.
39
+ # Changing an existing field could invalidate data that's already indexed.
40
+ # If you need to change the mapping of a field in a data stream's backing indices, refer to documentation about modifying data streams.
41
+ # If you need to change the mapping of a field in other indices, create a new index with the correct mapping and reindex your data into that index.
42
+ # **Rename a field**
43
+ # Renaming a field would invalidate data already indexed under the old field name.
44
+ # Instead, add an alias field to create an alternate field name.
29
45
  #
30
46
  # @option arguments [String, Array] :index A comma-separated list of index names the mapping should be added to (supports wildcards); use +_all+ or omit to add the mapping on all indices. (*Required*)
31
47
  # @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.
@@ -43,14 +59,13 @@ module ElasticsearchServerless
43
59
  # @option arguments [Hash] :headers Custom HTTP headers
44
60
  # @option arguments [Hash] :body request body
45
61
  #
46
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html
62
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-mapping
47
63
  #
48
64
  def put_mapping(arguments = {})
49
- request_opts = { endpoint: arguments[:endpoint] || "indices.put_mapping" }
65
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.put_mapping' }
50
66
 
51
- defined_params = [:index].inject({}) do |set_variables, variable|
67
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
52
68
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
53
- set_variables
54
69
  end
55
70
  request_opts[:defined_params] = defined_params unless defined_params.empty?
56
71
 
@@ -23,8 +23,19 @@ module ElasticsearchServerless
23
23
  module Indices
24
24
  module Actions
25
25
  # Update index settings.
26
- # Changes dynamic index settings in real time. For data streams, index setting
27
- # changes are applied to all backing indices by default.
26
+ # Changes dynamic index settings in real time.
27
+ # For data streams, index setting changes are applied to all backing indices by default.
28
+ # To revert a setting to the default value, use a null value.
29
+ # The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation.
30
+ # To preserve existing settings from being updated, set the +preserve_existing+ parameter to +true+.
31
+ # NOTE: You can only define new analyzers on closed indices.
32
+ # To add an analyzer, you must close the index, define the analyzer, and reopen the index.
33
+ # You cannot close the write index of a data stream.
34
+ # To update the analyzer for a data stream's write index and future backing indices, update the analyzer in the index template used by the stream.
35
+ # Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices.
36
+ # This affects searches and any new data added to the stream after the rollover.
37
+ # However, it does not affect the data stream's backing indices or their existing data.
38
+ # To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.
28
39
  #
29
40
  # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit
30
41
  # the request. Supports wildcards (+*+). To target all data streams and
@@ -49,14 +60,13 @@ module ElasticsearchServerless
49
60
  # @option arguments [Hash] :headers Custom HTTP headers
50
61
  # @option arguments [Hash] :body settings
51
62
  #
52
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html
63
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings
53
64
  #
54
65
  def put_settings(arguments = {})
55
- request_opts = { endpoint: arguments[:endpoint] || "indices.put_settings" }
66
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.put_settings' }
56
67
 
57
- defined_params = [:index].inject({}) do |set_variables, variable|
68
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
58
69
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
59
- set_variables
60
70
  end
61
71
  request_opts[:defined_params] = defined_params unless defined_params.empty?
62
72
 
@@ -73,7 +83,7 @@ module ElasticsearchServerless
73
83
  path = if _index
74
84
  "#{Utils.listify(_index)}/_settings"
75
85
  else
76
- "_settings"
86
+ '_settings'
77
87
  end
78
88
  params = Utils.process_params(arguments)
79
89
 
@@ -25,6 +25,13 @@ module ElasticsearchServerless
25
25
  # Refresh an index.
26
26
  # A refresh makes recent operations performed on one or more indices available for search.
27
27
  # For data streams, the API runs the refresh operation on the stream’s backing indices.
28
+ # By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds.
29
+ # You can change this default interval with the +index.refresh_interval+ setting.
30
+ # Refresh requests are synchronous and do not return a response until the refresh operation completes.
31
+ # Refreshes are resource-intensive.
32
+ # To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible.
33
+ # If your application workflow indexes documents and then runs a search to retrieve the indexed document, it's recommended to use the index API's +refresh=wait_for+ query parameter option.
34
+ # This option ensures the indexing operation waits for a periodic refresh before running the search.
28
35
  #
29
36
  # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request.
30
37
  # Supports wildcards (+*+).
@@ -38,14 +45,13 @@ module ElasticsearchServerless
38
45
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
39
46
  # @option arguments [Hash] :headers Custom HTTP headers
40
47
  #
41
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html
48
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-refresh
42
49
  #
43
50
  def refresh(arguments = {})
44
- request_opts = { endpoint: arguments[:endpoint] || "indices.refresh" }
51
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.refresh' }
45
52
 
46
- defined_params = [:index].inject({}) do |set_variables, variable|
53
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
47
54
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
48
- set_variables
49
55
  end
50
56
  request_opts[:defined_params] = defined_params unless defined_params.empty?
51
57
 
@@ -60,7 +66,7 @@ module ElasticsearchServerless
60
66
  path = if _index
61
67
  "#{Utils.listify(_index)}/_refresh"
62
68
  else
63
- "_refresh"
69
+ '_refresh'
64
70
  end
65
71
  params = Utils.process_params(arguments)
66
72
 
@@ -22,7 +22,8 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Indices
24
24
  module Actions
25
- # Resolves the specified name(s) and/or index patterns for indices, aliases, and data streams.
25
+ # Resolve indices.
26
+ # Resolve the names and/or index patterns for indices, aliases, and data streams.
26
27
  # Multiple patterns and remote clusters are supported.
27
28
  #
28
29
  # @option arguments [String, Array<String>] :name Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve.
@@ -37,14 +38,13 @@ module ElasticsearchServerless
37
38
  # 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.
38
39
  # @option arguments [Hash] :headers Custom HTTP headers
39
40
  #
40
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html
41
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-resolve-index
41
42
  #
42
43
  def resolve_index(arguments = {})
43
- request_opts = { endpoint: arguments[:endpoint] || "indices.resolve_index" }
44
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.resolve_index' }
44
45
 
45
- defined_params = [:name].inject({}) do |set_variables, variable|
46
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
46
47
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
47
- set_variables
48
48
  end
49
49
  request_opts[:defined_params] = defined_params unless defined_params.empty?
50
50
 
@@ -23,7 +23,31 @@ module ElasticsearchServerless
23
23
  module Indices
24
24
  module Actions
25
25
  # Roll over to a new index.
26
- # Creates a new index for a data stream or index alias.
26
+ # TIP: It is recommended to use the index lifecycle rollover action to automate rollovers.
27
+ # The rollover API creates a new index for a data stream or index alias.
28
+ # The API behavior depends on the rollover target.
29
+ # **Roll over a data stream**
30
+ # If you roll over a data stream, the API creates a new write index for the stream.
31
+ # The stream's previous write index becomes a regular backing index.
32
+ # A rollover also increments the data stream's generation.
33
+ # **Roll over an index alias with a write index**
34
+ # TIP: Prior to Elasticsearch 7.9, you'd typically use an index alias with a write index to manage time series data.
35
+ # Data streams replace this functionality, require less maintenance, and automatically integrate with data tiers.
36
+ # If an index alias points to multiple indices, one of the indices must be a write index.
37
+ # The rollover API creates a new write index for the alias with +is_write_index+ set to +true+.
38
+ # The API also +sets is_write_index+ to +false+ for the previous write index.
39
+ # **Roll over an index alias with one index**
40
+ # If you roll over an index alias that points to only one index, the API creates a new index for the alias and removes the original index from the alias.
41
+ # NOTE: A rollover creates a new index and is subject to the +wait_for_active_shards+ setting.
42
+ # **Increment index names for an alias**
43
+ # When you roll over an index alias, you can specify a name for the new index.
44
+ # If you don't specify a name and the current index ends with +-+ and a number, such as +my-index-000001+ or +my-index-3+, the new index name increments that number.
45
+ # For example, if you roll over an alias with a current index of +my-index-000001+, the rollover creates a new index named +my-index-000002+.
46
+ # This number is always six characters and zero-padded, regardless of the previous index's name.
47
+ # If you use an index alias for time series data, you can use date math in the index name to track the rollover date.
48
+ # For example, you can create an alias that points to an index named +<my-index-{now/d}-000001>+.
49
+ # If you create the index on May 6, 2099, the index's name is +my-index-2099.05.06-000001+.
50
+ # If you roll over the alias on May 7, 2099, the new index's name is +my-index-2099.05.07-000002+.
27
51
  #
28
52
  # @option arguments [String] :alias Name of the data stream or index alias to roll over. (*Required*)
29
53
  # @option arguments [String] :new_index Name of the index to create.
@@ -39,14 +63,13 @@ module ElasticsearchServerless
39
63
  # @option arguments [Hash] :headers Custom HTTP headers
40
64
  # @option arguments [Hash] :body request body
41
65
  #
42
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html
66
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-rollover
43
67
  #
44
68
  def rollover(arguments = {})
45
- request_opts = { endpoint: arguments[:endpoint] || "indices.rollover" }
69
+ request_opts = { endpoint: arguments[:endpoint] || 'indices.rollover' }
46
70
 
47
- defined_params = [:alias, :new_index].inject({}) do |set_variables, variable|
71
+ defined_params = [:alias, :new_index].each_with_object({}) do |variable, set_variables|
48
72
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
49
- set_variables
50
73
  end
51
74
  request_opts[:defined_params] = defined_params unless defined_params.empty?
52
75