lib/elasticsearch/api/actions/search_shards.rb in elasticsearch-api-6.1.0 vs lib/elasticsearch/api/actions/search_shards.rb in elasticsearch-api-6.2.0
- old
+ new
@@ -20,22 +20,26 @@
# that are open, closed or both. (options: open, closed)
#
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-shards.html
#
def search_shards(arguments={})
- valid_params = [
- :preference,
- :routing,
- :local,
- :ignore_unavailable,
- :allow_no_indices,
- :expand_wildcards ]
method = HTTP_GET
path = Utils.__pathify( Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), '_search_shards' )
- 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(:search_shards, [
+ :preference,
+ :routing,
+ :local,
+ :ignore_unavailable,
+ :allow_no_indices,
+ :expand_wildcards ].freeze)
end
end
end