From 5230f3a07ca60c316d935f3ccb12ebb7d3fe6f2c Mon Sep 17 00:00:00 2001 From: Patrick Nawracay Date: Tue, 15 May 2018 15:56:40 +0200 Subject: [PATCH] mgr/dashboard: Add documentation for method `endpoints` Signed-off-by: Patrick Nawracay --- src/pybind/mgr/dashboard/controllers/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/pybind/mgr/dashboard/controllers/__init__.py b/src/pybind/mgr/dashboard/controllers/__init__.py index e39e34aaae470..3d221beec3830 100644 --- a/src/pybind/mgr/dashboard/controllers/__init__.py +++ b/src/pybind/mgr/dashboard/controllers/__init__.py @@ -409,6 +409,21 @@ class BaseController(object): @classmethod def endpoints(cls): + """ + The endpoints method returns a list of endpoints. Each endpoint + consists of a tuple with methods, URL suffix, an action and its + arguments. + + By default, endpoints will be methods of the BaseController class, + which have been decorated by the @cherrpy.expose decorator. A method + will also be considered an endpoint if the `exposed` attribute has been + set on the method to a value which evaluates to True, which is + basically what @cherrpy.expose does, too. + + :return: A tuple of methods, url_suffix, action and arguments of the + function + :rtype: list[tuple] + """ result = [] for name, func in inspect.getmembers(cls, predicate=callable): -- 2.39.5