elasticsearch-api 7.8.1 → 7.9.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/elasticsearch/api.rb +2 -1
- data/lib/elasticsearch/api/actions/bulk.rb +7 -5
- data/lib/elasticsearch/api/actions/cat/aliases.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/allocation.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/count.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/health.rb +3 -2
- data/lib/elasticsearch/api/actions/cat/help.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/indices.rb +7 -3
- data/lib/elasticsearch/api/actions/cat/master.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/nodes.rb +4 -2
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +3 -2
- data/lib/elasticsearch/api/actions/cat/plugins.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/recovery.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/repositories.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/segments.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/shards.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/tasks.rb +3 -2
- data/lib/elasticsearch/api/actions/cat/templates.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +4 -3
- data/lib/elasticsearch/api/actions/clear_scroll.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +9 -4
- data/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +2 -6
- data/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/exists_component_template.rb +2 -6
- data/lib/elasticsearch/api/actions/cluster/get_component_template.rb +3 -7
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/health.rb +7 -3
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/put_component_template.rb +2 -6
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +3 -2
- data/lib/elasticsearch/api/actions/cluster/state.rb +5 -3
- data/lib/elasticsearch/api/actions/cluster/stats.rb +3 -3
- data/lib/elasticsearch/api/actions/count.rb +11 -14
- data/lib/elasticsearch/api/actions/create.rb +4 -2
- data/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb +60 -0
- data/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb +60 -0
- data/lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb +43 -0
- data/lib/elasticsearch/api/actions/dangling_indices/params_registry.rb +60 -0
- data/lib/elasticsearch/api/actions/delete.rb +5 -3
- data/lib/elasticsearch/api/actions/delete_by_query.rb +7 -3
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +2 -2
- data/lib/elasticsearch/api/actions/delete_script.rb +2 -2
- data/lib/elasticsearch/api/actions/exists.rb +4 -3
- data/lib/elasticsearch/api/actions/exists_source.rb +4 -3
- data/lib/elasticsearch/api/actions/explain.rb +13 -7
- data/lib/elasticsearch/api/actions/field_caps.rb +15 -8
- data/lib/elasticsearch/api/actions/get.rb +4 -3
- data/lib/elasticsearch/api/actions/get_script.rb +2 -2
- data/lib/elasticsearch/api/actions/get_script_context.rb +2 -6
- data/lib/elasticsearch/api/actions/get_script_languages.rb +2 -6
- data/lib/elasticsearch/api/actions/get_source.rb +4 -3
- data/lib/elasticsearch/api/actions/index.rb +6 -3
- data/lib/elasticsearch/api/actions/indices/add_block.rb +70 -0
- data/lib/elasticsearch/api/actions/indices/analyze.rb +12 -7
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/clone.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/close.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/create.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/create_data_stream.rb +3 -8
- data/lib/elasticsearch/api/actions/indices/data_streams_stats.rb +62 -0
- data/lib/elasticsearch/api/actions/indices/delete.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/delete_data_stream.rb +3 -7
- data/lib/elasticsearch/api/actions/indices/delete_index_template.rb +2 -6
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/exists.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/exists_index_template.rb +2 -6
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/flush.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/get.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/{get_data_streams.rb → get_data_stream.rb} +7 -11
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/get_index_template.rb +3 -7
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +5 -4
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/get_template.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/open.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/put_index_template.rb +2 -6
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/put_template.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/recovery.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/refresh.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/resolve_index.rb +58 -0
- data/lib/elasticsearch/api/actions/indices/rollover.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/segments.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/shrink.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/simulate_index_template.rb +2 -6
- data/lib/elasticsearch/api/actions/indices/simulate_template.rb +63 -0
- data/lib/elasticsearch/api/actions/indices/split.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/stats.rb +5 -2
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +16 -9
- data/lib/elasticsearch/api/actions/info.rb +2 -2
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +2 -2
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +3 -3
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +2 -2
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +2 -2
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +4 -4
- data/lib/elasticsearch/api/actions/mget.rb +4 -4
- data/lib/elasticsearch/api/actions/msearch.rb +6 -5
- data/lib/elasticsearch/api/actions/msearch_template.rb +6 -5
- data/lib/elasticsearch/api/actions/mtermvectors.rb +16 -10
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +4 -3
- data/lib/elasticsearch/api/actions/nodes/info.rb +4 -3
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +3 -3
- data/lib/elasticsearch/api/actions/nodes/stats.rb +7 -4
- data/lib/elasticsearch/api/actions/nodes/usage.rb +4 -3
- data/lib/elasticsearch/api/actions/ping.rb +2 -2
- data/lib/elasticsearch/api/actions/put_script.rb +3 -3
- data/lib/elasticsearch/api/actions/rank_eval.rb +6 -8
- data/lib/elasticsearch/api/actions/reindex.rb +2 -2
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +2 -2
- data/lib/elasticsearch/api/actions/render_search_template.rb +12 -7
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +9 -8
- data/lib/elasticsearch/api/actions/scroll.rb +12 -7
- data/lib/elasticsearch/api/actions/search.rb +18 -9
- data/lib/elasticsearch/api/actions/search_shards.rb +4 -3
- data/lib/elasticsearch/api/actions/search_template.rb +6 -4
- data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/create.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/get.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/status.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +2 -2
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +3 -3
- data/lib/elasticsearch/api/actions/tasks/get.rb +2 -2
- data/lib/elasticsearch/api/actions/tasks/list.rb +3 -2
- data/lib/elasticsearch/api/actions/termvectors.rb +9 -4
- data/lib/elasticsearch/api/actions/update.rb +4 -3
- data/lib/elasticsearch/api/actions/update_by_query.rb +7 -3
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +2 -2
- data/lib/elasticsearch/api/namespace/cat.rb +0 -1
- data/lib/elasticsearch/api/namespace/dangling_indices.rb +35 -0
- data/lib/elasticsearch/api/version.rb +1 -1
- data/spec/elasticsearch/api/actions/count_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/dangling_indices/delete_dangling_indices_spec.rb +48 -0
- data/spec/elasticsearch/api/actions/dangling_indices/import_dangling_indices_spec.rb +48 -0
- data/spec/elasticsearch/api/actions/dangling_indices/list_dangling_indices_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/explain_document_spec.rb +8 -9
- data/spec/elasticsearch/api/actions/indices/add_block_spec.rb +63 -0
- data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +7 -8
- data/spec/elasticsearch/api/actions/indices/data_streams_stats_spec.rb +72 -0
- data/spec/elasticsearch/api/actions/indices/validate_query_spec.rb +7 -13
- data/spec/elasticsearch/api/actions/ingest/simulate_spec.rb +6 -7
- data/spec/elasticsearch/api/actions/json_builders_spec.rb +10 -13
- data/spec/elasticsearch/api/actions/mget_spec.rb +5 -6
- data/spec/elasticsearch/api/actions/msearch_spec.rb +5 -6
- data/spec/elasticsearch/api/actions/msearch_template_spec.rb +5 -6
- data/spec/elasticsearch/api/actions/mtermvectors_spec.rb +7 -7
- data/spec/elasticsearch/api/actions/render_search_template_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/scroll_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/search_spec.rb +7 -7
- data/spec/elasticsearch/api/actions/search_template_spec.rb +5 -6
- data/spec/elasticsearch/api/actions/termvectors_spec.rb +5 -7
- data/spec/elasticsearch/api/rest_api_yaml_spec.rb +0 -1
- data/utils/thor/.rubocop.yml +2 -0
- data/utils/thor/generate_source.rb +23 -42
- data/utils/thor/generator/endpoint_specifics.rb +8 -1
- data/utils/thor/templates/_documentation_top.erb +11 -2
- metadata +25 -11
- data/spec/README.md +0 -61
- data/test/integration/yaml_test_runner.rb +0 -592
- data/test/test_helper.rb +0 -118
@@ -27,7 +27,7 @@ module Elasticsearch
|
|
27
27
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
28
|
# @option arguments [Hash] :body The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). (*Required*)
|
29
29
|
#
|
30
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
30
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-update-settings.html
|
31
31
|
#
|
32
32
|
def put_settings(arguments = {})
|
33
33
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
@@ -52,7 +52,7 @@ module Elasticsearch
|
|
52
52
|
:master_timeout,
|
53
53
|
:timeout
|
54
54
|
].freeze)
|
55
|
-
end
|
56
55
|
end
|
56
|
+
end
|
57
57
|
end
|
58
58
|
end
|
@@ -23,7 +23,7 @@ module Elasticsearch
|
|
23
23
|
#
|
24
24
|
# @option arguments [Hash] :headers Custom HTTP headers
|
25
25
|
#
|
26
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
26
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-remote-info.html
|
27
27
|
#
|
28
28
|
def remote_info(arguments = {})
|
29
29
|
headers = arguments.delete(:headers) || {}
|
@@ -37,7 +37,7 @@ module Elasticsearch
|
|
37
37
|
body = nil
|
38
38
|
perform_request(method, path, params, body, headers).body
|
39
39
|
end
|
40
|
-
end
|
41
40
|
end
|
41
|
+
end
|
42
42
|
end
|
43
43
|
end
|
@@ -26,12 +26,13 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [Boolean] :retry_failed Retries allocation of shards that are blocked due to too many subsequent allocation failures
|
27
27
|
# @option arguments [List] :metric Limit the information returned to the specified metrics. Defaults to all but metadata
|
28
28
|
# (options: _all,blocks,metadata,nodes,routing_table,master_node,version)
|
29
|
+
|
29
30
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
30
31
|
# @option arguments [Time] :timeout Explicit operation timeout
|
31
32
|
# @option arguments [Hash] :headers Custom HTTP headers
|
32
33
|
# @option arguments [Hash] :body The definition of `commands` to perform (`move`, `cancel`, `allocate`)
|
33
34
|
#
|
34
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
35
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-reroute.html
|
35
36
|
#
|
36
37
|
def reroute(arguments = {})
|
37
38
|
headers = arguments.delete(:headers) || {}
|
@@ -57,7 +58,7 @@ module Elasticsearch
|
|
57
58
|
:master_timeout,
|
58
59
|
:timeout
|
59
60
|
].freeze)
|
60
|
-
end
|
61
61
|
end
|
62
|
+
end
|
62
63
|
end
|
63
64
|
end
|
@@ -23,6 +23,7 @@ module Elasticsearch
|
|
23
23
|
#
|
24
24
|
# @option arguments [List] :metric Limit the information returned to the specified metrics
|
25
25
|
# (options: _all,blocks,metadata,nodes,routing_table,routing_nodes,master_node,version)
|
26
|
+
|
26
27
|
# @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
27
28
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
|
28
29
|
# @option arguments [Time] :master_timeout Specify timeout for connection to master
|
@@ -33,9 +34,10 @@ module Elasticsearch
|
|
33
34
|
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
34
35
|
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
35
36
|
# (options: open,closed,hidden,none,all)
|
37
|
+
|
36
38
|
# @option arguments [Hash] :headers Custom HTTP headers
|
37
39
|
#
|
38
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
40
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-state.html
|
39
41
|
#
|
40
42
|
def state(arguments = {})
|
41
43
|
headers = arguments.delete(:headers) || {}
|
@@ -53,7 +55,7 @@ module Elasticsearch
|
|
53
55
|
"_cluster/state/#{Utils.__listify(_metric)}"
|
54
56
|
else
|
55
57
|
"_cluster/state"
|
56
|
-
|
58
|
+
end
|
57
59
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
58
60
|
|
59
61
|
body = nil
|
@@ -73,7 +75,7 @@ module Elasticsearch
|
|
73
75
|
:allow_no_indices,
|
74
76
|
:expand_wildcards
|
75
77
|
].freeze)
|
76
|
-
end
|
77
78
|
end
|
79
|
+
end
|
78
80
|
end
|
79
81
|
end
|
@@ -26,7 +26,7 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [Time] :timeout Explicit operation timeout
|
27
27
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
28
|
#
|
29
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
29
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-stats.html
|
30
30
|
#
|
31
31
|
def stats(arguments = {})
|
32
32
|
headers = arguments.delete(:headers) || {}
|
@@ -40,7 +40,7 @@ module Elasticsearch
|
|
40
40
|
"_cluster/stats/nodes/#{Utils.__listify(_node_id)}"
|
41
41
|
else
|
42
42
|
"_cluster/stats"
|
43
|
-
|
43
|
+
end
|
44
44
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
45
45
|
|
46
46
|
body = nil
|
@@ -54,7 +54,7 @@ module Elasticsearch
|
|
54
54
|
:flat_settings,
|
55
55
|
:timeout
|
56
56
|
].freeze)
|
57
|
-
end
|
58
57
|
end
|
58
|
+
end
|
59
59
|
end
|
60
60
|
end
|
@@ -27,6 +27,7 @@ module Elasticsearch
|
|
27
27
|
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
28
28
|
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
29
29
|
# (options: open,closed,hidden,none,all)
|
30
|
+
|
30
31
|
# @option arguments [Number] :min_score Include only documents with a specific `_score` value in the result
|
31
32
|
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
|
32
33
|
# @option arguments [List] :routing A comma-separated list of specific routing values
|
@@ -35,6 +36,7 @@ module Elasticsearch
|
|
35
36
|
# @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false)
|
36
37
|
# @option arguments [String] :default_operator The default operator for query string query (AND or OR)
|
37
38
|
# (options: AND,OR)
|
39
|
+
|
38
40
|
# @option arguments [String] :df The field to use as default where no field prefix is given in the query string
|
39
41
|
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
40
42
|
# @option arguments [Number] :terminate_after The maximum count for each shard, upon reaching which the query execution will terminate early
|
@@ -46,7 +48,7 @@ module Elasticsearch
|
|
46
48
|
# Deprecated since version 7.0.0
|
47
49
|
#
|
48
50
|
#
|
49
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
51
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-count.html
|
50
52
|
#
|
51
53
|
def count(arguments = {})
|
52
54
|
headers = arguments.delete(:headers) || {}
|
@@ -57,19 +59,14 @@ module Elasticsearch
|
|
57
59
|
|
58
60
|
_type = arguments.delete(:type)
|
59
61
|
|
60
|
-
method =
|
61
|
-
|
62
|
+
method = Elasticsearch::API::HTTP_POST
|
63
|
+
path = if _index && _type
|
64
|
+
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_count"
|
65
|
+
elsif _index
|
66
|
+
"#{Utils.__listify(_index)}/_count"
|
62
67
|
else
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
path = if _index && _type
|
67
|
-
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_count"
|
68
|
-
elsif _index
|
69
|
-
"#{Utils.__listify(_index)}/_count"
|
70
|
-
else
|
71
|
-
"_count"
|
72
|
-
end
|
68
|
+
"_count"
|
69
|
+
end
|
73
70
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
74
71
|
|
75
72
|
body = arguments[:body]
|
@@ -96,5 +93,5 @@ module Elasticsearch
|
|
96
93
|
:terminate_after
|
97
94
|
].freeze)
|
98
95
|
end
|
99
|
-
|
96
|
+
end
|
100
97
|
end
|
@@ -28,11 +28,13 @@ module Elasticsearch
|
|
28
28
|
# @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the index 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)
|
29
29
|
# @option arguments [String] :refresh If `true` then refresh the affected 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.
|
30
30
|
# (options: true,false,wait_for)
|
31
|
+
|
31
32
|
# @option arguments [String] :routing Specific routing value
|
32
33
|
# @option arguments [Time] :timeout Explicit operation timeout
|
33
34
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
34
35
|
# @option arguments [String] :version_type Specific version type
|
35
36
|
# (options: internal,external,external_gte)
|
37
|
+
|
36
38
|
# @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with
|
37
39
|
# @option arguments [Hash] :headers Custom HTTP headers
|
38
40
|
# @option arguments [Hash] :body The document (*Required*)
|
@@ -42,7 +44,7 @@ module Elasticsearch
|
|
42
44
|
# Deprecated since version 7.0.0
|
43
45
|
#
|
44
46
|
#
|
45
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
47
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-index_.html
|
46
48
|
#
|
47
49
|
def create(arguments = {})
|
48
50
|
if arguments[:id]
|
@@ -52,5 +54,5 @@ module Elasticsearch
|
|
52
54
|
end
|
53
55
|
end
|
54
56
|
end
|
55
|
-
|
57
|
+
end
|
56
58
|
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
module Elasticsearch
|
19
|
+
module API
|
20
|
+
module DanglingIndices
|
21
|
+
module Actions
|
22
|
+
# Deletes the specified dangling index
|
23
|
+
#
|
24
|
+
# @option arguments [String] :index_uuid The UUID of the dangling index
|
25
|
+
# @option arguments [Boolean] :accept_data_loss Must be set to true in order to delete the dangling index
|
26
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
27
|
+
# @option arguments [Time] :master_timeout Specify timeout for connection to master
|
28
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
29
|
+
#
|
30
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-gateway-dangling-indices.html
|
31
|
+
#
|
32
|
+
def delete_dangling_index(arguments = {})
|
33
|
+
raise ArgumentError, "Required argument 'index_uuid' missing" unless arguments[:index_uuid]
|
34
|
+
|
35
|
+
headers = arguments.delete(:headers) || {}
|
36
|
+
|
37
|
+
arguments = arguments.clone
|
38
|
+
|
39
|
+
_index_uuid = arguments.delete(:index_uuid)
|
40
|
+
|
41
|
+
method = Elasticsearch::API::HTTP_DELETE
|
42
|
+
path = "_dangling/#{Utils.__listify(_index_uuid)}"
|
43
|
+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
44
|
+
|
45
|
+
body = nil
|
46
|
+
perform_request(method, path, params, body, headers).body
|
47
|
+
end
|
48
|
+
|
49
|
+
# Register this action with its valid params when the module is loaded.
|
50
|
+
#
|
51
|
+
# @since 6.2.0
|
52
|
+
ParamsRegistry.register(:delete_dangling_index, [
|
53
|
+
:accept_data_loss,
|
54
|
+
:timeout,
|
55
|
+
:master_timeout
|
56
|
+
].freeze)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
module Elasticsearch
|
19
|
+
module API
|
20
|
+
module DanglingIndices
|
21
|
+
module Actions
|
22
|
+
# Imports the specified dangling index
|
23
|
+
#
|
24
|
+
# @option arguments [String] :index_uuid The UUID of the dangling index
|
25
|
+
# @option arguments [Boolean] :accept_data_loss Must be set to true in order to import the dangling index
|
26
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
27
|
+
# @option arguments [Time] :master_timeout Specify timeout for connection to master
|
28
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
29
|
+
#
|
30
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-gateway-dangling-indices.html
|
31
|
+
#
|
32
|
+
def import_dangling_index(arguments = {})
|
33
|
+
raise ArgumentError, "Required argument 'index_uuid' missing" unless arguments[:index_uuid]
|
34
|
+
|
35
|
+
headers = arguments.delete(:headers) || {}
|
36
|
+
|
37
|
+
arguments = arguments.clone
|
38
|
+
|
39
|
+
_index_uuid = arguments.delete(:index_uuid)
|
40
|
+
|
41
|
+
method = Elasticsearch::API::HTTP_POST
|
42
|
+
path = "_dangling/#{Utils.__listify(_index_uuid)}"
|
43
|
+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
44
|
+
|
45
|
+
body = nil
|
46
|
+
perform_request(method, path, params, body, headers).body
|
47
|
+
end
|
48
|
+
|
49
|
+
# Register this action with its valid params when the module is loaded.
|
50
|
+
#
|
51
|
+
# @since 6.2.0
|
52
|
+
ParamsRegistry.register(:import_dangling_index, [
|
53
|
+
:accept_data_loss,
|
54
|
+
:timeout,
|
55
|
+
:master_timeout
|
56
|
+
].freeze)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
module Elasticsearch
|
19
|
+
module API
|
20
|
+
module DanglingIndices
|
21
|
+
module Actions
|
22
|
+
# Returns all dangling indices.
|
23
|
+
#
|
24
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
25
|
+
#
|
26
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-gateway-dangling-indices.html
|
27
|
+
#
|
28
|
+
def list_dangling_indices(arguments = {})
|
29
|
+
headers = arguments.delete(:headers) || {}
|
30
|
+
|
31
|
+
arguments = arguments.clone
|
32
|
+
|
33
|
+
method = Elasticsearch::API::HTTP_GET
|
34
|
+
path = "_dangling"
|
35
|
+
params = {}
|
36
|
+
|
37
|
+
body = nil
|
38
|
+
perform_request(method, path, params, body, headers).body
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
module Elasticsearch
|
19
|
+
module API
|
20
|
+
module DanglingIndices
|
21
|
+
module Actions
|
22
|
+
module ParamsRegistry
|
23
|
+
extend self
|
24
|
+
|
25
|
+
# A Mapping of all the actions to their list of valid params.
|
26
|
+
#
|
27
|
+
# @since 6.1.1
|
28
|
+
PARAMS = {}
|
29
|
+
|
30
|
+
# Register an action with its list of valid params.
|
31
|
+
#
|
32
|
+
# @example Register the action.
|
33
|
+
# ParamsRegistry.register(:benchmark, [ :verbose ])
|
34
|
+
#
|
35
|
+
# @param [ Symbol ] action The action to register.
|
36
|
+
# @param [ Array[Symbol] ] valid_params The list of valid params.
|
37
|
+
#
|
38
|
+
# @since 6.1.1
|
39
|
+
def register(action, valid_params)
|
40
|
+
PARAMS[action.to_sym] = valid_params
|
41
|
+
end
|
42
|
+
|
43
|
+
# Get the list of valid params for a given action.
|
44
|
+
#
|
45
|
+
# @example Get the list of valid params.
|
46
|
+
# ParamsRegistry.get(:benchmark)
|
47
|
+
#
|
48
|
+
# @param [ Symbol ] action The action.
|
49
|
+
#
|
50
|
+
# @return [ Array<Symbol> ] The list of valid params for the action.
|
51
|
+
#
|
52
|
+
# @since 6.1.1
|
53
|
+
def get(action)
|
54
|
+
PARAMS.fetch(action, [])
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -26,6 +26,7 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the delete 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)
|
27
27
|
# @option arguments [String] :refresh If `true` then refresh the affected 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.
|
28
28
|
# (options: true,false,wait_for)
|
29
|
+
|
29
30
|
# @option arguments [String] :routing Specific routing value
|
30
31
|
# @option arguments [Time] :timeout Explicit operation timeout
|
31
32
|
# @option arguments [Number] :if_seq_no only perform the delete operation if the last operation that has changed the document has the specified sequence number
|
@@ -33,6 +34,7 @@ module Elasticsearch
|
|
33
34
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
34
35
|
# @option arguments [String] :version_type Specific version type
|
35
36
|
# (options: internal,external,external_gte,force)
|
37
|
+
|
36
38
|
# @option arguments [Hash] :headers Custom HTTP headers
|
37
39
|
#
|
38
40
|
# *Deprecation notice*:
|
@@ -40,7 +42,7 @@ module Elasticsearch
|
|
40
42
|
# Deprecated since version 7.0.0
|
41
43
|
#
|
42
44
|
#
|
43
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
45
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete.html
|
44
46
|
#
|
45
47
|
def delete(arguments = {})
|
46
48
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -61,7 +63,7 @@ module Elasticsearch
|
|
61
63
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
|
62
64
|
else
|
63
65
|
"#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
|
64
|
-
|
66
|
+
end
|
65
67
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
66
68
|
|
67
69
|
body = nil
|
@@ -86,5 +88,5 @@ module Elasticsearch
|
|
86
88
|
:version_type
|
87
89
|
].freeze)
|
88
90
|
end
|
89
|
-
|
91
|
+
end
|
90
92
|
end
|