Skip to content

Commit 8091804

Browse files
committed
[API] Update generated code for 7.x
1 parent 39cdea8 commit 8091804

File tree

9 files changed

+67
-7
lines changed

9 files changed

+67
-7
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module Actions
2020
# @option arguments [List] :_source_excludes Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
2121
# @option arguments [List] :_source_includes Default list of fields to extract and return from the _source field, can be overridden on each sub-request
2222
# @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with
23+
# @option arguments [Boolean] :prefer_v2_templates favor V2 templates instead of V1 templates during automatic index creation
2324
# @option arguments [Hash] :headers Custom HTTP headers
2425
# @option arguments [Hash] :body The operation definition and data (action-data pairs), separated by newlines (*Required*)
2526
#
@@ -69,7 +70,8 @@ def bulk(arguments = {})
6970
:_source,
7071
:_source_excludes,
7172
:_source_includes,
72-
:pipeline
73+
:pipeline,
74+
:prefer_v2_templates
7375
].freeze)
7476
end
7577
end

elasticsearch-api/lib/elasticsearch/api/actions/create.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Actions
2323
# (options: internal,external,external_gte)
2424

2525
# @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with
26+
# @option arguments [Boolean] :prefer_v2_templates favor V2 templates instead of V1 templates during automatic index creation
2627
# @option arguments [Hash] :headers Custom HTTP headers
2728
# @option arguments [Hash] :body The document (*Required*)
2829
#

elasticsearch-api/lib/elasticsearch/api/actions/index.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module Actions
2626
# @option arguments [Number] :if_seq_no only perform the index operation if the last operation that has changed the document has the specified sequence number
2727
# @option arguments [Number] :if_primary_term only perform the index operation if the last operation that has changed the document has the specified primary term
2828
# @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with
29+
# @option arguments [Boolean] :prefer_v2_templates favor V2 templates instead of V1 templates during automatic index creation
2930
# @option arguments [Hash] :headers Custom HTTP headers
3031
# @option arguments [Hash] :body The document (*Required*)
3132
#
@@ -79,7 +80,8 @@ def index(arguments = {})
7980
:version_type,
8081
:if_seq_no,
8182
:if_primary_term,
82-
:pipeline
83+
:pipeline,
84+
:prefer_v2_templates
8385
].freeze)
8486
end
8587
end

elasticsearch-api/lib/elasticsearch/api/actions/indices/create.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module Actions
1313
# @option arguments [String] :wait_for_active_shards Set the number of active shards to wait for before the operation returns.
1414
# @option arguments [Time] :timeout Explicit operation timeout
1515
# @option arguments [Time] :master_timeout Specify timeout for connection to master
16+
# @option arguments [Boolean] :prefer_v2_templates favor V2 templates instead of V1 templates during index creation
1617
# @option arguments [Hash] :headers Custom HTTP headers
1718
# @option arguments [Hash] :body The configuration for the index (`settings` and `mappings`)
1819
#
@@ -42,7 +43,8 @@ def create(arguments = {})
4243
:include_type_name,
4344
:wait_for_active_shards,
4445
:timeout,
45-
:master_timeout
46+
:master_timeout,
47+
:prefer_v2_templates
4648
].freeze)
4749
end
4850
end
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 Indices
8+
module Actions
9+
# Returns information about whether a particular index template exists.
10+
#
11+
# @option arguments [String] :name The name of the template
12+
# @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
13+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
14+
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
15+
# @option arguments [Hash] :headers Custom HTTP headers
16+
#
17+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
18+
#
19+
def exists_index_template(arguments = {})
20+
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
21+
22+
headers = arguments.delete(:headers) || {}
23+
24+
arguments = arguments.clone
25+
26+
_name = arguments.delete(:name)
27+
28+
method = Elasticsearch::API::HTTP_HEAD
29+
path = "_index_template/#{Utils.__listify(_name)}"
30+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
31+
32+
body = nil
33+
perform_request(method, path, params, body, headers).body
34+
end
35+
36+
alias_method :exists_index_template?, :exists_index_template
37+
# Register this action with its valid params when the module is loaded.
38+
#
39+
# @since 6.2.0
40+
ParamsRegistry.register(:exists_index_template, [
41+
:flat_settings,
42+
:master_timeout,
43+
:local
44+
].freeze)
45+
end
46+
end
47+
end
48+
end

elasticsearch-api/lib/elasticsearch/api/actions/indices/rollover.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module Actions
1616
# @option arguments [Boolean] :dry_run If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false
1717
# @option arguments [Time] :master_timeout Specify timeout for connection to master
1818
# @option arguments [String] :wait_for_active_shards Set the number of active shards to wait for on the newly created rollover index before the operation returns.
19+
# @option arguments [Boolean] :prefer_v2_templates favor V2 templates instead of V1 templates during automatic index creation
1920
# @option arguments [Hash] :headers Custom HTTP headers
2021
# @option arguments [Hash] :body The conditions that needs to be met for executing rollover
2122
#
@@ -52,7 +53,8 @@ def rollover(arguments = {})
5253
:timeout,
5354
:dry_run,
5455
:master_timeout,
55-
:wait_for_active_shards
56+
:wait_for_active_shards,
57+
:prefer_v2_templates
5658
].freeze)
5759
end
5860
end

elasticsearch-api/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module Actions
1111
# @option arguments [List] :node_id A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
1212
# @option arguments [Time] :timeout Explicit operation timeout
1313
# @option arguments [Hash] :headers Custom HTTP headers
14+
# @option arguments [Hash] :body An object containing the password for the elasticsearch keystore
1415
#
1516
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings
1617
#
@@ -29,7 +30,7 @@ def reload_secure_settings(arguments = {})
2930
end
3031
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
3132

32-
body = nil
33+
body = arguments[:body]
3334
perform_request(method, path, params, body, headers).body
3435
end
3536

elasticsearch-api/lib/elasticsearch/api/actions/tasks/cancel.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Actions
1212
# @option arguments [List] :nodes 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
1313
# @option arguments [List] :actions A comma-separated list of actions that should be cancelled. Leave empty to cancel all.
1414
# @option arguments [String] :parent_task_id Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.
15-
# @option arguments [Boolean] :wait_for_completion Should the request block until the cancellation of the task and its child tasks is completed. Defaults to false
15+
# @option arguments [Boolean] :wait_for_completion Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false
1616
# @option arguments [Hash] :headers Custom HTTP headers
1717
#
1818
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html

elasticsearch-api/lib/elasticsearch/api/actions/update.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Actions
2323
# @option arguments [Time] :timeout Explicit operation timeout
2424
# @option arguments [Number] :if_seq_no only perform the update operation if the last operation that has changed the document has the specified sequence number
2525
# @option arguments [Number] :if_primary_term only perform the update operation if the last operation that has changed the document has the specified primary term
26+
# @option arguments [Boolean] :prefer_v2_templates favor V2 templates instead of V1 templates during automatic index creation
2627
# @option arguments [Hash] :headers Custom HTTP headers
2728
# @option arguments [Hash] :body The request definition requires either `script` or partial `doc` (*Required*)
2829
#
@@ -78,7 +79,8 @@ def update(arguments = {})
7879
:routing,
7980
:timeout,
8081
:if_seq_no,
81-
:if_primary_term
82+
:if_primary_term,
83+
:prefer_v2_templates
8284
].freeze)
8385
end
8486
end

0 commit comments

Comments
 (0)