lib/elasticsearch/api/actions/cat/snapshots.rb in elasticsearch-api-6.1.0 vs lib/elasticsearch/api/actions/cat/snapshots.rb in elasticsearch-api-6.2.0
- old
+ new
@@ -21,26 +21,28 @@
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html
#
def snapshots(arguments={})
raise ArgumentError, "Required argument 'repository' missing" if !arguments[:repository] && !arguments[:help]
-
- valid_params = [
- :master_timeout,
- :h,
- :help,
- :v,
- :s ]
-
repository = arguments.delete(:repository)
method = HTTP_GET
path = Utils.__pathify "_cat/snapshots", Utils.__escape(repository)
- params = Utils.__validate_and_extract_params arguments, valid_params
+ params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
body = nil
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(:snapshots, [
+ :master_timeout,
+ :h,
+ :help,
+ :v,
+ :s ].freeze)
end
end
end
end