elasticsearch-api 7.6.0 → 7.7.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/elasticsearch/api/actions/bulk.rb +6 -3
- data/lib/elasticsearch/api/actions/cat/aliases.rb +10 -4
- data/lib/elasticsearch/api/actions/cat/allocation.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/count.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/health.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/help.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/indices.rb +11 -5
- data/lib/elasticsearch/api/actions/cat/master.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/nodes.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/plugins.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/recovery.rb +7 -5
- data/lib/elasticsearch/api/actions/cat/repositories.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/segments.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/shards.rb +7 -5
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +7 -5
- data/lib/elasticsearch/api/actions/cat/tasks.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/templates.rb +6 -4
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +6 -4
- data/lib/elasticsearch/api/actions/clear_scroll.rb +6 -4
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +5 -3
- data/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +45 -0
- data/lib/elasticsearch/api/actions/cluster/get_component_template.rb +47 -0
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +5 -3
- data/lib/elasticsearch/api/actions/cluster/health.rb +7 -4
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +5 -3
- data/lib/elasticsearch/api/actions/cluster/put_component_template.rb +49 -0
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +5 -3
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +5 -3
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +5 -3
- data/lib/elasticsearch/api/actions/cluster/state.rb +7 -4
- data/lib/elasticsearch/api/actions/cluster/stats.rb +6 -4
- data/lib/elasticsearch/api/actions/count.rb +8 -6
- data/lib/elasticsearch/api/actions/create.rb +2 -2
- data/lib/elasticsearch/api/actions/delete.rb +6 -3
- data/lib/elasticsearch/api/actions/delete_by_query.rb +7 -5
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +5 -3
- data/lib/elasticsearch/api/actions/delete_script.rb +5 -3
- data/lib/elasticsearch/api/actions/exists.rb +5 -2
- data/lib/elasticsearch/api/actions/exists_source.rb +5 -2
- data/lib/elasticsearch/api/actions/explain.rb +5 -3
- data/lib/elasticsearch/api/actions/field_caps.rb +7 -5
- data/lib/elasticsearch/api/actions/get.rb +6 -3
- data/lib/elasticsearch/api/actions/get_script.rb +5 -3
- data/lib/elasticsearch/api/actions/get_script_context.rb +5 -3
- data/lib/elasticsearch/api/actions/get_script_languages.rb +5 -3
- data/lib/elasticsearch/api/actions/get_source.rb +5 -2
- data/lib/elasticsearch/api/actions/index.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/analyze.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +7 -5
- data/lib/elasticsearch/api/actions/indices/clone.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/close.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/create.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/create_data_stream.rb +37 -0
- data/lib/elasticsearch/api/actions/indices/delete.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/delete_data_stream.rb +35 -0
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/exists.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/flush.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +7 -5
- data/lib/elasticsearch/api/actions/indices/get.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +7 -5
- data/lib/elasticsearch/api/actions/indices/get_data_streams.rb +37 -0
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +7 -5
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +7 -5
- data/lib/elasticsearch/api/actions/indices/get_template.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/open.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +6 -3
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/put_template.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/recovery.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/refresh.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/rollover.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/segments.rb +7 -5
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/shrink.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/split.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/stats.rb +6 -4
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +7 -5
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +7 -5
- data/lib/elasticsearch/api/actions/info.rb +5 -3
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +5 -3
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +6 -4
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +5 -3
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +5 -3
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +5 -3
- data/lib/elasticsearch/api/actions/mget.rb +5 -3
- data/lib/elasticsearch/api/actions/msearch.rb +7 -4
- data/lib/elasticsearch/api/actions/msearch_template.rb +6 -3
- data/lib/elasticsearch/api/actions/mtermvectors.rb +6 -3
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +6 -4
- data/lib/elasticsearch/api/actions/nodes/info.rb +6 -4
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +6 -4
- data/lib/elasticsearch/api/actions/nodes/stats.rb +6 -4
- data/lib/elasticsearch/api/actions/nodes/usage.rb +6 -4
- data/lib/elasticsearch/api/actions/ping.rb +5 -3
- data/lib/elasticsearch/api/actions/put_script.rb +5 -3
- data/lib/elasticsearch/api/actions/rank_eval.rb +6 -3
- data/lib/elasticsearch/api/actions/reindex.rb +6 -4
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +5 -3
- data/lib/elasticsearch/api/actions/render_search_template.rb +6 -4
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +5 -3
- data/lib/elasticsearch/api/actions/scroll.rb +6 -4
- data/lib/elasticsearch/api/actions/search.rb +8 -6
- data/lib/elasticsearch/api/actions/search_shards.rb +7 -4
- data/lib/elasticsearch/api/actions/search_template.rb +6 -4
- data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +6 -5
- data/lib/elasticsearch/api/actions/snapshot/create.rb +5 -3
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +5 -3
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +6 -4
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +6 -4
- data/lib/elasticsearch/api/actions/snapshot/get.rb +6 -4
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +7 -5
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +5 -3
- data/lib/elasticsearch/api/actions/snapshot/status.rb +7 -5
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +5 -3
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +6 -4
- data/lib/elasticsearch/api/actions/tasks/get.rb +5 -3
- data/lib/elasticsearch/api/actions/tasks/list.rb +5 -3
- data/lib/elasticsearch/api/actions/termvectors.rb +5 -2
- data/lib/elasticsearch/api/actions/update.rb +6 -4
- data/lib/elasticsearch/api/actions/update_by_query.rb +7 -5
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +5 -3
- data/lib/elasticsearch/api/version.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/aliases_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/allocation_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/count_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/fielddata_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/cat/health_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/help_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/indices_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/master_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/nodeattrs_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/nodes_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/pending_tasks_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/plugins_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/recovery_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/repositories_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/segments_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/shards_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/snapshot_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/tasks_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/templates_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cat/thread_pool_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/clear_scroll_spec.rb +4 -2
- data/spec/elasticsearch/api/actions/cluster/allocation_explain_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cluster/get_settings_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cluster/health_spec.rb +3 -3
- data/spec/elasticsearch/api/actions/cluster/pending_tasks_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cluster/put_settings_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cluster/remote_info_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/cluster/reroute_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/cluster/state_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/cluster/stats_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/count_spec.rb +6 -3
- data/spec/elasticsearch/api/actions/create_document_spec.rb +8 -4
- data/spec/elasticsearch/api/actions/delete_by_query_spec.rb +6 -3
- data/spec/elasticsearch/api/actions/delete_document_spec.rb +4 -2
- data/spec/elasticsearch/api/actions/delete_script_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/exists_document_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/explain_document_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/field_caps_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/get_document_source_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/get_document_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/get_script_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/index_document_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/clear_cache_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/clone_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/close_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/create_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/delete_alias_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/delete_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/delete_template_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/exists_alias_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/exists_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/exists_template_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/exists_type_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/flush_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/flush_synced_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/forcemerge_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/get_alias_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/get_field_mapping_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/get_mapping_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/get_settings_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/get_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/open_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/put_alias_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/put_mapping_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/put_settings_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/put_template_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/recovery_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/refresh_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/rollover_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/segments_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/shard_stores_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/shrink_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/split_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/stats_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/update_aliases_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/upgrade_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/indices/validate_query_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/info_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/ingest/delete_pipeline_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/ingest/get_pipeline_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/ingest/put_pipeline_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/ingest/simulate_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/json_builders_spec.rb +4 -2
- data/spec/elasticsearch/api/actions/mget_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/mtermvectors_spec.rb +3 -2
- data/spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/nodes/info_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/nodes/reload_secure_settings_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/nodes/stats_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/ping_spec.rb +3 -2
- data/spec/elasticsearch/api/actions/put_script_spec.rb +4 -2
- data/spec/elasticsearch/api/actions/reindex_spec.rb +3 -2
- data/spec/elasticsearch/api/actions/render_search_template_spec.rb +4 -2
- data/spec/elasticsearch/api/actions/scroll_spec.rb +4 -2
- data/spec/elasticsearch/api/actions/search_shards_spec.rb +3 -2
- data/spec/elasticsearch/api/actions/search_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/search_template_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/snapshot/create_repository_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/snapshot/create_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/snapshot/delete_repository_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/snapshot/delete_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/snapshot/get_repository_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/snapshot/get_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/snapshot/restore_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/snapshot/status_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/snapshot/verify_repository_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/tasks/cancel_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/tasks/get_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/tasks/list_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/termvectors_spec.rb +2 -1
- data/spec/elasticsearch/api/actions/update_by_query_spec.rb +3 -2
- data/spec/elasticsearch/api/actions/update_document_spec.rb +2 -1
- data/utils/thor/generator/endpoint_specifics.rb +1 -1
- data/utils/thor/templates/_documentation_top.erb +3 -2
- data/utils/thor/templates/_perform_request.erb +6 -5
- data/utils/thor/templates/method.erb +2 -1
- metadata +10 -17
- data/lib/elasticsearch/api/actions/abort_benchmark.rb +0 -28
- data/lib/elasticsearch/api/actions/benchmark.rb +0 -68
- data/lib/elasticsearch/api/actions/delete_by_rethrottle.rb +0 -34
- data/lib/elasticsearch/api/actions/nodes/shutdown.rb +0 -43
- data/lib/elasticsearch/api/actions/remote/info.rb +0 -24
- data/spec/elasticsearch/api/actions/abort_benchmark_spec.rb +0 -21
- data/spec/elasticsearch/api/actions/benchmark_spec.rb +0 -21
- data/spec/elasticsearch/api/actions/nodes/shutdown_spec.rb +0 -63
- data/spec/elasticsearch/api/actions/remote/info_spec.rb +0 -22
@@ -0,0 +1,49 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V under one or more agreements.
|
2
|
+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
3
|
+
# See the LICENSE file in the project root for more information
|
4
|
+
|
5
|
+
module Elasticsearch
|
6
|
+
module API
|
7
|
+
module Cluster
|
8
|
+
module Actions
|
9
|
+
# Creates or updates a component template
|
10
|
+
#
|
11
|
+
# @option arguments [String] :name The name of the template
|
12
|
+
# @option arguments [Boolean] :create Whether the index template should only be added if new or can also replace an existing one
|
13
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
14
|
+
# @option arguments [Time] :master_timeout Specify timeout for connection to master
|
15
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
16
|
+
# @option arguments [Hash] :body The template definition (*Required*)
|
17
|
+
#
|
18
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html
|
19
|
+
#
|
20
|
+
def put_component_template(arguments = {})
|
21
|
+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
22
|
+
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
|
23
|
+
|
24
|
+
headers = arguments.delete(:headers) || {}
|
25
|
+
|
26
|
+
arguments = arguments.clone
|
27
|
+
|
28
|
+
_name = arguments.delete(:name)
|
29
|
+
|
30
|
+
method = Elasticsearch::API::HTTP_PUT
|
31
|
+
path = "_component_template/#{Utils.__listify(_name)}"
|
32
|
+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
33
|
+
|
34
|
+
body = arguments[:body]
|
35
|
+
perform_request(method, path, params, body, headers).body
|
36
|
+
end
|
37
|
+
|
38
|
+
# Register this action with its valid params when the module is loaded.
|
39
|
+
#
|
40
|
+
# @since 6.2.0
|
41
|
+
ParamsRegistry.register(:put_component_template, [
|
42
|
+
:create,
|
43
|
+
:timeout,
|
44
|
+
:master_timeout
|
45
|
+
].freeze)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -11,14 +11,16 @@ module Elasticsearch
|
|
11
11
|
# @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
|
12
12
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
13
13
|
# @option arguments [Time] :timeout Explicit operation timeout
|
14
|
-
|
14
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
15
15
|
# @option arguments [Hash] :body The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). (*Required*)
|
16
16
|
#
|
17
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
17
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html
|
18
18
|
#
|
19
19
|
def put_settings(arguments = {})
|
20
20
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
21
21
|
|
22
|
+
headers = arguments.delete(:headers) || {}
|
23
|
+
|
22
24
|
arguments = arguments.clone
|
23
25
|
|
24
26
|
method = Elasticsearch::API::HTTP_PUT
|
@@ -26,7 +28,7 @@ module Elasticsearch
|
|
26
28
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
27
29
|
|
28
30
|
body = arguments[:body] || {}
|
29
|
-
perform_request(method, path, params, body).body
|
31
|
+
perform_request(method, path, params, body, headers).body
|
30
32
|
end
|
31
33
|
|
32
34
|
# Register this action with its valid params when the module is loaded.
|
@@ -8,11 +8,13 @@ module Elasticsearch
|
|
8
8
|
module Actions
|
9
9
|
# Returns the information about configured remote clusters.
|
10
10
|
#
|
11
|
-
|
11
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
12
12
|
#
|
13
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
13
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html
|
14
14
|
#
|
15
15
|
def remote_info(arguments = {})
|
16
|
+
headers = arguments.delete(:headers) || {}
|
17
|
+
|
16
18
|
arguments = arguments.clone
|
17
19
|
|
18
20
|
method = Elasticsearch::API::HTTP_GET
|
@@ -20,7 +22,7 @@ module Elasticsearch
|
|
20
22
|
params = {}
|
21
23
|
|
22
24
|
body = nil
|
23
|
-
perform_request(method, path, params, body).body
|
25
|
+
perform_request(method, path, params, body, headers).body
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -16,12 +16,14 @@ module Elasticsearch
|
|
16
16
|
|
17
17
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
18
18
|
# @option arguments [Time] :timeout Explicit operation timeout
|
19
|
-
|
19
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
20
20
|
# @option arguments [Hash] :body The definition of `commands` to perform (`move`, `cancel`, `allocate`)
|
21
21
|
#
|
22
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
22
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html
|
23
23
|
#
|
24
24
|
def reroute(arguments = {})
|
25
|
+
headers = arguments.delete(:headers) || {}
|
26
|
+
|
25
27
|
arguments = arguments.clone
|
26
28
|
|
27
29
|
method = Elasticsearch::API::HTTP_POST
|
@@ -29,7 +31,7 @@ module Elasticsearch
|
|
29
31
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
30
32
|
|
31
33
|
body = arguments[:body] || {}
|
32
|
-
perform_request(method, path, params, body).body
|
34
|
+
perform_request(method, path, params, body, headers).body
|
33
35
|
end
|
34
36
|
|
35
37
|
# Register this action with its valid params when the module is loaded.
|
@@ -20,12 +20,15 @@ module Elasticsearch
|
|
20
20
|
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
21
21
|
# @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)
|
22
22
|
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
23
|
-
# (options: open,closed,none,all)
|
23
|
+
# (options: open,closed,hidden,none,all)
|
24
24
|
|
25
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
25
26
|
#
|
26
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
27
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html
|
27
28
|
#
|
28
29
|
def state(arguments = {})
|
30
|
+
headers = arguments.delete(:headers) || {}
|
31
|
+
|
29
32
|
arguments = arguments.clone
|
30
33
|
|
31
34
|
_metric = arguments.delete(:metric)
|
@@ -39,11 +42,11 @@ module Elasticsearch
|
|
39
42
|
"_cluster/state/#{Utils.__listify(_metric)}"
|
40
43
|
else
|
41
44
|
"_cluster/state"
|
42
|
-
end
|
45
|
+
end
|
43
46
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
44
47
|
|
45
48
|
body = nil
|
46
|
-
perform_request(method, path, params, body).body
|
49
|
+
perform_request(method, path, params, body, headers).body
|
47
50
|
end
|
48
51
|
|
49
52
|
# Register this action with its valid params when the module is loaded.
|
@@ -11,11 +11,13 @@ module Elasticsearch
|
|
11
11
|
# @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
|
12
12
|
# @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
|
13
13
|
# @option arguments [Time] :timeout Explicit operation timeout
|
14
|
-
|
14
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
15
15
|
#
|
16
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
16
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html
|
17
17
|
#
|
18
18
|
def stats(arguments = {})
|
19
|
+
headers = arguments.delete(:headers) || {}
|
20
|
+
|
19
21
|
arguments = arguments.clone
|
20
22
|
|
21
23
|
_node_id = arguments.delete(:node_id)
|
@@ -25,11 +27,11 @@ module Elasticsearch
|
|
25
27
|
"_cluster/stats/nodes/#{Utils.__listify(_node_id)}"
|
26
28
|
else
|
27
29
|
"_cluster/stats"
|
28
|
-
end
|
30
|
+
end
|
29
31
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
30
32
|
|
31
33
|
body = nil
|
32
|
-
perform_request(method, path, params, body).body
|
34
|
+
perform_request(method, path, params, body, headers).body
|
33
35
|
end
|
34
36
|
|
35
37
|
# Register this action with its valid params when the module is loaded.
|
@@ -13,7 +13,7 @@ module Elasticsearch
|
|
13
13
|
# @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled
|
14
14
|
# @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)
|
15
15
|
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
16
|
-
# (options: open,closed,none,all)
|
16
|
+
# (options: open,closed,hidden,none,all)
|
17
17
|
|
18
18
|
# @option arguments [Number] :min_score Include only documents with a specific `_score` value in the result
|
19
19
|
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
|
@@ -27,7 +27,7 @@ module Elasticsearch
|
|
27
27
|
# @option arguments [String] :df The field to use as default where no field prefix is given in the query string
|
28
28
|
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
29
29
|
# @option arguments [Number] :terminate_after The maximum count for each shard, upon reaching which the query execution will terminate early
|
30
|
-
|
30
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
31
31
|
# @option arguments [Hash] :body A query to restrict the results specified with the Query DSL (optional)
|
32
32
|
#
|
33
33
|
# *Deprecation notice*:
|
@@ -35,9 +35,11 @@ module Elasticsearch
|
|
35
35
|
# Deprecated since version 7.0.0
|
36
36
|
#
|
37
37
|
#
|
38
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
38
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html
|
39
39
|
#
|
40
40
|
def count(arguments = {})
|
41
|
+
headers = arguments.delete(:headers) || {}
|
42
|
+
|
41
43
|
arguments = arguments.clone
|
42
44
|
|
43
45
|
_index = arguments.delete(:index)
|
@@ -48,7 +50,7 @@ module Elasticsearch
|
|
48
50
|
Elasticsearch::API::HTTP_POST
|
49
51
|
else
|
50
52
|
Elasticsearch::API::HTTP_GET
|
51
|
-
end
|
53
|
+
end
|
52
54
|
|
53
55
|
path = if _index && _type
|
54
56
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_count"
|
@@ -56,11 +58,11 @@ end
|
|
56
58
|
"#{Utils.__listify(_index)}/_count"
|
57
59
|
else
|
58
60
|
"_count"
|
59
|
-
end
|
61
|
+
end
|
60
62
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
61
63
|
|
62
64
|
body = arguments[:body]
|
63
|
-
perform_request(method, path, params, body).body
|
65
|
+
perform_request(method, path, params, body, headers).body
|
64
66
|
end
|
65
67
|
|
66
68
|
# Register this action with its valid params when the module is loaded.
|
@@ -23,7 +23,7 @@ module Elasticsearch
|
|
23
23
|
# (options: internal,external,external_gte)
|
24
24
|
|
25
25
|
# @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with
|
26
|
-
|
26
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
27
27
|
# @option arguments [Hash] :body The document (*Required*)
|
28
28
|
#
|
29
29
|
# *Deprecation notice*:
|
@@ -31,7 +31,7 @@ module Elasticsearch
|
|
31
31
|
# Deprecated since version 7.0.0
|
32
32
|
#
|
33
33
|
#
|
34
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
34
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html
|
35
35
|
#
|
36
36
|
def create(arguments = {})
|
37
37
|
if arguments[:id]
|
@@ -22,18 +22,21 @@ module Elasticsearch
|
|
22
22
|
# @option arguments [String] :version_type Specific version type
|
23
23
|
# (options: internal,external,external_gte,force)
|
24
24
|
|
25
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
25
26
|
#
|
26
27
|
# *Deprecation notice*:
|
27
28
|
# Specifying types in urls has been deprecated
|
28
29
|
# Deprecated since version 7.0.0
|
29
30
|
#
|
30
31
|
#
|
31
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
32
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html
|
32
33
|
#
|
33
34
|
def delete(arguments = {})
|
34
35
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
35
36
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
36
37
|
|
38
|
+
headers = arguments.delete(:headers) || {}
|
39
|
+
|
37
40
|
arguments = arguments.clone
|
38
41
|
|
39
42
|
_id = arguments.delete(:id)
|
@@ -52,9 +55,9 @@ module Elasticsearch
|
|
52
55
|
|
53
56
|
body = nil
|
54
57
|
if Array(arguments[:ignore]).include?(404)
|
55
|
-
Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
|
58
|
+
Utils.__rescue_from_not_found { perform_request(method, path, params, body, headers).body }
|
56
59
|
else
|
57
|
-
perform_request(method, path, params, body).body
|
60
|
+
perform_request(method, path, params, body, headers).body
|
58
61
|
end
|
59
62
|
end
|
60
63
|
|
@@ -22,7 +22,7 @@ module Elasticsearch
|
|
22
22
|
# (options: abort,proceed)
|
23
23
|
|
24
24
|
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
25
|
-
# (options: open,closed,none,all)
|
25
|
+
# (options: open,closed,hidden,none,all)
|
26
26
|
|
27
27
|
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
28
28
|
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
|
@@ -49,8 +49,8 @@ module Elasticsearch
|
|
49
49
|
# @option arguments [Number] :scroll_size Size on the scroll request powering the delete by query
|
50
50
|
# @option arguments [Boolean] :wait_for_completion Should the request should block until the delete by query is complete.
|
51
51
|
# @option arguments [Number] :requests_per_second The throttle for this request in sub-requests per second. -1 means no throttle.
|
52
|
-
# @option arguments [Number] :slices The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
|
53
|
-
|
52
|
+
# @option arguments [Number|string] :slices The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`.
|
53
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
54
54
|
# @option arguments [Hash] :body The search definition using the Query DSL (*Required*)
|
55
55
|
#
|
56
56
|
# *Deprecation notice*:
|
@@ -58,12 +58,14 @@ module Elasticsearch
|
|
58
58
|
# Deprecated since version 7.0.0
|
59
59
|
#
|
60
60
|
#
|
61
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
61
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html
|
62
62
|
#
|
63
63
|
def delete_by_query(arguments = {})
|
64
64
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
65
65
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
66
66
|
|
67
|
+
headers = arguments.delete(:headers) || {}
|
68
|
+
|
67
69
|
arguments = arguments.clone
|
68
70
|
|
69
71
|
_index = arguments.delete(:index)
|
@@ -79,7 +81,7 @@ module Elasticsearch
|
|
79
81
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
80
82
|
|
81
83
|
body = arguments[:body]
|
82
|
-
perform_request(method, path, params, body).body
|
84
|
+
perform_request(method, path, params, body, headers).body
|
83
85
|
end
|
84
86
|
|
85
87
|
# Register this action with its valid params when the module is loaded.
|
@@ -9,13 +9,15 @@ module Elasticsearch
|
|
9
9
|
#
|
10
10
|
# @option arguments [String] :task_id The task id to rethrottle
|
11
11
|
# @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (*Required*)
|
12
|
-
|
12
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
13
13
|
#
|
14
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
14
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
|
15
15
|
#
|
16
16
|
def delete_by_query_rethrottle(arguments = {})
|
17
17
|
raise ArgumentError, "Required argument 'task_id' missing" unless arguments[:task_id]
|
18
18
|
|
19
|
+
headers = arguments.delete(:headers) || {}
|
20
|
+
|
19
21
|
arguments = arguments.clone
|
20
22
|
|
21
23
|
_task_id = arguments.delete(:task_id)
|
@@ -25,7 +27,7 @@ module Elasticsearch
|
|
25
27
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
26
28
|
|
27
29
|
body = nil
|
28
|
-
perform_request(method, path, params, body).body
|
30
|
+
perform_request(method, path, params, body, headers).body
|
29
31
|
end
|
30
32
|
|
31
33
|
# Register this action with its valid params when the module is loaded.
|
@@ -10,13 +10,15 @@ module Elasticsearch
|
|
10
10
|
# @option arguments [String] :id Script ID
|
11
11
|
# @option arguments [Time] :timeout Explicit operation timeout
|
12
12
|
# @option arguments [Time] :master_timeout Specify timeout for connection to master
|
13
|
-
|
13
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
14
14
|
#
|
15
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
15
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
|
16
16
|
#
|
17
17
|
def delete_script(arguments = {})
|
18
18
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
19
19
|
|
20
|
+
headers = arguments.delete(:headers) || {}
|
21
|
+
|
20
22
|
arguments = arguments.clone
|
21
23
|
|
22
24
|
_id = arguments.delete(:id)
|
@@ -26,7 +28,7 @@ module Elasticsearch
|
|
26
28
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
27
29
|
|
28
30
|
body = nil
|
29
|
-
perform_request(method, path, params, body).body
|
31
|
+
perform_request(method, path, params, body, headers).body
|
30
32
|
end
|
31
33
|
|
32
34
|
# Register this action with its valid params when the module is loaded.
|
@@ -22,18 +22,21 @@ module Elasticsearch
|
|
22
22
|
# @option arguments [String] :version_type Specific version type
|
23
23
|
# (options: internal,external,external_gte,force)
|
24
24
|
|
25
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
25
26
|
#
|
26
27
|
# *Deprecation notice*:
|
27
28
|
# Specifying types in urls has been deprecated
|
28
29
|
# Deprecated since version 7.0.0
|
29
30
|
#
|
30
31
|
#
|
31
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
32
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
|
32
33
|
#
|
33
34
|
def exists(arguments = {})
|
34
35
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
35
36
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
36
37
|
|
38
|
+
headers = arguments.delete(:headers) || {}
|
39
|
+
|
37
40
|
arguments = arguments.clone
|
38
41
|
|
39
42
|
_id = arguments.delete(:id)
|
@@ -53,7 +56,7 @@ module Elasticsearch
|
|
53
56
|
body = nil
|
54
57
|
|
55
58
|
Utils.__rescue_from_not_found do
|
56
|
-
perform_request(method, path, params, body).status == 200 ? true : false
|
59
|
+
perform_request(method, path, params, body, headers).status == 200 ? true : false
|
57
60
|
end
|
58
61
|
end
|
59
62
|
|
@@ -21,18 +21,21 @@ module Elasticsearch
|
|
21
21
|
# @option arguments [String] :version_type Specific version type
|
22
22
|
# (options: internal,external,external_gte,force)
|
23
23
|
|
24
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
24
25
|
#
|
25
26
|
# *Deprecation notice*:
|
26
27
|
# Specifying types in urls has been deprecated
|
27
28
|
# Deprecated since version 7.0.0
|
28
29
|
#
|
29
30
|
#
|
30
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/
|
31
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
|
31
32
|
#
|
32
33
|
def exists_source(arguments = {})
|
33
34
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
34
35
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
35
36
|
|
37
|
+
headers = arguments.delete(:headers) || {}
|
38
|
+
|
36
39
|
arguments = arguments.clone
|
37
40
|
|
38
41
|
_id = arguments.delete(:id)
|
@@ -50,7 +53,7 @@ module Elasticsearch
|
|
50
53
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
51
54
|
|
52
55
|
body = nil
|
53
|
-
perform_request(method, path, params, body).body
|
56
|
+
perform_request(method, path, params, body, headers).body
|
54
57
|
end
|
55
58
|
|
56
59
|
alias_method :exists_source?, :exists_source
|