elasticsearch-api 6.2.0 → 6.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/elasticsearch/api/actions/abort_benchmark.rb +1 -1
- data/lib/elasticsearch/api/actions/benchmark.rb +1 -1
- data/lib/elasticsearch/api/actions/bulk.rb +4 -6
- data/lib/elasticsearch/api/actions/cat/aliases.rb +10 -10
- data/lib/elasticsearch/api/actions/cat/allocation.rb +11 -11
- data/lib/elasticsearch/api/actions/cat/count.rb +10 -10
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +9 -7
- data/lib/elasticsearch/api/actions/cat/health.rb +11 -11
- data/lib/elasticsearch/api/actions/cat/help.rb +4 -2
- data/lib/elasticsearch/api/actions/cat/indices.rb +14 -15
- data/lib/elasticsearch/api/actions/cat/master.rb +10 -10
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/nodes.rb +10 -10
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +10 -10
- data/lib/elasticsearch/api/actions/cat/plugins.rb +7 -6
- data/lib/elasticsearch/api/actions/cat/recovery.rb +10 -12
- data/lib/elasticsearch/api/actions/cat/repositories.rb +7 -3
- data/lib/elasticsearch/api/actions/cat/segments.rb +9 -7
- data/lib/elasticsearch/api/actions/cat/shards.rb +12 -12
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +8 -4
- data/lib/elasticsearch/api/actions/cat/tasks.rb +4 -6
- data/lib/elasticsearch/api/actions/cat/templates.rb +6 -6
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +13 -17
- data/lib/elasticsearch/api/actions/clear_scroll.rb +7 -0
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +2 -3
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +5 -2
- data/lib/elasticsearch/api/actions/cluster/health.rb +11 -20
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +2 -3
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +8 -3
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +7 -1
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +7 -7
- data/lib/elasticsearch/api/actions/cluster/state.rb +18 -15
- data/lib/elasticsearch/api/actions/cluster/stats.rb +12 -5
- data/lib/elasticsearch/api/actions/count.rb +12 -23
- data/lib/elasticsearch/api/actions/count_percolate.rb +1 -1
- data/lib/elasticsearch/api/actions/delete.rb +16 -8
- data/lib/elasticsearch/api/actions/delete_by_query.rb +7 -9
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +29 -0
- data/lib/elasticsearch/api/actions/delete_script.rb +5 -6
- data/lib/elasticsearch/api/actions/exists.rb +3 -4
- data/lib/elasticsearch/api/actions/exists_source.rb +51 -0
- data/lib/elasticsearch/api/actions/explain.rb +11 -25
- data/lib/elasticsearch/api/actions/field_caps.rb +2 -2
- data/lib/elasticsearch/api/actions/get.rb +13 -19
- data/lib/elasticsearch/api/actions/get_script.rb +9 -2
- data/lib/elasticsearch/api/actions/get_source.rb +10 -14
- data/lib/elasticsearch/api/actions/index.rb +10 -16
- data/lib/elasticsearch/api/actions/indices/analyze.rb +3 -27
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +2 -4
- data/lib/elasticsearch/api/actions/indices/close.rb +9 -15
- data/lib/elasticsearch/api/actions/indices/create.rb +7 -7
- data/lib/elasticsearch/api/actions/indices/delete.rb +3 -4
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +5 -2
- data/lib/elasticsearch/api/actions/indices/exists.rb +11 -17
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +6 -14
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +8 -4
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +6 -15
- data/lib/elasticsearch/api/actions/indices/flush.rb +5 -9
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +13 -11
- data/lib/elasticsearch/api/actions/indices/freeze.rb +0 -1
- data/lib/elasticsearch/api/actions/indices/get.rb +9 -15
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +6 -14
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +11 -15
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +12 -16
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +12 -21
- data/lib/elasticsearch/api/actions/indices/get_template.rb +8 -5
- data/lib/elasticsearch/api/actions/indices/open.rb +9 -15
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +6 -3
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +11 -23
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +10 -20
- data/lib/elasticsearch/api/actions/indices/put_template.rb +10 -5
- data/lib/elasticsearch/api/actions/indices/recovery.rb +2 -4
- data/lib/elasticsearch/api/actions/indices/refresh.rb +6 -14
- data/lib/elasticsearch/api/actions/indices/rollover.rb +6 -5
- data/lib/elasticsearch/api/actions/indices/segments.rb +6 -14
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +2 -4
- data/lib/elasticsearch/api/actions/indices/shrink.rb +6 -7
- data/lib/elasticsearch/api/actions/indices/split.rb +2 -1
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +10 -13
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +14 -25
- data/lib/elasticsearch/api/actions/info.rb +6 -0
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +1 -1
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +4 -3
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +29 -0
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +1 -1
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +5 -5
- data/lib/elasticsearch/api/actions/mget.rb +8 -17
- data/lib/elasticsearch/api/actions/msearch.rb +7 -2
- data/lib/elasticsearch/api/actions/msearch_template.rb +8 -1
- data/lib/elasticsearch/api/actions/mtermvectors.rb +21 -22
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +4 -6
- data/lib/elasticsearch/api/actions/nodes/info.rb +6 -26
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +10 -4
- data/lib/elasticsearch/api/actions/nodes/stats.rb +11 -30
- data/lib/elasticsearch/api/actions/nodes/usage.rb +31 -0
- data/lib/elasticsearch/api/actions/ping.rb +6 -0
- data/lib/elasticsearch/api/actions/put_script.rb +10 -9
- data/lib/elasticsearch/api/actions/rank_eval.rb +36 -0
- data/lib/elasticsearch/api/actions/reindex.rb +9 -14
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +29 -0
- data/lib/elasticsearch/api/actions/render_search_template.rb +1 -1
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +27 -0
- data/lib/elasticsearch/api/actions/scroll.rb +3 -2
- data/lib/elasticsearch/api/actions/search.rb +36 -53
- data/lib/elasticsearch/api/actions/search_shards.rb +7 -14
- data/lib/elasticsearch/api/actions/search_template.rb +20 -19
- data/lib/elasticsearch/api/actions/snapshot/create.rb +2 -3
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +4 -3
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +1 -2
- data/lib/elasticsearch/api/actions/snapshot/get.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +3 -6
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/status.rb +4 -5
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +1 -2
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +7 -13
- data/lib/elasticsearch/api/actions/tasks/get.rb +6 -3
- data/lib/elasticsearch/api/actions/tasks/list.rb +10 -16
- data/lib/elasticsearch/api/actions/termvectors.rb +22 -21
- data/lib/elasticsearch/api/actions/update.rb +19 -33
- data/lib/elasticsearch/api/actions/update_by_query.rb +13 -33
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +29 -0
- data/lib/elasticsearch/api/version.rb +1 -1
- data/spec/elasticsearch/api/actions/cluster/state_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/cluster/stats_spec.rb +17 -0
- data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +0 -37
- data/spec/elasticsearch/api/actions/indices/put_settings_spec.rb +0 -15
- data/spec/elasticsearch/api/actions/indices/refresh_spec.rb +0 -15
- data/spec/elasticsearch/api/actions/indices/segments_spec.rb +0 -15
- data/spec/elasticsearch/api/actions/mget_spec.rb +0 -15
- data/spec/elasticsearch/api/actions/search_spec.rb +0 -15
- data/test/integration/yaml_test_runner.rb +2 -4
- data/utils/thor/generate_source.rb +1 -0
- data/utils/thor/templates/ruby/method.erb +7 -5
- metadata +12 -73
- data/lib/elasticsearch/api/actions/delete_template.rb +0 -21
- data/lib/elasticsearch/api/actions/field_stats.rb +0 -36
- data/lib/elasticsearch/api/actions/get_template.rb +0 -27
- data/lib/elasticsearch/api/actions/indices/delete_mapping.rb +0 -26
- data/lib/elasticsearch/api/actions/indices/delete_warmer.rb +0 -32
- data/lib/elasticsearch/api/actions/indices/get_aliases.rb +0 -37
- data/lib/elasticsearch/api/actions/indices/get_warmer.rb +0 -62
- data/lib/elasticsearch/api/actions/indices/optimize.rb +0 -77
- data/lib/elasticsearch/api/actions/indices/put_warmer.rb +0 -65
- data/lib/elasticsearch/api/actions/indices/seal.rb +0 -24
- data/lib/elasticsearch/api/actions/indices/snapshot_index.rb +0 -44
- data/lib/elasticsearch/api/actions/indices/status.rb +0 -63
- data/lib/elasticsearch/api/actions/list_benchmarks.rb +0 -27
- data/lib/elasticsearch/api/actions/mlt.rb +0 -130
- data/lib/elasticsearch/api/actions/mpercolate.rb +0 -62
- data/lib/elasticsearch/api/actions/nodes/shutdown.rb +0 -39
- data/lib/elasticsearch/api/actions/percolate.rb +0 -73
- data/lib/elasticsearch/api/actions/put_template.rb +0 -25
- data/lib/elasticsearch/api/actions/remote/info.rb +0 -21
- data/lib/elasticsearch/api/actions/search_exists.rb +0 -63
- data/lib/elasticsearch/api/actions/suggest.rb +0 -49
- data/spec/elasticsearch/api/actions/delete_template_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/field_stats_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/get_template_spec.rb +0 -52
- data/spec/elasticsearch/api/actions/indices/delete_mapping_spec.rb +0 -77
- data/spec/elasticsearch/api/actions/indices/delete_warmer_spec.rb +0 -86
- data/spec/elasticsearch/api/actions/indices/freeze_spec.rb +0 -68
- data/spec/elasticsearch/api/actions/indices/get_aliases_spec.rb +0 -55
- data/spec/elasticsearch/api/actions/indices/get_warmer_spec.rb +0 -48
- data/spec/elasticsearch/api/actions/indices/optimize_spec.rb +0 -63
- data/spec/elasticsearch/api/actions/indices/put_warmer_spec.rb +0 -101
- data/spec/elasticsearch/api/actions/indices/seal_spec.rb +0 -18
- data/spec/elasticsearch/api/actions/indices/snapshot_index_spec.rb +0 -89
- data/spec/elasticsearch/api/actions/indices/stats_spec.rb +0 -108
- data/spec/elasticsearch/api/actions/indices/status_spec.rb +0 -92
- data/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb +0 -68
- data/spec/elasticsearch/api/actions/list_benchmarks_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/mlt_spec.rb +0 -117
- data/spec/elasticsearch/api/actions/mpercolate_spec.rb +0 -49
- data/spec/elasticsearch/api/actions/nodes/shutdown_spec.rb +0 -59
- data/spec/elasticsearch/api/actions/percolate_spec.rb +0 -67
- data/spec/elasticsearch/api/actions/put_template_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/remote/info_spec.rb +0 -18
- data/spec/elasticsearch/api/actions/search_exists_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/suggest_spec.rb +0 -77
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'client.indices#get_warmer' do
|
4
|
-
|
5
|
-
let(:expected_args) do
|
6
|
-
[
|
7
|
-
'GET',
|
8
|
-
url,
|
9
|
-
params,
|
10
|
-
nil,
|
11
|
-
nil
|
12
|
-
]
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:params) do
|
16
|
-
{}
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:url) do
|
20
|
-
'_all/_warmer'
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'performs the request' do
|
24
|
-
expect(client_double.indices.get_warmer(index: '_all')).to eq({})
|
25
|
-
end
|
26
|
-
|
27
|
-
context 'when a specified warmer is specified' do
|
28
|
-
|
29
|
-
let(:url) do
|
30
|
-
'foo/_warmer/bar'
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'performs the request' do
|
34
|
-
expect(client_double.indices.get_warmer(index: 'foo', name: 'bar')).to eq({})
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context 'when the path must be URL-escaped' do
|
39
|
-
|
40
|
-
let(:url) do
|
41
|
-
'foo%5Ebar/_warmer/bar%2Fbam'
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'performs the request' do
|
45
|
-
expect(client_double.indices.get_warmer(index: 'foo^bar', name: 'bar/bam')).to eq({})
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'client.indices#optimize' do
|
4
|
-
|
5
|
-
let(:expected_args) do
|
6
|
-
[
|
7
|
-
'POST',
|
8
|
-
url,
|
9
|
-
params,
|
10
|
-
nil,
|
11
|
-
nil
|
12
|
-
]
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:params) do
|
16
|
-
{}
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:url) do
|
20
|
-
'_optimize'
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'performs the request' do
|
24
|
-
expect(client_double.indices.optimize).to eq({})
|
25
|
-
end
|
26
|
-
|
27
|
-
context 'when multiple indices are specified' do
|
28
|
-
|
29
|
-
let(:url) do
|
30
|
-
'foo,bar/_optimize'
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'performs the request' do
|
34
|
-
expect(client_double.indices.optimize(index: ['foo', 'bar'])).to eq({})
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context 'when parameters are specified' do
|
39
|
-
|
40
|
-
let(:params) do
|
41
|
-
{ max_num_segments: 1 }
|
42
|
-
end
|
43
|
-
|
44
|
-
let(:url) do
|
45
|
-
'foo/_optimize'
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'performs the request' do
|
49
|
-
expect(client_double.indices.optimize(index: 'foo', max_num_segments: 1)).to eq({})
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
context 'when the path must be URL-escaped' do
|
54
|
-
|
55
|
-
let(:url) do
|
56
|
-
'foo%5Ebar/_optimize'
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'performs the request' do
|
60
|
-
expect(client_double.indices.optimize(index: 'foo^bar')).to eq({})
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,101 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'client.cluster#put_warmer' do
|
4
|
-
|
5
|
-
let(:expected_args) do
|
6
|
-
[
|
7
|
-
'PUT',
|
8
|
-
url,
|
9
|
-
params,
|
10
|
-
body,
|
11
|
-
nil
|
12
|
-
]
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:url) do
|
16
|
-
'foo/_warmer/bar'
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:body) do
|
20
|
-
{ query: { match_all: {} } }
|
21
|
-
end
|
22
|
-
|
23
|
-
let(:params) do
|
24
|
-
{}
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'performs the request' do
|
28
|
-
expect(client_double.indices.put_warmer(index: 'foo', name: 'bar', body: { query: { match_all: {} } })).to eq({})
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'when there is no name specified' do
|
32
|
-
|
33
|
-
let(:client) do
|
34
|
-
Class.new { include Elasticsearch::API }.new
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'raises an exception' do
|
38
|
-
expect {
|
39
|
-
client.indices.put_warmer(body: {})
|
40
|
-
}.to raise_exception(ArgumentError)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
context 'when there is no body specified' do
|
45
|
-
|
46
|
-
let(:client) do
|
47
|
-
Class.new { include Elasticsearch::API }.new
|
48
|
-
end
|
49
|
-
|
50
|
-
it 'raises an exception' do
|
51
|
-
expect {
|
52
|
-
client.indices.put_warmer(name: 'foo')
|
53
|
-
}.to raise_exception(ArgumentError)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
context 'when multiple indices are specified' do
|
58
|
-
|
59
|
-
let(:url) do
|
60
|
-
'foo,bar/_warmer/xul'
|
61
|
-
end
|
62
|
-
|
63
|
-
let(:body) do
|
64
|
-
{}
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'performs the request' do
|
68
|
-
expect(client_double.indices.put_warmer(index: ['foo', 'bar'], name: 'xul', body: {})).to eq({})
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
context 'when a type is specified' do
|
73
|
-
|
74
|
-
let(:url) do
|
75
|
-
'foo/bar/_warmer/xul'
|
76
|
-
end
|
77
|
-
|
78
|
-
let(:body) do
|
79
|
-
{}
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'performs the request' do
|
83
|
-
expect(client_double.indices.put_warmer(index: 'foo', type: 'bar', name: 'xul', body: {})).to eq({})
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
context 'when the path needs to be URL-escaped' do
|
88
|
-
|
89
|
-
let(:url) do
|
90
|
-
'foo%5Ebar/bar%2Fbam/_warmer/qu+uz'
|
91
|
-
end
|
92
|
-
|
93
|
-
let(:body) do
|
94
|
-
{}
|
95
|
-
end
|
96
|
-
|
97
|
-
it 'performs the request' do
|
98
|
-
expect(client_double.indices.put_warmer(index: 'foo^bar', type: 'bar/bam', name: 'qu uz', body: {})).to eq({})
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'client.cluster#seal' do
|
4
|
-
|
5
|
-
let(:expected_args) do
|
6
|
-
[
|
7
|
-
'POST',
|
8
|
-
'foo/_seal',
|
9
|
-
{},
|
10
|
-
nil,
|
11
|
-
nil
|
12
|
-
]
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'performs the request' do
|
16
|
-
expect(client_double.indices.seal(index: 'foo')).to eq({})
|
17
|
-
end
|
18
|
-
end
|
@@ -1,89 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'client.cluster#snapshot_index' do
|
4
|
-
|
5
|
-
let(:expected_args) do
|
6
|
-
[
|
7
|
-
'POST',
|
8
|
-
url,
|
9
|
-
params,
|
10
|
-
body,
|
11
|
-
nil
|
12
|
-
]
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:url) do
|
16
|
-
'_gateway/snapshot'
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:body) do
|
20
|
-
nil
|
21
|
-
end
|
22
|
-
|
23
|
-
let(:params) do
|
24
|
-
{}
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'performs the request' do
|
28
|
-
expect(client_double.indices.snapshot_index).to eq({})
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'when an index is specified' do
|
32
|
-
|
33
|
-
let(:url) do
|
34
|
-
'foo/_gateway/snapshot'
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'performs the request' do
|
38
|
-
expect(client_double.indices.snapshot_index(index: 'foo')).to eq({})
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
context 'when multiple indicies are specified as a list' do
|
43
|
-
|
44
|
-
let(:url) do
|
45
|
-
'foo,bar/_gateway/snapshot'
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'performs the request' do
|
49
|
-
expect(client_double.indices.snapshot_index(index: ['foo', 'bar'])).to eq({})
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
context 'when multiple indicies are specified as a string' do
|
54
|
-
|
55
|
-
let(:url) do
|
56
|
-
'foo,bar/_gateway/snapshot'
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'performs the request' do
|
60
|
-
expect(client_double.indices.snapshot_index(index: 'foo,bar')).to eq({})
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
context 'when parameters are specified' do
|
65
|
-
|
66
|
-
let(:params) do
|
67
|
-
{ ignore_indices: 'missing' }
|
68
|
-
end
|
69
|
-
|
70
|
-
let(:url) do
|
71
|
-
'foo/_gateway/snapshot'
|
72
|
-
end
|
73
|
-
|
74
|
-
it 'performs the request' do
|
75
|
-
expect(client_double.indices.snapshot_index(index: 'foo', ignore_indices: 'missing')).to eq({})
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
context 'when the path needs to be URL-escaped' do
|
80
|
-
|
81
|
-
let(:url) do
|
82
|
-
'foo%5Ebar/_gateway/snapshot'
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'performs the request' do
|
86
|
-
expect(client_double.indices.snapshot_index(index: 'foo^bar')).to eq({})
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
@@ -1,108 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'client.cluster#stats' do
|
4
|
-
|
5
|
-
let(:expected_args) do
|
6
|
-
[
|
7
|
-
'GET',
|
8
|
-
url,
|
9
|
-
params,
|
10
|
-
body,
|
11
|
-
nil
|
12
|
-
]
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:url) do
|
16
|
-
'_stats'
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:body) do
|
20
|
-
nil
|
21
|
-
end
|
22
|
-
|
23
|
-
let(:params) do
|
24
|
-
{}
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'performs the request' do
|
28
|
-
expect(client_double.indices.stats).to eq({})
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'when an index is specified' do
|
32
|
-
|
33
|
-
let(:url) do
|
34
|
-
'foo/_stats'
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'performs the request' do
|
38
|
-
expect(client_double.indices.stats(index: 'foo')).to eq({})
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
context 'when multiple indicies are specified as a list' do
|
43
|
-
|
44
|
-
let(:url) do
|
45
|
-
'foo,bar/_stats'
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'performs the request' do
|
49
|
-
expect(client_double.indices.stats(index: ['foo', 'bar'])).to eq({})
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
context 'when multiple indicies are specified as a string' do
|
54
|
-
|
55
|
-
let(:url) do
|
56
|
-
'foo,bar/_stats'
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'performs the request' do
|
60
|
-
expect(client_double.indices.stats(index: 'foo,bar')).to eq({})
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
context 'when parameters are specified' do
|
65
|
-
|
66
|
-
let(:params) do
|
67
|
-
{ expand_wildcards: true }
|
68
|
-
end
|
69
|
-
|
70
|
-
let(:url) do
|
71
|
-
'foo/_stats'
|
72
|
-
end
|
73
|
-
|
74
|
-
it 'performs the request' do
|
75
|
-
expect(client_double.indices.stats(index: 'foo', expand_wildcards: true)).to eq({})
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
context 'when the fields parameter is specified as a list' do
|
80
|
-
|
81
|
-
let(:params) do
|
82
|
-
{ fields: 'foo,bar' }
|
83
|
-
end
|
84
|
-
|
85
|
-
let(:url) do
|
86
|
-
'foo/_stats/fielddata'
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'performs the request' do
|
90
|
-
expect(client_double.indices.stats(index: 'foo', fielddata: true, fields: [ 'foo', 'bar'])).to eq({})
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
context 'when the groups parameter is specified as a list' do
|
95
|
-
|
96
|
-
let(:params) do
|
97
|
-
{ groups: 'groupA,groupB' }
|
98
|
-
end
|
99
|
-
|
100
|
-
let(:url) do
|
101
|
-
'_stats/search'
|
102
|
-
end
|
103
|
-
|
104
|
-
it 'performs the request' do
|
105
|
-
expect(client_double.indices.stats(search: true, groups: [ 'groupA', 'groupB'])).to eq({})
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
@@ -1,92 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'client.cluster#status' do
|
4
|
-
|
5
|
-
let(:expected_args) do
|
6
|
-
[
|
7
|
-
'GET',
|
8
|
-
url,
|
9
|
-
params,
|
10
|
-
body,
|
11
|
-
nil
|
12
|
-
]
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:url) do
|
16
|
-
'_status'
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:body) do
|
20
|
-
nil
|
21
|
-
end
|
22
|
-
|
23
|
-
let(:params) do
|
24
|
-
{}
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'performs the request' do
|
28
|
-
expect(client_double.indices.status).to eq({})
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'when an index is specified' do
|
32
|
-
|
33
|
-
let(:url) do
|
34
|
-
'foo/_status'
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'performs the request' do
|
38
|
-
expect(client_double.indices.status(index: 'foo')).to eq({})
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
context 'when multiple indicies are specified as a list' do
|
43
|
-
|
44
|
-
let(:url) do
|
45
|
-
'foo,bar/_status'
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'performs the request' do
|
49
|
-
expect(client_double.indices.status(index: ['foo', 'bar'])).to eq({})
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
context 'when multiple indicies are specified as a string' do
|
54
|
-
|
55
|
-
|
56
|
-
let(:url) do
|
57
|
-
'foo,bar/_status'
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'performs the request' do
|
61
|
-
expect(client_double.indices.status(index: 'foo,bar')).to eq({})
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
context 'when parameters are specified' do
|
66
|
-
|
67
|
-
let(:params) do
|
68
|
-
{ recovery: true }
|
69
|
-
end
|
70
|
-
|
71
|
-
let(:url) do
|
72
|
-
'foo/_status'
|
73
|
-
end
|
74
|
-
|
75
|
-
it 'performs the request' do
|
76
|
-
expect(client_double.indices.status(index: 'foo', recovery: true)).to eq({})
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
context 'when a \'not found\' exception is raised' do
|
81
|
-
|
82
|
-
let(:client) do
|
83
|
-
Class.new { include Elasticsearch::API }.new.tap do |_client|
|
84
|
-
expect(_client).to receive(:perform_request).and_raise(NotFound)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
it 'does not raise the exception' do
|
89
|
-
expect(client.indices.status(index: 'foo', ignore: 404)).to eq(false)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|