elasticsearch-api 7.4.0 → 7.5.0.pre.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +16 -23
  3. data/lib/elasticsearch/api/actions/abort_benchmark.rb +1 -2
  4. data/lib/elasticsearch/api/actions/benchmark.rb +2 -3
  5. data/lib/elasticsearch/api/actions/bulk.rb +35 -68
  6. data/lib/elasticsearch/api/actions/cat/aliases.rb +30 -52
  7. data/lib/elasticsearch/api/actions/cat/allocation.rb +36 -50
  8. data/lib/elasticsearch/api/actions/cat/count.rb +25 -46
  9. data/lib/elasticsearch/api/actions/cat/fielddata.rb +31 -33
  10. data/lib/elasticsearch/api/actions/cat/health.rb +27 -37
  11. data/lib/elasticsearch/api/actions/cat/help.rb +14 -10
  12. data/lib/elasticsearch/api/actions/cat/indices.rb +45 -62
  13. data/lib/elasticsearch/api/actions/cat/master.rb +24 -34
  14. data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +20 -16
  15. data/lib/elasticsearch/api/actions/cat/nodes.rb +34 -46
  16. data/lib/elasticsearch/api/actions/cat/params_registry.rb +0 -1
  17. data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +29 -35
  18. data/lib/elasticsearch/api/actions/cat/plugins.rb +21 -18
  19. data/lib/elasticsearch/api/actions/cat/recovery.rb +40 -56
  20. data/lib/elasticsearch/api/actions/cat/repositories.rb +21 -24
  21. data/lib/elasticsearch/api/actions/cat/segments.rb +29 -22
  22. data/lib/elasticsearch/api/actions/cat/shards.rb +38 -59
  23. data/lib/elasticsearch/api/actions/cat/snapshots.rb +32 -27
  24. data/lib/elasticsearch/api/actions/cat/tasks.rb +25 -19
  25. data/lib/elasticsearch/api/actions/cat/templates.rb +26 -18
  26. data/lib/elasticsearch/api/actions/cat/thread_pool.rb +36 -46
  27. data/lib/elasticsearch/api/actions/clear_scroll.rb +21 -8
  28. data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +15 -13
  29. data/lib/elasticsearch/api/actions/cluster/get_settings.rb +18 -18
  30. data/lib/elasticsearch/api/actions/cluster/health.rb +42 -44
  31. data/lib/elasticsearch/api/actions/cluster/params_registry.rb +0 -1
  32. data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +15 -17
  33. data/lib/elasticsearch/api/actions/cluster/put_settings.rb +20 -17
  34. data/lib/elasticsearch/api/actions/cluster/remote_info.rb +8 -6
  35. data/lib/elasticsearch/api/actions/cluster/reroute.rb +25 -37
  36. data/lib/elasticsearch/api/actions/cluster/state.rb +37 -41
  37. data/lib/elasticsearch/api/actions/cluster/stats.rb +20 -12
  38. data/lib/elasticsearch/api/actions/count.rb +52 -39
  39. data/lib/elasticsearch/api/actions/create.rb +25 -26
  40. data/lib/elasticsearch/api/actions/delete.rb +43 -36
  41. data/lib/elasticsearch/api/actions/delete_by_query.rb +74 -62
  42. data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +39 -0
  43. data/lib/elasticsearch/api/actions/delete_by_rethrottle.rb +4 -3
  44. data/lib/elasticsearch/api/actions/delete_script.rb +19 -13
  45. data/lib/elasticsearch/api/actions/exists.rb +44 -34
  46. data/lib/elasticsearch/api/actions/exists_source.rb +43 -25
  47. data/lib/elasticsearch/api/actions/explain.rb +46 -51
  48. data/lib/elasticsearch/api/actions/field_caps.rb +27 -20
  49. data/lib/elasticsearch/api/actions/get.rb +42 -41
  50. data/lib/elasticsearch/api/actions/get_script.rb +19 -14
  51. data/lib/elasticsearch/api/actions/get_source.rb +38 -44
  52. data/lib/elasticsearch/api/actions/index.rb +60 -89
  53. data/lib/elasticsearch/api/actions/indices/analyze.rb +19 -48
  54. data/lib/elasticsearch/api/actions/indices/clear_cache.rb +29 -41
  55. data/lib/elasticsearch/api/actions/indices/clone.rb +21 -21
  56. data/lib/elasticsearch/api/actions/indices/close.rb +28 -32
  57. data/lib/elasticsearch/api/actions/indices/create.rb +22 -70
  58. data/lib/elasticsearch/api/actions/indices/delete.rb +23 -35
  59. data/lib/elasticsearch/api/actions/indices/delete_alias.rb +24 -20
  60. data/lib/elasticsearch/api/actions/indices/delete_template.rb +18 -20
  61. data/lib/elasticsearch/api/actions/indices/exists.rb +32 -34
  62. data/lib/elasticsearch/api/actions/indices/exists_alias.rb +33 -29
  63. data/lib/elasticsearch/api/actions/indices/exists_template.rb +21 -16
  64. data/lib/elasticsearch/api/actions/indices/exists_type.rb +29 -29
  65. data/lib/elasticsearch/api/actions/indices/flush.rb +28 -28
  66. data/lib/elasticsearch/api/actions/indices/flush_synced.rb +23 -12
  67. data/lib/elasticsearch/api/actions/indices/forcemerge.rb +26 -41
  68. data/lib/elasticsearch/api/actions/indices/freeze.rb +7 -8
  69. data/lib/elasticsearch/api/actions/indices/get.rb +25 -19
  70. data/lib/elasticsearch/api/actions/indices/get_alias.rb +31 -23
  71. data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +42 -38
  72. data/lib/elasticsearch/api/actions/indices/get_mapping.rb +39 -31
  73. data/lib/elasticsearch/api/actions/indices/get_settings.rb +34 -37
  74. data/lib/elasticsearch/api/actions/indices/get_template.rb +21 -23
  75. data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +48 -0
  76. data/lib/elasticsearch/api/actions/indices/open.rb +24 -21
  77. data/lib/elasticsearch/api/actions/indices/params_registry.rb +0 -1
  78. data/lib/elasticsearch/api/actions/indices/put_alias.rb +25 -27
  79. data/lib/elasticsearch/api/actions/indices/put_mapping.rb +40 -39
  80. data/lib/elasticsearch/api/actions/indices/put_settings.rb +30 -37
  81. data/lib/elasticsearch/api/actions/indices/put_template.rb +23 -23
  82. data/lib/elasticsearch/api/actions/indices/recovery.rb +20 -23
  83. data/lib/elasticsearch/api/actions/indices/refresh.rb +22 -26
  84. data/lib/elasticsearch/api/actions/indices/rollover.rb +28 -19
  85. data/lib/elasticsearch/api/actions/indices/segments.rb +24 -17
  86. data/lib/elasticsearch/api/actions/indices/shard_stores.rb +27 -15
  87. data/lib/elasticsearch/api/actions/indices/shrink.rb +23 -17
  88. data/lib/elasticsearch/api/actions/indices/split.rb +23 -17
  89. data/lib/elasticsearch/api/actions/indices/stats.rb +53 -104
  90. data/lib/elasticsearch/api/actions/indices/unfreeze.rb +7 -7
  91. data/lib/elasticsearch/api/actions/indices/update_aliases.rb +15 -32
  92. data/lib/elasticsearch/api/actions/indices/upgrade.rb +26 -16
  93. data/lib/elasticsearch/api/actions/indices/validate_query.rb +46 -59
  94. data/lib/elasticsearch/api/actions/info.rb +9 -6
  95. data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +18 -12
  96. data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +21 -11
  97. data/lib/elasticsearch/api/actions/ingest/params_registry.rb +0 -1
  98. data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +12 -13
  99. data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +19 -14
  100. data/lib/elasticsearch/api/actions/ingest/simulate.rb +23 -13
  101. data/lib/elasticsearch/api/actions/mget.rb +37 -44
  102. data/lib/elasticsearch/api/actions/msearch.rb +54 -54
  103. data/lib/elasticsearch/api/actions/msearch_template.rb +46 -35
  104. data/lib/elasticsearch/api/actions/mtermvectors.rb +39 -35
  105. data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +30 -25
  106. data/lib/elasticsearch/api/actions/nodes/info.rb +29 -63
  107. data/lib/elasticsearch/api/actions/nodes/params_registry.rb +0 -1
  108. data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +24 -22
  109. data/lib/elasticsearch/api/actions/nodes/shutdown.rb +4 -4
  110. data/lib/elasticsearch/api/actions/nodes/stats.rb +43 -36
  111. data/lib/elasticsearch/api/actions/nodes/usage.rb +31 -10
  112. data/lib/elasticsearch/api/actions/params_registry.rb +0 -1
  113. data/lib/elasticsearch/api/actions/ping.rb +12 -13
  114. data/lib/elasticsearch/api/actions/put_script.rb +26 -30
  115. data/lib/elasticsearch/api/actions/rank_eval.rb +24 -15
  116. data/lib/elasticsearch/api/actions/reindex.rb +25 -48
  117. data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +18 -12
  118. data/lib/elasticsearch/api/actions/remote/info.rb +1 -2
  119. data/lib/elasticsearch/api/actions/render_search_template.rb +17 -15
  120. data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +8 -6
  121. data/lib/elasticsearch/api/actions/scroll.rb +28 -51
  122. data/lib/elasticsearch/api/actions/search.rb +104 -165
  123. data/lib/elasticsearch/api/actions/search_shards.rb +31 -28
  124. data/lib/elasticsearch/api/actions/search_template.rb +48 -40
  125. data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +44 -0
  126. data/lib/elasticsearch/api/actions/snapshot/create.rb +22 -29
  127. data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +19 -24
  128. data/lib/elasticsearch/api/actions/snapshot/delete.rb +20 -22
  129. data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +16 -18
  130. data/lib/elasticsearch/api/actions/snapshot/get.rb +22 -31
  131. data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +21 -25
  132. data/lib/elasticsearch/api/actions/snapshot/params_registry.rb +0 -1
  133. data/lib/elasticsearch/api/actions/snapshot/restore.rb +21 -32
  134. data/lib/elasticsearch/api/actions/snapshot/status.rb +23 -24
  135. data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +18 -13
  136. data/lib/elasticsearch/api/actions/tasks/cancel.rb +19 -13
  137. data/lib/elasticsearch/api/actions/tasks/get.rb +16 -13
  138. data/lib/elasticsearch/api/actions/tasks/list.rb +20 -18
  139. data/lib/elasticsearch/api/actions/tasks/params_registry.rb +0 -1
  140. data/lib/elasticsearch/api/actions/termvectors.rb +52 -70
  141. data/lib/elasticsearch/api/actions/update.rb +53 -98
  142. data/lib/elasticsearch/api/actions/update_by_query.rb +77 -66
  143. data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +17 -11
  144. data/lib/elasticsearch/api/version.rb +1 -1
  145. data/spec/elasticsearch/api/actions/cat/segments_spec.rb +9 -11
  146. data/spec/elasticsearch/api/actions/cluster/put_settings_spec.rb +1 -1
  147. data/spec/elasticsearch/api/actions/count_spec.rb +8 -8
  148. data/spec/elasticsearch/api/actions/delete_by_query_spec.rb +12 -7
  149. data/spec/elasticsearch/api/actions/delete_script_spec.rb +0 -14
  150. data/spec/elasticsearch/api/actions/exists_document_spec.rb +1 -1
  151. data/spec/elasticsearch/api/actions/get_document_source_spec.rb +1 -1
  152. data/spec/elasticsearch/api/actions/index_document_spec.rb +6 -15
  153. data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +0 -4
  154. data/spec/elasticsearch/api/actions/indices/clear_cache_spec.rb +1 -5
  155. data/spec/elasticsearch/api/actions/indices/clone_spec.rb +1 -1
  156. data/spec/elasticsearch/api/actions/indices/delete_alias_spec.rb +2 -2
  157. data/spec/elasticsearch/api/actions/indices/get_spec.rb +0 -11
  158. data/spec/elasticsearch/api/actions/indices/put_alias_spec.rb +3 -3
  159. data/spec/elasticsearch/api/actions/indices/put_mapping_spec.rb +3 -3
  160. data/spec/elasticsearch/api/actions/indices/stats_spec.rb +0 -1
  161. data/spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb +3 -3
  162. data/spec/elasticsearch/api/actions/put_script_spec.rb +20 -15
  163. data/spec/elasticsearch/api/actions/render_search_template_spec.rb +23 -7
  164. data/spec/elasticsearch/api/actions/scroll_spec.rb +37 -0
  165. data/spec/elasticsearch/api/actions/search_spec.rb +0 -15
  166. data/spec/elasticsearch/api/actions/tasks/list_spec.rb +0 -11
  167. data/spec/elasticsearch/api/actions/update_document_spec.rb +3 -7
  168. data/spec/rest_yaml_tests_helper.rb +12 -0
  169. data/utils/Gemfile +1 -0
  170. data/utils/Thorfile +0 -1
  171. data/utils/thor/generate_source.rb +192 -85
  172. data/utils/thor/generator/endpoint_specifics.rb +157 -0
  173. data/utils/thor/generator/files_helper.rb +37 -0
  174. data/utils/thor/lister.rb +3 -4
  175. data/utils/thor/templates/_documentation_top.erb +27 -0
  176. data/utils/thor/templates/_method_setup.erb +35 -0
  177. data/utils/thor/templates/_params_registry.erb +12 -0
  178. data/utils/thor/templates/_perform_request.erb +37 -0
  179. data/utils/thor/templates/method.erb +59 -0
  180. data/utils/thor/templates/{ruby/test.erb → test.erb} +0 -0
  181. data/utils/thor/templates/{ruby/test_helper.rb → test_helper.rb} +0 -0
  182. metadata +19 -11
  183. data/spec/elasticsearch/api/actions/scoll_spec.rb +0 -21
  184. data/utils/thor/generate_api.rb +0 -193
  185. data/utils/thor/templates/ruby/method.erb +0 -62
