diff --git a/server/src/uds/REST/documentation.py b/server/src/uds/REST/documentation.py index 5ace6fc0a..e879de01d 100644 --- a/server/src/uds/REST/documentation.py +++ b/server/src/uds/REST/documentation.py @@ -125,7 +125,8 @@ class Documentation(View): else: methods = [] - help_data.append(HelpInfo(level, path, node.help.text, methods)) + if node.kind != types.rest.HelpNode.HelpNodeType.PATH: + help_data.append(HelpInfo(level, path, node.help.text, methods)) for child in node.children: _process_node( diff --git a/server/src/uds/REST/methods/gui_callback.py b/server/src/uds/REST/methods/gui_callback.py index b4076e4fa..028fef2e1 100644 --- a/server/src/uds/REST/methods/gui_callback.py +++ b/server/src/uds/REST/methods/gui_callback.py @@ -42,6 +42,11 @@ logger = logging.getLogger(__name__) class Callback(Handler): + """ + API: + Description: + Executes a callback from the GUI. Internal use, not intended to be called from outside. + """ path = 'gui' min_access_role = consts.UserRole.STAFF diff --git a/server/src/uds/REST/methods/meta_pools.py b/server/src/uds/REST/methods/meta_pools.py index 9edb284e3..6a87b8b8e 100644 --- a/server/src/uds/REST/methods/meta_pools.py +++ b/server/src/uds/REST/methods/meta_pools.py @@ -290,6 +290,14 @@ class MetaPools(ModelHandler): # Set fallback status def set_fallback_access(self, item: MetaPool) -> typing.Any: + """ + API: + Description: + Sets the fallback access for a metapool + + Response: + 200: All fine, no data returned + """ self.ensure_has_access(item, types.permissions.PermissionType.MANAGEMENT) fallback = self._params.get('fallbackAccess', 'ALLOW') diff --git a/server/src/uds/REST/methods/system.py b/server/src/uds/REST/methods/system.py index 82f01fbab..c3b4abd1a 100644 --- a/server/src/uds/REST/methods/system.py +++ b/server/src/uds/REST/methods/system.py @@ -151,10 +151,10 @@ class System(Handler): types.rest.HelpPath('stats/inuse', ''), types.rest.HelpPath('stats/cached', ''), types.rest.HelpPath('stats/complete', ''), - types.rest.HelpPath('stats/assigned/', ''), - types.rest.HelpPath('stats/inuse/', ''), - types.rest.HelpPath('stats/cached/', ''), - types.rest.HelpPath('stats/complete/', ''), + types.rest.HelpPath('stats/assigned/', 'Get service pool assigned stats'), + types.rest.HelpPath('stats/inuse/', 'Get service pool in use stats'), + types.rest.HelpPath('stats/cached/', 'Get service pool cached stats'), + types.rest.HelpPath('stats/complete/', 'Get service pool complete stats'), ] help_text = 'Provides system information. Must be admin to access this' diff --git a/server/src/uds/core/types/rest.py b/server/src/uds/core/types/rest.py index b5f5c922f..c20b50485 100644 --- a/server/src/uds/core/types/rest.py +++ b/server/src/uds/core/types/rest.py @@ -273,14 +273,28 @@ class HandlerNode: doc = getattr(method_class, detail_method).__doc__ or '' custom_help.add( HelpNode( - HelpPath(path=self.full_path() + '//' + method_name + '//' + detail_method, help=doc), + HelpPath( + path=self.full_path() + + '//' + + method_name + + '//' + + detail_method, + help=doc, + ), [], HelpNode.HelpNodeType.CUSTOM, ) ) custom_help |= { - HelpNode(HelpPath(path=help_info.path, help=help_info.text), [], help_node_type) + HelpNode( + HelpPath( + path=self.full_path() + '/' + help_info.path, + help=help_info.text, + ), + [], + help_node_type, + ) for help_info in self.handler.help_paths } @@ -298,7 +312,7 @@ class HandlerNode: """ if not path or not self.children: return self - + # Remove any trailing '/' to allow some "bogus" paths with trailing slashes path = path.lstrip('/').split('/') if isinstance(path, str) else path