lib/elasticsearch/api/actions/indices/get.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/indices/get.rb in elasticsearch-api-8.11.0
- old
+ new
@@ -33,13 +33,21 @@
# @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
# @option arguments [Boolean] :include_defaults Whether to return all default setting for each of the indices.
# @option arguments [Time] :master_timeout Specify timeout for connection to master
# @option arguments [Hash] :headers Custom HTTP headers
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/indices-get-index.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-get-index.html
#
def get(arguments = {})
+ request_opts = { endpoint: arguments[:endpoint] || "indices.get" }
+
+ defined_params = [:index].inject({}) do |set_variables, variable|
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
+ set_variables
+ end
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
+
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
@@ -50,10 +58,10 @@
method = Elasticsearch::API::HTTP_GET
path = "#{Utils.__listify(_index)}"
params = Utils.process_params(arguments)
Elasticsearch::API::Response.new(
- perform_request(method, path, params, body, headers)
+ perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end