elasticsearch-serverless 0.6.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 (249) 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 +7 -6
  5. data/lib/elasticsearch-serverless/api/async_search/submit.rb +5 -7
  6. data/lib/elasticsearch-serverless/api/bulk.rb +109 -22
  7. data/lib/elasticsearch-serverless/api/cat/aliases.rb +17 -14
  8. data/lib/elasticsearch-serverless/api/cat/component_templates.rb +14 -13
  9. data/lib/elasticsearch-serverless/api/cat/count.rb +13 -14
  10. data/lib/elasticsearch-serverless/api/cat/help.rb +5 -15
  11. data/lib/elasticsearch-serverless/api/cat/indices.rb +10 -11
  12. data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +7 -13
  13. data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +6 -12
  14. data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +6 -12
  15. data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +7 -12
  16. data/lib/elasticsearch-serverless/api/cat/transforms.rb +6 -12
  17. data/lib/elasticsearch-serverless/api/clear_scroll.rb +7 -6
  18. data/lib/elasticsearch-serverless/api/close_point_in_time.rb +3 -3
  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 +11 -10
  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 -7
  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 -5
  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 -7
  106. data/lib/elasticsearch-serverless/api/inference/get.rb +4 -5
  107. data/lib/elasticsearch-serverless/api/inference/put.rb +12 -5
  108. data/lib/elasticsearch-serverless/api/inference/put_watsonx.rb +78 -0
  109. data/lib/elasticsearch-serverless/api/inference/rerank.rb +62 -0
  110. data/lib/elasticsearch-serverless/api/inference/sparse_embedding.rb +62 -0
  111. data/lib/elasticsearch-serverless/api/inference/text_embedding.rb +62 -0
  112. data/lib/elasticsearch-serverless/api/info.rb +4 -4
  113. data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +5 -5
  114. data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +6 -6
  115. data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +5 -4
  116. data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +3 -4
  117. data/lib/elasticsearch-serverless/api/ingest/simulate.rb +9 -8
  118. data/lib/elasticsearch-serverless/api/license/get.rb +4 -5
  119. data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +7 -6
  120. data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +7 -7
  121. data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +7 -6
  122. data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +3 -4
  123. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +4 -5
  124. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +3 -4
  125. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +3 -4
  126. data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +3 -4
  127. data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +3 -4
  128. data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +3 -4
  129. data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +3 -4
  130. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +4 -4
  131. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +3 -4
  132. data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +5 -5
  133. data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +3 -3
  134. data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +3 -4
  135. data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +3 -4
  136. data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +4 -5
  137. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +4 -5
  138. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +4 -5
  139. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +4 -5
  140. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +4 -5
  141. data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +4 -5
  142. data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +4 -5
  143. data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +4 -5
  144. data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +3 -4
  145. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +4 -5
  146. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +4 -5
  147. data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +3 -9
  148. data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +3 -4
  149. data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +3 -4
  150. data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +5 -6
  151. data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +4 -5
  152. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +3 -4
  153. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +3 -4
  154. data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +6 -4
  155. data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +6 -6
  156. data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +3 -4
  157. data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +16 -5
  158. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +3 -4
  159. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +3 -4
  160. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +3 -4
  161. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +3 -4
  162. data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +3 -4
  163. data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +3 -4
  164. data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +3 -4
  165. data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +7 -6
  166. data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +3 -4
  167. data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +3 -4
  168. data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +3 -4
  169. data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +3 -4
  170. data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +3 -4
  171. data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +3 -4
  172. data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +3 -4
  173. data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +3 -4
  174. data/lib/elasticsearch-serverless/api/mget.rb +12 -5
  175. data/lib/elasticsearch-serverless/api/msearch.rb +16 -17
  176. data/lib/elasticsearch-serverless/api/msearch_template.rb +22 -15
  177. data/lib/elasticsearch-serverless/api/mtermvectors.rb +15 -12
  178. data/lib/elasticsearch-serverless/api/open_point_in_time.rb +29 -12
  179. data/lib/elasticsearch-serverless/api/ping.rb +8 -10
  180. data/lib/elasticsearch-serverless/api/put_script.rb +12 -11
  181. data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +6 -5
  182. data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +6 -5
  183. data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +5 -5
  184. data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +5 -5
  185. data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +7 -6
  186. data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +11 -7
  187. data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +11 -6
  188. data/lib/elasticsearch-serverless/api/query_rules/test.rb +5 -5
  189. data/lib/elasticsearch-serverless/api/rank_eval.rb +6 -6
  190. data/lib/elasticsearch-serverless/api/reindex.rb +146 -9
  191. data/lib/elasticsearch-serverless/api/render_search_template.rb +5 -6
  192. data/lib/elasticsearch-serverless/api/response.rb +1 -1
  193. data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +7 -3
  194. data/lib/elasticsearch-serverless/api/scroll.rb +4 -4
  195. data/lib/elasticsearch-serverless/api/search.rb +77 -69
  196. data/lib/elasticsearch-serverless/api/search_application/delete.rb +4 -5
  197. data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +3 -4
  198. data/lib/elasticsearch-serverless/api/search_application/get.rb +3 -4
  199. data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +4 -5
  200. data/lib/elasticsearch-serverless/api/search_application/list.rb +5 -4
  201. data/lib/elasticsearch-serverless/api/search_application/put.rb +3 -4
  202. data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +3 -4
  203. data/lib/elasticsearch-serverless/api/search_application/search.rb +3 -4
  204. data/lib/elasticsearch-serverless/api/search_mvt.rb +131 -9
  205. data/lib/elasticsearch-serverless/api/search_template.rb +12 -12
  206. data/lib/elasticsearch-serverless/api/security/authenticate.rb +3 -3
  207. data/lib/elasticsearch-serverless/api/security/create_api_key.rb +7 -3
  208. data/lib/elasticsearch-serverless/api/security/delete_role.rb +6 -5
  209. data/lib/elasticsearch-serverless/api/security/get_api_key.rb +3 -3
  210. data/lib/elasticsearch-serverless/api/security/get_builtin_privileges.rb +3 -3
  211. data/lib/elasticsearch-serverless/api/security/get_role.rb +11 -8
  212. data/lib/elasticsearch-serverless/api/security/has_privileges.rb +6 -5
  213. data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +8 -6
  214. data/lib/elasticsearch-serverless/api/security/put_role.rb +3 -4
  215. data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +12 -6
  216. data/lib/elasticsearch-serverless/api/security/query_role.rb +61 -0
  217. data/lib/elasticsearch-serverless/api/security/update_api_key.rb +74 -0
  218. data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +4 -4
  219. data/lib/elasticsearch-serverless/api/sql/delete_async.rb +10 -6
  220. data/lib/elasticsearch-serverless/api/sql/get_async.rb +16 -13
  221. data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +6 -6
  222. data/lib/elasticsearch-serverless/api/sql/query.rb +8 -5
  223. data/lib/elasticsearch-serverless/api/sql/translate.rb +6 -4
  224. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +17 -6
  225. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +7 -7
  226. data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +7 -8
  227. data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +7 -7
  228. data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +7 -6
  229. data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -6
  230. data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -7
  231. data/lib/elasticsearch-serverless/api/tasks/get.rb +9 -7
  232. data/lib/elasticsearch-serverless/api/terms_enum.rb +7 -9
  233. data/lib/elasticsearch-serverless/api/termvectors.rb +39 -16
  234. data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +3 -5
  235. data/lib/elasticsearch-serverless/api/transform/get_transform.rb +5 -6
  236. data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +4 -5
  237. data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +4 -5
  238. data/lib/elasticsearch-serverless/api/transform/put_transform.rb +3 -4
  239. data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +4 -5
  240. data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +7 -8
  241. data/lib/elasticsearch-serverless/api/transform/start_transform.rb +3 -5
  242. data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +3 -4
  243. data/lib/elasticsearch-serverless/api/transform/update_transform.rb +3 -4
  244. data/lib/elasticsearch-serverless/api/update.rb +36 -24
  245. data/lib/elasticsearch-serverless/api/update_by_query.rb +102 -31
  246. data/lib/elasticsearch-serverless/api.rb +22 -25
  247. data/lib/elasticsearch-serverless/version.rb +1 -1
  248. data/lib/elasticsearch-serverless.rb +7 -0
  249. metadata +18 -7
