elasticsearch-api 2.0.2 → 5.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -8
- data/elasticsearch-api.gemspec +1 -1
- data/lib/elasticsearch/api/actions/bulk.rb +20 -18
- data/lib/elasticsearch/api/actions/cat/aliases.rb +7 -1
- data/lib/elasticsearch/api/actions/cat/allocation.rb +3 -1
- data/lib/elasticsearch/api/actions/cat/count.rb +3 -1
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +2 -0
- data/lib/elasticsearch/api/actions/cat/health.rb +3 -1
- data/lib/elasticsearch/api/actions/cat/indices.rb +8 -3
- data/lib/elasticsearch/api/actions/cat/master.rb +3 -1
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +4 -6
- data/lib/elasticsearch/api/actions/cat/nodes.rb +3 -1
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +3 -1
- data/lib/elasticsearch/api/actions/cat/plugins.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/recovery.rb +3 -1
- data/lib/elasticsearch/api/actions/cat/repositories.rb +3 -4
- data/lib/elasticsearch/api/actions/cat/segments.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/shards.rb +3 -1
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +4 -5
- data/lib/elasticsearch/api/actions/cat/tasks.rb +4 -6
- data/lib/elasticsearch/api/actions/cat/templates.rb +39 -0
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +6 -4
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +6 -5
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +0 -3
- data/lib/elasticsearch/api/actions/cluster/health.rb +7 -1
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +0 -3
- data/lib/elasticsearch/api/actions/delete_by_query.rb +0 -2
- data/lib/elasticsearch/api/actions/explain.rb +3 -1
- data/lib/elasticsearch/api/actions/get.rb +3 -1
- data/lib/elasticsearch/api/actions/index.rb +0 -3
- data/lib/elasticsearch/api/actions/indices/create.rb +3 -1
- data/lib/elasticsearch/api/actions/indices/get.rb +0 -3
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +0 -3
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +0 -3
- data/lib/elasticsearch/api/actions/indices/rollover.rb +41 -0
- data/lib/elasticsearch/api/actions/indices/shrink.rb +45 -0
- data/lib/elasticsearch/api/actions/indices/stats.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +1 -5
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +1 -5
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +2 -7
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +1 -5
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +3 -6
- data/lib/elasticsearch/api/actions/mget.rb +3 -1
- data/lib/elasticsearch/api/actions/nodes/info.rb +2 -1
- data/lib/elasticsearch/api/actions/ping.rb +1 -1
- data/lib/elasticsearch/api/actions/scroll.rb +3 -9
- data/lib/elasticsearch/api/actions/search.rb +7 -0
- data/lib/elasticsearch/api/actions/search_exists.rb +1 -3
- data/lib/elasticsearch/api/actions/snapshot/get.rb +2 -0
- data/lib/elasticsearch/api/actions/snapshot/status.rb +2 -0
- data/lib/elasticsearch/api/actions/tasks/list.rb +0 -3
- data/lib/elasticsearch/api/actions/update.rb +7 -0
- data/lib/elasticsearch/api/actions/update_by_query.rb +0 -3
- data/lib/elasticsearch/api/utils.rb +6 -6
- data/lib/elasticsearch/api/version.rb +1 -1
- data/test/integration/yaml_test_runner.rb +44 -11
- data/test/unit/cat/templates_test.rb +26 -0
- data/test/unit/indices/rollover_test.rb +38 -0
- data/test/unit/indices/shrink_test.rb +33 -0
- data/test/unit/ingest/get_pipeline_test.rb +0 -6
- data/test/unit/search_exists_test.rb +0 -32
- data/utils/thor/generate_source.rb +12 -0
- data/utils/thor/templates/ruby/method.erb +5 -9
- data/utils/thor/templates/ruby/test.erb +3 -3
- metadata +14 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecee9a5f6ee610f547eedea1f62be23d87b15828
|
4
|
+
data.tar.gz: 9652aab1592a6983d8fd7ba00e12bce42524c50b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23d1e1b4db1935d4023e5c1faa0d5c61fc9dc8a585832dc38c7643f4d3b2a67c944859cd2edf16b9fcd51cfd6840d7ebca161ae3674728810ae2ab797eabf96c
|
7
|
+
data.tar.gz: e44b133d5d70ed6d678b42cc76ec9cbc1e96613aeaead67f7374b9a14b67e3d0f2b61495e02ebdddd40c2b9c715c440d375bb7998b479f79e59f9e5baa9c2d08
|
data/README.md
CHANGED
@@ -9,17 +9,20 @@ The `elasticsearch-api` library provides a Ruby implementation of
|
|
9
9
|
the [Elasticsearch](http://elasticsearch.org) REST API.
|
10
10
|
|
11
11
|
It does not provide an Elasticsearch client; see the
|
12
|
-
[`elasticsearch-transport`](https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-transport)
|
13
|
-
library.
|
12
|
+
[`elasticsearch-transport`](https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-transport) library.
|
14
13
|
|
15
|
-
The library is compatible with Ruby 1.8.7
|
14
|
+
The library is compatible with Ruby 1.8.7 and higher.
|
16
15
|
|
17
|
-
|
16
|
+
It is compatible with Elasticsearch's API versions from 0.90 till current,
|
17
|
+
just use a release matching major version of Elasticsearch.
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
| Ruby | | Elasticsearch |
|
20
|
+
|:-------------:|:-:| :-----------: |
|
21
|
+
| 0.90 | → | 0.90 |
|
22
|
+
| 1.x | → | 1.x |
|
23
|
+
| 2.x | → | 2.x |
|
24
|
+
| 5.x | → | 5.x |
|
25
|
+
| master | → | master |
|
23
26
|
|
24
27
|
## Installation
|
25
28
|
|
data/elasticsearch-api.gemspec
CHANGED
@@ -53,7 +53,7 @@ Gem::Specification.new do |s|
|
|
53
53
|
# Prevent unit test failures on Ruby 1.8
|
54
54
|
if defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
|
55
55
|
s.add_development_dependency "test-unit", '~> 2'
|
56
|
-
s.add_development_dependency "json"
|
56
|
+
s.add_development_dependency "json", '~> 1.8'
|
57
57
|
end
|
58
58
|
|
59
59
|
if defined?(RUBY_VERSION) && RUBY_VERSION > '1.9'
|
@@ -45,21 +45,23 @@ module Elasticsearch
|
|
45
45
|
#
|
46
46
|
# ]
|
47
47
|
#
|
48
|
-
# @option arguments [String]
|
49
|
-
# @option arguments [String]
|
50
|
-
# @option arguments [
|
51
|
-
# @option arguments [String]
|
52
|
-
#
|
53
|
-
# @option arguments [
|
54
|
-
# @option arguments [
|
55
|
-
# @option arguments [
|
56
|
-
# @option arguments [
|
57
|
-
#
|
58
|
-
# @
|
48
|
+
# @option arguments [String] :index Default index for items which don't provide one
|
49
|
+
# @option arguments [String] :type Default document type for items which don't provide one
|
50
|
+
# @option arguments [Hash] :body The operation definition and data (action-data pairs), separated by newlines (*Required*)
|
51
|
+
# @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
52
|
+
# @option arguments [String] :refresh If `true` then refresh the effected 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` (the default) then do nothing with refreshes. (options: true, false, wait_for)
|
53
|
+
# @option arguments [String] :routing Specific routing value
|
54
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
55
|
+
# @option arguments [String] :type Default document type for items which don't provide one
|
56
|
+
# @option arguments [List] :fields Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request
|
57
|
+
# @option arguments [List] :_source True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
|
58
|
+
# @option arguments [List] :_source_exclude Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
|
59
|
+
# @option arguments [List] :_source_include Default list of fields to extract and return from the _source field, can be overridden on each sub-request
|
60
|
+
# @option arguments [String] :pipeline The pipeline ID to preprocess incoming documents with
|
59
61
|
#
|
60
62
|
# @return [Hash] Deserialized Elasticsearch response
|
61
63
|
#
|
62
|
-
# @see
|
64
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
|
63
65
|
#
|
64
66
|
def bulk(arguments={})
|
65
67
|
arguments = arguments.clone
|
@@ -67,17 +69,17 @@ module Elasticsearch
|
|
67
69
|
type = arguments.delete(:type)
|
68
70
|
|
69
71
|
valid_params = [
|
70
|
-
:
|
72
|
+
:wait_for_active_shards,
|
71
73
|
:refresh,
|
72
|
-
:
|
73
|
-
:type,
|
74
|
+
:routing,
|
74
75
|
:timeout,
|
76
|
+
:type,
|
75
77
|
:fields,
|
78
|
+
:_source,
|
79
|
+
:_source_exclude,
|
80
|
+
:_source_include,
|
76
81
|
:pipeline ]
|
77
82
|
|
78
|
-
unsupported_params = [ :fields, :pipeline ]
|
79
|
-
Utils.__report_unsupported_parameters(arguments, unsupported_params)
|
80
|
-
|
81
83
|
method = HTTP_POST
|
82
84
|
path = Utils.__pathify Utils.__escape(arguments[:index]), Utils.__escape(type), '_bulk'
|
83
85
|
|
@@ -25,6 +25,10 @@ module Elasticsearch
|
|
25
25
|
#
|
26
26
|
# puts client.cat.aliases h: 'a,i'
|
27
27
|
#
|
28
|
+
# @example Return the output sorted by the alias name
|
29
|
+
#
|
30
|
+
# puts client.cat.aliases s: 'alias'
|
31
|
+
#
|
28
32
|
# @example Return the information as Ruby objects
|
29
33
|
#
|
30
34
|
# client.cat.aliases format: 'json'
|
@@ -32,6 +36,7 @@ module Elasticsearch
|
|
32
36
|
# @option arguments [List] :name A comma-separated list of alias names to return
|
33
37
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
34
38
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
39
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
35
40
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
36
41
|
# @option arguments [Boolean] :help Return information about headers
|
37
42
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -46,7 +51,8 @@ module Elasticsearch
|
|
46
51
|
:master_timeout,
|
47
52
|
:h,
|
48
53
|
:help,
|
49
|
-
:v
|
54
|
+
:v,
|
55
|
+
:s ]
|
50
56
|
|
51
57
|
name = arguments.delete(:name)
|
52
58
|
|
@@ -33,6 +33,7 @@ module Elasticsearch
|
|
33
33
|
# @option arguments [String] :bytes The unit in which to display byte values (options: b, k, m, g)
|
34
34
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
35
35
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
36
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
36
37
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
37
38
|
# @option arguments [Boolean] :help Return information about headers
|
38
39
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -48,7 +49,8 @@ module Elasticsearch
|
|
48
49
|
:master_timeout,
|
49
50
|
:h,
|
50
51
|
:help,
|
51
|
-
:v
|
52
|
+
:v,
|
53
|
+
:s ]
|
52
54
|
|
53
55
|
node_id = arguments.delete(:node_id)
|
54
56
|
|
@@ -28,6 +28,7 @@ module Elasticsearch
|
|
28
28
|
# @option arguments [List] :index A comma-separated list of index names to limit the returned information
|
29
29
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
30
30
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
31
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
31
32
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
32
33
|
# @option arguments [Boolean] :help Return information about headers
|
33
34
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -42,7 +43,8 @@ module Elasticsearch
|
|
42
43
|
:master_timeout,
|
43
44
|
:h,
|
44
45
|
:help,
|
45
|
-
:v
|
46
|
+
:v,
|
47
|
+
:s ]
|
46
48
|
|
47
49
|
index = arguments.delete(:index)
|
48
50
|
|
@@ -21,6 +21,7 @@ module Elasticsearch
|
|
21
21
|
# @option arguments [List] :h Comma-separated list of column names to display
|
22
22
|
# @option arguments [Boolean] :help Return help information
|
23
23
|
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
24
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
24
25
|
#
|
25
26
|
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-fielddata.html
|
26
27
|
#
|
@@ -32,6 +33,7 @@ module Elasticsearch
|
|
32
33
|
:h,
|
33
34
|
:help,
|
34
35
|
:v,
|
36
|
+
:s,
|
35
37
|
:fields ]
|
36
38
|
|
37
39
|
fields = arguments.delete(:fields)
|
@@ -20,6 +20,7 @@ module Elasticsearch
|
|
20
20
|
# @option arguments [Boolean] :ts Whether to display timestamp information
|
21
21
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
22
22
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
23
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
23
24
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
24
25
|
# @option arguments [Boolean] :help Return information about headers
|
25
26
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -35,7 +36,8 @@ module Elasticsearch
|
|
35
36
|
:h,
|
36
37
|
:help,
|
37
38
|
:ts,
|
38
|
-
:v
|
39
|
+
:v,
|
40
|
+
:s ]
|
39
41
|
|
40
42
|
method = HTTP_GET
|
41
43
|
path = "_cat/health"
|
@@ -40,6 +40,9 @@ module Elasticsearch
|
|
40
40
|
# @option arguments [Boolean] :pri Limit the returned information on primary shards only (default: false)
|
41
41
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
42
42
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
43
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
44
|
+
# @option arguments [String] :health A health status ("green", "yellow", or "red" to filter only indices
|
45
|
+
# matching the specified health status (options: green, yellow, red)
|
43
46
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
44
47
|
# @option arguments [Boolean] :help Return information about headers
|
45
48
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -51,12 +54,14 @@ module Elasticsearch
|
|
51
54
|
def indices(arguments={})
|
52
55
|
valid_params = [
|
53
56
|
:bytes,
|
54
|
-
:local,
|
55
|
-
:master_timeout,
|
56
57
|
:h,
|
58
|
+
:health,
|
57
59
|
:help,
|
60
|
+
:local,
|
61
|
+
:master_timeout,
|
58
62
|
:pri,
|
59
|
-
:v
|
63
|
+
:v,
|
64
|
+
:s ]
|
60
65
|
|
61
66
|
index = arguments.delete(:index)
|
62
67
|
|
@@ -19,6 +19,7 @@ module Elasticsearch
|
|
19
19
|
#
|
20
20
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
21
21
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
22
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
22
23
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
23
24
|
# @option arguments [Boolean] :help Return information about headers
|
24
25
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -33,7 +34,8 @@ module Elasticsearch
|
|
33
34
|
:master_timeout,
|
34
35
|
:h,
|
35
36
|
:help,
|
36
|
-
:v
|
37
|
+
:v,
|
38
|
+
:s ]
|
37
39
|
|
38
40
|
method = HTTP_GET
|
39
41
|
path = "_cat/master"
|
@@ -10,6 +10,7 @@ module Elasticsearch
|
|
10
10
|
# @option arguments [List] :h Comma-separated list of column names to display
|
11
11
|
# @option arguments [Boolean] :help Return help information
|
12
12
|
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
13
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
13
14
|
#
|
14
15
|
# @see http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html
|
15
16
|
#
|
@@ -19,12 +20,9 @@ module Elasticsearch
|
|
19
20
|
:master_timeout,
|
20
21
|
:h,
|
21
22
|
:help,
|
22
|
-
:v
|
23
|
-
|
24
|
-
|
25
|
-
Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
|
26
|
-
|
27
|
-
method = HTTP_GET
|
23
|
+
:v,
|
24
|
+
:s ]
|
25
|
+
method = 'GET'
|
28
26
|
path = "_cat/nodeattrs"
|
29
27
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
30
28
|
body = nil
|
@@ -27,6 +27,7 @@ module Elasticsearch
|
|
27
27
|
#
|
28
28
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
29
29
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
30
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
30
31
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
31
32
|
# @option arguments [Boolean] :help Return information about headers
|
32
33
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -41,7 +42,8 @@ module Elasticsearch
|
|
41
42
|
:master_timeout,
|
42
43
|
:h,
|
43
44
|
:help,
|
44
|
-
:v
|
45
|
+
:v,
|
46
|
+
:s ]
|
45
47
|
|
46
48
|
method = HTTP_GET
|
47
49
|
path = "_cat/nodes"
|
@@ -19,6 +19,7 @@ module Elasticsearch
|
|
19
19
|
#
|
20
20
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
21
21
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
22
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
22
23
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
23
24
|
# @option arguments [Boolean] :help Return information about headers
|
24
25
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -33,7 +34,8 @@ module Elasticsearch
|
|
33
34
|
:master_timeout,
|
34
35
|
:h,
|
35
36
|
:help,
|
36
|
-
:v
|
37
|
+
:v,
|
38
|
+
:s ]
|
37
39
|
|
38
40
|
method = HTTP_GET
|
39
41
|
path = "_cat/pending_tasks"
|
@@ -9,6 +9,7 @@ module Elasticsearch
|
|
9
9
|
# (default: false)
|
10
10
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
11
11
|
# @option arguments [List] :h Comma-separated list of column names to display
|
12
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
12
13
|
# @option arguments [Boolean] :help Return help information
|
13
14
|
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
14
15
|
#
|
@@ -20,9 +21,9 @@ module Elasticsearch
|
|
20
21
|
:master_timeout,
|
21
22
|
:h,
|
22
23
|
:help,
|
23
|
-
:v
|
24
|
-
|
25
|
-
method =
|
24
|
+
:v,
|
25
|
+
:s ]
|
26
|
+
method = 'GET'
|
26
27
|
path = "_cat/plugins"
|
27
28
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
28
29
|
body = nil
|
@@ -37,6 +37,7 @@ module Elasticsearch
|
|
37
37
|
# @option arguments [String] :bytes The unit in which to display byte values (options: b, k, m, g)
|
38
38
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
39
39
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
40
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
40
41
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
41
42
|
# @option arguments [Boolean] :help Return information about headers
|
42
43
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -52,7 +53,8 @@ module Elasticsearch
|
|
52
53
|
:master_timeout,
|
53
54
|
:h,
|
54
55
|
:help,
|
55
|
-
:v
|
56
|
+
:v,
|
57
|
+
:s ]
|
56
58
|
|
57
59
|
index = arguments.delete(:index)
|
58
60
|
|
@@ -17,6 +17,7 @@ module Elasticsearch
|
|
17
17
|
# @option arguments [List] :h Comma-separated list of column names to display
|
18
18
|
# @option arguments [Boolean] :help Return help information
|
19
19
|
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
20
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
20
21
|
#
|
21
22
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-repositories.html
|
22
23
|
#
|
@@ -25,10 +26,8 @@ module Elasticsearch
|
|
25
26
|
:master_timeout,
|
26
27
|
:h,
|
27
28
|
:help,
|
28
|
-
:v
|
29
|
-
|
30
|
-
unsupported_params = [ :format ]
|
31
|
-
Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
|
29
|
+
:v,
|
30
|
+
:s ]
|
32
31
|
|
33
32
|
method = HTTP_GET
|
34
33
|
path = "_cat/repositories"
|
@@ -14,17 +14,19 @@ module Elasticsearch
|
|
14
14
|
# @option arguments [List] :h Comma-separated list of column names to display
|
15
15
|
# @option arguments [Boolean] :help Return help information
|
16
16
|
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
17
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
17
18
|
#
|
18
19
|
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-segments.html
|
19
20
|
#
|
20
21
|
def segments(arguments={})
|
21
22
|
valid_params = [
|
22
23
|
:bytes,
|
24
|
+
:index,
|
23
25
|
:h,
|
24
26
|
:help,
|
25
|
-
:v
|
26
|
-
|
27
|
-
method =
|
27
|
+
:v,
|
28
|
+
:s ]
|
29
|
+
method = 'GET'
|
28
30
|
path = "_cat/segments"
|
29
31
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
30
32
|
body = nil
|
@@ -41,6 +41,7 @@ module Elasticsearch
|
|
41
41
|
# @option arguments [String] :bytes The unit in which to display byte values (options: b, k, m, g)
|
42
42
|
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
43
43
|
# @option arguments [Boolean] :v Display column headers as part of the output
|
44
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
44
45
|
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
45
46
|
# @option arguments [Boolean] :help Return information about headers
|
46
47
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
@@ -56,7 +57,8 @@ module Elasticsearch
|
|
56
57
|
:bytes,
|
57
58
|
:h,
|
58
59
|
:help,
|
59
|
-
:v
|
60
|
+
:v,
|
61
|
+
:s ]
|
60
62
|
|
61
63
|
index = arguments.delete(:index)
|
62
64
|
|
@@ -17,20 +17,19 @@ module Elasticsearch
|
|
17
17
|
# @option arguments [List] :h Comma-separated list of column names to display
|
18
18
|
# @option arguments [Boolean] :help Return help information
|
19
19
|
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
20
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
20
21
|
#
|
21
22
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html
|
22
23
|
#
|
23
24
|
def snapshots(arguments={})
|
24
|
-
raise ArgumentError, "Required argument 'repository' missing"
|
25
|
+
raise ArgumentError, "Required argument 'repository' missing" if !arguments[:repository] && !arguments[:help]
|
25
26
|
|
26
27
|
valid_params = [
|
27
28
|
:master_timeout,
|
28
29
|
:h,
|
29
30
|
:help,
|
30
|
-
:v
|
31
|
-
|
32
|
-
unsupported_params = [ :format ]
|
33
|
-
Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
|
31
|
+
:v,
|
32
|
+
:s ]
|
34
33
|
|
35
34
|
repository = arguments.delete(:repository)
|
36
35
|
|