Show More
@@ -575,16 +575,16 b' OUTPUT::' | |||||
575 | "description" : "<description>", |
|
575 | "description" : "<description>", | |
576 | "landing_rev": "<landing_rev>", |
|
576 | "landing_rev": "<landing_rev>", | |
577 | "last_changeset": { |
|
577 | "last_changeset": { | |
578 | "author": "<full_author>", |
|
578 | "author": "<full_author>", | |
579 | "date": "<date_time_of_commit>", |
|
579 | "date": "<date_time_of_commit>", | |
580 | "message": "<commit_message>", |
|
580 | "message": "<commit_message>", | |
581 | "raw_id": "<raw_id>", |
|
581 | "raw_id": "<raw_id>", | |
582 | "revision": "<numeric_revision>", |
|
582 | "revision": "<numeric_revision>", | |
583 | "short_id": "<short_id>" |
|
583 | "short_id": "<short_id>" | |
584 | }, |
|
584 | }, | |
585 | "owner": "<repo_owner>", |
|
585 | "owner": "<repo_owner>", | |
586 | "fork_of": "<name_of_fork_parent>", |
|
586 | "fork_of": "<name_of_fork_parent>", | |
587 |
"members" : |
|
587 | "members" : [ | |
588 | { |
|
588 | { | |
589 | "type": "user", |
|
589 | "type": "user", | |
590 | "user_id" : "<user_id>", |
|
590 | "user_id" : "<user_id>", | |
@@ -609,8 +609,8 b' OUTPUT::' | |||||
609 | "permission" : "repository.(read|write|admin)" |
|
609 | "permission" : "repository.(read|write|admin)" | |
610 | }, |
|
610 | }, | |
611 | β¦ |
|
611 | β¦ | |
612 |
|
|
612 | ], | |
613 |
|
|
613 | "followers": [ | |
614 | { |
|
614 | { | |
615 | "user_id" : "<user_id>", |
|
615 | "user_id" : "<user_id>", | |
616 | "username" : "<username>", |
|
616 | "username" : "<username>", | |
@@ -626,20 +626,20 b' OUTPUT::' | |||||
626 | "last_login": "<last_login>", |
|
626 | "last_login": "<last_login>", | |
627 | }, |
|
627 | }, | |
628 | β¦ |
|
628 | β¦ | |
629 |
|
|
629 | ], | |
630 |
|
|
630 | <if with_revision_names == True> | |
631 |
|
|
631 | "tags": { | |
632 | "<tagname>": "<raw_id>", |
|
632 | "<tagname>": "<raw_id>", | |
633 | ... |
|
633 | ... | |
634 |
|
|
634 | }, | |
635 |
|
|
635 | "branches": { | |
636 | "<branchname>": "<raw_id>", |
|
636 | "<branchname>": "<raw_id>", | |
637 | ... |
|
637 | ... | |
638 |
|
|
638 | }, | |
639 |
|
|
639 | "bookmarks": { | |
640 | "<bookmarkname>": "<raw_id>", |
|
640 | "<bookmarkname>": "<raw_id>", | |
641 | ... |
|
641 | ... | |
642 |
|
|
642 | }, | |
643 | <if with_pullrequests == True> |
|
643 | <if with_pullrequests == True> | |
644 | "pull_requests": [ |
|
644 | "pull_requests": [ | |
645 | { |
|
645 | { |
@@ -172,20 +172,20 b' class ApiController(JSONRPCController):' | |||||
172 |
|
172 | |||
173 | OUTPUT:: |
|
173 | OUTPUT:: | |
174 |
|
174 | |||
175 | id : <id_given_in_input> |
|
175 | id : <id_given_in_input> | |
176 | result : { |
|
176 | result : { | |
177 | "msg": "Pulled from `<repository name>`" |
|
177 | "msg": "Pulled from `<repository name>`" | |
178 | "repository": "<repository name>" |
|
178 | "repository": "<repository name>" | |
179 | } |
|
179 | } | |
180 | error : null |
|
180 | error : null | |
181 |
|
181 | |||
182 | ERROR OUTPUT:: |
|
182 | ERROR OUTPUT:: | |
183 |
|
183 | |||
184 | id : <id_given_in_input> |
|
184 | id : <id_given_in_input> | |
185 | result : null |
|
185 | result : null | |
186 | error : { |
|
186 | error : { | |
187 | "Unable to pull changes from `<reponame>`" |
|
187 | "Unable to pull changes from `<reponame>`" | |
188 | } |
|
188 | } | |
189 | """ |
|
189 | """ | |
190 | repo = get_repo_or_error(repoid) |
|
190 | repo = get_repo_or_error(repoid) | |
191 |
|
191 | |||
@@ -218,20 +218,20 b' class ApiController(JSONRPCController):' | |||||
218 |
|
218 | |||
219 | OUTPUT:: |
|
219 | OUTPUT:: | |
220 |
|
220 | |||
221 | id : <id_given_in_input> |
|
221 | id : <id_given_in_input> | |
222 | result : { |
|
222 | result : { | |
223 | 'added': [<added repository name>,...] |
|
223 | 'added': [<added repository name>,...] | |
224 | 'removed': [<removed repository name>,...] |
|
224 | 'removed': [<removed repository name>,...] | |
225 | } |
|
225 | } | |
226 | error : null |
|
226 | error : null | |
227 |
|
227 | |||
228 | ERROR OUTPUT:: |
|
228 | ERROR OUTPUT:: | |
229 |
|
229 | |||
230 | id : <id_given_in_input> |
|
230 | id : <id_given_in_input> | |
231 | result : null |
|
231 | result : null | |
232 | error : { |
|
232 | error : { | |
233 | 'Error occurred during rescan repositories action' |
|
233 | 'Error occurred during rescan repositories action' | |
234 | } |
|
234 | } | |
235 | """ |
|
235 | """ | |
236 | try: |
|
236 | try: | |
237 | rm_obsolete = remove_obsolete |
|
237 | rm_obsolete = remove_obsolete | |
@@ -255,20 +255,20 b' class ApiController(JSONRPCController):' | |||||
255 |
|
255 | |||
256 | OUTPUT:: |
|
256 | OUTPUT:: | |
257 |
|
257 | |||
258 | id : <id_given_in_input> |
|
258 | id : <id_given_in_input> | |
259 | result : { |
|
259 | result : { | |
260 | 'msg': Cache for repository `<repository name>` was invalidated, |
|
260 | 'msg': Cache for repository `<repository name>` was invalidated, | |
261 | 'repository': <repository name> |
|
261 | 'repository': <repository name> | |
262 | } |
|
262 | } | |
263 | error : null |
|
263 | error : null | |
264 |
|
264 | |||
265 | ERROR OUTPUT:: |
|
265 | ERROR OUTPUT:: | |
266 |
|
266 | |||
267 | id : <id_given_in_input> |
|
267 | id : <id_given_in_input> | |
268 | result : null |
|
268 | result : null | |
269 | error : { |
|
269 | error : { | |
270 | 'Error occurred during cache invalidation action' |
|
270 | 'Error occurred during cache invalidation action' | |
271 | } |
|
271 | } | |
272 | """ |
|
272 | """ | |
273 | repo = get_repo_or_error(repoid) |
|
273 | repo = get_repo_or_error(repoid) | |
274 | if not HasPermissionAny('hg.admin')(): |
|
274 | if not HasPermissionAny('hg.admin')(): | |
@@ -333,16 +333,16 b' class ApiController(JSONRPCController):' | |||||
333 |
|
333 | |||
334 | OUTPUT:: |
|
334 | OUTPUT:: | |
335 |
|
335 | |||
336 | id : <id_given_in_input> |
|
336 | id : <id_given_in_input> | |
337 | result : { |
|
337 | result : { | |
338 | 'modules': [ [<module name>, <module version>], ...] |
|
338 | 'modules': [ [<module name>, <module version>], ...] | |
339 | 'py_version': <python version>, |
|
339 | 'py_version': <python version>, | |
340 | 'platform': <platform type>, |
|
340 | 'platform': <platform type>, | |
341 | 'kallithea_version': <kallithea version>, |
|
341 | 'kallithea_version': <kallithea version>, | |
342 | 'git_version': '<git version>', |
|
342 | 'git_version': '<git version>', | |
343 | 'git_path': '<git path>' |
|
343 | 'git_path': '<git path>' | |
344 | } |
|
344 | } | |
345 |
error : |
|
345 | error : null | |
346 | """ |
|
346 | """ | |
347 | return db.Setting.get_server_info() |
|
347 | return db.Setting.get_server_info() | |
348 |
|
348 | |||
@@ -456,15 +456,15 b' class ApiController(JSONRPCController):' | |||||
456 |
|
456 | |||
457 | ERROR OUTPUT:: |
|
457 | ERROR OUTPUT:: | |
458 |
|
458 | |||
459 | id : <id_given_in_input> |
|
459 | id : <id_given_in_input> | |
460 | result : null |
|
460 | result : null | |
461 | error : { |
|
461 | error : { | |
462 | "user `<username>` already exist" |
|
462 | "user `<username>` already exist" | |
463 | or |
|
463 | or | |
464 | "email `<email>` already exist" |
|
464 | "email `<email>` already exist" | |
465 | or |
|
465 | or | |
466 | "failed to create user `<username>`" |
|
466 | "failed to create user `<username>`" | |
467 | } |
|
467 | } | |
468 | """ |
|
468 | """ | |
469 | if db.User.get_by_username(username): |
|
469 | if db.User.get_by_username(username): | |
470 | raise JSONRPCError("user `%s` already exist" % (username,)) |
|
470 | raise JSONRPCError("user `%s` already exist" % (username,)) | |
@@ -535,11 +535,11 b' class ApiController(JSONRPCController):' | |||||
535 |
|
535 | |||
536 | ERROR OUTPUT:: |
|
536 | ERROR OUTPUT:: | |
537 |
|
537 | |||
538 | id : <id_given_in_input> |
|
538 | id : <id_given_in_input> | |
539 | result : null |
|
539 | result : null | |
540 | error : { |
|
540 | error : { | |
541 | "failed to update user `<username>`" |
|
541 | "failed to update user `<username>`" | |
542 | } |
|
542 | } | |
543 | """ |
|
543 | """ | |
544 | user = get_user_or_error(userid) |
|
544 | user = get_user_or_error(userid) | |
545 |
|
545 | |||
@@ -591,11 +591,11 b' class ApiController(JSONRPCController):' | |||||
591 |
|
591 | |||
592 | ERROR OUTPUT:: |
|
592 | ERROR OUTPUT:: | |
593 |
|
593 | |||
594 | id : <id_given_in_input> |
|
594 | id : <id_given_in_input> | |
595 | result : null |
|
595 | result : null | |
596 | error : { |
|
596 | error : { | |
597 | "failed to delete user ID:<userid> <username>" |
|
597 | "failed to delete user ID:<userid> <username>" | |
598 | } |
|
598 | } | |
599 | """ |
|
599 | """ | |
600 | user = get_user_or_error(userid) |
|
600 | user = get_user_or_error(userid) | |
601 |
|
601 | |||
@@ -690,13 +690,13 b' class ApiController(JSONRPCController):' | |||||
690 |
|
690 | |||
691 | ERROR OUTPUT:: |
|
691 | ERROR OUTPUT:: | |
692 |
|
692 | |||
693 | id : <id_given_in_input> |
|
693 | id : <id_given_in_input> | |
694 | result : null |
|
694 | result : null | |
695 | error : { |
|
695 | error : { | |
696 | "user group `<group name>` already exist" |
|
696 | "user group `<group name>` already exist" | |
697 | or |
|
697 | or | |
698 | "failed to create group `<group name>`" |
|
698 | "failed to create group `<group name>`" | |
699 | } |
|
699 | } | |
700 | """ |
|
700 | """ | |
701 | if UserGroupModel().get_by_name(group_name): |
|
701 | if UserGroupModel().get_by_name(group_name): | |
702 | raise JSONRPCError("user group `%s` already exist" % (group_name,)) |
|
702 | raise JSONRPCError("user group `%s` already exist" % (group_name,)) | |
@@ -843,21 +843,21 b' class ApiController(JSONRPCController):' | |||||
843 |
|
843 | |||
844 | OUTPUT:: |
|
844 | OUTPUT:: | |
845 |
|
845 | |||
846 | id : <id_given_in_input> |
|
846 | id : <id_given_in_input> | |
847 | result : { |
|
847 | result : { | |
848 | "success": True|False # depends on if member is in group |
|
848 | "success": True|False # depends on if member is in group | |
849 | "msg": "added member `<username>` to a user group `<groupname>` | |
|
849 | "msg": "added member `<username>` to a user group `<groupname>` | | |
850 | User is already in that group" |
|
850 | User is already in that group" | |
851 | } |
|
851 | } | |
852 | error : null |
|
852 | error : null | |
853 |
|
853 | |||
854 | ERROR OUTPUT:: |
|
854 | ERROR OUTPUT:: | |
855 |
|
855 | |||
856 | id : <id_given_in_input> |
|
856 | id : <id_given_in_input> | |
857 | result : null |
|
857 | result : null | |
858 | error : { |
|
858 | error : { | |
859 | "failed to add member to user group `<user_group_name>`" |
|
859 | "failed to add member to user group `<user_group_name>`" | |
860 | } |
|
860 | } | |
861 | """ |
|
861 | """ | |
862 | user = get_user_or_error(userid) |
|
862 | user = get_user_or_error(userid) | |
863 | user_group = get_user_group_or_error(usergroupid) |
|
863 | user_group = get_user_group_or_error(usergroupid) | |
@@ -943,58 +943,58 b' class ApiController(JSONRPCController):' | |||||
943 |
|
943 | |||
944 | OUTPUT:: |
|
944 | OUTPUT:: | |
945 |
|
945 | |||
946 | id : <id_given_in_input> |
|
946 | id : <id_given_in_input> | |
947 | result : { |
|
947 | result : { | |
948 | "repo_id" : "<repo_id>", |
|
948 | "repo_id" : "<repo_id>", | |
949 | "repo_name" : "<reponame>" |
|
949 | "repo_name" : "<reponame>" | |
950 | "repo_type" : "<repo_type>", |
|
950 | "repo_type" : "<repo_type>", | |
951 | "clone_uri" : "<clone_uri>", |
|
951 | "clone_uri" : "<clone_uri>", | |
952 | "enable_downloads": "<bool>", |
|
952 | "enable_downloads": "<bool>", | |
953 | "enable_statistics": "<bool>", |
|
953 | "enable_statistics": "<bool>", | |
954 | "private": "<bool>", |
|
954 | "private": "<bool>", | |
955 | "created_on" : "<date_time_created>", |
|
955 | "created_on" : "<date_time_created>", | |
956 | "description" : "<description>", |
|
956 | "description" : "<description>", | |
957 | "landing_rev": "<landing_rev>", |
|
957 | "landing_rev": "<landing_rev>", | |
958 | "last_changeset": { |
|
958 | "last_changeset": { | |
959 | "author": "<full_author>", |
|
959 | "author": "<full_author>", | |
960 | "date": "<date_time_of_commit>", |
|
960 | "date": "<date_time_of_commit>", | |
961 | "message": "<commit_message>", |
|
961 | "message": "<commit_message>", | |
962 | "raw_id": "<raw_id>", |
|
962 | "raw_id": "<raw_id>", | |
963 | "revision": "<numeric_revision>", |
|
963 | "revision": "<numeric_revision>", | |
964 | "short_id": "<short_id>" |
|
964 | "short_id": "<short_id>" | |
965 | } |
|
965 | } | |
966 | "owner": "<repo_owner>", |
|
966 | "owner": "<repo_owner>", | |
967 | "fork_of": "<name_of_fork_parent>", |
|
967 | "fork_of": "<name_of_fork_parent>", | |
968 | "members" : [ |
|
968 | "members" : [ | |
969 | { |
|
969 | { | |
970 | "name": "<username>", |
|
970 | "name": "<username>", | |
971 | "type" : "user", |
|
971 | "type" : "user", | |
972 | "permission" : "repository.(read|write|admin)" |
|
972 | "permission" : "repository.(read|write|admin)" | |
973 | }, |
|
973 | }, | |
974 | β¦ |
|
974 | β¦ | |
975 | { |
|
975 | { | |
976 | "name": "<usergroup name>", |
|
976 | "name": "<usergroup name>", | |
977 | "type" : "user_group", |
|
977 | "type" : "user_group", | |
978 | "permission" : "usergroup.(read|write|admin)" |
|
978 | "permission" : "usergroup.(read|write|admin)" | |
979 | }, |
|
979 | }, | |
980 | β¦ |
|
980 | β¦ | |
981 | ] |
|
981 | ] | |
982 | "followers": [<user_obj>, ...], |
|
982 | "followers": [<user_obj>, ...], | |
983 | <if with_revision_names == True> |
|
983 | <if with_revision_names == True> | |
984 | "tags": { |
|
984 | "tags": { | |
985 | "<tagname>": "<raw_id>", |
|
985 | "<tagname>": "<raw_id>", | |
986 | ... |
|
986 | ... | |
987 | }, |
|
987 | }, | |
988 | "branches": { |
|
988 | "branches": { | |
989 | "<branchname>": "<raw_id>", |
|
989 | "<branchname>": "<raw_id>", | |
990 | ... |
|
990 | ... | |
991 | }, |
|
991 | }, | |
992 | "bookmarks": { |
|
992 | "bookmarks": { | |
993 | "<bookmarkname>": "<raw_id>", |
|
993 | "<bookmarkname>": "<raw_id>", | |
994 | ... |
|
994 | ... | |
995 | }, |
|
995 | }, | |
996 | } |
|
996 | } | |
997 | error : null |
|
997 | error : null | |
998 | """ |
|
998 | """ | |
999 | repo = get_repo_or_error(repoid) |
|
999 | repo = get_repo_or_error(repoid) | |
1000 |
|
1000 | |||
@@ -1177,11 +1177,11 b' class ApiController(JSONRPCController):' | |||||
1177 |
|
1177 | |||
1178 | ERROR OUTPUT:: |
|
1178 | ERROR OUTPUT:: | |
1179 |
|
1179 | |||
1180 | id : <id_given_in_input> |
|
1180 | id : <id_given_in_input> | |
1181 | result : null |
|
1181 | result : null | |
1182 | error : { |
|
1182 | error : { | |
1183 | 'failed to create repository `<repo_name>` |
|
1183 | 'failed to create repository `<repo_name>` | |
1184 | } |
|
1184 | } | |
1185 | """ |
|
1185 | """ | |
1186 | group_name = None |
|
1186 | group_name = None | |
1187 | repo_name_parts = repo_name.split('/') |
|
1187 | repo_name_parts = repo_name.split('/') | |
@@ -1579,20 +1579,20 b' class ApiController(JSONRPCController):' | |||||
1579 |
|
1579 | |||
1580 | OUTPUT:: |
|
1580 | OUTPUT:: | |
1581 |
|
1581 | |||
1582 | id : <id_given_in_input> |
|
1582 | id : <id_given_in_input> | |
1583 | result : { |
|
1583 | result : { | |
1584 | "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`", |
|
1584 | "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`", | |
1585 | "success": true |
|
1585 | "success": true | |
1586 | } |
|
1586 | } | |
1587 | error : null |
|
1587 | error : null | |
1588 |
|
1588 | |||
1589 | ERROR OUTPUT:: |
|
1589 | ERROR OUTPUT:: | |
1590 |
|
1590 | |||
1591 | id : <id_given_in_input> |
|
1591 | id : <id_given_in_input> | |
1592 | result : null |
|
1592 | result : null | |
1593 | error : { |
|
1593 | error : { | |
1594 | "failed to edit permission for user group: `<usergroup>` in repo `<repo>`' |
|
1594 | "failed to edit permission for user group: `<usergroup>` in repo `<repo>`' | |
1595 | } |
|
1595 | } | |
1596 | """ |
|
1596 | """ | |
1597 | repo = get_repo_or_error(repoid) |
|
1597 | repo = get_repo_or_error(repoid) | |
1598 | perm = get_perm_or_error(perm) |
|
1598 | perm = get_perm_or_error(perm) |
General Comments 0
You need to be logged in to leave comments.
Login now