lib/elasticsearch/api/actions/indices/put_settings.rb in elasticsearch-api-6.1.0 vs lib/elasticsearch/api/actions/indices/put_settings.rb in elasticsearch-api-6.2.0
- old
+ new
@@ -45,28 +45,29 @@
#
# @see http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/
#
def put_settings(arguments={})
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
+ method = HTTP_PUT
+ path = Utils.__pathify Utils.__listify(arguments[:index]), '_settings'
+ params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
+ body = arguments[:body]
- valid_params = [
+ perform_request(method, path, params, body).body
+ end
+
+ # Register this action with its valid params when the module is loaded.
+ #
+ # @since 6.2.0
+ ParamsRegistry.register(:put_settings, [
:ignore_indices,
:ignore_unavailable,
:include_defaults,
:allow_no_indices,
:expand_wildcards,
:preserve_existing,
:master_timeout,
- :flat_settings
- ]
-
- method = HTTP_PUT
- path = Utils.__pathify Utils.__listify(arguments[:index]), '_settings'
- params = Utils.__validate_and_extract_params arguments, valid_params
- body = arguments[:body]
-
- perform_request(method, path, params, body).body
- end
+ :flat_settings ].freeze)
end
end
end
end