lib/elasticsearch/api/actions/indices/get_index_template.rb in elasticsearch-api-7.17.11 vs lib/elasticsearch/api/actions/indices/get_index_template.rb in elasticsearch-api-8.0.0.pre1
- old
+ new
@@ -19,44 +19,38 @@
module API
module Indices
module Actions
# Returns an index template.
#
- # @option arguments [String] :name A pattern that returned template names must match
+ # @option arguments [List] :name The comma separated names of the index templates
# @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
# @option arguments [Hash] :headers Custom HTTP headers
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-templates.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
#
def get_index_template(arguments = {})
headers = arguments.delete(:headers) || {}
+ body = nil
+
arguments = arguments.clone
_name = arguments.delete(:name)
method = Elasticsearch::API::HTTP_GET
path = if _name
"_index_template/#{Utils.__listify(_name)}"
else
"_index_template"
end
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
+ params = Utils.process_params(arguments)
- body = nil
- perform_request(method, path, params, body, headers).body
+ Elasticsearch::API::Response.new(
+ perform_request(method, path, params, body, headers)
+ )
end
-
- # Register this action with its valid params when the module is loaded.
- #
- # @since 6.2.0
- ParamsRegistry.register(:get_index_template, [
- :flat_settings,
- :master_timeout,
- :local
- ].freeze)
end
end
end
end