@@ -5,21 +5,26 @@
5
5
  module Elasticsearch
6
6
  module API
7
7
  module Actions
8
-
9
- # The value of requests_per_second can be changed on a running update by query using the _rethrottle API
8
+ # Changes the number of requests per second for a particular Update By Query operation.
10
9
  #
11
- # @option arguments [String] :task_id The task id to rethrottle (*Required*)
12
- # @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
10
+ # @option arguments [String] :task_id The task id to rethrottle
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. (*Required*)
12
+
13
13
  #
14
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html
14
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/docs-update-by-query.html
15
15
  #
16
- def update_by_query_rethrottle(arguments={})
16
+ def update_by_query_rethrottle(arguments = {})
17
17
  raise ArgumentError, "Required argument 'task_id' missing" unless arguments[:task_id]
18
+
19
+ arguments = arguments.clone
20
+
21
+ _task_id = arguments.delete(:task_id)
22
+
18
23
  method = Elasticsearch::API::HTTP_POST
19
- path = "_update_by_query/#{arguments[:task_id]}/_rethrottle"
20
- params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
21
- body = nil
24
+ path = "_update_by_query/#{Utils.__listify(_task_id)}/_rethrottle"
25
+ params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
22
26
 
27
+ body = nil
23
28
  perform_request(method, path, params, body).body
