From: Patrick Nawracay Date: Tue, 15 May 2018 13:56:40 +0000 (+0200) Subject: mgr/dashboard: Add documentation for method `endpoints` X-Git-Tag: v14.0.1~1262^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5230f3a07ca60c316d935f3ccb12ebb7d3fe6f2c;p=ceph.git mgr/dashboard: Add documentation for method `endpoints` Signed-off-by: Patrick Nawracay --- 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):