elasticsearch-api 7.6.0 → 7.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 (270) hide show
  1. checksums.yaml +4 -4
  2. data/elasticsearch-api.gemspec +7 -2
  3. data/lib/elasticsearch/api/actions/bulk.rb +6 -3
  4. data/lib/elasticsearch/api/actions/cat/aliases.rb +10 -4
  5. data/lib/elasticsearch/api/actions/cat/allocation.rb +6 -4
  6. data/lib/elasticsearch/api/actions/cat/count.rb +6 -4
  7. data/lib/elasticsearch/api/actions/cat/fielddata.rb +6 -4
  8. data/lib/elasticsearch/api/actions/cat/health.rb +6 -4
  9. data/lib/elasticsearch/api/actions/cat/help.rb +5 -3
  10. data/lib/elasticsearch/api/actions/cat/indices.rb +11 -5
  11. data/lib/elasticsearch/api/actions/cat/master.rb +5 -3
  12. data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +5 -3
  13. data/lib/elasticsearch/api/actions/cat/nodes.rb +6 -4
  14. data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +6 -4
  15. data/lib/elasticsearch/api/actions/cat/plugins.rb +5 -3
  16. data/lib/elasticsearch/api/actions/cat/recovery.rb +7 -5
  17. data/lib/elasticsearch/api/actions/cat/repositories.rb +5 -3
  18. data/lib/elasticsearch/api/actions/cat/segments.rb +6 -4
  19. data/lib/elasticsearch/api/actions/cat/shards.rb +7 -5
  20. data/lib/elasticsearch/api/actions/cat/snapshots.rb +7 -5
  21. data/lib/elasticsearch/api/actions/cat/tasks.rb +6 -4
  22. data/lib/elasticsearch/api/actions/cat/templates.rb +6 -4
  23. data/lib/elasticsearch/api/actions/cat/thread_pool.rb +6 -4
  24. data/lib/elasticsearch/api/actions/clear_scroll.rb +6 -4
  25. data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +5 -3
  26. data/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +45 -0
  27. data/lib/elasticsearch/api/actions/cluster/get_component_template.rb +47 -0
  28. data/lib/elasticsearch/api/actions/cluster/get_settings.rb +5 -3
  29. data/lib/elasticsearch/api/actions/cluster/health.rb +7 -4
  30. data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +5 -3
  31. data/lib/elasticsearch/api/actions/cluster/put_component_template.rb +49 -0
  32. data/lib/elasticsearch/api/actions/cluster/put_settings.rb +5 -3
  33. data/lib/elasticsearch/api/actions/cluster/remote_info.rb +5 -3
  34. data/lib/elasticsearch/api/actions/cluster/reroute.rb +5 -3
  35. data/lib/elasticsearch/api/actions/cluster/state.rb +7 -4
  36. data/lib/elasticsearch/api/actions/cluster/stats.rb +6 -4
  37. data/lib/elasticsearch/api/actions/count.rb +8 -6
  38. data/lib/elasticsearch/api/actions/create.rb +2 -2
  39. data/lib/elasticsearch/api/actions/delete.rb +6 -3
  40. data/lib/elasticsearch/api/actions/delete_by_query.rb +7 -5
  41. data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +5 -3
  42. data/lib/elasticsearch/api/actions/delete_script.rb +5 -3
  43. data/lib/elasticsearch/api/actions/exists.rb +5 -2
  44. data/lib/elasticsearch/api/actions/exists_source.rb +5 -2
  45. data/lib/elasticsearch/api/actions/explain.rb +5 -3
  46. data/lib/elasticsearch/api/actions/field_caps.rb +7 -5
  47. data/lib/elasticsearch/api/actions/get.rb +6 -3
  48. data/lib/elasticsearch/api/actions/get_script.rb +5 -3
  49. data/lib/elasticsearch/api/actions/get_script_context.rb +5 -3
  50. data/lib/elasticsearch/api/actions/get_script_languages.rb +5 -3
  51. data/lib/elasticsearch/api/actions/get_source.rb +5 -2
  52. data/lib/elasticsearch/api/actions/index.rb +5 -3
  53. data/lib/elasticsearch/api/actions/indices/analyze.rb +6 -4
  54. data/lib/elasticsearch/api/actions/indices/clear_cache.rb +7 -5
  55. data/lib/elasticsearch/api/actions/indices/clone.rb +5 -3
  56. data/lib/elasticsearch/api/actions/indices/close.rb +6 -4
  57. data/lib/elasticsearch/api/actions/indices/create.rb +5 -3
  58. data/lib/elasticsearch/api/actions/indices/create_data_stream.rb +37 -0
  59. data/lib/elasticsearch/api/actions/indices/delete.rb +7 -4
  60. data/lib/elasticsearch/api/actions/indices/delete_alias.rb +5 -3
  61. data/lib/elasticsearch/api/actions/indices/delete_data_stream.rb +35 -0
  62. data/lib/elasticsearch/api/actions/indices/delete_template.rb +6 -4
  63. data/lib/elasticsearch/api/actions/indices/exists.rb +6 -4
  64. data/lib/elasticsearch/api/actions/indices/exists_alias.rb +6 -4
  65. data/lib/elasticsearch/api/actions/indices/exists_template.rb +5 -3
  66. data/lib/elasticsearch/api/actions/indices/exists_type.rb +6 -4
  67. data/lib/elasticsearch/api/actions/indices/flush.rb +7 -4
  68. data/lib/elasticsearch/api/actions/indices/flush_synced.rb +7 -4
  69. data/lib/elasticsearch/api/actions/indices/forcemerge.rb +7 -5
  70. data/lib/elasticsearch/api/actions/indices/freeze.rb +4 -0
  71. data/lib/elasticsearch/api/actions/indices/get.rb +6 -4
  72. data/lib/elasticsearch/api/actions/indices/get_alias.rb +7 -5
  73. data/lib/elasticsearch/api/actions/indices/get_data_streams.rb +37 -0
  74. data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +6 -4
  75. data/lib/elasticsearch/api/actions/indices/get_mapping.rb +7 -5
  76. data/lib/elasticsearch/api/actions/indices/get_settings.rb +7 -5
  77. data/lib/elasticsearch/api/actions/indices/get_template.rb +6 -4
  78. data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +7 -4
  79. data/lib/elasticsearch/api/actions/indices/open.rb +6 -4
  80. data/lib/elasticsearch/api/actions/indices/put_alias.rb +5 -3
  81. data/lib/elasticsearch/api/actions/indices/put_mapping.rb +6 -3
  82. data/lib/elasticsearch/api/actions/indices/put_settings.rb +6 -4
  83. data/lib/elasticsearch/api/actions/indices/put_template.rb +5 -3
  84. data/lib/elasticsearch/api/actions/indices/recovery.rb +6 -4
  85. data/lib/elasticsearch/api/actions/indices/refresh.rb +7 -4
  86. data/lib/elasticsearch/api/actions/indices/rollover.rb +5 -3
  87. data/lib/elasticsearch/api/actions/indices/segments.rb +7 -5
  88. data/lib/elasticsearch/api/actions/indices/shard_stores.rb +7 -4
  89. data/lib/elasticsearch/api/actions/indices/shrink.rb +5 -3
  90. data/lib/elasticsearch/api/actions/indices/split.rb +5 -3
  91. data/lib/elasticsearch/api/actions/indices/stats.rb +6 -4
  92. data/lib/elasticsearch/api/actions/indices/unfreeze.rb +4 -0
  93. data/lib/elasticsearch/api/actions/indices/update_aliases.rb +5 -3
  94. data/lib/elasticsearch/api/actions/indices/upgrade.rb +7 -5
  95. data/lib/elasticsearch/api/actions/indices/validate_query.rb +7 -5
  96. data/lib/elasticsearch/api/actions/info.rb +5 -3
  97. data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +5 -3
  98. data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +6 -4
  99. data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +5 -3
  100. data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +5 -3
  101. data/lib/elasticsearch/api/actions/ingest/simulate.rb +5 -3
  102. data/lib/elasticsearch/api/actions/mget.rb +5 -3
  103. data/lib/elasticsearch/api/actions/msearch.rb +7 -4
  104. data/lib/elasticsearch/api/actions/msearch_template.rb +6 -3
  105. data/lib/elasticsearch/api/actions/mtermvectors.rb +6 -3
  106. data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +6 -4
  107. data/lib/elasticsearch/api/actions/nodes/info.rb +6 -4
  108. data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +8 -5
  109. data/lib/elasticsearch/api/actions/nodes/stats.rb +6 -4
  110. data/lib/elasticsearch/api/actions/nodes/usage.rb +6 -4
  111. data/lib/elasticsearch/api/actions/ping.rb +5 -3
  112. data/lib/elasticsearch/api/actions/put_script.rb +5 -3
  113. data/lib/elasticsearch/api/actions/rank_eval.rb +6 -3
  114. data/lib/elasticsearch/api/actions/reindex.rb +6 -4
  115. data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +5 -3
  116. data/lib/elasticsearch/api/actions/render_search_template.rb +6 -4
  117. data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +5 -3
  118. data/lib/elasticsearch/api/actions/scroll.rb +6 -4
  119. data/lib/elasticsearch/api/actions/search.rb +8 -6
  120. data/lib/elasticsearch/api/actions/search_shards.rb +7 -4
  121. data/lib/elasticsearch/api/actions/search_template.rb +6 -4
  122. data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +6 -5
  123. data/lib/elasticsearch/api/actions/snapshot/create.rb +5 -3
  124. data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +5 -3
  125. data/lib/elasticsearch/api/actions/snapshot/delete.rb +6 -4
  126. data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +6 -4
  127. data/lib/elasticsearch/api/actions/snapshot/get.rb +6 -4
  128. data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +7 -5
  129. data/lib/elasticsearch/api/actions/snapshot/restore.rb +5 -3
  130. data/lib/elasticsearch/api/actions/snapshot/status.rb +7 -5
  131. data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +5 -3
  132. data/lib/elasticsearch/api/actions/tasks/cancel.rb +6 -4
  133. data/lib/elasticsearch/api/actions/tasks/get.rb +5 -3
  134. data/lib/elasticsearch/api/actions/tasks/list.rb +5 -3
  135. data/lib/elasticsearch/api/actions/termvectors.rb +5 -2
  136. data/lib/elasticsearch/api/actions/update.rb +6 -4
  137. data/lib/elasticsearch/api/actions/update_by_query.rb +7 -5
  138. data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +5 -3
  139. data/lib/elasticsearch/api/version.rb +1 -1
  140. data/spec/elasticsearch/api/actions/cat/aliases_spec.rb +1 -1
  141. data/spec/elasticsearch/api/actions/cat/allocation_spec.rb +1 -1
  142. data/spec/elasticsearch/api/actions/cat/count_spec.rb +1 -1
  143. data/spec/elasticsearch/api/actions/cat/fielddata_spec.rb +2 -2
  144. data/spec/elasticsearch/api/actions/cat/health_spec.rb +1 -1
  145. data/spec/elasticsearch/api/actions/cat/help_spec.rb +1 -1
  146. data/spec/elasticsearch/api/actions/cat/indices_spec.rb +1 -1
  147. data/spec/elasticsearch/api/actions/cat/master_spec.rb +1 -1
  148. data/spec/elasticsearch/api/actions/cat/nodeattrs_spec.rb +1 -1
  149. data/spec/elasticsearch/api/actions/cat/nodes_spec.rb +1 -1
  150. data/spec/elasticsearch/api/actions/cat/pending_tasks_spec.rb +1 -1
  151. data/spec/elasticsearch/api/actions/cat/plugins_spec.rb +1 -1
  152. data/spec/elasticsearch/api/actions/cat/recovery_spec.rb +1 -1
  153. data/spec/elasticsearch/api/actions/cat/repositories_spec.rb +1 -1
  154. data/spec/elasticsearch/api/actions/cat/segments_spec.rb +1 -1
  155. data/spec/elasticsearch/api/actions/cat/shards_spec.rb +1 -1
  156. data/spec/elasticsearch/api/actions/cat/snapshot_spec.rb +1 -1
  157. data/spec/elasticsearch/api/actions/cat/tasks_spec.rb +1 -1
  158. data/spec/elasticsearch/api/actions/cat/templates_spec.rb +1 -1
  159. data/spec/elasticsearch/api/actions/cat/thread_pool_spec.rb +1 -1
  160. data/spec/elasticsearch/api/actions/clear_scroll_spec.rb +4 -2
  161. data/spec/elasticsearch/api/actions/cluster/allocation_explain_spec.rb +1 -1
  162. data/spec/elasticsearch/api/actions/cluster/get_settings_spec.rb +1 -1
  163. data/spec/elasticsearch/api/actions/cluster/health_spec.rb +3 -3
  164. data/spec/elasticsearch/api/actions/cluster/pending_tasks_spec.rb +1 -1
  165. data/spec/elasticsearch/api/actions/cluster/put_settings_spec.rb +1 -1
  166. data/spec/elasticsearch/api/actions/cluster/remote_info_spec.rb +1 -1
  167. data/spec/elasticsearch/api/actions/cluster/reroute_spec.rb +2 -2
  168. data/spec/elasticsearch/api/actions/cluster/state_spec.rb +2 -2
  169. data/spec/elasticsearch/api/actions/cluster/stats_spec.rb +1 -1
  170. data/spec/elasticsearch/api/actions/count_spec.rb +6 -3
  171. data/spec/elasticsearch/api/actions/create_document_spec.rb +8 -4
  172. data/spec/elasticsearch/api/actions/delete_by_query_spec.rb +6 -3
  173. data/spec/elasticsearch/api/actions/delete_document_spec.rb +4 -2
  174. data/spec/elasticsearch/api/actions/delete_script_spec.rb +2 -1
  175. data/spec/elasticsearch/api/actions/exists_document_spec.rb +2 -1
  176. data/spec/elasticsearch/api/actions/explain_document_spec.rb +2 -1
  177. data/spec/elasticsearch/api/actions/field_caps_spec.rb +2 -1
  178. data/spec/elasticsearch/api/actions/get_document_source_spec.rb +2 -1
  179. data/spec/elasticsearch/api/actions/get_document_spec.rb +2 -1
  180. data/spec/elasticsearch/api/actions/get_script_spec.rb +2 -1
  181. data/spec/elasticsearch/api/actions/index_document_spec.rb +2 -1
  182. data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +1 -1
  183. data/spec/elasticsearch/api/actions/indices/clear_cache_spec.rb +1 -1
  184. data/spec/elasticsearch/api/actions/indices/clone_spec.rb +1 -1
  185. data/spec/elasticsearch/api/actions/indices/close_spec.rb +1 -1
  186. data/spec/elasticsearch/api/actions/indices/create_spec.rb +1 -1
  187. data/spec/elasticsearch/api/actions/indices/delete_alias_spec.rb +1 -1
  188. data/spec/elasticsearch/api/actions/indices/delete_spec.rb +1 -1
  189. data/spec/elasticsearch/api/actions/indices/delete_template_spec.rb +1 -1
  190. data/spec/elasticsearch/api/actions/indices/exists_alias_spec.rb +1 -1
  191. data/spec/elasticsearch/api/actions/indices/exists_spec.rb +1 -1
  192. data/spec/elasticsearch/api/actions/indices/exists_template_spec.rb +1 -1
  193. data/spec/elasticsearch/api/actions/indices/exists_type_spec.rb +1 -1
  194. data/spec/elasticsearch/api/actions/indices/flush_spec.rb +1 -1
  195. data/spec/elasticsearch/api/actions/indices/flush_synced_spec.rb +1 -1
  196. data/spec/elasticsearch/api/actions/indices/forcemerge_spec.rb +1 -1
  197. data/spec/elasticsearch/api/actions/indices/freeze_spec.rb +4 -0
  198. data/spec/elasticsearch/api/actions/indices/get_alias_spec.rb +1 -1
  199. data/spec/elasticsearch/api/actions/indices/get_field_mapping_spec.rb +1 -1
  200. data/spec/elasticsearch/api/actions/indices/get_mapping_spec.rb +1 -1
  201. data/spec/elasticsearch/api/actions/indices/get_settings_spec.rb +1 -1
  202. data/spec/elasticsearch/api/actions/indices/get_spec.rb +1 -1
  203. data/spec/elasticsearch/api/actions/indices/open_spec.rb +1 -1
  204. data/spec/elasticsearch/api/actions/indices/put_alias_spec.rb +1 -1
  205. data/spec/elasticsearch/api/actions/indices/put_mapping_spec.rb +1 -1
  206. data/spec/elasticsearch/api/actions/indices/put_settings_spec.rb +1 -1
  207. data/spec/elasticsearch/api/actions/indices/put_template_spec.rb +1 -1
  208. data/spec/elasticsearch/api/actions/indices/recovery_spec.rb +1 -1
  209. data/spec/elasticsearch/api/actions/indices/refresh_spec.rb +1 -1
  210. data/spec/elasticsearch/api/actions/indices/rollover_spec.rb +1 -1
  211. data/spec/elasticsearch/api/actions/indices/segments_spec.rb +1 -1
  212. data/spec/elasticsearch/api/actions/indices/shard_stores_spec.rb +1 -1
  213. data/spec/elasticsearch/api/actions/indices/shrink_spec.rb +1 -1
  214. data/spec/elasticsearch/api/actions/indices/split_spec.rb +1 -1
  215. data/spec/elasticsearch/api/actions/indices/stats_spec.rb +1 -1
  216. data/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb +4 -0
  217. data/spec/elasticsearch/api/actions/indices/update_aliases_spec.rb +1 -1
  218. data/spec/elasticsearch/api/actions/indices/upgrade_spec.rb +1 -1
  219. data/spec/elasticsearch/api/actions/indices/validate_query_spec.rb +1 -1
  220. data/spec/elasticsearch/api/actions/info_spec.rb +2 -1
  221. data/spec/elasticsearch/api/actions/ingest/delete_pipeline_spec.rb +1 -1
  222. data/spec/elasticsearch/api/actions/ingest/get_pipeline_spec.rb +1 -1
  223. data/spec/elasticsearch/api/actions/ingest/put_pipeline_spec.rb +1 -1
  224. data/spec/elasticsearch/api/actions/ingest/simulate_spec.rb +1 -1
  225. data/spec/elasticsearch/api/actions/json_builders_spec.rb +4 -2
  226. data/spec/elasticsearch/api/actions/mget_spec.rb +2 -1
  227. data/spec/elasticsearch/api/actions/mtermvectors_spec.rb +3 -2
  228. data/spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb +1 -1
  229. data/spec/elasticsearch/api/actions/nodes/info_spec.rb +1 -1
  230. data/spec/elasticsearch/api/actions/nodes/reload_secure_settings_spec.rb +13 -8
  231. data/spec/elasticsearch/api/actions/nodes/stats_spec.rb +1 -1
  232. data/spec/elasticsearch/api/actions/ping_spec.rb +3 -2
  233. data/spec/elasticsearch/api/actions/put_script_spec.rb +4 -2
  234. data/spec/elasticsearch/api/actions/reindex_spec.rb +3 -2
  235. data/spec/elasticsearch/api/actions/render_search_template_spec.rb +4 -2
  236. data/spec/elasticsearch/api/actions/scroll_spec.rb +4 -2
  237. data/spec/elasticsearch/api/actions/search_shards_spec.rb +3 -2
  238. data/spec/elasticsearch/api/actions/search_spec.rb +2 -1
  239. data/spec/elasticsearch/api/actions/search_template_spec.rb +2 -1
  240. data/spec/elasticsearch/api/actions/snapshot/create_repository_spec.rb +1 -1
  241. data/spec/elasticsearch/api/actions/snapshot/create_spec.rb +1 -1
  242. data/spec/elasticsearch/api/actions/snapshot/delete_repository_spec.rb +1 -1
  243. data/spec/elasticsearch/api/actions/snapshot/delete_spec.rb +1 -1
  244. data/spec/elasticsearch/api/actions/snapshot/get_repository_spec.rb +1 -1
  245. data/spec/elasticsearch/api/actions/snapshot/get_spec.rb +1 -1
  246. data/spec/elasticsearch/api/actions/snapshot/restore_spec.rb +1 -1
  247. data/spec/elasticsearch/api/actions/snapshot/status_spec.rb +1 -1
  248. data/spec/elasticsearch/api/actions/snapshot/verify_repository_spec.rb +1 -1
  249. data/spec/elasticsearch/api/actions/tasks/cancel_spec.rb +1 -1
  250. data/spec/elasticsearch/api/actions/tasks/get_spec.rb +1 -1
  251. data/spec/elasticsearch/api/actions/tasks/list_spec.rb +1 -1
  252. data/spec/elasticsearch/api/actions/termvectors_spec.rb +2 -1
  253. data/spec/elasticsearch/api/actions/update_by_query_spec.rb +3 -2
  254. data/spec/elasticsearch/api/actions/update_document_spec.rb +2 -1
  255. data/spec/rest_yaml_tests_helper.rb +4 -0
  256. data/utils/thor/generator/endpoint_specifics.rb +1 -3
  257. data/utils/thor/generator/files_helper.rb +10 -0
  258. data/utils/thor/templates/_documentation_top.erb +3 -2
  259. data/utils/thor/templates/_perform_request.erb +6 -5
  260. data/utils/thor/templates/method.erb +2 -1
  261. metadata +14 -17
  262. data/lib/elasticsearch/api/actions/abort_benchmark.rb +0 -28
  263. data/lib/elasticsearch/api/actions/benchmark.rb +0 -68
  264. data/lib/elasticsearch/api/actions/delete_by_rethrottle.rb +0 -34
  265. data/lib/elasticsearch/api/actions/nodes/shutdown.rb +0 -43
  266. data/lib/elasticsearch/api/actions/remote/info.rb +0 -24
  267. data/spec/elasticsearch/api/actions/abort_benchmark_spec.rb +0 -21
  268. data/spec/elasticsearch/api/actions/benchmark_spec.rb +0 -21
  269. data/spec/elasticsearch/api/actions/nodes/shutdown_spec.rb +0 -63
  270. data/spec/elasticsearch/api/actions/remote/info_spec.rb +0 -22