24
29
  end
25
30
 
@@ -27,7 +32,8 @@ module Elasticsearch
27
32
  #
28
33
  # @since 6.2.0
29
34
  ParamsRegistry.register(:update_by_query_rethrottle, [
30
- :requests_per_second ].freeze)
35
+ :requests_per_second
36
+ ].freeze)
37
+ end
31
38
  end
32
- end
33
39
  end
@@ -4,6 +4,6 @@
4
4
 
5
5
  module Elasticsearch
6
6
  module API
7
- VERSION = "7.4.0"
7
+ VERSION = "7.5.0-pre"
8
8
  end
9
9
  end
@@ -8,16 +8,16 @@ describe 'client.cat#segments' do
8
8
 
9
9
  let(:expected_args) do
10
10
  [
11
- 'GET',
12
- '_cat/segments',
13
- params,
14
- nil,
15
- nil
11
+ 'GET',
12
+ url,
13
+ {},
14
+ nil,
15
+ nil
16
16
  ]
17
17
  end
18
18
 
19
- let(:params) do
20
- {}
19
+ let(:url) do
20
+ '_cat/segments'
21
21
  end
22
22
 
23
23
  it 'performs the request' do
@@ -25,10 +25,8 @@ describe 'client.cat#segments' do
25
25
  end