@@ -33,19 +33,20 @@ module ElasticsearchServerless
33
33
  # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job (*Required*)
34
34
  # @option arguments [Hash] :headers Custom HTTP headers
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cancel-connector-sync-job-api.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-cancel
37
37
  #
38
38
  def sync_job_cancel(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "connector.sync_job_cancel" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_cancel' }
40
40
 
41
- defined_params = [:connector_sync_job_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:connector_sync_job_id].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
47
- raise ArgumentError,
48
- "Required argument 'connector_sync_job_id' missing" unless arguments[:connector_sync_job_id]
46
+ unless arguments[:connector_sync_job_id]
47
+ raise ArgumentError,
48
+ "Required argument 'connector_sync_job_id' missing"
49
+ end
49
50
 
50
51
  arguments = arguments.clone
51
52
  headers = arguments.delete(:headers) || {}
@@ -33,19 +33,20 @@ module ElasticsearchServerless
33
33
  # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to be deleted (*Required*)
34
34
  # @option arguments [Hash] :headers Custom HTTP headers
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-connector-sync-job-api.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-delete
37
37
  #
38
38
  def sync_job_delete(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "connector.sync_job_delete" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_delete' }
40
40
 
41
- defined_params = [:connector_sync_job_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:connector_sync_job_id].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
47
- raise ArgumentError,
48
- "Required argument 'connector_sync_job_id' missing" unless arguments[:connector_sync_job_id]
46
+ unless arguments[:connector_sync_job_id]
47
+ raise ArgumentError,
48
+ "Required argument 'connector_sync_job_id' missing"
49
+ end
49
50
 
50
51
  arguments = arguments.clone
51
52
  headers = arguments.delete(:headers) || {}
@@ -31,19 +31,20 @@ module ElasticsearchServerless
31
31
  # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job (*Required*)
32
32
  # @option arguments [Hash] :headers Custom HTTP headers
33
33
  #
34
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-connector-sync-job-api.html
34
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-get
35
35
  #
36
36
  def sync_job_get(arguments = {})
37
- request_opts = { endpoint: arguments[:endpoint] || "connector.sync_job_get" }
37
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_get' }
38
38
 
39
- defined_params = [:connector_sync_job_id].inject({}) do |set_variables, variable|
39
+ defined_params = [:connector_sync_job_id].each_with_object({}) do |variable, set_variables|
40
40
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
- set_variables
42
41
  end
43
42
  request_opts[:defined_params] = defined_params unless defined_params.empty?
44
43
 
45
- raise ArgumentError,
46
- "Required argument 'connector_sync_job_id' missing" unless arguments[:connector_sync_job_id]
44
+ unless arguments[:connector_sync_job_id]
45
+ raise ArgumentError,
46
+ "Required argument 'connector_sync_job_id' missing"
47
+ end
47
48
 
48
49
  arguments = arguments.clone
49
50
  headers = arguments.delete(:headers) || {}
@@ -36,10 +36,10 @@ module ElasticsearchServerless
36
36
  # @option arguments [Syncjobtype] :job_type A comma-separated list of job types to fetch the sync jobs for
37
37
  # @option arguments [Hash] :headers Custom HTTP headers
38
38
  #
39
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/list-connector-sync-jobs-api.html
39
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-list
40
40
  #
41
41
  def sync_job_list(arguments = {})
42
- request_opts = { endpoint: arguments[:endpoint] || "connector.sync_job_list" }
42
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_list' }
43
43
 
44
44
  arguments = arguments.clone
45
45
  headers = arguments.delete(:headers) || {}
@@ -47,7 +47,7 @@ module ElasticsearchServerless
47
47
  body = nil
48
48
 
49
49
  method = ElasticsearchServerless::API::HTTP_GET
50
- path = "_connector/_sync_job"
50
+ path = '_connector/_sync_job'
51
51
  params = Utils.process_params(arguments)
52
52
 
53
53
  ElasticsearchServerless::API::Response.new(
@@ -32,10 +32,10 @@ module ElasticsearchServerless
32
32
  # @option arguments [Hash] :headers Custom HTTP headers
33
33
  # @option arguments [Hash] :body request body
34
34
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-sync-job-api.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-post
36
36
  #
37
37
  def sync_job_post(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "connector.sync_job_post" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_post' }
39
39
 
40
40
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
41
41
 
@@ -45,7 +45,7 @@ module ElasticsearchServerless
45
45
  body = arguments.delete(:body)
46
46
 
47
47
  method = ElasticsearchServerless::API::HTTP_POST
48
- path = "_connector/_sync_job"
48
+ path = '_connector/_sync_job'
49
49
  params = {}
50
50
 
51
51
  ElasticsearchServerless::API::Response.new(
@@ -32,14 +32,13 @@ module ElasticsearchServerless
32
32
  # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*)
33
33
  # @option arguments [Hash] :headers Custom HTTP headers
34
34
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-filtering-api.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering
36
36
  #
37
37
  def update_active_filtering(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_active_filtering" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_active_filtering' }
39
39
 
40
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
40
+ defined_params = [:connector_id].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
 
@@ -36,14 +36,13 @@ module ElasticsearchServerless
36
36
  # @option arguments [Hash] :headers Custom HTTP headers
37
37
  # @option arguments [Hash] :body request body
38
38
  #
39
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-api-key-id-api.html
39
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-api-key-id
40
40
  #
41
41
  def update_api_key_id(arguments = {})
42
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_api_key_id" }
42
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_api_key_id' }
43
43
 
44
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
44
+ defined_params = [:connector_id].each_with_object({}) do |variable, set_variables|
45
45
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
46
- set_variables
47
46
  end
48
47
  request_opts[:defined_params] = defined_params unless defined_params.empty?
49
48
 
@@ -33,14 +33,13 @@ module ElasticsearchServerless
33
33
  # @option arguments [Hash] :headers Custom HTTP headers
34
34
  # @option arguments [Hash] :body request body
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-configuration-api.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-configuration
37
37
  #
38
38
  def update_configuration(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_configuration" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_configuration' }
40
40
 
41
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:connector_id].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
@@ -35,14 +35,13 @@ module ElasticsearchServerless
35
35
  # @option arguments [Hash] :headers Custom HTTP headers
36
36
  # @option arguments [Hash] :body request body
37
37
  #
38
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-error-api.html
38
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-error
39
39
  #
40
40
  def update_error(arguments = {})
41
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_error" }
41
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_error' }
42
42
 
43
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
43
+ defined_params = [:connector_id].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
 
@@ -35,14 +35,13 @@ module ElasticsearchServerless
35
35
  # @option arguments [Hash] :headers Custom HTTP headers
36
36
  # @option arguments [Hash] :body request body
37
37
  #
38
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-filtering-api.html
38
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering
39
39
  #
40
40
  def update_filtering(arguments = {})
41
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_filtering" }
41
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_filtering' }
42
42
 
43
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
43
+ defined_params = [:connector_id].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
 
@@ -36,11 +36,10 @@ module ElasticsearchServerless
36
36
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-filtering-validation-api.html
37
37
  #
38
38
  def update_filtering_validation(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_filtering_validation" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_filtering_validation' }
40
40
 
41
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:connector_id].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
@@ -33,14 +33,13 @@ module ElasticsearchServerless
33
33
  # @option arguments [Hash] :headers Custom HTTP headers
34
34
  # @option arguments [Hash] :body request body
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-index-name-api.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-index-name
37
37
  #
38
38
  def update_index_name(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_index_name" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_index_name' }
40
40
 
41
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:connector_id].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
@@ -32,14 +32,13 @@ module ElasticsearchServerless
32
32
  # @option arguments [Hash] :headers Custom HTTP headers
33
33
  # @option arguments [Hash] :body request body
34
34
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-name-description-api.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-name
36
36
  #
37
37
  def update_name(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_name" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_name' }
39
39
 
40
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
40
+ defined_params = [:connector_id].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
 
@@ -35,11 +35,10 @@ module ElasticsearchServerless
35
35
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-native-api.html
36
36
  #
37
37
  def update_native(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_native" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_native' }
39
39
 
40
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
40
+ defined_params = [:connector_id].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
 
@@ -33,14 +33,13 @@ module ElasticsearchServerless
33
33
  # @option arguments [Hash] :headers Custom HTTP headers
34
34
  # @option arguments [Hash] :body request body
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-pipeline-api.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-pipeline
37
37
  #
38
38
  def update_pipeline(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_pipeline" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_pipeline' }
40
40
 
41
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:connector_id].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
@@ -32,14 +32,13 @@ module ElasticsearchServerless
32
32
  # @option arguments [Hash] :headers Custom HTTP headers
33
33
  # @option arguments [Hash] :body request body
34
34
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-scheduling-api.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-scheduling
36
36
  #
37
37
  def update_scheduling(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_scheduling" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_scheduling' }
39
39
 
40
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
40
+ defined_params = [:connector_id].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
 
@@ -32,14 +32,13 @@ module ElasticsearchServerless
32
32
  # @option arguments [Hash] :headers Custom HTTP headers
33
33
  # @option arguments [Hash] :body request body
34
34
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-service-type-api.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-service-type
36
36
  #
37
37
  def update_service_type(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_service_type" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_service_type' }
39
39
 
40
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
40
+ defined_params = [:connector_id].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
 
@@ -32,14 +32,13 @@ module ElasticsearchServerless
32
32
  # @option arguments [Hash] :headers Custom HTTP headers
33
33
  # @option arguments [Hash] :body request body
34
34
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-status-api.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-status
36
36
  #
37
37
  def update_status(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "connector.update_status" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'connector.update_status' }
39
39
 
40
- defined_params = [:connector_id].inject({}) do |set_variables, variable|
40
+ defined_params = [:connector_id].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
 
@@ -21,46 +21,57 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Returns number of documents matching a query.
24
+ # Count search results.
25
+ # Get the number of documents matching a query.
26
+ # The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body.
27
+ # The query is optional. When no query is provided, the API uses +match_all+ to count all the documents.
28
+ # The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.
29
+ # The operation is broadcast across all shards.
30
+ # For each shard ID group, a replica is chosen and the search is run against it.
31
+ # This means that replicas increase the scalability of the count.
25
32
  #
26
- # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search.
27
- # Supports wildcards (+*+).
33
+ # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search.
34
+ # It supports wildcards (+*+).
28
35
  # To search all data streams and indices, omit this parameter or use +*+ or +_all+.
29
36
  # @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.
30
- # This behavior applies even if the request targets other open indices. Server default: true.
31
- # @option arguments [String] :analyzer Analyzer to use for the query string.
32
- # This parameter can only be used when the +q+ query string parameter is specified.
37
+ # This behavior applies even if the request targets other open indices.
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.
39
+ # @option arguments [String] :analyzer The analyzer to use for the query string.
40
+ # This parameter can be used only when the +q+ query string parameter is specified.
33
41
  # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed.
34
- # This parameter can only be used when the +q+ query string parameter is specified.
42
+ # This parameter can be used only when the +q+ query string parameter is specified.
35
43
  # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+.
36
- # This parameter can only be used when the +q+ query string parameter is specified.
37
- # @option arguments [String] :df Field to use as default where no field prefix is given in the query string.
38
- # This parameter can only be used when the +q+ query string parameter is specified.
39
- # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match.
44
+ # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR.
45
+ # @option arguments [String] :df The field to use as a default when no field prefix is given in the query string.
46
+ # This parameter can be used only when the +q+ query string parameter is specified.
47
+ # @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
40
48
  # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
41
- # Supports comma-separated values, such as +open,hidden+. Server default: open.
42
- # @option arguments [Boolean] :ignore_throttled If +true+, concrete, expanded or aliased indices are ignored when frozen. Server default: true.
49
+ # It supports comma-separated values, such as +open,hidden+. Server default: open.
50
+ # @option arguments [Boolean] :ignore_throttled If +true+, concrete, expanded, or aliased indices are ignored when frozen. Server default: true.
43
51
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
44
52
  # @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.
45
- # @option arguments [Float] :min_score Sets the minimum +_score+ value that documents must have to be included in the result.
46
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
47
- # Random by default.
48
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
49
- # @option arguments [Integer] :terminate_after Maximum number of documents to collect for each shard.
53
+ # This parameter can be used only when the +q+ query string parameter is specified.
54
+ # @option arguments [Float] :min_score The minimum +_score+ value that documents must have to be included in the result.
55
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
56
+ # By default, it is random.
57
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
58
+ # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard.
50
59
  # If a query reaches this limit, Elasticsearch terminates the query early.
51
- # Elasticsearch collects documents before sorting.
52
- # @option arguments [String] :q Query in the Lucene query string syntax.
60
+ # Elasticsearch collects documents before sorting.IMPORTANT: Use with caution.
61
+ # Elasticsearch applies this parameter to each shard handling the request.
62
+ # When possible, let Elasticsearch perform early termination automatically.
63
+ # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
64
+ # @option arguments [String] :q The query in Lucene query string syntax. This parameter cannot be used with a request body.
53
65
  # @option arguments [Hash] :headers Custom HTTP headers
54
66
  # @option arguments [Hash] :body request body
55
67
  #
56
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html
68
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-count
57
69
  #
58
70
  def count(arguments = {})
59
- request_opts = { endpoint: arguments[:endpoint] || "count" }
71
+ request_opts = { endpoint: arguments[:endpoint] || 'count' }
60
72
 
61
- defined_params = [:index].inject({}) do |set_variables, variable|
73
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
62
74
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
63
- set_variables
64
75
  end
65
76
  request_opts[:defined_params] = defined_params unless defined_params.empty?
66
77
 
@@ -80,7 +91,7 @@ module ElasticsearchServerless
80
91
  path = if _index
81
92
  "#{Utils.listify(_index)}/_count"
82
93
  else
83
- "_count"
94
+ '_count'
84
95
  end
85
96
  params = Utils.process_params(arguments)
86
97
 
@@ -21,37 +21,92 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Index a document.
25
- # Adds a JSON document to the specified data stream or index and makes it searchable.
26
- # If the target is an index and the document already exists, the request updates the document and increments its version.
24
+ # Create a new document in the index.
25
+ # You can index a new JSON document with the +/<target>/_doc/+ or +/<target>/_create/<_id>+ APIs
26
+ # Using +_create+ guarantees that the document is indexed only if it does not already exist.
27
+ # It returns a 409 response when a document with a same ID already exists in the index.
28
+ # To update an existing document, you must use the +/<target>/_doc/+ API.
29
+ # If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias:
30
+ # * To add a document using the +PUT /<target>/_create/<_id>+ or +POST /<target>/_create/<_id>+ request formats, you must have the +create_doc+, +create+, +index+, or +write+ index privilege.
31
+ # * To automatically create a data stream or index with this API request, you must have the +auto_configure+, +create_index+, or +manage+ index privilege.
32
+ # Automatic data stream creation requires a matching index template with data stream enabled.
33
+ # **Automatically create data streams and indices**
34
+ # If the request's target doesn't exist and matches an index template with a +data_stream+ definition, the index operation automatically creates the data stream.
35
+ # If the target doesn't exist and doesn't match a data stream template, the operation automatically creates the index and applies any matching index templates.
36
+ # NOTE: Elasticsearch includes several built-in index templates. To avoid naming collisions with these templates, refer to index pattern documentation.
37
+ # If no mapping exists, the index operation creates a dynamic mapping.
38
+ # By default, new fields and objects are automatically added to the mapping if needed.
39
+ # Automatic index creation is controlled by the +action.auto_create_index+ setting.
40
+ # If it is +true+, any index can be created automatically.
41
+ # You can modify this setting to explicitly allow or block automatic creation of indices that match specified patterns or set it to +false+ to turn off automatic index creation entirely.
42
+ # Specify a comma-separated list of patterns you want to allow or prefix each pattern with +++ or +-+ to indicate whether it should be allowed or blocked.
43
+ # When a list is specified, the default behaviour is to disallow.
44
+ # NOTE: The +action.auto_create_index+ setting affects the automatic creation of indices only.
45
+ # It does not affect the creation of data streams.
46
+ # **Routing**
47
+ # By default, shard placement — or routing — is controlled by using a hash of the document's ID value.
48
+ # For more explicit control, the value fed into the hash function used by the router can be directly specified on a per-operation basis using the +routing+ parameter.
49
+ # When setting up explicit mapping, you can also use the +_routing+ field to direct the index operation to extract the routing value from the document itself.
50
+ # This does come at the (very minimal) cost of an additional document parsing pass.
51
+ # If the +_routing+ mapping is defined and set to be required, the index operation will fail if no routing value is provided or extracted.
52
+ # NOTE: Data streams do not support custom routing unless they were created with the +allow_custom_routing+ setting enabled in the template.
53
+ # **Distributed**
54
+ # The index operation is directed to the primary shard based on its route and performed on the actual node containing this shard.
55
+ # After the primary shard completes the operation, if needed, the update is distributed to applicable replicas.
56
+ # **Active shards**
57
+ # To improve the resiliency of writes to the system, indexing operations can be configured to wait for a certain number of active shard copies before proceeding with the operation.
58
+ # If the requisite number of active shard copies are not available, then the write operation must wait and retry, until either the requisite shard copies have started or a timeout occurs.
59
+ # By default, write operations only wait for the primary shards to be active before proceeding (that is to say +wait_for_active_shards+ is +1+).
60
+ # This default can be overridden in the index settings dynamically by setting +index.write.wait_for_active_shards+.
61
+ # To alter this behavior per operation, use the +wait_for_active_shards request+ parameter.
62
+ # Valid values are all or any positive integer up to the total number of configured copies per shard in the index (which is +number_of_replicas++1).
63
+ # Specifying a negative value or a number greater than the number of shard copies will throw an error.
64
+ # For example, suppose you have a cluster of three nodes, A, B, and C and you create an index index with the number of replicas set to 3 (resulting in 4 shard copies, one more copy than there are nodes).
65
+ # If you attempt an indexing operation, by default the operation will only ensure the primary copy of each shard is available before proceeding.
66
+ # This means that even if B and C went down and A hosted the primary shard copies, the indexing operation would still proceed with only one copy of the data.
67
+ # If +wait_for_active_shards+ is set on the request to +3+ (and all three nodes are up), the indexing operation will require 3 active shard copies before proceeding.
68
+ # This requirement should be met because there are 3 active nodes in the cluster, each one holding a copy of the shard.
69
+ # However, if you set +wait_for_active_shards+ to +all+ (or to +4+, which is the same in this situation), the indexing operation will not proceed as you do not have all 4 copies of each shard active in the index.
70
+ # The operation will timeout unless a new node is brought up in the cluster to host the fourth copy of the shard.
71
+ # It is important to note that this setting greatly reduces the chances of the write operation not writing to the requisite number of shard copies, but it does not completely eliminate the possibility, because this check occurs before the write operation starts.
72
+ # After the write operation is underway, it is still possible for replication to fail on any number of shard copies but still succeed on the primary.
73
+ # The +_shards+ section of the API response reveals the number of shard copies on which replication succeeded and failed.
27
74
  #
28
- # @option arguments [String] :id Unique identifier for the document. (*Required*)
29
- # @option arguments [String] :index Name of the data stream or index to target.
30
- # If the target doesn’t exist and matches the name or wildcard (+*+) pattern of an index template with a +data_stream+ definition, this request creates the data stream.
31
- # If the target doesnt exist and doesn’t match a data stream template, this request creates the index. (*Required*)
32
- # @option arguments [String] :pipeline ID of the pipeline to use to preprocess incoming documents.
33
- # If the index has a default ingest pipeline specified, then setting the value to +_none+ disables the default ingest pipeline for this request.
34
- # If a final pipeline is configured it will always run, regardless of the value of this parameter.
35
- # @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ do nothing with refreshes.
36
- # Valid values: +true+, +false+, +wait_for+. Server default: false.
37
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
38
- # @option arguments [Time] :timeout Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. Server default: 1m.
39
- # @option arguments [Integer] :version Explicit version number for concurrency control.
40
- # The specified version must match the current version of the document for the request to succeed.
41
- # @option arguments [String] :version_type Specific version type: +external+, +external_gte+.
75
+ # @option arguments [String] :id A unique identifier for the document.
76
+ # To automatically generate a document ID, use the +POST /<target>/_doc/+ request format. (*Required*)
77
+ # @option arguments [String] :index The name of the data stream or index to target.
78
+ # If the target doesn't exist and matches the name or wildcard (+*+) pattern of an index template with a +data_stream+ definition, this request creates the data stream.
79
+ # If the target doesn't exist and doesn’t match a data stream template, this request creates the index. (*Required*)
80
+ # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Server default: true.
81
+ # @option arguments [String] :pipeline The ID of the pipeline to use to preprocess incoming documents.
82
+ # If the index has a default ingest pipeline specified, setting the value to +_none+ turns off the default ingest pipeline for this request.
83
+ # If a final pipeline is configured, it will always run regardless of the value of this parameter.
84
+ # @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search.
85
+ # If +wait_for+, it waits for a refresh to make this operation visible to search.
86
+ # If +false+, it does nothing with refreshes. Server default: false.
87
+ # @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
88
+ # @option arguments [Time] :timeout The period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
89
+ # Elasticsearch waits for at least the specified timeout period before failing.
90
+ # The actual wait time could be longer, particularly when multiple waits occur.This parameter is useful for situations where the primary shard assigned to perform the operation might not be available when the operation runs.
91
+ # Some reasons for this might be that the primary shard is currently recovering from a gateway or undergoing relocation.
92
+ # By default, the operation will wait on the primary shard to become available for at least 1 minute before failing and responding with an error.
93
+ # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m.
94
+ # @option arguments [Integer] :version The explicit version number for concurrency control.
95
+ # It must be a non-negative long number.
96
+ # @option arguments [String] :version_type The version type.
42
97
  # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
43
- # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1.
98
+ # You can set it to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
99
+ # The default value of +1+ means it waits for each primary shard to be active. Server default: 1.
44
100
  # @option arguments [Hash] :headers Custom HTTP headers
45
101
  # @option arguments [Hash] :body document
46
102
  #
47
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html
103
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create
48
104
  #
49
105
  def create(arguments = {})
50
- request_opts = { endpoint: arguments[:endpoint] || "create" }
106
+ request_opts = { endpoint: arguments[:endpoint] || 'create' }
51
107
 
52
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
108
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
53
109
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
54
- set_variables
55
110
  end
56
111
  request_opts[:defined_params] = defined_params unless defined_params.empty?
57
112