# HG changeset patch # User Mads Kiilerich # Date 2022-10-13 19:37:43 # Node ID d69c3e30f8b5511660ec74a8db6265885579c056 # Parent 33f1faa7fe044e6cea68bf4bf65f63e2a2dc15e9 api docs: update docstrings Changes contributed by toras . diff --git a/kallithea/controllers/api/api.py b/kallithea/controllers/api/api.py --- a/kallithea/controllers/api/api.py +++ b/kallithea/controllers/api/api.py @@ -341,10 +341,12 @@ class ApiController(JSONRPCController): id : result : { - 'modules': [,...] + 'modules': [ [, ], ...] 'py_version': , 'platform': , - 'kallithea_version': + 'kallithea_version': , + 'git_version': '', + 'git_path': '' } error : null """ @@ -367,25 +369,20 @@ class ApiController(JSONRPCController): result: None if user does not exist or { "user_id" : "", - "api_key" : "", - "api_keys": "[]" "username" : "", "firstname": "", "lastname" : "", "email" : "", "emails": "[]", - "ip_addresses": "[,...]", "active" : "", - "admin" :  "", - "extern_name" : "", - "extern_type" : " - "last_login": "", + "admin" : "", "permissions": { "global": ["hg.create.repository", "repository.read", "hg.register.manual_activate"], "repositories": {"repo1": "repository.none"}, - "repositories_groups": {"Group1": "group.read"} + "repositories_groups": {"Group1": "group.read"}, + "user_groups": { "usrgrp1": "usergroup.admin" } }, } @@ -446,9 +443,9 @@ class ApiController(JSONRPCController): :param password: password :type password: Optional(str) :param firstname: firstname - :type firstname: Optional(str) + :type firstname: str :param lastname: lastname - :type lastname: Optional(str) + :type lastname: str :param active: active :type active: Optional(bool) :param admin: admin @@ -522,9 +519,9 @@ class ApiController(JSONRPCController): :param userid: userid to update :type userid: str or int :param username: new username - :type username: str or int + :type username: Optional(str or int) :param email: email - :type email: str + :type email: Optional(str) :param password: password :type password: Optional(str) :param firstname: firstname @@ -649,7 +646,9 @@ class ApiController(JSONRPCController): { "users_group_id" : "", "group_name" : "", + "group_description": "" "active": "", + "owner": "" "members" : [,...] } error : null @@ -694,7 +693,7 @@ class ApiController(JSONRPCController): :param group_name: name of new user group :type group_name: str :param description: group description - :type description: str + :type description: Optional(str) :param owner: owner of group. If not passed apiuser is the owner :type owner: Optional(str or int) :param active: group is active @@ -810,7 +809,7 @@ class ApiController(JSONRPCController): belonging to user with admin rights or an admin of given user group :param usergroupid: - :type usergroupid: int + :type usergroupid: str or int OUTPUT:: @@ -862,9 +861,9 @@ class ApiController(JSONRPCController): belonging to user with admin rights or an admin of given user group :param usergroupid: - :type usergroupid: int + :type usergroupid: str or int :param userid: - :type userid: int + :type userid: str or int OUTPUT:: @@ -1205,8 +1204,7 @@ class ApiController(JSONRPCController): id : result: { "msg": "Created new repository ``", - "success": true, - "task": "" + "success": true } error: null @@ -1393,8 +1391,7 @@ class ApiController(JSONRPCController): id : result: { "msg": "Created fork of `` as ``", - "success": true, - "task": "" + "success": true } error: null @@ -2219,14 +2216,14 @@ class ApiController(JSONRPCController): :param lifetime: time in minutes of gist lifetime :type lifetime: Optional(int) :param description: gist description - :type description: Optional(str) + :type description: str OUTPUT:: id : result : { "msg": "created new gist", - "gist": {} + "gist": } error : null @@ -2272,7 +2269,7 @@ class ApiController(JSONRPCController): id : result : { - "deleted gist ID: ", + "msg": "deleted gist ID: ", "gist": null } error : null