26
26
 
27
27
  context 'when index is specified' do
28
-
29
-
30
- let(:params) do
31
- { index: 'foo' }
28
+ let(:url) do
29
+ '_cat/segments/foo'
32
30
  end
33
31
 
34
32
  it 'performs the request' do
@@ -17,6 +17,6 @@ describe 'client.cluster#put_settings' do
17
17
  end
18
18
 
19
19
  it 'performs the request' do
20
- expect(client_double.cluster.put_settings).to eq({})
20
+ expect(client_double.cluster.put_settings(body: {})).to eq({})
21
21
  end
22
22
  end
@@ -23,10 +23,10 @@ describe 'client#count' do
23
23
 
24
24
  let(:expected_args) do
25
25
  [
26
- 'GET',
27
- 'foo,bar/t1,t2/_count',
28
- {},
29
- nil
26
+ 'GET',
27
+ 'foo,bar/t1,t2/_count',
28
+ {},
29
+ nil
30
30
  ]
31
31
  end
32
32
 
@@ -39,10 +39,10 @@ describe 'client#count' do
39
39
 
40
40
  let(:expected_args) do
41
41
  [
42
- 'GET',
43
- '_count',
44
- {},
45
- { match: { foo: 'bar' } }
42
+ 'POST',
43
+ '_count',
44
+ {},
45
+ { match: { foo: 'bar' } }
46
46
  ]
