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.
- checksums.yaml +4 -4
- data/Rakefile +16 -23
- data/lib/elasticsearch/api/actions/abort_benchmark.rb +1 -2
- data/lib/elasticsearch/api/actions/benchmark.rb +2 -3
- data/lib/elasticsearch/api/actions/bulk.rb +35 -68
- data/lib/elasticsearch/api/actions/cat/aliases.rb +30 -52
- data/lib/elasticsearch/api/actions/cat/allocation.rb +36 -50
- data/lib/elasticsearch/api/actions/cat/count.rb +25 -46
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +31 -33
- data/lib/elasticsearch/api/actions/cat/health.rb +27 -37
- data/lib/elasticsearch/api/actions/cat/help.rb +14 -10
- data/lib/elasticsearch/api/actions/cat/indices.rb +45 -62
- data/lib/elasticsearch/api/actions/cat/master.rb +24 -34
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +20 -16
- data/lib/elasticsearch/api/actions/cat/nodes.rb +34 -46
- data/lib/elasticsearch/api/actions/cat/params_registry.rb +0 -1
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +29 -35
- data/lib/elasticsearch/api/actions/cat/plugins.rb +21 -18
- data/lib/elasticsearch/api/actions/cat/recovery.rb +40 -56
- data/lib/elasticsearch/api/actions/cat/repositories.rb +21 -24
- data/lib/elasticsearch/api/actions/cat/segments.rb +29 -22
- data/lib/elasticsearch/api/actions/cat/shards.rb +38 -59
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +32 -27
- data/lib/elasticsearch/api/actions/cat/tasks.rb +25 -19
- data/lib/elasticsearch/api/actions/cat/templates.rb +26 -18
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +36 -46
- data/lib/elasticsearch/api/actions/clear_scroll.rb +21 -8
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +15 -13
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +18 -18
- data/lib/elasticsearch/api/actions/cluster/health.rb +42 -44
- data/lib/elasticsearch/api/actions/cluster/params_registry.rb +0 -1
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +15 -17
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +20 -17
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +8 -6
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +25 -37
- data/lib/elasticsearch/api/actions/cluster/state.rb +37 -41
- data/lib/elasticsearch/api/actions/cluster/stats.rb +20 -12
- data/lib/elasticsearch/api/actions/count.rb +52 -39
- data/lib/elasticsearch/api/actions/create.rb +25 -26
- data/lib/elasticsearch/api/actions/delete.rb +43 -36
- data/lib/elasticsearch/api/actions/delete_by_query.rb +74 -62
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +39 -0
- data/lib/elasticsearch/api/actions/delete_by_rethrottle.rb +4 -3
- data/lib/elasticsearch/api/actions/delete_script.rb +19 -13
- data/lib/elasticsearch/api/actions/exists.rb +44 -34
- data/lib/elasticsearch/api/actions/exists_source.rb +43 -25
- data/lib/elasticsearch/api/actions/explain.rb +46 -51
- data/lib/elasticsearch/api/actions/field_caps.rb +27 -20
- data/lib/elasticsearch/api/actions/get.rb +42 -41
- data/lib/elasticsearch/api/actions/get_script.rb +19 -14
- data/lib/elasticsearch/api/actions/get_source.rb +38 -44
- data/lib/elasticsearch/api/actions/index.rb +60 -89
- data/lib/elasticsearch/api/actions/indices/analyze.rb +19 -48
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +29 -41
- data/lib/elasticsearch/api/actions/indices/clone.rb +21 -21
- data/lib/elasticsearch/api/actions/indices/close.rb +28 -32
- data/lib/elasticsearch/api/actions/indices/create.rb +22 -70
- data/lib/elasticsearch/api/actions/indices/delete.rb +23 -35
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +24 -20
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +18 -20
- data/lib/elasticsearch/api/actions/indices/exists.rb +32 -34
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +33 -29
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +21 -16
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +29 -29
- data/lib/elasticsearch/api/actions/indices/flush.rb +28 -28
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +23 -12
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +26 -41
- data/lib/elasticsearch/api/actions/indices/freeze.rb +7 -8
- data/lib/elasticsearch/api/actions/indices/get.rb +25 -19
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +31 -23
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +42 -38
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +39 -31
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +34 -37
- data/lib/elasticsearch/api/actions/indices/get_template.rb +21 -23
- data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +48 -0
- data/lib/elasticsearch/api/actions/indices/open.rb +24 -21
- data/lib/elasticsearch/api/actions/indices/params_registry.rb +0 -1
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +25 -27
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +40 -39
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +30 -37
- data/lib/elasticsearch/api/actions/indices/put_template.rb +23 -23
- data/lib/elasticsearch/api/actions/indices/recovery.rb +20 -23
- data/lib/elasticsearch/api/actions/indices/refresh.rb +22 -26
- data/lib/elasticsearch/api/actions/indices/rollover.rb +28 -19
- data/lib/elasticsearch/api/actions/indices/segments.rb +24 -17
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +27 -15
- data/lib/elasticsearch/api/actions/indices/shrink.rb +23 -17
- data/lib/elasticsearch/api/actions/indices/split.rb +23 -17
- data/lib/elasticsearch/api/actions/indices/stats.rb +53 -104
- data/lib/elasticsearch/api/actions/indices/unfreeze.rb +7 -7
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +15 -32
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +26 -16
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +46 -59
- data/lib/elasticsearch/api/actions/info.rb +9 -6
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +18 -12
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +21 -11
- data/lib/elasticsearch/api/actions/ingest/params_registry.rb +0 -1
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +12 -13
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +19 -14
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +23 -13
- data/lib/elasticsearch/api/actions/mget.rb +37 -44
- data/lib/elasticsearch/api/actions/msearch.rb +54 -54
- data/lib/elasticsearch/api/actions/msearch_template.rb +46 -35
- data/lib/elasticsearch/api/actions/mtermvectors.rb +39 -35
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +30 -25
- data/lib/elasticsearch/api/actions/nodes/info.rb +29 -63
- data/lib/elasticsearch/api/actions/nodes/params_registry.rb +0 -1
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +24 -22
- data/lib/elasticsearch/api/actions/nodes/shutdown.rb +4 -4
- data/lib/elasticsearch/api/actions/nodes/stats.rb +43 -36
- data/lib/elasticsearch/api/actions/nodes/usage.rb +31 -10
- data/lib/elasticsearch/api/actions/params_registry.rb +0 -1
- data/lib/elasticsearch/api/actions/ping.rb +12 -13
- data/lib/elasticsearch/api/actions/put_script.rb +26 -30
- data/lib/elasticsearch/api/actions/rank_eval.rb +24 -15
- data/lib/elasticsearch/api/actions/reindex.rb +25 -48
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +18 -12
- data/lib/elasticsearch/api/actions/remote/info.rb +1 -2
- data/lib/elasticsearch/api/actions/render_search_template.rb +17 -15
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +8 -6
- data/lib/elasticsearch/api/actions/scroll.rb +28 -51
- data/lib/elasticsearch/api/actions/search.rb +104 -165
- data/lib/elasticsearch/api/actions/search_shards.rb +31 -28
- data/lib/elasticsearch/api/actions/search_template.rb +48 -40
- data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +44 -0
- data/lib/elasticsearch/api/actions/snapshot/create.rb +22 -29
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +19 -24
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +20 -22
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +16 -18
- data/lib/elasticsearch/api/actions/snapshot/get.rb +22 -31
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +21 -25
- data/lib/elasticsearch/api/actions/snapshot/params_registry.rb +0 -1
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +21 -32
- data/lib/elasticsearch/api/actions/snapshot/status.rb +23 -24
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +18 -13
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +19 -13
- data/lib/elasticsearch/api/actions/tasks/get.rb +16 -13
- data/lib/elasticsearch/api/actions/tasks/list.rb +20 -18
- data/lib/elasticsearch/api/actions/tasks/params_registry.rb +0 -1
- data/lib/elasticsearch/api/actions/termvectors.rb +52 -70
- data/lib/elasticsearch/api/actions/update.rb +53 -98
- data/lib/elasticsearch/api/actions/update_by_query.rb +77 -66
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +17 -11
- data/lib/elasticsearch/api/version.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/segments_spec.rb +9 -11
- data/spec/elasticsearch/api/actions/cluster/put_settings_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/count_spec.rb +8 -8
- data/spec/elasticsearch/api/actions/delete_by_query_spec.rb +12 -7
- data/spec/elasticsearch/api/actions/delete_script_spec.rb +0 -14
- data/spec/elasticsearch/api/actions/exists_document_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/get_document_source_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/index_document_spec.rb +6 -15
- data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +0 -4
- data/spec/elasticsearch/api/actions/indices/clear_cache_spec.rb +1 -5
- data/spec/elasticsearch/api/actions/indices/clone_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/delete_alias_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/indices/get_spec.rb +0 -11
- data/spec/elasticsearch/api/actions/indices/put_alias_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/indices/put_mapping_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/indices/stats_spec.rb +0 -1
- data/spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/put_script_spec.rb +20 -15
- data/spec/elasticsearch/api/actions/render_search_template_spec.rb +23 -7
- data/spec/elasticsearch/api/actions/scroll_spec.rb +37 -0
- data/spec/elasticsearch/api/actions/search_spec.rb +0 -15
- data/spec/elasticsearch/api/actions/tasks/list_spec.rb +0 -11
- data/spec/elasticsearch/api/actions/update_document_spec.rb +3 -7
- data/spec/rest_yaml_tests_helper.rb +12 -0
- data/utils/Gemfile +1 -0
- data/utils/Thorfile +0 -1
- data/utils/thor/generate_source.rb +192 -85
- data/utils/thor/generator/endpoint_specifics.rb +157 -0
- data/utils/thor/generator/files_helper.rb +37 -0
- data/utils/thor/lister.rb +3 -4
- data/utils/thor/templates/_documentation_top.erb +27 -0
- data/utils/thor/templates/_method_setup.erb +35 -0
- data/utils/thor/templates/_params_registry.erb +12 -0
- data/utils/thor/templates/_perform_request.erb +37 -0
- data/utils/thor/templates/method.erb +59 -0
- data/utils/thor/templates/{ruby/test.erb → test.erb} +0 -0
- data/utils/thor/templates/{ruby/test_helper.rb → test_helper.rb} +0 -0
- metadata +19 -11
- data/spec/elasticsearch/api/actions/scoll_spec.rb +0 -21
- data/utils/thor/generate_api.rb +0 -193
- data/utils/thor/templates/ruby/method.erb +0 -62
@@ -6,43 +6,50 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cat
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Display information about the segments in the shards of an index
|
11
|
-
#
|
12
|
-
# @example Display information for all indices
|
13
|
-
#
|
14
|
-
# puts client.cat.segments
|
9
|
+
# Provides low-level information about the segments in the shards of an index.
|
15
10
|
#
|
16
11
|
# @option arguments [List] :index A comma-separated list of index names to limit the returned information
|
17
|
-
# @option arguments [String] :
|
12
|
+
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
|
13
|
+
# @option arguments [String] :bytes The unit in which to display byte values
|
14
|
+
# (options: b,k,kb,m,mb,g,gb,t,tb,p,pb)
|
15
|
+
|
18
16
|
# @option arguments [List] :h Comma-separated list of column names to display
|
19
17
|
# @option arguments [Boolean] :help Return help information
|
20
|
-
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
21
18
|
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
19
|
+
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
20
|
+
|
22
21
|
#
|
23
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
22
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-segments.html
|
24
23
|
#
|
25
|
-
def segments(arguments={})
|
26
|
-
|
27
|
-
|
24
|
+
def segments(arguments = {})
|
25
|
+
arguments = arguments.clone
|
26
|
+
|
27
|
+
_index = arguments.delete(:index)
|
28
|
+
|
29
|
+
method = Elasticsearch::API::HTTP_GET
|
30
|
+
path = if _index
|
31
|
+
"_cat/segments/#{Utils.__listify(_index)}"
|
32
|
+
else
|
33
|
+
"_cat/segments"
|
34
|
+
end
|
28
35
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
29
|
-
body = nil
|
30
36
|
|
37
|
+
body = nil
|
31
38
|
perform_request(method, path, params, body).body
|
32
39
|
end
|
33
40
|
|
34
41
|
# Register this action with its valid params when the module is loaded.
|
35
42
|
#
|
36
|
-
# @since 6.
|
43
|
+
# @since 6.2.0
|
37
44
|
ParamsRegistry.register(:segments, [
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
+
:format,
|
46
|
+
:bytes,
|
47
|
+
:h,
|
48
|
+
:help,
|
49
|
+
:s,
|
50
|
+
:v
|
51
|
+
].freeze)
|
52
|
+
end
|
45
53
|
end
|
46
|
-
end
|
47
54
|
end
|
48
55
|
end
|
@@ -6,80 +6,59 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cat
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Display shard allocation across nodes
|
11
|
-
#
|
12
|
-
# @example Display information for all indices
|
13
|
-
#
|
14
|
-
# puts client.cat.shards
|
15
|
-
#
|
16
|
-
# @example Display information for a specific index
|
17
|
-
#
|
18
|
-
# puts client.cat.shards index: 'index-a'
|
19
|
-
#
|
20
|
-
# @example Display information for a list of indices
|
21
|
-
#
|
22
|
-
# puts client.cat.shards index: ['index-a', 'index-b']
|
23
|
-
#
|
24
|
-
# @example Display header names in the output
|
25
|
-
#
|
26
|
-
# puts client.cat.shards v: true
|
27
|
-
#
|
28
|
-
# @example Display shard size in choice of units
|
29
|
-
#
|
30
|
-
# puts client.cat.shards bytes: 'b'
|
31
|
-
#
|
32
|
-
# @example Display only specific columns in the output (see the `help` parameter)
|
33
|
-
#
|
34
|
-
# puts client.cat.shards h: ['node', 'index', 'shard', 'prirep', 'docs', 'store', 'merges.total']
|
35
|
-
#
|
36
|
-
# @example Display only specific columns in the output, using the short names
|
37
|
-
#
|
38
|
-
# puts client.cat.shards h: 'n,i,s,p,d,sto,mt'
|
39
|
-
#
|
40
|
-
# @example Return the information as Ruby objects
|
41
|
-
#
|
42
|
-
# client.cat.shards format: 'json'
|
9
|
+
# Provides a detailed view of shard allocation on nodes.
|
43
10
|
#
|
44
11
|
# @option arguments [List] :index A comma-separated list of index names to limit the returned information
|
45
|
-
# @option arguments [String] :
|
46
|
-
# @option arguments [
|
47
|
-
#
|
48
|
-
|
49
|
-
# @option arguments [
|
50
|
-
# @option arguments [Boolean] :help Return information about headers
|
51
|
-
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
52
|
-
# (default: false)
|
12
|
+
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
|
13
|
+
# @option arguments [String] :bytes The unit in which to display byte values
|
14
|
+
# (options: b,k,kb,m,mb,g,gb,t,tb,p,pb)
|
15
|
+
|
16
|
+
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
|
53
17
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
18
|
+
# @option arguments [List] :h Comma-separated list of column names to display
|
19
|
+
# @option arguments [Boolean] :help Return help information
|
20
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
21
|
+
# @option arguments [String] :time The unit in which to display time values
|
22
|
+
# (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
|
23
|
+
|
24
|
+
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
25
|
+
|
54
26
|
#
|
55
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
27
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-shards.html
|
56
28
|
#
|
57
|
-
def shards(arguments={})
|
58
|
-
|
59
|
-
|
60
|
-
|
29
|
+
def shards(arguments = {})
|
30
|
+
arguments = arguments.clone
|
31
|
+
|
32
|
+
_index = arguments.delete(:index)
|
61
33
|
|
34
|
+
method = Elasticsearch::API::HTTP_GET
|
35
|
+
path = if _index
|
36
|
+
"_cat/shards/#{Utils.__listify(_index)}"
|
37
|
+
else
|
38
|
+
"_cat/shards"
|
39
|
+
end
|
62
40
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
63
41
|
params[:h] = Utils.__listify(params[:h]) if params[:h]
|
64
42
|
|
65
|
-
body
|
66
|
-
|
43
|
+
body = nil
|
67
44
|
perform_request(method, path, params, body).body
|
68
45
|
end
|
69
46
|
|
70
47
|
# Register this action with its valid params when the module is loaded.
|
71
48
|
#
|
72
|
-
# @since 6.
|
49
|
+
# @since 6.2.0
|
73
50
|
ParamsRegistry.register(:shards, [
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
51
|
+
:format,
|
52
|
+
:bytes,
|
53
|
+
:local,
|
54
|
+
:master_timeout,
|
55
|
+
:h,
|
56
|
+
:help,
|
57
|
+
:s,
|
58
|
+
:time,
|
59
|
+
:v
|
60
|
+
].freeze)
|
61
|
+
end
|
82
62
|
end
|
83
|
-
end
|
84
63
|
end
|
85
64
|
end
|
@@ -6,49 +6,54 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cat
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Shows all snapshots that belong to a specific repository
|
11
|
-
#
|
12
|
-
# @example Return snapshots for 'my_repository'
|
13
|
-
#
|
14
|
-
# client.cat.snapshots repository: 'my_repository'
|
15
|
-
#
|
16
|
-
# @example Return id, status and start_epoch for 'my_repository'
|
17
|
-
#
|
18
|
-
# client.cat.snapshots repository: 'my_repository', h: 'id,status,start_epoch'
|
9
|
+
# Returns all snapshots in a specific repository.
|
19
10
|
#
|
11
|
+
# @option arguments [List] :repository Name of repository from which to fetch the snapshot information
|
12
|
+
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
|
13
|
+
# @option arguments [Boolean] :ignore_unavailable Set to true to ignore unavailable snapshots
|
20
14
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
21
15
|
# @option arguments [List] :h Comma-separated list of column names to display
|
22
16
|
# @option arguments [Boolean] :help Return help information
|
23
|
-
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
24
17
|
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
18
|
+
# @option arguments [String] :time The unit in which to display time values
|
19
|
+
# (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
|
20
|
+
|
21
|
+
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
22
|
+
|
25
23
|
#
|
26
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
24
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-snapshots.html
|
27
25
|
#
|
28
|
-
def snapshots(arguments={})
|
29
|
-
|
26
|
+
def snapshots(arguments = {})
|
27
|
+
arguments = arguments.clone
|
28
|
+
|
29
|
+
_repository = arguments.delete(:repository)
|
30
30
|
|
31
|
-
method = HTTP_GET
|
32
|
-
path =
|
31
|
+
method = Elasticsearch::API::HTTP_GET
|
32
|
+
path = if _repository
|
33
|
+
"_cat/snapshots/#{Utils.__listify(_repository)}"
|
34
|
+
else
|
35
|
+
"_cat/snapshots"
|
36
|
+
end
|
33
37
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
34
|
-
body = nil
|
35
38
|
|
39
|
+
body = nil
|
36
40
|
perform_request(method, path, params, body).body
|
37
41
|
end
|
38
42
|
|
39
43
|
# Register this action with its valid params when the module is loaded.
|
40
44
|
#
|
41
|
-
# @since 6.
|
45
|
+
# @since 6.2.0
|
42
46
|
ParamsRegistry.register(:snapshots, [
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
:format,
|
48
|
+
:ignore_unavailable,
|
49
|
+
:master_timeout,
|
50
|
+
:h,
|
51
|
+
:help,
|
52
|
+
:s,
|
53
|
+
:time,
|
54
|
+
:v
|
55
|
+
].freeze)
|
56
|
+
end
|
50
57
|
end
|
51
|
-
end
|
52
58
|
end
|
53
59
|
end
|
54
|
-
|
@@ -6,45 +6,51 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cat
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Return currently running tasks
|
9
|
+
# Returns information about the tasks currently executing on one or more nodes in the cluster.
|
11
10
|
#
|
12
11
|
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
|
13
12
|
# @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
14
13
|
# @option arguments [List] :actions A comma-separated list of actions that should be returned. Leave empty to return all.
|
15
14
|
# @option arguments [Boolean] :detailed Return detailed task information (default: false)
|
16
|
-
# @option arguments [String] :parent_node Return tasks with specified parent node.
|
17
15
|
# @option arguments [Number] :parent_task Return tasks with specified parent task id. Set to -1 to return all.
|
18
16
|
# @option arguments [List] :h Comma-separated list of column names to display
|
19
17
|
# @option arguments [Boolean] :help Return help information
|
20
|
-
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
21
18
|
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
19
|
+
# @option arguments [String] :time The unit in which to display time values
|
20
|
+
# (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
|
21
|
+
|
22
|
+
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
23
|
+
|
22
24
|
#
|
23
|
-
# @see
|
25
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/tasks.html
|
24
26
|
#
|
25
|
-
def tasks(arguments={})
|
26
|
-
|
27
|
+
def tasks(arguments = {})
|
28
|
+
arguments = arguments.clone
|
29
|
+
|
30
|
+
method = Elasticsearch::API::HTTP_GET
|
27
31
|
path = "_cat/tasks"
|
28
32
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
29
|
-
body = nil
|
30
33
|
|
34
|
+
body = nil
|
31
35
|
perform_request(method, path, params, body).body
|
32
36
|
end
|
33
37
|
|
34
38
|
# Register this action with its valid params when the module is loaded.
|
35
39
|
#
|
36
|
-
# @since 6.
|
40
|
+
# @since 6.2.0
|
37
41
|
ParamsRegistry.register(:tasks, [
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
:format,
|
43
|
+
:node_id,
|
44
|
+
:actions,
|
45
|
+
:detailed,
|
46
|
+
:parent_task,
|
47
|
+
:h,
|
48
|
+
:help,
|
49
|
+
:s,
|
50
|
+
:time,
|
51
|
+
:v
|
52
|
+
].freeze)
|
53
|
+
end
|
47
54
|
end
|
48
|
-
end
|
49
55
|
end
|
50
56
|
end
|
@@ -6,8 +6,7 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cat
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Returns information about existing templates
|
9
|
+
# Returns information about existing templates.
|
11
10
|
#
|
12
11
|
# @option arguments [String] :name A pattern that returned template names must match
|
13
12
|
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
|
@@ -15,33 +14,42 @@ module Elasticsearch
|
|
15
14
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
16
15
|
# @option arguments [List] :h Comma-separated list of column names to display
|
17
16
|
# @option arguments [Boolean] :help Return help information
|
18
|
-
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
19
17
|
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
18
|
+
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
19
|
+
|
20
20
|
#
|
21
|
-
# @see
|
21
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-templates.html
|
22
22
|
#
|
23
|
-
def templates(arguments={})
|
24
|
-
|
25
|
-
|
23
|
+
def templates(arguments = {})
|
24
|
+
arguments = arguments.clone
|
25
|
+
|
26
|
+
_name = arguments.delete(:name)
|
27
|
+
|
28
|
+
method = Elasticsearch::API::HTTP_GET
|
29
|
+
path = if _name
|
30
|
+
"_cat/templates/#{Utils.__listify(_name)}"
|
31
|
+
else
|
32
|
+
"_cat/templates"
|
33
|
+
end
|
26
34
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
27
|
-
body = nil
|
28
35
|
|
36
|
+
body = nil
|
29
37
|
perform_request(method, path, params, body).body
|
30
38
|
end
|
31
39
|
|
32
40
|
# Register this action with its valid params when the module is loaded.
|
33
41
|
#
|
34
|
-
# @since 6.
|
42
|
+
# @since 6.2.0
|
35
43
|
ParamsRegistry.register(:templates, [
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
+
:format,
|
45
|
+
:local,
|
46
|
+
:master_timeout,
|
47
|
+
:h,
|
48
|
+
:help,
|
49
|
+
:s,
|
50
|
+
:v
|
51
|
+
].freeze)
|
52
|
+
end
|
44
53
|
end
|
45
|
-
end
|
46
54
|
end
|
47
55
|
end
|
@@ -6,66 +6,56 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cat
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
#
|
11
|
-
# of avaialable thread pools)
|
12
|
-
#
|
13
|
-
# @example Display information about all thread pools across nodes
|
14
|
-
#
|
15
|
-
# puts client.cat.thread_pool
|
16
|
-
#
|
17
|
-
# @example Display header names in the output
|
18
|
-
#
|
19
|
-
# puts client.cat.thread_pool v: true
|
20
|
-
#
|
21
|
-
# @example Display information about the indexing thread pool
|
22
|
-
#
|
23
|
-
# puts client.cat.thread_pool h: %w(h ip index.active index.size index.queue index.rejected), v: true
|
24
|
-
#
|
25
|
-
# @example Display information about the indexing and search threads, using the short names
|
26
|
-
#
|
27
|
-
# puts client.cat.thread_pool h: 'host,ia,is,iq,ir,sa,ss,sq,sr', v: true
|
9
|
+
# Returns cluster-wide thread pool statistics per node.
|
10
|
+
# By default the active, queue and rejected statistics are returned for all thread pools.
|
28
11
|
#
|
29
|
-
# @option arguments [
|
12
|
+
# @option arguments [List] :thread_pool_patterns A comma-separated list of regular-expressions to filter the thread pools in the output
|
13
|
+
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
|
30
14
|
# @option arguments [String] :size The multiplier in which to display values
|
31
|
-
#
|
32
|
-
|
33
|
-
#
|
34
|
-
# @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
|
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
|
37
|
-
# @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
|
38
|
-
# @option arguments [Boolean] :help Return information about headers
|
39
|
-
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
40
|
-
# (default: false)
|
15
|
+
# (options: ,k,m,g,t,p)
|
16
|
+
|
17
|
+
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
|
41
18
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
19
|
+
# @option arguments [List] :h Comma-separated list of column names to display
|
20
|
+
# @option arguments [Boolean] :help Return help information
|
21
|
+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
|
22
|
+
# @option arguments [Boolean] :v Verbose mode. Display column headers
|
23
|
+
|
42
24
|
#
|
43
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
25
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-thread-pool.html
|
44
26
|
#
|
45
|
-
def thread_pool(arguments={})
|
46
|
-
|
47
|
-
|
27
|
+
def thread_pool(arguments = {})
|
28
|
+
arguments = arguments.clone
|
29
|
+
|
30
|
+
_thread_pool_patterns = arguments.delete(:thread_pool_patterns)
|
31
|
+
|
32
|
+
method = Elasticsearch::API::HTTP_GET
|
33
|
+
path = if _thread_pool_patterns
|
34
|
+
"_cat/thread_pool/#{Utils.__listify(_thread_pool_patterns)}"
|
35
|
+
else
|
36
|
+
"_cat/thread_pool"
|
37
|
+
end
|
48
38
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
49
39
|
params[:h] = Utils.__listify(params[:h]) if params[:h]
|
50
|
-
body = nil
|
51
40
|
|
41
|
+
body = nil
|
52
42
|
perform_request(method, path, params, body).body
|
53
43
|
end
|
54
44
|
|
55
45
|
# Register this action with its valid params when the module is loaded.
|
56
46
|
#
|
57
|
-
# @since 6.
|
47
|
+
# @since 6.2.0
|
58
48
|
ParamsRegistry.register(:thread_pool, [
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
49
|
+
:format,
|
50
|
+
:size,
|
51
|
+
:local,
|
52
|
+
:master_timeout,
|
53
|
+
:h,
|
54
|
+
:help,
|
55
|
+
:s,
|
56
|
+
:v
|
57
|
+
].freeze)
|
58
|
+
end
|
68
59
|
end
|
69
|
-
end
|
70
60
|
end
|
71
61
|
end
|