@@ -12,7 +12,7 @@ describe 'client.tasks#get' do
12
12
  '_tasks/foo1',
13
13
  {},
14
14
  nil,
15
- nil
15
+ {}
16
16
  ]
17
17
  end
18
18
 
@@ -12,7 +12,7 @@ describe 'client.tasks#list' do
12
12
  url,
13
13
  {},
14
14
  nil,
15
- nil
15
+ {}
16
16
  ]
17
17
  end
18
18
 
@@ -11,7 +11,8 @@ describe 'client#termvectors' do
11
11
  'GET',
12
12
  url,
13
13
  params,
14
- body
14
+ body,
15
+ {}
15
16
  ]
16
17
  end
17
18
 
@@ -10,8 +10,9 @@ describe 'client#update_by_query' do
10
10
  [
11
11
  'POST',
12
12
  'foo/_update_by_query',
13
- { },
14
- nil
13
+ {},
14
+ nil,
15
+ {}
15
16
  ]
16
17
  end
17
18
 
@@ -11,7 +11,8 @@ describe 'client#update' do
11
11
  'POST',
12
12
  url,
13
13
  params,
14
- body
14
+ body,
15
+ {}
15
16
  ]
16
17
  end
17
18
 
@@ -85,6 +85,10 @@ skipped_tests << { file: 'cluster.health/10_basic.yml',
85
85
  skipped_tests << { file: 'cat.indices/10_basic.yml',
86
86
  description: 'Test cat indices output for closed index (pre 7.2.0)' }
87
87
 
88
+ # support for reloading password protected keystores was introduced in 8.0.0
89
+ skipped_tests << { file: 'nodes.reload_secure_settings/10_basic.yml',
90
+ description: 'node_reload_secure_settings test wrong password' }
91
+
88
92
  SKIPPED_TESTS = skipped_tests
89
93
 
90
94
  # The directory of rest api YAML files.
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  # Licensed to Elasticsearch B.V under one or more agreements.
4
2
  # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
5
3
  # See the LICENSE file in the project root for more information
@@ -87,7 +85,7 @@ module Elasticsearch
87
85
  def ping_perform_request
88
86
  <<~SRC
89
87
  begin
90
- perform_request(method, path, params, body).status == 200 ? true : false
88
+ perform_request(method, path, params, body, headers).status == 200 ? true : false
91
89
  rescue Exception => e
92
90
  if e.class.to_s =~ /NotFound|ConnectionFailed/ || e.message =~ /Not\s*Found|404|ConnectionFailed/i
93
91
  false
@@ -1,4 +1,9 @@
1
+ # Licensed to Elasticsearch B.V under one or more agreements.
2
+ # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
+ # See the LICENSE file in the project root for more information
4
+
1
5
  require 'pathname'
6
+ require_relative '../../../lib/elasticsearch/api/version.rb'
2
7
 
3
8
  module Elasticsearch
4
9
  module API
@@ -32,6 +37,11 @@ module Elasticsearch
32
37
  File.extname(f) != '.json'
33
38
  end
34
39
  end
40
+
41
+ def self.gem_version
42
+ regex = /([0-9]{1,2}\.[0-9x]{1,2})/
43
+ Elasticsearch::API::VERSION.match(regex)[0]
44
+ end
35
45
  end
36
46
  end
37
47
  end
@@ -12,7 +12,8 @@
12
12
  <%# URL parameters -%>
13
13
  <%- @params.each do |name, info| -%>
14
14
  <%= docs_helper(name, info) -%>
15
- <%- end %>
15
+ <%- end -%>
16
+ # @option arguments [Hash] :headers Custom HTTP headers
16
17
  <%= ' '*(@namespace_depth+3) + '# @option arguments [Hash] :body ' + (@spec['body']['description'] ? @spec['body']['description'].strip : 'TODO: Description') + (@spec['body']['required'] ? ' (*Required*)' : '') + "\n" if @spec['body'] -%>
17
18
  <% if @deprecation_note -%>
18
19
  #
@@ -23,5 +24,5 @@
23
24
  <% end -%>
24
25
  <%= ' '*(@namespace_depth+3) -%>#
25
26
  <%# Documentation link -%>
26
- <%= ' '*(@namespace_depth+3) %># @see <%= @spec['documentation']['url'] ? @spec['documentation']['url'].gsub!(/\/(current|master)\//, '/7.5/') : "[TODO]" %>
27
+ <%= ' '*(@namespace_depth+3) %># @see <%= @spec['documentation']['url'] ? @spec['documentation']['url'].gsub(/\/(current|master)\//, "/#{Elasticsearch::API::FilesHelper.gem_version}/") : "[TODO]" %>
27
28
  <%= ' '*(@namespace_depth+3) %>#
@@ -16,22 +16,23 @@ when 'mtermvectors'
16
16
  <%- end -%>
17
17
  <%- if ['bulk', 'msearch', 'msearch_template'].include? @method_name -%>
18
18
  <%= self.send("#{@method_name}_body_helper".to_s) %>
19
- <%= ' '*(@namespace_depth+4) %>perform_request(method, path, params, payload, {"Content-Type" => "application/x-ndjson"}).body
19
+ headers.merge!("Content-Type" => "application/x-ndjson")
20
+ <%= ' '*(@namespace_depth+4) %>perform_request(method, path, params, payload, headers).body
20
21
  <%- elsif @method_name == 'ping' -%>
21
22
  <%= ping_perform_request %>
22
23
  <%- else -%>
23
24
  <%- if needs_ignore_404?(@endpoint_name) %>
24
25
  <%= __utils %>.__rescue_from_not_found do
25
- perform_request(method, path, params, body).status == 200 ? true : false
26
+ perform_request(method, path, params, body, headers).status == 200 ? true : false
26
27
  end
27
28
  <%- elsif needs_complex_ignore_404?(@endpoint_name) -%>
28
29
  if Array(arguments[:ignore]).include?(404)
29
- <%= __utils %>.__rescue_from_not_found { perform_request(method, path, params, body).body }
30
+ <%= __utils %>.__rescue_from_not_found { perform_request(method, path, params, body, headers).body }
30
31
  else
31
- perform_request(method, path, params, body).body
32
+ perform_request(method, path, params, body, headers).body
32
33
  end
33
34
  <%- else -%>
34
- perform_request(method, path, params, body).body
35
+ perform_request(method, path, params, body, headers).body
35
36
  <%- end -%>
36
37
  <%- end -%>
37
38
  <%= ' '*(@namespace_depth+3) %>end
@@ -13,7 +13,7 @@ module Elasticsearch
13
13
  <%= ' '*(@namespace_depth+2) %>module Actions
14
14
  <%= ERB.new(File.new("./thor/templates/_documentation_top.erb").read, trim_mode: '-').result(binding) -%>
15
15
  <%# Method definition -%>
16
- <%= ' '*(@namespace_depth+3) -%>def <%= @method_name %>(arguments={})
16
+ <%= ' '*(@namespace_depth+3) -%>def <%= @method_name %>(arguments = {})
17
17
  <%- if @endpoint_name == 'create' -%>
18
18
  <%= ' '*(@namespace_depth+3) %>if arguments[:id]
19
19
  <%= ' '*(@namespace_depth+3) %> index arguments.update op_type: 'create'
@@ -30,6 +30,7 @@ module Elasticsearch
30
30
  <%= ' '*(@namespace_depth+3) + "raise ArgumentError, \"Required argument '#{required}' missing\" unless arguments[:#{required}]" + "\n" -%>
31
31
  <%- end -%>
32
32
  <%- end -%>
33
+ headers = arguments.delete(:headers) || {}
33
34
  <%- # Method setup -%>
34
35
  <%= ERB.new(File.new("./thor/templates/_method_setup.erb").read, trim_mode: '-').result(binding) %>
35
36
  <%- # Perform request -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.0
4
+ version: 7.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-07 00:00:00.000000000 Z
11
+ date: 2020-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -357,8 +357,6 @@ files:
357
357
  - elasticsearch-api.gemspec
358
358
  - lib/elasticsearch-api.rb
359
359
  - lib/elasticsearch/api.rb
360
- - lib/elasticsearch/api/actions/abort_benchmark.rb
361
- - lib/elasticsearch/api/actions/benchmark.rb
362
360
  - lib/elasticsearch/api/actions/bulk.rb
363
361
  - lib/elasticsearch/api/actions/cat/aliases.rb
364
362
  - lib/elasticsearch/api/actions/cat/allocation.rb
@@ -383,10 +381,13 @@ files:
383
381
  - lib/elasticsearch/api/actions/cat/thread_pool.rb
384
382
  - lib/elasticsearch/api/actions/clear_scroll.rb
385
383
  - lib/elasticsearch/api/actions/cluster/allocation_explain.rb
384
+ - lib/elasticsearch/api/actions/cluster/delete_component_template.rb
385
+ - lib/elasticsearch/api/actions/cluster/get_component_template.rb
386
386
  - lib/elasticsearch/api/actions/cluster/get_settings.rb
387
387
  - lib/elasticsearch/api/actions/cluster/health.rb
388
388
  - lib/elasticsearch/api/actions/cluster/params_registry.rb
389
389
  - lib/elasticsearch/api/actions/cluster/pending_tasks.rb
390
+ - lib/elasticsearch/api/actions/cluster/put_component_template.rb
390
391
  - lib/elasticsearch/api/actions/cluster/put_settings.rb
391
392
  - lib/elasticsearch/api/actions/cluster/remote_info.rb
392
393
  - lib/elasticsearch/api/actions/cluster/reroute.rb
@@ -397,7 +398,6 @@ files:
397
398
  - lib/elasticsearch/api/actions/delete.rb
398
399
  - lib/elasticsearch/api/actions/delete_by_query.rb
399
400
  - lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb
400
- - lib/elasticsearch/api/actions/delete_by_rethrottle.rb
401
401
  - lib/elasticsearch/api/actions/delete_script.rb
402
402
  - lib/elasticsearch/api/actions/exists.rb
403
403
  - lib/elasticsearch/api/actions/exists_source.rb
@@ -414,8 +414,10 @@ files:
414
414
  - lib/elasticsearch/api/actions/indices/clone.rb
415
415
  - lib/elasticsearch/api/actions/indices/close.rb
416
416
  - lib/elasticsearch/api/actions/indices/create.rb
417
+ - lib/elasticsearch/api/actions/indices/create_data_stream.rb
417
418
  - lib/elasticsearch/api/actions/indices/delete.rb
418
419
  - lib/elasticsearch/api/actions/indices/delete_alias.rb
420
+ - lib/elasticsearch/api/actions/indices/delete_data_stream.rb
419
421
  - lib/elasticsearch/api/actions/indices/delete_template.rb
420
422
  - lib/elasticsearch/api/actions/indices/exists.rb
421
423
  - lib/elasticsearch/api/actions/indices/exists_alias.rb
@@ -427,6 +429,7 @@ files:
427
429
  - lib/elasticsearch/api/actions/indices/freeze.rb
428
430
  - lib/elasticsearch/api/actions/indices/get.rb
429
431
  - lib/elasticsearch/api/actions/indices/get_alias.rb
432
+ - lib/elasticsearch/api/actions/indices/get_data_streams.rb
430
433
  - lib/elasticsearch/api/actions/indices/get_field_mapping.rb
431
434
  - lib/elasticsearch/api/actions/indices/get_mapping.rb
432
435
  - lib/elasticsearch/api/actions/indices/get_settings.rb
@@ -465,7 +468,6 @@ files:
465
468
  - lib/elasticsearch/api/actions/nodes/info.rb
466
469
  - lib/elasticsearch/api/actions/nodes/params_registry.rb
467
470
  - lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb
468
- - lib/elasticsearch/api/actions/nodes/shutdown.rb
469
471
  - lib/elasticsearch/api/actions/nodes/stats.rb
470
472
  - lib/elasticsearch/api/actions/nodes/usage.rb
471
473
  - lib/elasticsearch/api/actions/params_registry.rb
@@ -474,7 +476,6 @@ files:
474
476
  - lib/elasticsearch/api/actions/rank_eval.rb
475
477
  - lib/elasticsearch/api/actions/reindex.rb
476
478
  - lib/elasticsearch/api/actions/reindex_rethrottle.rb
477
- - lib/elasticsearch/api/actions/remote/info.rb
478
479
  - lib/elasticsearch/api/actions/render_search_template.rb
479
480
  - lib/elasticsearch/api/actions/scripts_painless_execute.rb
480
481
  - lib/elasticsearch/api/actions/scroll.rb
@@ -512,8 +513,6 @@ files:
512
513
  - lib/elasticsearch/api/utils.rb
513
514
  - lib/elasticsearch/api/version.rb
514
515
  - spec/README.md
515
- - spec/elasticsearch/api/actions/abort_benchmark_spec.rb
516
- - spec/elasticsearch/api/actions/benchmark_spec.rb
517
516
  - spec/elasticsearch/api/actions/bulk_spec.rb
518
517
  - spec/elasticsearch/api/actions/cat/aliases_spec.rb
519
518
  - spec/elasticsearch/api/actions/cat/allocation_spec.rb
@@ -609,12 +608,10 @@ files:
609
608
  - spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb
610
609
  - spec/elasticsearch/api/actions/nodes/info_spec.rb
611
610
  - spec/elasticsearch/api/actions/nodes/reload_secure_settings_spec.rb
612
- - spec/elasticsearch/api/actions/nodes/shutdown_spec.rb
613
611
  - spec/elasticsearch/api/actions/nodes/stats_spec.rb
614
612
  - spec/elasticsearch/api/actions/ping_spec.rb
615
613
  - spec/elasticsearch/api/actions/put_script_spec.rb
616
614
  - spec/elasticsearch/api/actions/reindex_spec.rb
617
- - spec/elasticsearch/api/actions/remote/info_spec.rb
618
615
  - spec/elasticsearch/api/actions/render_search_template_spec.rb
619
616
  - spec/elasticsearch/api/actions/scroll_spec.rb
620
617
  - spec/elasticsearch/api/actions/search_shards_spec.rb
@@ -657,10 +654,14 @@ files:
657
654
  - utils/thor/templates/method.erb
658
655
  - utils/thor/templates/test.erb
659
656
  - utils/thor/templates/test_helper.rb
660
- homepage: https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-api
657
+ homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.x/index.html
661
658
  licenses:
662
659
  - Apache-2.0
663
- metadata: {}
660
+ metadata:
661
+ homepage_uri: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.x/index.html
662
+ changelog_uri: https://github.com/elastic/elasticsearch-ruby/blob/7.x/CHANGELOG.md
663
+ source_code_uri: https://github.com/elastic/elasticsearch-ruby/tree/7.x/elasticsearch-api
664
+ bug_tracker_uri: https://github.com/elastic/elasticsearch-ruby/issues
664
665
  post_install_message:
665
666
  rdoc_options:
666
667
  - "--charset=UTF-8"
@@ -683,8 +684,6 @@ specification_version: 4
683
684
  summary: Ruby API for Elasticsearch.
684
685
  test_files:
685
686
  - spec/README.md
686
- - spec/elasticsearch/api/actions/abort_benchmark_spec.rb
687
- - spec/elasticsearch/api/actions/benchmark_spec.rb
688
687
  - spec/elasticsearch/api/actions/bulk_spec.rb
689
688
  - spec/elasticsearch/api/actions/cat/aliases_spec.rb
690
689
  - spec/elasticsearch/api/actions/cat/allocation_spec.rb
@@ -780,12 +779,10 @@ test_files:
780
779
  - spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb
781
780
  - spec/elasticsearch/api/actions/nodes/info_spec.rb
782
781
  - spec/elasticsearch/api/actions/nodes/reload_secure_settings_spec.rb
783
- - spec/elasticsearch/api/actions/nodes/shutdown_spec.rb
784
782
  - spec/elasticsearch/api/actions/nodes/stats_spec.rb
785
783
  - spec/elasticsearch/api/actions/ping_spec.rb
786
784
  - spec/elasticsearch/api/actions/put_script_spec.rb
787
785
  - spec/elasticsearch/api/actions/reindex_spec.rb
788
- - spec/elasticsearch/api/actions/remote/info_spec.rb
789
786
  - spec/elasticsearch/api/actions/render_search_template_spec.rb
790
787
  - spec/elasticsearch/api/actions/scroll_spec.rb
791
788
  - spec/elasticsearch/api/actions/search_shards_spec.rb
@@ -1,28 +0,0 @@
1
- # Licensed to Elasticsearch B.V under one or more agreements.
2
- # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- # See the LICENSE file in the project root for more information
4
-
5
- module Elasticsearch
6
- module API
7
- module Actions
8
- # Abort a running benchmark
9
- #
10
- # @example
11
- #
12
- # client.abort_benchmark name: 'my_benchmark'
13
- #
14
- # @option arguments [String] :name A benchmark name
15
- #
16
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-benchmark.html
17
- #
18
- def abort_benchmark(arguments = {})
19
- method = HTTP_POST
20
- path = "_bench/abort/#{arguments[:name]}"
21
- params = {}
22
- body = nil
23
-
24
- perform_request(method, path, params, body).body
25
- end
26
- end
27
- end
28
- end
@@ -1,68 +0,0 @@
1
- # Licensed to Elasticsearch B.V under one or more agreements.
2
- # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- # See the LICENSE file in the project root for more information
4
-
5
- module Elasticsearch
6
- module API
7
- module Actions
8
- # Run a single query, or a set of queries, and return statistics on their performance
9
- #
10
- # @example Return statistics for a single query
11
- #
12
- # client.benchmark body: {
13
- # name: 'my_benchmark',
14
- # competitors: [
15
- # {
16
- # name: 'query_1',
17
- # requests: [
18
- # { query: { match: { _all: 'a*' } } }
19
- # ]
20
- # }
21
- # ]
22
- # }
23
- #
24
- # @example Return statistics for a set of "competing" queries
25
- #
26
- # client.benchmark body: {
27
- # name: 'my_benchmark',
28
- # competitors: [
29
- # {
30
- # name: 'query_a',
31
- # requests: [
32
- # { query: { match: { _all: 'a*' } } }
33
- # ]
34
- # },
35
- # {
36
- # name: 'query_b',
37
- # requests: [
38
- # { query: { match: { _all: 'b*' } } }
39
- # ]
40
- # }
41
- # ]
42
- # }
43
- #
44
- # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string
45
- # to perform the operation on all indices
46
- # @option arguments [String] :type The name of the document type
47
- # @option arguments [Hash] :body The search definition using the Query DSL
48
- # @option arguments [Boolean] :verbose Specify whether to return verbose statistics about each iteration
49
- # (default: false)
50
- #
51
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-benchmark.html
52
- #
53
- def benchmark(arguments = {})
54
- method = HTTP_PUT
55
- path = "_bench"
56
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
57
- body = arguments[:body]
58
-
59
- perform_request(method, path, params, body).body
60
- end
61
-
62
- # Register this action with its valid params when the module is loaded.
63
- #
64
- # @since 6.1.1
65
- ParamsRegistry.register(:benchmark, [:verbose].freeze)
66
- end
67
- end
68
- end
@@ -1,34 +0,0 @@
1
- # Licensed to Elasticsearch B.V under one or more agreements.
2
- # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- # See the LICENSE file in the project root for more information
4
-
5
- module Elasticsearch
6
- module API
7
- module Actions
8
- # The value of requests_per_second can be changed on a running delete by query using the _rethrottle API
9
- #
10
- # @option arguments [String] :task_id The task id to rethrottle (*Required*)
11
- # @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
12
- #
13
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
14
- #
15
- def delete_by_query_rethrottle(arguments = {})
16
- raise ArgumentError, "Required argument 'task_id' missing" unless arguments[:task_id]
17
-
18
- method = Elasticsearch::API::HTTP_POST
19
- path = "_delete_by_query/#{arguments[:task_id]}/_rethrottle"
20
- params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
21
- body = nil
22
-
23
- perform_request(method, path, params, body).body
24
- end
25
-
26
- # Register this action with its valid params when the module is loaded.
27
- #
28
- # @since 6.2.0
29
- ParamsRegistry.register(:delete_by_query_rethrottle, [
30
- :requests_per_second
31
- ].freeze)
32
- end
33
- end
34
- end
@@ -1,43 +0,0 @@
1
- # Licensed to Elasticsearch B.V under one or more agreements.
2
- # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- # See the LICENSE file in the project root for more information
4
-
5
- module Elasticsearch
6
- module API
7
- module Nodes
8
- module Actions
9
- # Shutdown one or all nodes
10
- #
11
- # @example Shut down node named _Bloke_
12
- #
13
- # client.nodes.shutdown node_id: 'Bloke'
14
- #
15
- # @option arguments [List] :node_id A comma-separated list of node IDs or names to perform the operation on; use
16
- # `_local` to shutdown the node you're connected to, leave empty to
17
- # shutdown all nodes
18
- # @option arguments [Time] :delay Set the delay for the operation (default: 1s)
19
- # @option arguments [Boolean] :exit Exit the JVM as well (default: true)
20
- #
21
- # @see http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-shutdown/
22
- #
23
- def shutdown(arguments = {})
24
- method = HTTP_POST
25
- path = Utils.__pathify '_cluster/nodes', Utils.__listify(arguments[:node_id]), '_shutdown'
26
-
27
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
28
- body = nil
29
-
30
- perform_request(method, path, params, body).body
31
- end
32
-
33
- # Register this action with its valid params when the module is loaded.
34
- #
35
- # @since 6.1.1
36
- ParamsRegistry.register(:shutdown, [
37
- :delay,
38
- :exit
39
- ].freeze)
40
- end
41
- end
42
- end
43
- end
@@ -1,24 +0,0 @@
1
- # Licensed to Elasticsearch B.V under one or more agreements.
2
- # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- # See the LICENSE file in the project root for more information
4
-
5
- module Elasticsearch
6
- module API
7
- module Remote
8
- module Actions
9
- # Returns all of the configured remote cluster information
10
- #
11
- # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/remote-info.html
12
- #
13
- def info(arguments = {})
14
- method = HTTP_GET
15
- path = "_remote/info"
16
- params = {}
17
- body = nil
18
-
19
- perform_request(method, path, params, body).body
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,21 +0,0 @@
1
- # Licensed to Elasticsearch B.V under one or more agreements.
2
- # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- # See the LICENSE file in the project root for more information
4
-
5
- require 'spec_helper'
6
-
7
- describe 'client#abort_benchmark' do
8
-
9
- let(:expected_args) do
10
- [
11
- 'POST',
12
- '_bench/abort/foo',
13
- {},
14
- nil
15
- ]
16
- end
17
-
18
- it 'performs the request' do
19
- expect(client_double.abort_benchmark(name: 'foo'))
20
- end
21
- end
@@ -1,21 +0,0 @@
1
- # Licensed to Elasticsearch B.V under one or more agreements.
2
- # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- # See the LICENSE file in the project root for more information
4
-
5
- require 'spec_helper'
6
-
7
- describe 'client#benchmark' do
8
-
9
- let(:expected_args) do
10
- [
11
- 'PUT',
12
- '_bench',
13
- {},
14
- { name: 'foo' }
15
- ]
16
- end
17
-
18
- it 'performs the request' do
19
- expect(client_double.benchmark(body: { name: 'foo' }))
20
- end
21
- end
@@ -1,63 +0,0 @@
1
- # Licensed to Elasticsearch B.V under one or more agreements.
2
- # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- # See the LICENSE file in the project root for more information
4
-
5
- require 'spec_helper'
6
-
7
- describe 'client.nodes#shutdown' do
8
-
9
- let(:expected_args) do
10
- [
11
- 'POST',
12
- url,
13
- params,
14
- nil,
15
- nil
16
- ]
17
- end
18
-
19
- let(:url) do
20
- '_cluster/nodes/_shutdown'
21
- end
22
-
23
- it 'performs the request' do
24
- expect(client_double.nodes.shutdown).to eq({})
25
- end
26
-
27
- let(:params) do
28
- {}
29
- end
30
-
31
- context 'when the node id is specified' do
32
-
33
- let(:url) do
34
- '_cluster/nodes/foo/_shutdown'
35
- end
36
-
37
- it 'performs the request' do
38
- expect(client_double.nodes.shutdown(node_id: 'foo')).to eq({})
39
- end
40
- end
41
-
42
- context 'when multiple node ids are specified as a list' do
43
-
44
- let(:url) do
45
- '_cluster/nodes/A,B,C/_shutdown'
46
- end
47
-
48
- it 'performs the request' do
49
- expect(client_double.nodes.shutdown(node_id: ['A', 'B', 'C'])).to eq({})
50
- end
51
- end
52
-
53
- context 'when multiple node ids are specified as a String' do
54
-
55
- let(:url) do
56
- '_cluster/nodes/A,B,C/_shutdown'
57
- end
58
-
59
- it 'performs the request' do
60
- expect(client_double.nodes.shutdown(node_id: 'A,B,C')).to eq({})
61
- end
62
- end
63
- end
@@ -1,22 +0,0 @@
1
- # Licensed to Elasticsearch B.V under one or more agreements.
2
- # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- # See the LICENSE file in the project root for more information
4
-
5
- require 'spec_helper'
6
-
7
- describe 'client.remote#info' do
8
-
9
- let(:expected_args) do
10
- [
11
- 'GET',
12
- '_remote/info',
13
- {},
14
- nil,
15
- nil
16
- ]
17
- end
18
-
19
- it 'performs the request' do
20
- expect(client_double.remote.info).to eq({})
21
- end
22
- end