47
47
  end
48
48
 
@@ -8,10 +8,10 @@ describe 'client#delete_by_query' do
8
8
 
9
9
  let(:expected_args) do
10
10
  [
11
- 'POST',
12
- 'foo/_delete_by_query',
13
- {},
14
- { term: {} }
11
+ 'POST',
12
+ 'foo/_delete_by_query',
13
+ {},
14
+ { term: {} }
15
15
  ]
16
16
  end
17
17
 
@@ -42,18 +42,23 @@ describe 'client#delete_by_query' do
42
42
  end
43
43
 
44
44
  context 'when a query is provided' do
45
-
46
45
  let(:expected_args) do
47
46
  [
48
47
  'POST',
49
48
  'foo/_delete_by_query',
50
49
  { q: 'foo:bar' },
51
- nil
50
+ { query: 'query' }
52
51
  ]
53
52
  end
54
53
 
55
54
  it 'performs the request' do
56
- expect(client_double.delete_by_query(index: 'foo', q: 'foo:bar')).to eq({})
55
+ expect(
56
+ client_double.delete_by_query(
57
+ index: 'foo',
58
+ q: 'foo:bar',
59
+ body: { query: 'query' }
60
+ )
61
+ ).to eq({})
57
62
  end
58
63
  end
59
64
  end
@@ -5,20 +5,6 @@
5
5
  require 'spec_helper'
6
6
 
7
7
  describe 'client#delete_script' do
8
-
9
- let(:expected_args) do
10
- [
11
- 'DELETE',
12
- '_scripts/groovy/foo',
13
- {},
14
- nil
15
- ]
16
- end
17
-
18
- it 'performs the request' do
19
- expect(client_double.delete_script(lang: 'groovy', id: 'foo')).to eq({})
20
- end
21
-
22
8
  context 'when lang parameter is not provided' do
23
9
 
24
10
  let(:expected_args) do
@@ -42,7 +42,7 @@ describe 'client#exists' do
42
42
  context 'when the type parameter is not provided' do
43
43
 
44
44
  let(:url) do
45
- 'foo/_all/1'
45
+ 'foo/_doc/1'
46
46
  end
47
47
 
48
48
  it 'performs the request' do
@@ -42,7 +42,7 @@ describe 'client#get_source' do
42
42
  context 'when the type parameter is not provided' do
43
43
 
44
44
  let(:url) do
45
- 'foo/_doc/1/_source'
45
+ 'foo/_source/1'
46
46
  end
47
47
 
48
48
  it 'performs the request' do
@@ -28,7 +28,7 @@ describe 'client#index' do
28
28
  end
29
29
 
30
30
  let(:body) do
31
- { :foo => 'bar' }
31
+ { foo: 'bar' }
32
32
  end
33
33
 
34
34
  let(:client) do
