Mercurial > public > src > rhodecode
annotate docs/api/api.rst @ 2467:b902baeaa494 beta
API, added delete_user method.
- create_user now also returns new user object data as get_user
- updated docs
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 31 May 2012 18:42:49 +0200 |
parents | 347b00545b60 |
children | 04ef27ce939e |
rev | line source |
---|---|
1526 | 1 .. _api: |
2 | |
2191 | 3 === |
1526 | 4 API |
5 === | |
6 | |
7 | |
8 Starting from RhodeCode version 1.2 a simple API was implemented. | |
1580 | 9 There's a single schema for calling all api methods. API is implemented |
1676 | 10 with JSON protocol both ways. An url to send API request in RhodeCode is |
1580 | 11 <your_server>/_admin/api |
1526 | 12 |
1924 | 13 API ACCESS FOR WEB VIEWS |
14 ++++++++++++++++++++++++ | |
1526 | 15 |
1996 | 16 API access can also be turned on for each web view in RhodeCode that is |
17 decorated with `@LoginRequired` decorator. To enable API access simple change | |
18 the standard login decorator to `@LoginRequired(api_access=True)`. | |
19 After this change, a rhodecode view can be accessed without login by adding a | |
20 GET parameter `?api_key=<api_key>` to url. By default this is only | |
1896
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1895
diff
changeset
|
21 enabled on RSS/ATOM feed views. |
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1895
diff
changeset
|
22 |
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1895
diff
changeset
|
23 |
1924 | 24 API ACCESS |
25 ++++++++++ | |
26 | |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
27 All clients are required to send JSON-RPC spec JSON data:: |
1526 | 28 |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
29 { |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
30 "id:"<id>", |
1526 | 31 "api_key":"<api_key>", |
32 "method":"<method_name>", | |
33 "args":{"<arg_key>":"<arg_val>"} | |
34 } | |
35 | |
1580 | 36 Example call for autopulling remotes repos using curl:: |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
37 curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}' |
1580 | 38 |
1676 | 39 Simply provide |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
40 - *id* A value of any type, which is used to match the response with the request that it is replying to. |
1580 | 41 - *api_key* for access and permission validation. |
42 - *method* is name of method to call | |
43 - *args* is an key:value list of arguments to pass to method | |
1676 | 44 |
1526 | 45 .. note:: |
1676 | 46 |
47 api_key can be found in your user account page | |
48 | |
49 | |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
50 RhodeCode API will return always a JSON-RPC response:: |
1676 | 51 |
1793
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
52 { |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
53 "id":<id>, # matching id sent by request |
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
54 "result": "<result>"|null, # JSON formatted result, null if any errors |
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
55 "error": "null"|<error_message> # JSON formatted error (if any) |
1526 | 56 } |
57 | |
58 All responses from API will be `HTTP/1.0 200 OK`, if there's an error while | |
1676 | 59 calling api *error* key from response will contain failure description |
1526 | 60 and result will be null. |
61 | |
62 API METHODS | |
63 +++++++++++ | |
64 | |
1676 | 65 |
1526 | 66 pull |
67 ---- | |
68 | |
1676 | 69 Pulls given repo from remote location. Can be used to automatically keep |
70 remote repos up to date. This command can be executed only using api_key | |
1580 | 71 belonging to user with admin rights |
72 | |
73 INPUT:: | |
74 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
75 id : <id_for_response> |
1676 | 76 api_key : "<api_key>" |
77 method : "pull" | |
78 args : { | |
1928 | 79 "repo_name" : "<reponame>" |
1676 | 80 } |
81 | |
82 OUTPUT:: | |
83 | |
1928 | 84 result : "Pulled from <reponame>" |
1676 | 85 error : null |
86 | |
87 | |
1928 | 88 get_user |
89 -------- | |
90 | |
2098
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2097
diff
changeset
|
91 Get's an user by username or user_id, Returns empty result if user is not found. |
1928 | 92 This command can be executed only using api_key belonging to user with admin |
93 rights. | |
94 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
95 |
1928 | 96 INPUT:: |
97 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
98 id : <id_for_response> |
1928 | 99 api_key : "<api_key>" |
100 method : "get_user" | |
101 args : { | |
2098
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2097
diff
changeset
|
102 "userid" : "<username or user_id>" |
1928 | 103 } |
104 | |
105 OUTPUT:: | |
106 | |
107 result: None if user does not exist or | |
108 { | |
109 "id" : "<id>", | |
110 "username" : "<username>", | |
111 "firstname": "<firstname>", | |
112 "lastname" : "<lastname>", | |
113 "email" : "<email>", | |
114 "active" : "<bool>", | |
115 "admin" :Â "<bool>", | |
2249
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
116 "ldap_dn" : "<ldap_dn>", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
117 "last_login": "<last_login>", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
118 "permissions": { |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
119 "global": ["hg.create.repository", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
120 "repository.read", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
121 "hg.register.manual_activate"], |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
122 "repositories": {"repo1": "repository.none"}, |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
123 "repositories_groups": {"Group1": "group.read"} |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
124 }, |
1928 | 125 } |
126 | |
127 error: null | |
128 | |
129 | |
1676 | 130 get_users |
131 --------- | |
132 | |
133 Lists all existing users. This command can be executed only using api_key | |
134 belonging to user with admin rights. | |
135 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
136 |
1676 | 137 INPUT:: |
138 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
139 id : <id_for_response> |
1676 | 140 api_key : "<api_key>" |
141 method : "get_users" | |
142 args : { } | |
143 | |
144 OUTPUT:: | |
145 | |
146 result: [ | |
147 { | |
148 "id" : "<id>", | |
149 "username" : "<username>", | |
150 "firstname": "<firstname>", | |
151 "lastname" : "<lastname>", | |
152 "email" : "<email>", | |
153 "active" : "<bool>", | |
154 "admin" :Â "<bool>", | |
2249
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
155 "ldap_dn" : "<ldap_dn>", |
12ceeda33339
#404 API extensions for showing permission for users
Marcin Kuzminski <marcin@python-works.com>
parents:
2244
diff
changeset
|
156 "last_login": "<last_login>", |
1676 | 157 }, |
158 … | |
159 ] | |
160 error: null | |
161 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
162 |
1676 | 163 create_user |
164 ----------- | |
165 | |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
166 Creates new user. This command can |
1994
f2bd5b0c1094
create user api_doc update
Marcin Kuzminski <marcin@python-works.com>
parents:
1928
diff
changeset
|
167 be executed only using api_key belonging to user with admin rights. |
1676 | 168 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
169 |
1676 | 170 INPUT:: |
171 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
172 id : <id_for_response> |
1676 | 173 api_key : "<api_key>" |
174 method : "create_user" | |
175 args : { | |
176 "username" : "<username>", | |
177 "password" : "<password>", | |
2036
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1996
diff
changeset
|
178 "email" : "<useremail>", |
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1996
diff
changeset
|
179 "firstname" : "<firstname> = None", |
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1996
diff
changeset
|
180 "lastname" : "<lastname> = None", |
1676 | 181 "active" : "<bool> = True", |
182 "admin" : "<bool> = False", | |
183 "ldap_dn" : "<ldap_dn> = None" | |
184 } | |
1580 | 185 |
186 OUTPUT:: | |
187 | |
1676 | 188 result: { |
1928 | 189 "id" : "<new_user_id>", |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
190 "msg" : "created new user <username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
191 "user": { |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
192 "id" : "<id>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
193 "username" : "<username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
194 "firstname": "<firstname>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
195 "lastname" : "<lastname>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
196 "email" : "<email>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
197 "active" : "<bool>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
198 "admin" :Â "<bool>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
199 "ldap_dn" : "<ldap_dn>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
200 "last_login": "<last_login>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
201 }, |
1676 | 202 } |
203 error: null | |
204 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
205 |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
206 update_user |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
207 ----------- |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
208 |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
209 updates given user if such user exists. This command can |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
210 be executed only using api_key belonging to user with admin rights. |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
211 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
212 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
213 INPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
214 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
215 id : <id_for_response> |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
216 api_key : "<api_key>" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
217 method : "update_user" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
218 args : { |
2097 | 219 "userid" : "<user_id or username>", |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
220 "username" : "<username>", |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
221 "password" : "<password>", |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
222 "email" : "<useremail>", |
2097 | 223 "firstname" : "<firstname>", |
224 "lastname" : "<lastname>", | |
225 "active" : "<bool>", | |
226 "admin" : "<bool>", | |
227 "ldap_dn" : "<ldap_dn>" | |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
228 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
229 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
230 OUTPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
231 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
232 result: { |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
233 "id" : "<edited_user_id>", |
2467
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
234 "msg" : "updated user ID:<userid> <username>" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
235 } |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
236 error: null |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
237 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
238 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
239 delete_user |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
240 ----------- |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
241 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
242 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
243 deletes givenuser if such user exists. This command can |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
244 be executed only using api_key belonging to user with admin rights. |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
245 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
246 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
247 INPUT:: |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
248 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
249 id : <id_for_response> |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
250 api_key : "<api_key>" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
251 method : "delete_user" |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
252 args : { |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
253 "userid" : "<user_id or username>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
254 } |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
255 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
256 OUTPUT:: |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
257 |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
258 result: { |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
259 "id" : "<edited_user_id>", |
b902baeaa494
API, added delete_user method.
Marcin Kuzminski <marcin@python-works.com>
parents:
2440
diff
changeset
|
260 "msg" : "deleted user ID:<userid> <username>" |
2090
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
261 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
262 error: null |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
263 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
2077
diff
changeset
|
264 |
1676 | 265 get_users_group |
266 --------------- | |
267 | |
268 Gets an existing users group. This command can be executed only using api_key | |
269 belonging to user with admin rights. | |
270 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
271 |
1676 | 272 INPUT:: |
273 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
274 id : <id_for_response> |
1676 | 275 api_key : "<api_key>" |
276 method : "get_users_group" | |
277 args : { | |
278 "group_name" : "<name>" | |
279 } | |
280 | |
281 OUTPUT:: | |
282 | |
283 result : None if group not exist | |
284 { | |
1928 | 285 "id" : "<id>", |
286 "group_name" : "<groupname>", | |
287 "active": "<bool>", | |
1676 | 288 "members" : [ |
1928 | 289 { "id" : "<userid>", |
290 "username" : "<username>", | |
291 "firstname": "<firstname>", | |
292 "lastname" : "<lastname>", | |
293 "email" : "<email>", | |
294 "active" : "<bool>", | |
295 "admin" :Â "<bool>", | |
296 "ldap" : "<ldap_dn>" | |
297 }, | |
298 … | |
299 ] | |
1676 | 300 } |
301 error : null | |
302 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
303 |
1928 | 304 get_users_groups |
305 ---------------- | |
306 | |
307 Lists all existing users groups. This command can be executed only using | |
308 api_key belonging to user with admin rights. | |
309 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
310 |
1928 | 311 INPUT:: |
312 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
313 id : <id_for_response> |
1928 | 314 api_key : "<api_key>" |
315 method : "get_users_groups" | |
316 args : { } | |
317 | |
318 OUTPUT:: | |
319 | |
320 result : [ | |
321 { | |
322 "id" : "<id>", | |
323 "group_name" : "<groupname>", | |
324 "active": "<bool>", | |
325 "members" : [ | |
326 { | |
327 "id" : "<userid>", | |
328 "username" : "<username>", | |
329 "firstname": "<firstname>", | |
330 "lastname" : "<lastname>", | |
331 "email" : "<email>", | |
332 "active" : "<bool>", | |
333 "admin" :Â "<bool>", | |
334 "ldap" : "<ldap_dn>" | |
335 }, | |
336 … | |
337 ] | |
338 } | |
339 ] | |
340 error : null | |
341 | |
342 | |
1580 | 343 create_users_group |
344 ------------------ | |
345 | |
1676 | 346 Creates new users group. This command can be executed only using api_key |
1580 | 347 belonging to user with admin rights |
348 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
349 |
1580 | 350 INPUT:: |
351 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
352 id : <id_for_response> |
1676 | 353 api_key : "<api_key>" |
354 method : "create_users_group" | |
355 args: { | |
1928 | 356 "group_name": "<groupname>", |
1676 | 357 "active":"<bool> = True" |
358 } | |
359 | |
360 OUTPUT:: | |
361 | |
362 result: { | |
363 "id": "<newusersgroupid>", | |
1928 | 364 "msg": "created new users group <groupname>" |
1676 | 365 } |
366 error: null | |
367 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
368 |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
369 add_user_to_users_group |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
370 ----------------------- |
1676 | 371 |
2077 | 372 Adds a user to a users group. If user exists in that group success will be |
373 `false`. This command can be executed only using api_key | |
1676 | 374 belonging to user with admin rights |
375 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
376 |
1676 | 377 INPUT:: |
378 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
379 id : <id_for_response> |
1676 | 380 api_key : "<api_key>" |
381 method : "add_user_users_group" | |
382 args: { | |
383 "group_name" : "<groupname>", | |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
384 "username" : "<username>" |
1676 | 385 } |
386 | |
387 OUTPUT:: | |
388 | |
389 result: { | |
390 "id": "<newusersgroupmemberid>", | |
2077 | 391 "success": True|False # depends on if member is in group |
392 "msg": "added member <username> to users group <groupname> | | |
393 User is already in that group" | |
394 } | |
395 error: null | |
396 | |
397 | |
398 remove_user_from_users_group | |
399 ---------------------------- | |
400 | |
401 Removes a user from a users group. If user is not in given group success will | |
402 be `false`. This command can be executed only | |
403 using api_key belonging to user with admin rights | |
404 | |
405 | |
406 INPUT:: | |
407 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
408 id : <id_for_response> |
2077 | 409 api_key : "<api_key>" |
410 method : "remove_user_from_users_group" | |
411 args: { | |
412 "group_name" : "<groupname>", | |
413 "username" : "<username>" | |
414 } | |
415 | |
416 OUTPUT:: | |
417 | |
418 result: { | |
419 "success": True|False, # depends on if member is in group | |
420 "msg": "removed member <username> from users group <groupname> | | |
421 User wasn't in group" | |
1676 | 422 } |
423 error: null | |
424 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
425 |
1928 | 426 get_repo |
427 -------- | |
428 | |
2244 | 429 Gets an existing repository by it's name or repository_id. Members will return |
430 either users_group or user associated to that repository. This command can | |
2098
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2097
diff
changeset
|
431 be executed only using api_key belonging to user with admin rights. |
1928 | 432 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
433 |
1928 | 434 INPUT:: |
435 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
436 id : <id_for_response> |
1928 | 437 api_key : "<api_key>" |
438 method : "get_repo" | |
439 args: { | |
2098
14dffcfebb02
API get_user and get_repo methods can fetch by id or names
Marcin Kuzminski <marcin@python-works.com>
parents:
2097
diff
changeset
|
440 "repoid" : "<reponame or repo_id>" |
1928 | 441 } |
442 | |
443 OUTPUT:: | |
444 | |
445 result: None if repository does not exist or | |
446 { | |
447 "id" : "<id>", | |
448 "repo_name" : "<reponame>" | |
449 "type" : "<type>", | |
450 "description" : "<description>", | |
2440
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
451 "clone_uri" : "<clone_uri>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
452 "private": : "<bool>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
453 "created_on" : "<datetimecreated>", |
1928 | 454 "members" : [ |
2244 | 455 { |
456 "type": "user", | |
457 "id" : "<userid>", | |
1928 | 458 "username" : "<username>", |
459 "firstname": "<firstname>", | |
460 "lastname" : "<lastname>", | |
461 "email" : "<email>", | |
462 "active" : "<bool>", | |
463 "admin" :Â "<bool>", | |
464 "ldap" : "<ldap_dn>", | |
465 "permission" : "repository.(read|write|admin)" | |
466 }, | |
467 … | |
2244 | 468 { |
469 "type": "users_group", | |
1928 | 470 "id" : "<usersgroupid>", |
471 "name" : "<usersgroupname>", | |
472 "active": "<bool>", | |
473 "permission" : "repository.(read|write|admin)" | |
474 }, | |
475 … | |
476 ] | |
477 } | |
478 error: null | |
479 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
480 |
1676 | 481 get_repos |
482 --------- | |
483 | |
484 Lists all existing repositories. This command can be executed only using api_key | |
485 belonging to user with admin rights | |
486 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
487 |
1676 | 488 INPUT:: |
489 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
490 id : <id_for_response> |
1676 | 491 api_key : "<api_key>" |
492 method : "get_repos" | |
493 args: { } | |
1580 | 494 |
495 OUTPUT:: | |
496 | |
1676 | 497 result: [ |
498 { | |
499 "id" : "<id>", | |
1928 | 500 "repo_name" : "<reponame>" |
1676 | 501 "type" : "<type>", |
2440
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
502 "description" : "<description>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
503 "clone_uri" : "<clone_uri>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
504 "private": : "<bool>", |
347b00545b60
Updated API to return clone_uri, private, created_on
Marcin Kuzminski <marcin@python-works.com>
parents:
2249
diff
changeset
|
505 "created_on" : "<datetimecreated>", |
1676 | 506 }, |
507 … | |
508 ] | |
509 error: null | |
510 | |
511 | |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
512 get_repo_nodes |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
513 -------------- |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
514 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
515 returns a list of nodes and it's children in a flat list for a given path |
1928 | 516 at given revision. It's possible to specify ret_type to show only `files` or |
517 `dirs`. This command can be executed only using api_key belonging to user | |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
518 with admin rights |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
519 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
520 |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
521 INPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
522 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
523 id : <id_for_response> |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
524 api_key : "<api_key>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
525 method : "get_repo_nodes" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
526 args: { |
1928 | 527 "repo_name" : "<reponame>", |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
528 "revision" : "<revision>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
529 "root_path" : "<root_path>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
530 "ret_type" : "<ret_type>" = 'all' |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
531 } |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
532 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
533 OUTPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
534 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
535 result: [ |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
536 { |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
537 "name" : "<name>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
538 "type" : "<type>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
539 }, |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
540 … |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
541 ] |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
542 error: null |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
543 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
544 |
1676 | 545 create_repo |
546 ----------- | |
547 | |
548 Creates a repository. This command can be executed only using api_key | |
549 belonging to user with admin rights. | |
550 If repository name contains "/", all needed repository groups will be created. | |
551 For example "foo/bar/baz" will create groups "foo", "bar" (with "foo" as parent), | |
552 and create "baz" repository with "bar" as group. | |
553 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
554 |
1676 | 555 INPUT:: |
556 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
557 id : <id_for_response> |
1676 | 558 api_key : "<api_key>" |
559 method : "create_repo" | |
560 args: { | |
1928 | 561 "repo_name" : "<reponame>", |
1676 | 562 "owner_name" : "<ownername>", |
563 "description" : "<description> = ''", | |
564 "repo_type" : "<type> = 'hg'", | |
2094
34d009e5147a
added clone_uri to API method for creating users
Marcin Kuzminski <marcin@python-works.com>
parents:
2091
diff
changeset
|
565 "private" : "<bool> = False", |
34d009e5147a
added clone_uri to API method for creating users
Marcin Kuzminski <marcin@python-works.com>
parents:
2091
diff
changeset
|
566 "clone_uri" : "<clone_uri> = None", |
1676 | 567 } |
568 | |
569 OUTPUT:: | |
570 | |
1928 | 571 result: { |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
572 "id": "<newrepoid>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
573 "msg": "Created new repository <reponame>", |
1928 | 574 } |
1676 | 575 error: null |
576 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
577 |
2091
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
578 delete_repo |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
579 ----------- |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
580 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
581 Deletes a repository. This command can be executed only using api_key |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
582 belonging to user with admin rights. |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
583 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
584 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
585 INPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
586 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
587 id : <id_for_response> |
2091
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
588 api_key : "<api_key>" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
589 method : "delete_repo" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
590 args: { |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
591 "repo_name" : "<reponame>", |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
592 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
593 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
594 OUTPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
595 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
596 result: { |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
597 "msg": "Deleted repository <reponame>", |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
598 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
599 error: null |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
600 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2090
diff
changeset
|
601 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
602 grant_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
603 --------------------- |
1676 | 604 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
605 Grant permission for user on given repository, or update existing one |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
606 if found. This command can be executed only using api_key belonging to user |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
607 with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
608 |
1676 | 609 |
610 INPUT:: | |
611 | |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
612 id : <id_for_response> |
1676 | 613 api_key : "<api_key>" |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
614 method : "grant_user_permission" |
1676 | 615 args: { |
616 "repo_name" : "<reponame>", | |
1928 | 617 "username" : "<username>", |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
618 "perm" : "(repository.(none|read|write|admin))", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
619 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
620 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
621 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
622 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
623 result: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
624 "msg" : "Granted perm: <perm> for user: <username> in repo: <reponame>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
625 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
626 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
627 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
628 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
629 revoke_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
630 ---------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
631 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
632 Revoke permission for user on given repository. This command can be executed |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
633 only using api_key belonging to user with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
634 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
635 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
636 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
637 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
638 id : <id_for_response> |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
639 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
640 method : "revoke_user_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
641 args: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
642 "repo_name" : "<reponame>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
643 "username" : "<username>", |
1676 | 644 } |
645 | |
646 OUTPUT:: | |
647 | |
1928 | 648 result: { |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
649 "msg" : "Revoked perm for user: <suername> in repo: <reponame>" |
1928 | 650 } |
1676 | 651 error: null |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
652 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
653 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
654 grant_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
655 ---------------------------- |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
656 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
657 Grant permission for users group on given repository, or update |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
658 existing one if found. This command can be executed only using |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
659 api_key belonging to user with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
660 |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
661 |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
662 INPUT:: |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
663 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
664 id : <id_for_response> |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
665 api_key : "<api_key>" |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
666 method : "grant_users_group_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
667 args: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
668 "repo_name" : "<reponame>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
669 "group_name" : "<usersgroupname>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
670 "perm" : "(repository.(none|read|write|admin))", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
671 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
672 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
673 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
674 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
675 result: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
676 "msg" : "Granted perm: <perm> for group: <usersgroupname> in repo: <reponame>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
677 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
678 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
679 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
680 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
681 revoke_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
682 ----------------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
683 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
684 Revoke permission for users group on given repository.This command can be |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
685 executed only using api_key belonging to user with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
686 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
687 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
688 |
2241
c1f1f0661090
API docs improvement.
Marcin Kuzminski <marcin@python-works.com>
parents:
2191
diff
changeset
|
689 id : <id_for_response> |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
690 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
691 method : "revoke_users_group_permission" |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
692 args: { |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
693 "repo_name" : "<reponame>", |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
694 "users_group" : "<usersgroupname>", |
1928 | 695 } |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
696 |
1928 | 697 OUTPUT:: |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
698 |
1928 | 699 result: { |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
700 "msg" : "Revoked perm for group: <usersgroupname> in repo: <reponame>" |
1928 | 701 } |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
702 error: null |