Skip to content

Commit a767d2e

Browse files
committed
[API] Updates indices.simulate_index_template to elasticsearch-specification
1 parent b9f5e27 commit a767d2e

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,29 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
#
18-
# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
19-
# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
18+
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
19+
# @see https://github.com/elastic/elasticsearch-specification
2020
#
2121
module Elasticsearch
2222
module API
2323
module Indices
2424
module Actions
25-
# Simulate matching the given index name against the index templates in the system
25+
# Simulate an index.
26+
# Get the index configuration that would be applied to the specified index from an existing index template.
2627
#
27-
# @option arguments [String] :name The name of the index (it must be a concrete index name)
28-
# @option arguments [Boolean] :create Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
29-
# @option arguments [String] :cause User defined reason for dry-run creating the new template for simulation purposes
30-
# @option arguments [Time] :master_timeout Specify timeout for connection to master
31-
# @option arguments [Boolean] :include_defaults Return all relevant default configurations for this index template simulation (default: false)
28+
# @option arguments [String] :name Name of the index to simulate (*Required*)
29+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
30+
# @option arguments [Boolean] :include_defaults If true, returns all relevant default configurations for the index template.
3231
# @option arguments [Hash] :headers Custom HTTP headers
33-
# @option arguments [Hash] :body New index template definition, which will be included in the simulation, as if it already exists in the system
3432
#
35-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-simulate-index.html
33+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-simulate-index-template
3634
#
3735
def simulate_index_template(arguments = {})
3836
request_opts = { endpoint: arguments[:endpoint] || 'indices.simulate_index_template' }
3937

40-
defined_params = [:name].each_with_object({}) do |variable, set_variables|
38+
defined_params = [:name].inject({}) do |set_variables, variable|
4139
set_variables[variable] = arguments[variable] if arguments.key?(variable)
40+
set_variables
4241
end
4342
request_opts[:defined_params] = defined_params unless defined_params.empty?
4443

@@ -47,7 +46,7 @@ def simulate_index_template(arguments = {})
4746
arguments = arguments.clone
4847
headers = arguments.delete(:headers) || {}
4948

50-
body = arguments.delete(:body)
49+
body = nil
5150

5251
_name = arguments.delete(:name)
5352

0 commit comments

Comments
 (0)