@@ -42,7 +42,7 @@ describe 'client#index' do
42
42
  end
43
43
 
44
44
  it 'performs the request' do
45
- expect(client_double.index(index: 'foo', type: 'bar', body: { foo: 'bar' })).to eq({})
45
+ expect(client_double.index(index: 'foo', type: 'bar', body: body)).to eq({})
46
46
  end
47
47
 
48
48
  context 'when a specific id is provided' do
@@ -56,7 +56,7 @@ describe 'client#index' do
56
56
  end
57
57
 
58
58
  it 'performs the request' do
59
- expect(client_double.index(index: 'foo', type: 'bar', id: '1', body: { foo: 'bar' })).to eq({})
59
+ expect(client_double.index(index: 'foo', type: 'bar', id: '1', body: body)).to eq({})
60
60
  end
61
61
  end
62
62
 
@@ -74,12 +74,8 @@ describe 'client#index' do
74
74
  { op_type: 'create' }
75
75
  end
76
76
 
77
- let(:body) do
78
- nil
79
- end
80
-
81
77
  it 'passes the URL params' do
82
- expect(client_double.index(index: 'foo', type: 'bar', op_type: 'create')).to eq({})
78
+ expect(client_double.index(index: 'foo', type: 'bar', op_type: 'create', body: body)).to eq({})
83
79
  end
84
80
 
85
81
  context 'when a specific id is provided' do
@@ -97,13 +93,12 @@ describe 'client#index' do
97
93
  end
98
94
 
99
95
  it 'passes the URL params' do
100
- expect(client_double.index(index: 'foo', type: 'bar', id: '1', op_type: 'create')).to eq({})
96
+ expect(client_double.index(index: 'foo', type: 'bar', id: '1', op_type: 'create', body: body)).to eq({})
101
97
  end
102
98
  end
103
99
  end
104
100
 
105
101
  context 'when the request needs to be URL-escaped' do
106
-
107
102
  let(:request_type) do
108
103
  'PUT'
109
104
  end
@@ -112,12 +107,8 @@ describe 'client#index' do
112
107
  'foo/bar%2Fbam/123'
113
108
  end
114
109
 
115
- let(:body) do
116
- nil
117
- end
118
-
119
110
  it 'URL-escapes the parts' do
120
- expect(client_double.index(index: 'foo', type: 'bar/bam', id: '123')).to eq({})
111
+ expect(client_double.index(index: 'foo', type: 'bar/bam', id: '123', body: body)).to eq({})
121
112
  end
122
113
  end
123
114
 
@@ -38,10 +38,6 @@ describe 'client.indices#analyze' do
38
38
  'foo/_analyze'
39
39
  end
40
40
 
41
- let(:params) do
42
- { index: 'foo' }
43
- end
44
-
45
41
  it 'performs the request' do
46
42
  expect(client_double.indices.analyze(index: 'foo')).to eq({})
47
43
  end
@@ -34,10 +34,6 @@ describe 'client.indices#clear_cache' do
34
34
  'foo/_cache/clear'
35
35
  end
36
36
 
37
- let(:params) do
38
- { index: 'foo' }
39
- end
40
-
41
37
  it 'performs the request' do
42
38
  expect(client_double.indices.clear_cache(index: 'foo')).to eq({})
43
39
  end
@@ -61,7 +57,7 @@ describe 'client.indices#clear_cache' do
61
57
  end
62
58
 
63
59
  let(:params) do
64
- { index: 'foo^bar' }
60
+ { }
65
61
  end
66
62
 
67
63
  it 'performs the request' do
@@ -8,7 +8,7 @@ describe 'client.indices#clone' do
8
8
 
9
9
  let(:expected_args) do
