diff --git a/docs/api/api.rst b/docs/api/api.rst --- a/docs/api/api.rst +++ b/docs/api/api.rst @@ -115,7 +115,7 @@ OUTPUT:: id : result : "Pulled from ``" - error : null + error : null rescan_repos ^^^^^^^^^^^^ @@ -138,7 +138,7 @@ OUTPUT:: id : result : "{'added': [], 'removed': []}" - error : null + error : null invalidate_cache ^^^^^^^^^^^^^^^^ @@ -160,7 +160,7 @@ OUTPUT:: id : result : "Caches of repository ``" - error : null + error : null get_ip ^^^^^^ @@ -182,16 +182,16 @@ OUTPUT:: id : result : { - "ip_addr_server": ", - "user_ips": [ + "ip_addr_server" : ", + "user_ips" : [ { - "ip_addr": "", - "ip_range": ["", ""], + "ip_addr" : "", + "ip_range" : ["", ""], }, ... - ] + ] } - error : null + error : null get_user ^^^^^^^^ @@ -213,29 +213,29 @@ INPUT:: OUTPUT:: id : - result: None if user does not exist or - { + result : None if user does not exist or + { "user_id" : "", "api_key" : "", "username" : "", - "firstname": "", + "firstname" : "", "lastname" : "", "email" : "", - "emails": "", + "emails" : "", "ip_addresses": "", "active" : "", "admin" : "", "ldap_dn" : "", - "last_login": "", + "last_login" : "", "permissions": { "global": ["hg.create.repository", "repository.read", "hg.register.manual_activate"], - "repositories": {"repo1": "repository.none"}, - "repositories_groups": {"Group1": "group.read"} + "repositories" : {"repo1" : "repository.none"}, + "repositories_groups" : {"Group1" : "group.read"} }, - } - error: null + } + error : null get_users ^^^^^^^^^ @@ -253,24 +253,24 @@ INPUT:: OUTPUT:: id : - result: [ + result : [ { "user_id" : "", "api_key" : "", "username" : "", - "firstname": "", + "firstname" : "", "lastname" : "", "email" : "", - "emails": "", + "emails" : "", "ip_addresses": "", "active" : "", "admin" : "", "ldap_dn" : "", - "last_login": "", + "last_login" : "", }, … - ] - error: null + ] + error : null .. _create-user: @@ -299,22 +299,22 @@ INPUT:: OUTPUT:: id : - result: { + result : { "msg" : "created new user ``", - "user": { + "user" : { "user_id" : "", "username" : "", "firstname": "", "lastname" : "", "email" : "", - "emails": "", + "emails" : "", "active" : "", "admin" : "", "ldap_dn" : "", "last_login": "", }, - } - error: null + } + error : null Example:: @@ -346,23 +346,23 @@ INPUT:: OUTPUT:: id : - result: { + result : { "msg" : "updated user ID: ", - "user": { + "user" : { "user_id" : "", "api_key" : "", "username" : "", "firstname": "", "lastname" : "", "email" : "", - "emails": "", + "emails" : "", "active" : "", "admin" : "", "ldap_dn" : "", "last_login": "", }, - } - error: null + } + error : null delete_user ^^^^^^^^^^^ @@ -382,11 +382,11 @@ INPUT:: OUTPUT:: id : - result: { + result : { "msg" : "deleted user ID: ", - "user": null - } - error: null + "user" : null + } + error : null get_user_group ^^^^^^^^^^^^^^ @@ -410,7 +410,7 @@ OUTPUT:: { "users_group_id" : "", "group_name" : "", - "active": "", + "active" : "", "members" : [ { "user_id" : "", @@ -419,7 +419,7 @@ OUTPUT:: "firstname": "", "lastname" : "", "email" : "", - "emails": "", + "emails" : "", "active" : "", "admin" : "", "ldap_dn" : "", @@ -450,7 +450,7 @@ OUTPUT:: { "users_group_id" : "", "group_name" : "", - "active": "", + "active" : "", }, … ] @@ -467,24 +467,24 @@ INPUT:: id : api_key : "" method : "create_user_group" - args: { + args : { "group_name": "", "owner" : "", - "active": " = Optional(True)" + "active" : " = Optional(True)" } OUTPUT:: id : - result: { - "msg": "created new user group ``", - "users_group": { + result : { + "msg" : "created new user group ``", + "users_group" : { "users_group_id" : "", "group_name" : "", - "active": "", + "active" : "", }, - } - error: null + } + error : null add_user_to_user_group ^^^^^^^^^^^^^^^^^^^^^^ @@ -498,7 +498,7 @@ INPUT:: id : api_key : "" method : "add_user_user_group" - args: { + args : { "usersgroupid" : "", "userid" : "", } @@ -506,12 +506,12 @@ INPUT:: OUTPUT:: id : - result: { - "success": True|False # depends on if member is in group - "msg": "added member `` to a user group `` | - User is already in that group" - } - error: null + result : { + "success" : True|False # depends on if member is in group + "msg" : "added member `` to a user group `` | + User is already in that group" + } + error : null remove_user_from_user_group ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -525,7 +525,7 @@ INPUT:: id : api_key : "" method : "remove_user_from_user_group" - args: { + args : { "usersgroupid" : "", "userid" : "", } @@ -533,12 +533,12 @@ INPUT:: OUTPUT:: id : - result: { - "success": True|False, # depends on if member is in group - "msg": "removed member from user group | - User wasn't in group" - } - error: null + result : { + "success" : True|False, # depends on if member is in group + "msg" : "removed member from user group | + User wasn't in group" + } + error : null get_repo ^^^^^^^^ @@ -553,144 +553,144 @@ INPUT:: id : api_key : "" method : "get_repo" - args: { + args : { "repoid" : "", - "with_revision_names": " = Optional(False)", - "with_pullrequests": " = Optional(False)", + "with_revision_names" : " = Optional(False)", + "with_pullrequests" : " = Optional(False)", } OUTPUT:: id : - result: None if repository does not exist or - { + result : None if repository does not exist or + { "repo_id" : "", "repo_name" : "" "repo_type" : "", "clone_uri" : "", - "enable_downloads": "", + "enable_downloads" : "", "enable_statistics": "", - "private": "", + "private" : "", "created_on" : "", "description" : "", - "landing_rev": "", - "last_changeset": { - "author": "", - "date": "", - "message": "", - "raw_id": "", + "landing_rev" : "", + "last_changeset" : { + "author" : "", + "date" : "", + "message" : "", + "raw_id" : "", "revision": "", "short_id": "" }, - "owner": "", - "fork_of": "", + "owner" : "", + "fork_of" : "", "members" : [ { - "type": "user", + "type" : "user", "user_id" : "", "api_key" : "", "username" : "", - "firstname": "", + "firstname" : "", "lastname" : "", "email" : "", - "emails": "", + "emails" : "", "active" : "", "admin" : "", "ldap_dn" : "", - "last_login": "", + "last_login" : "", "permission" : "repository.(read|write|admin)" }, … { - "type": "users_group", + "type" : "users_group", "id" : "", "name" : "", - "active": "", + "active" : "", "permission" : "repository.(read|write|admin)" }, … ], - "followers": [ + "followers" : [ { "user_id" : "", "username" : "", "api_key" : "", - "firstname": "", + "firstname" : "", "lastname" : "", "email" : "", - "emails": "", + "emails" : "", "ip_addresses": "", "active" : "", "admin" : "", "ldap_dn" : "", - "last_login": "", + "last_login" : "", }, … ], - "tags": { - "": "", + "tags" : { + "" : "", ... }, - "branches": { - "": "", + "branches" : { + "" : "", ... }, - "bookmarks": { - "": "", + "bookmarks" : { + "" : "", ... }, - "pull_requests": [ + "pull_requests" : [ { - "status": "", - "pull_request_id": , - "description": "", - "title": "", - "url": "", - "reviewers": [ + "status" : "", + "pull_request_id" : , + "description" : "", + "title" : "", + "url" : "", + "reviewers" : [ { - "username": "", + "username" : "", }, ... ], - "org_repo_url": "", - "org_ref_parts": [ + "org_repo_url" : "", + "org_ref_parts" : [ "", "", "" ], - "other_ref_parts": [ + "other_ref_parts" : [ "", "", "" ], - "comments": [ + "comments" : [ { - "username": "", - "text": "", - "comment_id": "", + "username" : "", + "text" : "", + "comment_id" : "", }, ... ], - "owner": "", - "statuses": [ + "owner" : "", + "statuses" : [ { - "status": "", # "under_review", "approved" or "rejected" - "reviewer": "", - "modified_at": "" # iso 8601 date, server's timezone + "status" : "", # "under_review", "approved" or "rejected" + "reviewer" : "", + "modified_at" : "" # iso 8601 date, server's timezone }, ... ], - "revisions": [ + "revisions" : [ "", ... ] }, ... ] - } - error: null + } + error : null get_repos ^^^^^^^^^ @@ -704,12 +704,12 @@ INPUT:: id : api_key : "" method : "get_repos" - args: { } + args : { } OUTPUT:: id : - result: [ + result : [ { "repo_id" : "", "repo_name" : "" @@ -718,15 +718,15 @@ OUTPUT:: "private" : "", "created_on" : "", "description" : "", - "landing_rev": "", - "owner": "", - "fork_of": "", - "enable_downloads": "", + "landing_rev" : "", + "owner" : "", + "fork_of" : "", + "enable_downloads" : "", "enable_statistics": "", }, … - ] - error: null + ] + error : null get_repo_nodes ^^^^^^^^^^^^^^ @@ -740,24 +740,24 @@ INPUT:: id : api_key : "" method : "get_repo_nodes" - args: { + args : { "repoid" : "" - "revision" : "", + "revision" : "", "root_path" : "", - "ret_type" : " = Optional('all')" + "ret_type" : " = Optional('all')" } OUTPUT:: id : - result: [ + result : [ { "name" : "" "type" : "", }, … - ] - error: null + ] + error : null create_repo ^^^^^^^^^^^ @@ -777,7 +777,7 @@ INPUT:: id : api_key : "" method : "create_repo" - args: { + args : { "repo_name" : "", "owner" : "", "repo_type" : " = Optional('hg')", @@ -785,16 +785,16 @@ INPUT:: "private" : " = Optional(False)", "clone_uri" : " = Optional(None)", "landing_rev" : " = Optional('tip')", - "enable_downloads": " = Optional(False)", + "enable_downloads" : " = Optional(False)", "enable_statistics": " = Optional(False)", } OUTPUT:: id : - result: { - "msg": "Created new repository ``", - "repo": { + result : { + "msg" : "Created new repository ``", + "repo" : { "repo_id" : "", "repo_name" : "" "repo_type" : "", @@ -802,14 +802,14 @@ OUTPUT:: "private" : "", "created_on" : "", "description" : "", - "landing_rev": "", - "owner": "", - "fork_of": "", - "enable_downloads": "", + "landing_rev" : "", + "owner" : "", + "fork_of" : "", + "enable_downloads" : "", "enable_statistics": "", }, - } - error: null + } + error : null update_repo ^^^^^^^^^^^ @@ -824,7 +824,7 @@ INPUT:: id : api_key : "" method : "update_repo" - args: { + args : { "repoid" : "" "name" : " = Optional('')", "group" : " = Optional(None)", @@ -833,39 +833,39 @@ INPUT:: "private" : " = Optional(False)", "clone_uri" : " = Optional(None)", "landing_rev" : " = Optional('tip')", - "enable_downloads": " = Optional(False)", + "enable_downloads" : " = Optional(False)", "enable_statistics": " = Optional(False)", } OUTPUT:: id : - result: { - "msg": "updated repo ID:repo_id ``", - "repository": { + result : { + "msg" : "updated repo ID:repo_id ``", + "repository" : { "repo_id" : "", "repo_name" : "" "repo_type" : "", "clone_uri" : "", - "private": "", + "private" : "", "created_on" : "", "description" : "", - "landing_rev": "", - "owner": "", - "fork_of": "", - "enable_downloads": "", + "landing_rev" : "", + "owner" : "", + "fork_of" : "", + "enable_downloads" : "", "enable_statistics": "", - "last_changeset": { - "author": "", - "date": "", - "message": "", - "raw_id": "", + "last_changeset" : { + "author" : "", + "date" : "", + "message" : "", + "raw_id" : "", "revision": "", "short_id": "" } }, - } - error: null + } + error : null fork_repo ^^^^^^^^^ @@ -883,24 +883,24 @@ INPUT:: id : api_key : "" method : "fork_repo" - args: { + args : { "repoid" : "", - "fork_name": "", - "owner": "", - "description": "", + "fork_name" : "", + "owner" : "", + "description" : "", "copy_permissions": "", - "private": "", - "landing_rev": "" + "private" : "", + "landing_rev" : "" } OUTPUT:: id : - result: { - "msg": "Created fork of `` as ``", - "success": true - } - error: null + result : { + "msg" : "Created fork of `` as ``", + "success" : true + } + error : null delete_repo ^^^^^^^^^^^ @@ -915,19 +915,19 @@ INPUT:: id : api_key : "" method : "delete_repo" - args: { + args : { "repoid" : "", - "forks" : "`delete` or `detach` = Optional(None)" + "forks" : "`delete` or `detach` = Optional(None)" } OUTPUT:: id : - result: { - "msg": "Deleted repository ``", - "success": true - } - error: null + result : { + "msg" : "Deleted repository ``", + "success" : true + } + error : null grant_user_permission ^^^^^^^^^^^^^^^^^^^^^ @@ -940,7 +940,7 @@ INPUT:: id : api_key : "" method : "grant_user_permission" - args: { + args : { "repoid" : "" "userid" : "" "perm" : "(repository.(none|read|write|admin))", @@ -949,11 +949,11 @@ INPUT:: OUTPUT:: id : - result: { + result : { "msg" : "Granted perm: `` for user: `` in repo: ``", - "success": true - } - error: null + "success" : true + } + error : null revoke_user_permission ^^^^^^^^^^^^^^^^^^^^^^ @@ -965,8 +965,8 @@ INPUT:: id : api_key : "" - method : "revoke_user_permission" - args: { + method : "revoke_user_permission" + args : { "repoid" : "" "userid" : "" } @@ -974,11 +974,11 @@ INPUT:: OUTPUT:: id : - result: { + result : { "msg" : "Revoked perm for user: `` in repo: ``", - "success": true - } - error: null + "success" : true + } + error : null grant_user_group_permission ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -992,7 +992,7 @@ INPUT:: id : api_key : "" method : "grant_user_group_permission" - args: { + args : { "repoid" : "" "usersgroupid" : "" "perm" : "(repository.(none|read|write|admin))", @@ -1001,11 +1001,11 @@ INPUT:: OUTPUT:: id : - result: { + result : { "msg" : "Granted perm: `` for group: `` in repo: ``", - "success": true - } - error: null + "success" : true + } + error : null revoke_user_group_permission ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1017,8 +1017,8 @@ INPUT:: id : api_key : "" - method : "revoke_user_group_permission" - args: { + method : "revoke_user_group_permission" + args : { "repoid" : "" "usersgroupid" : "" } @@ -1026,11 +1026,11 @@ INPUT:: OUTPUT:: id : - result: { + result : { "msg" : "Revoked perm for group: `` in repo: ``", - "success": true - } - error: null + "success" : true + } + error : null get_changesets ^^^^^^^^^^^^^^ @@ -1042,37 +1042,37 @@ INPUT:: id : api_key : "" - method : "get_changesets" - args: { + method : "get_changesets" + args : { "repoid" : "", - "start": " = Optional(None)", - "end": " = Optional(None)", - "start_date": " = Optional(None)", # in "%Y-%m-%dT%H:%M:%S" format - "end_date": " = Optional(None)", # in "%Y-%m-%dT%H:%M:%S" format - "branch_name": " = Optional(None)", - "reverse": " = Optional(False)", - "with_file_list": " = Optional(False)" + "start" : " = Optional(None)", + "end" : " = Optional(None)", + "start_date" : " = Optional(None)", # in "%Y-%m-%dT%H:%M:%S" format + "end_date" : " = Optional(None)", # in "%Y-%m-%dT%H:%M:%S" format + "branch_name" : " = Optional(None)", + "reverse" : " = Optional(False)", + "with_file_list" : " = Optional(False)" } OUTPUT:: id : - result: [ + result : [ { - "raw_id": "", - "short_id": "", - "author": "", - "date": "", - "message": "", - "revision": "", + "raw_id" : "", + "short_id" : "", + "author" : "", + "date" : "", + "message" : "", + "revision" : "", - "added": [], - "changed": [], - "removed": [] + "added" : [], + "changed" : [], + "removed" : [] }, ... ] - error: null + error : null get_changeset ^^^^^^^^^^^^^ @@ -1085,32 +1085,32 @@ INPUT:: id : api_key : "" - method : "get_changeset" - args: { + method : "get_changeset" + args : { "repoid" : "", "raw_id" : "", - "with_reviews": " = Optional(False)" + "with_reviews" : " = Optional(False)" } OUTPUT:: id : - result: { - "author": "", - "date": "", - "message": "", - "raw_id": "", + result : { + "author" : "", + "date" : "", + "message" : "", + "raw_id" : "", "revision": "", "short_id": "", - "reviews": [{ - "reviewer": "", - "modified_at": "", # iso 8601 date, server's timezone - "status": "", # "under_review", "approved" or "rejected" + "reviews" : [{ + "reviewer" : "", + "modified_at" : "", # iso 8601 date, server's timezone + "status" : "", # "under_review", "approved" or "rejected" }, ... ] - } - error: null + } + error : null Example output:: @@ -1153,60 +1153,60 @@ INPUT:: id : api_key : "" - method : "get_pullrequest" - args: { + method : "get_pullrequest" + args : { "pullrequest_id" : "", } OUTPUT:: id : - result: { - "status": "", - "pull_request_id": , - "description": "", - "title": "", - "url": "", - "reviewers": [ + result : { + "status" : "", + "pull_request_id" : , + "description" : "", + "title" : "", + "url" : "", + "reviewers" : [ { - "username": "", + "username" : "", }, ... ], - "org_repo_url": "", - "org_ref_parts": [ + "org_repo_url" : "", + "org_ref_parts" : [ "", "", "" ], - "other_ref_parts": [ + "other_ref_parts" : [ "", "", "" ], - "comments": [ + "comments" : [ { - "username": "", - "text": "", - "comment_id": "", + "username" : "", + "text" : "", + "comment_id" : "", }, ... ], - "owner": "", - "statuses": [ + "owner" : "", + "statuses" : [ { - "status": "", # "under_review", "approved" or "rejected" - "reviewer": "", - "modified_at": "" # iso 8601 date, server's timezone + "status" : "", # "under_review", "approved" or "rejected" + "reviewer" : "", + "modified_at" : "" # iso 8601 date, server's timezone }, ... ], - "revisions": [ + "revisions" : [ "", ... ] }, - error: null + error : null comment_pullrequest ^^^^^^^^^^^^^^^^^^^ @@ -1218,19 +1218,19 @@ INPUT:: id : api_key : "" - method : "comment_pullrequest" - args: { - "pull_request_id": "", - "comment_msg": Optional(''), - "status": Optional(None), # "under_review", "approved" or "rejected" - "close_pr": Optional(False)", + method : "comment_pullrequest" + args : { + "pull_request_id" : "", + "comment_msg" : Optional(''), + "status" : Optional(None), # "under_review", "approved" or "rejected" + "close_pr" : Optional(False)", } OUTPUT:: id : - result: True - error: null + result : True + error : null API access for web views 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 @@ -174,10 +174,10 @@ class ApiController(JSONRPCController): id : result : { - "msg": "Pulled from ``" - "repository": "" + "msg" : "Pulled from ``" + "repository" : "" } - error : null + error : null ERROR OUTPUT:: @@ -223,7 +223,7 @@ class ApiController(JSONRPCController): 'added': [,...] 'removed': [,...] } - error : null + error : null ERROR OUTPUT:: @@ -260,7 +260,7 @@ class ApiController(JSONRPCController): 'msg': Cache for repository `` was invalidated, 'repository': } - error : null + error : null ERROR OUTPUT:: @@ -303,14 +303,14 @@ class ApiController(JSONRPCController): id : result : { - "server_ip_addr": "", - "user_ips": [ + "server_ip_addr" : "", + "user_ips" : [ { - "ip_addr": "", - "ip_range": ["", ""], + "ip_addr" : "", + "ip_range" : ["", ""], }, ... - ] + ] } error : null """ @@ -335,12 +335,12 @@ class ApiController(JSONRPCController): id : result : { - 'modules': [ [, ], ...] - 'py_version': , - 'platform': , - 'kallithea_version': , - 'git_version': '', - 'git_path': '' + 'modules' : [ [, ], ...] + 'py_version' : , + 'platform' : , + 'kallithea_version' : , + 'git_version' : '', + 'git_path' : '' } error : null """ @@ -360,26 +360,26 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: None if user does not exist or - { + result : None if user does not exist or + { "user_id" : "", "username" : "", - "firstname": "", + "firstname" : "", "lastname" : "", "email" : "", - "emails": "[]", + "emails" : "[]", "active" : "", "admin" : "", - "permissions": { - "global": ["hg.create.repository", - "repository.read", - "hg.register.manual_activate"], - "repositories": {"repo1": "repository.none"}, - "repositories_groups": {"Group1": "group.read"}, - "user_groups": { "usrgrp1": "usergroup.admin" } + "permissions" : { + "global" : ["hg.create.repository", + "repository.read", + "hg.register.manual_activate"], + "repositories" : {"repo1" : "repository.none"}, + "repositories_groups" : {"Group1" : "group.read"}, + "user_groups" : { "usrgrp1" : "usergroup.admin" } }, - } - error: null + } + error : null """ if not HasPermissionAny('hg.admin')(): # make sure normal user does not pass someone else userid, @@ -406,8 +406,8 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: [, ...] - error: null + result : [, ...] + error : null """ return [ user.get_api_data() @@ -448,11 +448,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { + result : { "msg" : "created new user ``", - "user": - } - error: null + "user" : + } + error : null ERROR OUTPUT:: @@ -527,11 +527,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { + result : { "msg" : "updated user ID: ", - "user": , - } - error: null + "user" : , + } + error : null ERROR OUTPUT:: @@ -583,11 +583,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { + result : { "msg" : "deleted user ID: ", - "user": null - } - error: null + "user" : null + } + error : null ERROR OUTPUT:: @@ -629,10 +629,10 @@ class ApiController(JSONRPCController): { "users_group_id" : "", "group_name" : "", - "group_description": "" - "active": "", - "owner": "" - "members" : [,...] + "group_description" : "" + "active" : "", + "owner" : "" + "members" : [,...] } error : null """ @@ -682,11 +682,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { - "msg": "created new user group ``", - "user_group": - } - error: null + result : { + "msg" : "created new user group ``", + "user_group" : + } + error : null ERROR OUTPUT:: @@ -740,10 +740,10 @@ class ApiController(JSONRPCController): id : result : { - "msg": 'updated user group ID: ', - "user_group": + "msg" : 'updated user group ID: ', + "user_group" : } - error : null + error : null ERROR OUTPUT:: @@ -792,9 +792,9 @@ class ApiController(JSONRPCController): id : result : { - "msg": "deleted user group ID: " + "msg" : "deleted user group ID: " } - error : null + error : null ERROR OUTPUT:: @@ -845,11 +845,11 @@ class ApiController(JSONRPCController): id : result : { - "success": True|False # depends on if member is in group - "msg": "added member `` to a user group `` | - User is already in that group" + "success" : True|False # depends on if member is in group + "msg" : "added member `` to a user group `` | + User is already in that group" } - error : null + error : null ERROR OUTPUT:: @@ -899,12 +899,12 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { - "success": True|False, # depends on if member is in group - "msg": "removed member from user group | - User wasn't in group" - } - error: null + result : { + "success" : True|False, # depends on if member is in group + "msg" : "removed member from user group | + User wasn't in group" + } + error : null """ user = get_user_or_error(userid) user_group = get_user_group_or_error(usergroupid) @@ -949,52 +949,52 @@ class ApiController(JSONRPCController): "repo_name" : "" "repo_type" : "", "clone_uri" : "", - "enable_downloads": "", + "enable_downloads" : "", "enable_statistics": "", - "private": "", + "private" : "", "created_on" : "", "description" : "", - "landing_rev": "", - "last_changeset": { - "author": "", - "date": "", - "message": "", - "raw_id": "", + "landing_rev" : "", + "last_changeset" : { + "author" : "", + "date" : "", + "message" : "", + "raw_id" : "", "revision": "", "short_id": "" } - "owner": "", - "fork_of": "", + "owner" : "", + "fork_of" : "", "members" : [ { - "name": "", + "name" : "", "type" : "user", "permission" : "repository.(read|write|admin)" }, … { - "name": "", + "name" : "", "type" : "user_group", "permission" : "usergroup.(read|write|admin)" }, … ] - "followers": [, ...], + "followers" : [, ...], - "tags": { - "": "", + "tags" : { + "" : "", ... }, - "branches": { - "": "", + "branches" : { + "" : "", ... }, - "bookmarks": { - "": "", + "bookmarks" : { + "" : "", ... }, - } - error : null + } + error : null """ repo = get_repo_or_error(repoid) @@ -1044,7 +1044,7 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: [ + result : [ { "repo_id" : "", "repo_name" : "" @@ -1053,15 +1053,15 @@ class ApiController(JSONRPCController): "private" : "", "created_on" : "", "description" : "", - "landing_rev": "", - "owner": "", - "fork_of": "", - "enable_downloads": "", + "landing_rev" : "", + "owner" : "", + "fork_of" : "", + "enable_downloads" : "", "enable_statistics": "", }, … - ] - error: null + ] + error : null """ if not HasPermissionAny('hg.admin')(): repos = request.authuser.get_all_user_repos() @@ -1094,14 +1094,14 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: [ + result : [ { "name" : "" "type" : "", }, … - ] - error: null + ] + error : null """ repo = get_repo_or_error(repoid) @@ -1169,11 +1169,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { - "msg": "Created new repository ``", - "success": true - } - error: null + result : { + "msg" : "Created new repository ``", + "success" : true + } + error : null ERROR OUTPUT:: @@ -1342,24 +1342,24 @@ class ApiController(JSONRPCController): id : api_key : "" method : "fork_repo" - args: { + args : { "repoid" : "", - "fork_name": "", - "owner": "", - "description": "", + "fork_name" : "", + "owner" : "", + "description" : "", "copy_permissions": "", - "private": "", - "landing_rev": "" + "private" : "", + "landing_rev" : "" } OUTPUT:: id : - result: { - "msg": "Created fork of `` as ``", - "success": true - } - error: null + result : { + "msg" : "Created fork of `` as ``", + "success" : true + } + error : null """ repo = get_repo_or_error(repoid) repo_name = repo.repo_name @@ -1442,11 +1442,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { - "msg": "Deleted repository ``", - "success": true - } - error: null + result : { + "msg" : "Deleted repository ``", + "success" : true + } + error : null """ repo = get_repo_or_error(repoid) @@ -1496,11 +1496,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { + result : { "msg" : "Granted perm: `` for user: `` in repo: ``", - "success": true - } - error: null + "success" : true + } + error : null """ repo = get_repo_or_error(repoid) user = get_user_or_error(userid) @@ -1538,11 +1538,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { + result : { "msg" : "Revoked perm for user: `` in repo: ``", - "success": true - } - error: null + "success" : true + } + error : null """ repo = get_repo_or_error(repoid) user = get_user_or_error(userid) @@ -1582,9 +1582,9 @@ class ApiController(JSONRPCController): id : result : { "msg" : "Granted perm: `` for group: `` in repo: ``", - "success": true + "success" : true } - error : null + error : null ERROR OUTPUT:: @@ -1639,11 +1639,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { + result : { "msg" : "Revoked perm for group: `` in repo: ``", - "success": true - } - error: null + "success" : true + } + error : null """ repo = get_repo_or_error(repoid) user_group = get_user_group_or_error(usergroupid) @@ -1744,10 +1744,10 @@ class ApiController(JSONRPCController): id : result : { - "msg": "created new repo group ``" - "repo_group": + "msg" : "created new repo group ``" + "repo_group" : } - error : null + error : null ERROR OUTPUT:: @@ -1820,10 +1820,10 @@ class ApiController(JSONRPCController): id : result : { - 'msg': 'deleted repo group ID: - 'repo_group': null + 'msg' : 'deleted repo group ID: + 'repo_group' : null } - error : null + error : null ERROR OUTPUT:: @@ -1869,11 +1869,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { + result : { "msg" : "Granted perm: `` (recursive:) for user: `` in repo group: ``", - "success": true - } - error: null + "success" : true + } + error : null ERROR OUTPUT:: @@ -1929,11 +1929,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { + result : { "msg" : "Revoked perm (recursive:) for user: `` in repo group: ``", - "success": true - } - error: null + "success" : true + } + error : null ERROR OUTPUT:: @@ -1994,9 +1994,9 @@ class ApiController(JSONRPCController): id : result : { "msg" : "Granted perm: `` (recursive:) for user group: `` in repo group: ``", - "success": true + "success" : true } - error : null + error : null ERROR OUTPUT:: @@ -2059,11 +2059,11 @@ class ApiController(JSONRPCController): OUTPUT:: id : - result: { + result : { "msg" : "Revoked perm (recursive:) for user group: `` in repo group: ``", - "success": true - } - error: null + "success" : true + } + error : null ERROR OUTPUT:: @@ -2169,10 +2169,10 @@ class ApiController(JSONRPCController): id : result : { - "msg": "created new gist", - "gist": + "msg" : "created new gist", + "gist" : } - error : null + error : null ERROR OUTPUT:: @@ -2215,10 +2215,10 @@ class ApiController(JSONRPCController): id : result : { - "msg": "deleted gist ID: ", - "gist": null + "msg" : "deleted gist ID: ", + "gist" : null } - error : null + error : null ERROR OUTPUT::