]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Add documentation for method `endpoints`
authorPatrick Nawracay <pnawracay@suse.com>
Tue, 15 May 2018 13:56:40 +0000 (15:56 +0200)
committerRicardo Dias <rdias@suse.com>
Thu, 24 May 2018 09:39:36 +0000 (10:39 +0100)
Signed-off-by: Patrick Nawracay <pnawracay@suse.com>
src/pybind/mgr/dashboard/controllers/__init__.py

index e39e34aaae4707e5eadfed1dc07d81869b9cc931..3d221beec3830cf2158540293468588abfb77329 100644 (file)
@@ -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):