10
10
  [
11
- 'POST',
11
+ 'PUT',
12
12
  url,
13
13
  params,
14
14
  body,
@@ -49,7 +49,7 @@ describe 'client.indices#delete_alias' do
49
49
  context 'when an index and name are specified' do
50
50
 
51
51
  let(:url) do
52
- 'foo/_alias/bar'
52
+ 'foo/_aliases/bar'
53
53
  end
54
54
 
55
55
  it 'performs the request' do
@@ -60,7 +60,7 @@ describe 'client.indices#delete_alias' do
60
60
  context 'when the path must be URL-escaped' do
61
61
 
62
62
  let(:url) do
63
- 'foo%5Ebar/_alias/bar%2Fbam'
63
+ 'foo%5Ebar/_aliases/bar%2Fbam'
64
64
  end
65
65
 
66
66
  it 'performs the request' do
@@ -38,15 +38,4 @@ describe 'client.indices#get' do
38
38
  expect(client_double.indices.get(index: 'foo', ignore_unavailable: 1)).to eq({})
39
39
  end
40
40
  end
41
-
42
- context 'when features are specified' do
43
-
44
- let(:url) do
45
- 'foo/_settings'
46
- end
47
-
48
- it 'includes them in the URL' do
49
- expect(client_double.indices.get(index: 'foo', feature: '_settings')).to eq({})
50
- end
51
- end
52
41
  end
@@ -17,7 +17,7 @@ describe 'client.cluster#put_alias' do
17
17
  end
18
18
 
19
19
  let(:url) do
20
- 'foo/_alias/bar'
20
+ 'foo/_aliases/bar'
21
21
  end
22
22
 
23
23
  let(:body) do
@@ -55,7 +55,7 @@ describe 'client.cluster#put_alias' do
55
55
  context 'when multiple indices are specified' do
56
56
 
57
57
  let(:url) do
58
- 'foo,bar/_alias/bam'
58
+ 'foo,bar/_aliases/bam'
59
59
  end
60
60
 
61
61
  it 'performs the request' do
@@ -66,7 +66,7 @@ describe 'client.cluster#put_alias' do
66
66
  context 'when the path needs to be URL-escaped' do
67
67
 
68
68
  let(:url) do
69
- 'foo%5Ebar/_alias/bar%2Fbam'
69
+ 'foo%5Ebar/_aliases/bar%2Fbam'
70
70
  end
71
71
 
72
72
  it 'performs the request' do
@@ -17,7 +17,7 @@ describe 'client.cluster#put_mapping' do
17
17
  end
18
18
 
19
19
  let(:url) do
20
- 'foo/_mapping/bar'
20
+ 'foo/bar/_mappings'
21
21
  end
22
22
 
23
23
  let(:body) do
@@ -68,7 +68,7 @@ describe 'client.cluster#put_mapping' do
68
68
  context 'when multiple indices are specified' do
69
69
 
70
70
  let(:url) do
71
- 'foo,bar/_mapping/bam'
71
+ 'foo,bar/bam/_mappings'
72
72
  end
73
73
 
74
74
  it 'performs the request' do
@@ -79,7 +79,7 @@ describe 'client.cluster#put_mapping' do
79
79
  context 'when the path needs to be URL-escaped' do
80
80
 
81
81
  let(:url) do
82
- 'foo%5Ebar/_mapping/bar%2Fbam'
82
+ 'foo%5Ebar/bar%2Fbam/_mappings'
83
83
  end
84
84
 
85
85
  it 'performs the request' do
@@ -66,7 +66,6 @@ describe 'client.cluster#stats' do
66
66
  end
67
67
 
68
68
  context 'when parameters are specified' do
69
-
70
69
  let(:params) do
71
70
  { expand_wildcards: true }
72
71
  end
@@ -17,7 +17,7 @@ describe 'client.nodes#hot_threads' do
17
17
  end
18
18
 
19
19
  let(:url) do
20
- '_nodes/hot_threads'
20
+ '_cluster/nodes/hot_threads'
21
21
  end
22
22
 
23
23
  it 'performs the request' do
@@ -27,7 +27,7 @@ describe 'client.nodes#hot_threads' do
27
27
  context 'when the node id is specified' do
28
28
 
29
29
  let(:url) do
30
- '_nodes/foo/hot_threads'
30
+ '_cluster/nodes/foo/hot_threads'
31
31
  end
32
32
 
33
33
  it 'performs the request' do
@@ -38,7 +38,7 @@ describe 'client.nodes#hot_threads' do
38
38
  context 'when the path must be URL-escaped' do
39
39
 
40
40
  let(:url) do
41
- '_nodes/foo%5Ebar/hot_threads'
41
+ '_cluster/nodes/foo%5Ebar/hot_threads'
42
42
  end
43
43
 
44
44
  it 'performs the request' do