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
@@ -5,22 +5,35 @@
|
|
5
5
|
module Elasticsearch
|
6
6
|
module API
|
7
7
|
module Actions
|
8
|
-
|
9
|
-
# Abort a particular scroll search and clear all the resources associated with it.
|
8
|
+
# Explicitly clears the search context for a scroll.
|
10
9
|
#
|
11
|
-
# @option arguments [List] :scroll_id A comma-separated list of scroll IDs to clear
|
10
|
+
# @option arguments [List] :scroll_id A comma-separated list of scroll IDs to clear *Deprecated*
|
11
|
+
|
12
12
|
# @option arguments [Hash] :body A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
|
13
13
|
#
|
14
|
-
#
|
14
|
+
# *Deprecation notice*:
|
15
|
+
# A scroll id can be quite large and should be specified as part of the body
|
16
|
+
# Deprecated since version 7.0.0
|
17
|
+
#
|
18
|
+
#
|
19
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/search-request-body.html#_clear_scroll_api
|
15
20
|
#
|
16
|
-
def clear_scroll(arguments={})
|
21
|
+
def clear_scroll(arguments = {})
|
22
|
+
arguments = arguments.clone
|
23
|
+
|
24
|
+
_scroll_id = arguments.delete(:scroll_id)
|
25
|
+
|
17
26
|
method = Elasticsearch::API::HTTP_DELETE
|
18
|
-
path =
|
27
|
+
path = if _scroll_id
|
28
|
+
"_search/scroll/#{Utils.__listify(_scroll_id)}"
|
29
|
+
else
|
30
|
+
"_search/scroll"
|
31
|
+
end
|
19
32
|
params = {}
|
20
|
-
body = arguments[:body]
|
21
33
|
|
34
|
+
body = arguments[:body]
|
22
35
|
perform_request(method, path, params, body).body
|
23
36
|
end
|
24
37
|
end
|
25
|
-
|
38
|
+
end
|
26
39
|
end
|
@@ -6,32 +6,34 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cluster
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Return the information about why a shard is or isn't allocated
|
9
|
+
# Provides explanations for shard allocations in the cluster.
|
11
10
|
#
|
12
|
-
# @option arguments [Hash] :body The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'
|
13
11
|
# @option arguments [Boolean] :include_yes_decisions Return 'YES' decisions in explanation (default: false)
|
14
|
-
# @option arguments [Boolean] :include_disk_info Return information about disk usage and shard sizes
|
15
|
-
|
12
|
+
# @option arguments [Boolean] :include_disk_info Return information about disk usage and shard sizes (default: false)
|
13
|
+
|
14
|
+
# @option arguments [Hash] :body The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'
|
16
15
|
#
|
17
|
-
# @see
|
16
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cluster-allocation-explain.html
|
18
17
|
#
|
19
|
-
def allocation_explain(arguments={})
|
20
|
-
|
18
|
+
def allocation_explain(arguments = {})
|
19
|
+
arguments = arguments.clone
|
20
|
+
|
21
|
+
method = Elasticsearch::API::HTTP_GET
|
21
22
|
path = "_cluster/allocation/explain"
|
22
23
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
23
|
-
body = arguments[:body]
|
24
24
|
|
25
|
+
body = arguments[:body]
|
25
26
|
perform_request(method, path, params, body).body
|
26
27
|
end
|
27
28
|
|
28
29
|
# Register this action with its valid params when the module is loaded.
|
29
30
|
#
|
30
|
-
# @since 6.
|
31
|
+
# @since 6.2.0
|
31
32
|
ParamsRegistry.register(:allocation_explain, [
|
32
|
-
|
33
|
-
|
33
|
+
:include_yes_decisions,
|
34
|
+
:include_disk_info
|
35
|
+
].freeze)
|
36
|
+
end
|
34
37
|
end
|
35
|
-
end
|
36
38
|
end
|
37
39
|
end
|
@@ -6,37 +6,37 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cluster
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Get the cluster settings (previously set with {Cluster::Actions#put_settings})
|
11
|
-
#
|
12
|
-
# @example Get cluster settings
|
13
|
-
#
|
14
|
-
# client.cluster.get_settings
|
9
|
+
# Returns cluster settings.
|
15
10
|
#
|
16
11
|
# @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
|
17
|
-
# @option arguments [
|
18
|
-
#
|
12
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
13
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
14
|
+
# @option arguments [Boolean] :include_defaults Whether to return all default clusters setting.
|
15
|
+
|
19
16
|
#
|
20
|
-
# @see
|
17
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cluster-update-settings.html
|
21
18
|
#
|
22
|
-
def get_settings(arguments={})
|
23
|
-
|
19
|
+
def get_settings(arguments = {})
|
20
|
+
arguments = arguments.clone
|
21
|
+
|
22
|
+
method = Elasticsearch::API::HTTP_GET
|
24
23
|
path = "_cluster/settings"
|
25
24
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
26
|
-
body = nil
|
27
25
|
|
26
|
+
body = nil
|
28
27
|
perform_request(method, path, params, body).body
|
29
28
|
end
|
30
29
|
|
31
30
|
# Register this action with its valid params when the module is loaded.
|
32
31
|
#
|
33
|
-
# @since 6.
|
32
|
+
# @since 6.2.0
|
34
33
|
ParamsRegistry.register(:get_settings, [
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
:flat_settings,
|
35
|
+
:master_timeout,
|
36
|
+
:timeout,
|
37
|
+
:include_defaults
|
38
|
+
].freeze)
|
39
|
+
end
|
39
40
|
end
|
40
|
-
end
|
41
41
|
end
|
42
42
|
end
|
@@ -6,67 +6,65 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cluster
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Returns information about cluster "health".
|
11
|
-
#
|
12
|
-
# @example Get the cluster health information
|
13
|
-
#
|
14
|
-
# client.cluster.health
|
15
|
-
#
|
16
|
-
# @example Block the request until the cluster is in the "yellow" state
|
9
|
+
# Returns basic information about the health of the cluster.
|
17
10
|
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
11
|
+
# @option arguments [List] :index Limit the information returned to a specific index
|
12
|
+
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
13
|
+
# (options: open,closed,none,all)
|
14
|
+
|
21
15
|
# @option arguments [String] :level Specify the level of detail for returned information
|
22
|
-
#
|
23
|
-
|
24
|
-
#
|
16
|
+
# (options: cluster,indices,shards)
|
17
|
+
|
18
|
+
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
|
25
19
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
26
20
|
# @option arguments [Time] :timeout Explicit operation timeout
|
27
|
-
# @option arguments [
|
28
|
-
# @option arguments [
|
29
|
-
# @option arguments [
|
30
|
-
#
|
31
|
-
|
32
|
-
#
|
33
|
-
# @option arguments [Boolean] :wait_for_no_initializing_shards Whether to wait until there are no
|
34
|
-
# initializing shards in the cluster
|
21
|
+
# @option arguments [String] :wait_for_active_shards Wait until the specified number of shards is active
|
22
|
+
# @option arguments [String] :wait_for_nodes Wait until the specified number of nodes is available
|
23
|
+
# @option arguments [String] :wait_for_events Wait until all currently queued events with the given priority are processed
|
24
|
+
# (options: immediate,urgent,high,normal,low,languid)
|
25
|
+
|
26
|
+
# @option arguments [Boolean] :wait_for_no_relocating_shards Whether to wait until there are no relocating shards in the cluster
|
27
|
+
# @option arguments [Boolean] :wait_for_no_initializing_shards Whether to wait until there are no initializing shards in the cluster
|
35
28
|
# @option arguments [String] :wait_for_status Wait until cluster is in a specific state
|
36
|
-
#
|
37
|
-
|
38
|
-
# are processed (immediate, urgent, high, normal, low, languid)
|
29
|
+
# (options: green,yellow,red)
|
30
|
+
|
39
31
|
#
|
40
|
-
# @see
|
32
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cluster-health.html
|
41
33
|
#
|
42
|
-
def health(arguments={})
|
34
|
+
def health(arguments = {})
|
43
35
|
arguments = arguments.clone
|
44
|
-
index = arguments.delete(:index)
|
45
|
-
method = HTTP_GET
|
46
|
-
path = Utils.__pathify "_cluster/health", Utils.__listify(index)
|
47
36
|
|
37
|
+
_index = arguments.delete(:index)
|
38
|
+
|
39
|
+
method = Elasticsearch::API::HTTP_GET
|
40
|
+
path = if _index
|
41
|
+
"_cluster/health/#{Utils.__listify(_index)}"
|
42
|
+
else
|
43
|
+
"_cluster/health"
|
44
|
+
end
|
48
45
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
49
|
-
body = nil
|
50
46
|
|
47
|
+
body = nil
|
51
48
|
perform_request(method, path, params, body).body
|
52
49
|
end
|
53
50
|
|
54
51
|
# Register this action with its valid params when the module is loaded.
|
55
52
|
#
|
56
|
-
# @since 6.
|
53
|
+
# @since 6.2.0
|
57
54
|
ParamsRegistry.register(:health, [
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
55
|
+
:expand_wildcards,
|
56
|
+
:level,
|
57
|
+
:local,
|
58
|
+
:master_timeout,
|
59
|
+
:timeout,
|
60
|
+
:wait_for_active_shards,
|
61
|
+
:wait_for_nodes,
|
62
|
+
:wait_for_events,
|
63
|
+
:wait_for_no_relocating_shards,
|
64
|
+
:wait_for_no_initializing_shards,
|
65
|
+
:wait_for_status
|
66
|
+
].freeze)
|
67
|
+
end
|
69
68
|
end
|
70
|
-
end
|
71
69
|
end
|
72
70
|
end
|
@@ -6,36 +6,34 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cluster
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
#
|
11
|
-
# which have not yet been executed and are queued up.
|
12
|
-
#
|
13
|
-
# @example Get a list of currently queued up tasks in the cluster
|
14
|
-
#
|
15
|
-
# client.cluster.pending_tasks
|
9
|
+
# Returns a list of any cluster-level changes (e.g. create index, update mapping,
|
10
|
+
# allocate or fail shard) which have not yet been executed.
|
16
11
|
#
|
17
|
-
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
18
|
-
# (default: false)
|
12
|
+
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
|
19
13
|
# @option arguments [Time] :master_timeout Specify timeout for connection to master
|
14
|
+
|
20
15
|
#
|
21
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
16
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cluster-pending.html
|
22
17
|
#
|
23
|
-
def pending_tasks(arguments={})
|
24
|
-
|
18
|
+
def pending_tasks(arguments = {})
|
19
|
+
arguments = arguments.clone
|
20
|
+
|
21
|
+
method = Elasticsearch::API::HTTP_GET
|
25
22
|
path = "_cluster/pending_tasks"
|
26
23
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
27
|
-
body = nil
|
28
24
|
|
25
|
+
body = nil
|
29
26
|
perform_request(method, path, params, body).body
|
30
27
|
end
|
31
28
|
|
32
29
|
# Register this action with its valid params when the module is loaded.
|
33
30
|
#
|
34
|
-
# @since 6.
|
31
|
+
# @since 6.2.0
|
35
32
|
ParamsRegistry.register(:pending_tasks, [
|
36
|
-
|
37
|
-
|
33
|
+
:local,
|
34
|
+
:master_timeout
|
35
|
+
].freeze)
|
36
|
+
end
|
38
37
|
end
|
39
|
-
end
|
40
38
|
end
|
41
39
|
end
|
@@ -6,35 +6,38 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cluster
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Update cluster settings.
|
11
|
-
#
|
12
|
-
# @example Disable shard allocation in the cluster until restart
|
9
|
+
# Updates the cluster settings.
|
13
10
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
# @option arguments [
|
17
|
-
|
11
|
+
# @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
|
12
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
13
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
14
|
+
|
15
|
+
# @option arguments [Hash] :body The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). (*Required*)
|
18
16
|
#
|
19
|
-
# @see
|
17
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cluster-update-settings.html
|
20
18
|
#
|
21
|
-
def put_settings(arguments={})
|
22
|
-
|
19
|
+
def put_settings(arguments = {})
|
20
|
+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
21
|
+
|
22
|
+
arguments = arguments.clone
|
23
|
+
|
24
|
+
method = Elasticsearch::API::HTTP_PUT
|
23
25
|
path = "_cluster/settings"
|
24
26
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
25
|
-
body = arguments[:body] || {}
|
26
27
|
|
28
|
+
body = arguments[:body] || {}
|
27
29
|
perform_request(method, path, params, body).body
|
28
30
|
end
|
29
31
|
|
30
32
|
# Register this action with its valid params when the module is loaded.
|
31
33
|
#
|
32
|
-
# @since 6.
|
34
|
+
# @since 6.2.0
|
33
35
|
ParamsRegistry.register(:put_settings, [
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
:flat_settings,
|
37
|
+
:master_timeout,
|
38
|
+
:timeout
|
39
|
+
].freeze)
|
40
|
+
end
|
37
41
|
end
|
38
|
-
end
|
39
42
|
end
|
40
43
|
end
|
@@ -6,21 +6,23 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cluster
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Returns the configured remote cluster information
|
9
|
+
# Returns the information about configured remote clusters.
|
11
10
|
#
|
11
|
+
|
12
12
|
#
|
13
|
-
# @see
|
13
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cluster-remote-info.html
|
14
14
|
#
|
15
|
-
def remote_info(arguments={})
|
15
|
+
def remote_info(arguments = {})
|
16
|
+
arguments = arguments.clone
|
17
|
+
|
16
18
|
method = Elasticsearch::API::HTTP_GET
|
17
19
|
path = "_remote/info"
|
18
20
|
params = {}
|
19
|
-
body = nil
|
20
21
|
|
22
|
+
body = nil
|
21
23
|
perform_request(method, path, params, body).body
|
22
24
|
end
|
25
|
+
end
|
23
26
|
end
|
24
|
-
end
|
25
27
|
end
|
26
28
|
end
|
@@ -6,56 +6,44 @@ module Elasticsearch
|
|
6
6
|
module API
|
7
7
|
module Cluster
|
8
8
|
module Actions
|
9
|
-
|
10
|
-
# Perform manual shard allocation in the cluster.
|
11
|
-
#
|
12
|
-
# Pass the operations you want to perform in the `:body` option. Use the `dry_run` option to
|
13
|
-
# evaluate the result of operations without actually performing them.
|
14
|
-
#
|
15
|
-
# @example Move shard `0` of index `myindex` from node named _Node1_ to node named _Node2_
|
9
|
+
# Allows to manually change the allocation of individual shards in the cluster.
|
16
10
|
#
|
17
|
-
# client.cluster.reroute body: {
|
18
|
-
# commands: [
|
19
|
-
# { move: { index: 'myindex', shard: 0, from_node: 'Node1', to_node: 'Node2' } }
|
20
|
-
# ]
|
21
|
-
# }
|
22
|
-
#
|
23
|
-
# @note If you want to explicitly set the shard allocation to a certain node, you might
|
24
|
-
# want to look at the `allocation.*` cluster settings.
|
25
|
-
#
|
26
|
-
# @option arguments [Hash] :body The definition of `commands` to perform (`move`, `cancel`, `allocate`)
|
27
11
|
# @option arguments [Boolean] :dry_run Simulate the operation only and return the resulting state
|
28
|
-
# @option arguments [Boolean] :explain Return an explanation
|
29
|
-
# @option arguments [Boolean] :
|
30
|
-
#
|
31
|
-
#
|
32
|
-
|
33
|
-
# @option arguments [
|
34
|
-
#
|
12
|
+
# @option arguments [Boolean] :explain Return an explanation of why the commands can or cannot be executed
|
13
|
+
# @option arguments [Boolean] :retry_failed Retries allocation of shards that are blocked due to too many subsequent allocation failures
|
14
|
+
# @option arguments [List] :metric Limit the information returned to the specified metrics. Defaults to all but metadata
|
15
|
+
# (options: _all,blocks,metadata,nodes,routing_table,master_node,version)
|
16
|
+
|
17
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
18
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
19
|
+
|
20
|
+
# @option arguments [Hash] :body The definition of `commands` to perform (`move`, `cancel`, `allocate`)
|
35
21
|
#
|
36
|
-
# @see
|
22
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cluster-reroute.html
|
37
23
|
#
|
38
|
-
def reroute(arguments={})
|
39
|
-
|
40
|
-
path = "_cluster/reroute"
|
24
|
+
def reroute(arguments = {})
|
25
|
+
arguments = arguments.clone
|
41
26
|
|
27
|
+
method = Elasticsearch::API::HTTP_POST
|
28
|
+
path = "_cluster/reroute"
|
42
29
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
43
|
-
body = arguments[:body] || {}
|
44
30
|
|
31
|
+
body = arguments[:body] || {}
|
45
32
|
perform_request(method, path, params, body).body
|
46
33
|
end
|
47
34
|
|
48
35
|
# Register this action with its valid params when the module is loaded.
|
49
36
|
#
|
50
|
-
# @since 6.
|
37
|
+
# @since 6.2.0
|
51
38
|
ParamsRegistry.register(:reroute, [
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
39
|
+
:dry_run,
|
40
|
+
:explain,
|
41
|
+
:retry_failed,
|
42
|
+
:metric,
|
43
|
+
:master_timeout,
|
44
|
+
:timeout
|
45
|
+
].freeze)
|
46
|
+
end
|
58
47
|
end
|
59
|
-
end
|
60
48
|
end
|
61
49
|
end
|