lib/elasticsearch/xpack/api/actions/watcher/stats.rb in elasticsearch-xpack-7.3.0 vs lib/elasticsearch/xpack/api/actions/watcher/stats.rb in elasticsearch-xpack-7.4.0
- old
+ new
@@ -14,17 +14,22 @@
# (options: _all, queued_watches, pending_watches)
#
# @see https://www.elastic.co/guide/en/x-pack/current/watcher-api-stats.html
#
def stats(arguments={})
- valid_params = [ :metric, :emit_stacktraces ]
method = Elasticsearch::API::HTTP_GET
path = "_xpack/watcher/stats"
- params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
+ params = Elasticsearch::API::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 7.4.0
+ ParamsRegistry.register(:stats, [ :metric,
+ :emit_stacktraces ].freeze)
end
end
end
end
end