diff --git a/docs/api/api.rst b/docs/api/api.rst --- a/docs/api/api.rst +++ b/docs/api/api.rst @@ -74,15 +74,47 @@ INPUT:: api_key : "" method : "pull" args : { - "repo" : "" + "repo_name" : "" } OUTPUT:: - result : "Pulled from " + result : "Pulled from " error : null +get_user +-------- + +Get's an user by username, Returns empty result if user is not found. +This command can be executed only using api_key belonging to user with admin +rights. + +INPUT:: + + api_key : "" + method : "get_user" + args : { + "username" : "" + } + +OUTPUT:: + + result: None if user does not exist or + { + "id" : "", + "username" : "", + "firstname": "", + "lastname" : "", + "email" : "", + "active" : "", + "admin" :  "", + "ldap" : "" + } + + error: null + + get_users --------- @@ -136,46 +168,11 @@ INPUT:: OUTPUT:: result: { + "id" : "", "msg" : "created new user " } error: null -get_users_groups ----------------- - -Lists all existing users groups. This command can be executed only using api_key -belonging to user with admin rights. - -INPUT:: - - api_key : "" - method : "get_users_groups" - args : { } - -OUTPUT:: - - result : [ - { - "id" : "", - "name" : "", - "active": "", - "members" : [ - { - "id" : "", - "username" : "", - "firstname": "", - "lastname" : "", - "email" : "", - "active" : "", - "admin" :  "", - "ldap" : "" - }, - … - ] - } - ] - error : null - get_users_group --------------- @@ -194,24 +191,61 @@ OUTPUT:: result : None if group not exist { - "id" : "", - "name" : "", - "active": "", + "id" : "", + "group_name" : "", + "active": "", "members" : [ - { "id" : "", - "username" : "", - "firstname": "", - "lastname" : "", - "email" : "", - "active" : "", - "admin" :  "", - "ldap" : "" - }, - … - ] + { "id" : "", + "username" : "", + "firstname": "", + "lastname" : "", + "email" : "", + "active" : "", + "admin" :  "", + "ldap" : "" + }, + … + ] } error : null +get_users_groups +---------------- + +Lists all existing users groups. This command can be executed only using +api_key belonging to user with admin rights. + +INPUT:: + + api_key : "" + method : "get_users_groups" + args : { } + +OUTPUT:: + + result : [ + { + "id" : "", + "group_name" : "", + "active": "", + "members" : [ + { + "id" : "", + "username" : "", + "firstname": "", + "lastname" : "", + "email" : "", + "active" : "", + "admin" :  "", + "ldap" : "" + }, + … + ] + } + ] + error : null + + create_users_group ------------------ @@ -223,7 +257,7 @@ INPUT:: api_key : "" method : "create_users_group" args: { - "name": "", + "group_name": "", "active":" = True" } @@ -231,7 +265,7 @@ OUTPUT:: result: { "id": "", - "msg": "created new users group " + "msg": "created new users group " } error: null @@ -258,6 +292,51 @@ OUTPUT:: } error: null +get_repo +-------- + +Gets an existing repository. This command can be executed only using api_key +belonging to user with admin rights + +INPUT:: + + api_key : "" + method : "get_repo" + args: { + "repo_name" : "" + } + +OUTPUT:: + + result: None if repository does not exist or + { + "id" : "", + "repo_name" : "" + "type" : "", + "description" : "", + "members" : [ + { "id" : "", + "username" : "", + "firstname": "", + "lastname" : "", + "email" : "", + "active" : "", + "admin" :  "", + "ldap" : "", + "permission" : "repository.(read|write|admin)" + }, + … + { + "id" : "", + "name" : "", + "active": "", + "permission" : "repository.(read|write|admin)" + }, + … + ] + } + error: null + get_repos --------- @@ -275,7 +354,7 @@ OUTPUT:: result: [ { "id" : "", - "name" : "" + "repo_name" : "" "type" : "", "description" : "" }, @@ -283,57 +362,13 @@ OUTPUT:: ] error: null -get_repo --------- - -Gets an existing repository. This command can be executed only using api_key -belonging to user with admin rights - -INPUT:: - - api_key : "" - method : "get_repo" - args: { - "name" : "" - } - -OUTPUT:: - - result: None if repository not exist - { - "id" : "", - "name" : "" - "type" : "", - "description" : "", - "members" : [ - { "id" : "", - "username" : "", - "firstname": "", - "lastname" : "", - "email" : "", - "active" : "", - "admin" :  "", - "ldap" : "", - "permission" : "repository.(read|write|admin)" - }, - … - { - "id" : "", - "name" : "", - "active": "", - "permission" : "repository.(read|write|admin)" - }, - … - ] - } - error: null get_repo_nodes -------------- returns a list of nodes and it's children in a flat list for a given path -at given revision. It's possible to specify ret_type to show only files or -dirs. This command can be executed only using api_key belonging to user +at given revision. It's possible to specify ret_type to show only `files` or +`dirs`. This command can be executed only using api_key belonging to user with admin rights INPUT:: @@ -341,7 +376,7 @@ INPUT:: api_key : "" method : "get_repo_nodes" args: { - "repo_name" : "", + "repo_name" : "", "revision" : "", "root_path" : "", "ret_type" : "" = 'all' @@ -374,7 +409,7 @@ INPUT:: api_key : "" method : "create_repo" args: { - "name" : "", + "repo_name" : "", "owner_name" : "", "description" : " = ''", "repo_type" : " = 'hg'", @@ -383,7 +418,10 @@ INPUT:: OUTPUT:: - result: None + result: { + "id": "", + "msg": "Created new repository ", + } error: null add_user_to_repo @@ -399,13 +437,15 @@ INPUT:: method : "add_user_to_repo" args: { "repo_name" : "", - "username" : "", + "username" : "", "perm" : "(None|repository.(read|write|admin))", } OUTPUT:: - result: None + result: { + "msg" : "Added perm: for in repo: " + } error: null add_users_group_to_repo @@ -421,6 +461,12 @@ INPUT:: method : "add_users_group_to_repo" args: { "repo_name" : "", - "group_name" : "", + "group_name" : "", "perm" : "(None|repository.(read|write|admin))", - } \ No newline at end of file + } +OUTPUT:: + + result: { + "msg" : Added perm: for in repo: " + } +