Mercurial > public > src > rhodecode
annotate docs/api/api.rst @ 2077:0f87c784756e beta
API changes
- added removed_user_from_users_group function
- fixed errors on wrong username
- normalized add/remove members from groups functions
- docs updates
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 14 Feb 2012 23:02:23 +0200 |
parents | 87f0800abc7b |
children | bdc0ad168006 |
rev | line source |
---|---|
1526 | 1 .. _api: |
2 | |
3 | |
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 { |
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
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 { |
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
53 "id":<id>, |
1676 | 54 "result": "<result>", |
1526 | 55 "error": null |
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 | |
1676 | 75 api_key : "<api_key>" |
76 method : "pull" | |
77 args : { | |
1928 | 78 "repo_name" : "<reponame>" |
1676 | 79 } |
80 | |
81 OUTPUT:: | |
82 | |
1928 | 83 result : "Pulled from <reponame>" |
1676 | 84 error : null |
85 | |
86 | |
1928 | 87 get_user |
88 -------- | |
89 | |
90 Get's an user by username, Returns empty result if user is not found. | |
91 This command can be executed only using api_key belonging to user with admin | |
92 rights. | |
93 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
94 |
1928 | 95 INPUT:: |
96 | |
97 api_key : "<api_key>" | |
98 method : "get_user" | |
99 args : { | |
100 "username" : "<username>" | |
101 } | |
102 | |
103 OUTPUT:: | |
104 | |
105 result: None if user does not exist or | |
106 { | |
107 "id" : "<id>", | |
108 "username" : "<username>", | |
109 "firstname": "<firstname>", | |
110 "lastname" : "<lastname>", | |
111 "email" : "<email>", | |
112 "active" : "<bool>", | |
113 "admin" :Â "<bool>", | |
114 "ldap" : "<ldap_dn>" | |
115 } | |
116 | |
117 error: null | |
118 | |
119 | |
1676 | 120 get_users |
121 --------- | |
122 | |
123 Lists all existing users. This command can be executed only using api_key | |
124 belonging to user with admin rights. | |
125 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
126 |
1676 | 127 INPUT:: |
128 | |
129 api_key : "<api_key>" | |
130 method : "get_users" | |
131 args : { } | |
132 | |
133 OUTPUT:: | |
134 | |
135 result: [ | |
136 { | |
137 "id" : "<id>", | |
138 "username" : "<username>", | |
139 "firstname": "<firstname>", | |
140 "lastname" : "<lastname>", | |
141 "email" : "<email>", | |
142 "active" : "<bool>", | |
143 "admin" :Â "<bool>", | |
144 "ldap" : "<ldap_dn>" | |
145 }, | |
146 … | |
147 ] | |
148 error: null | |
149 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
150 |
1676 | 151 create_user |
152 ----------- | |
153 | |
1994
f2bd5b0c1094
create user api_doc update
Marcin Kuzminski <marcin@python-works.com>
parents:
1928
diff
changeset
|
154 Creates new user or updates current one if such user exists. This command can |
f2bd5b0c1094
create user api_doc update
Marcin Kuzminski <marcin@python-works.com>
parents:
1928
diff
changeset
|
155 be executed only using api_key belonging to user with admin rights. |
1676 | 156 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
157 |
1676 | 158 INPUT:: |
159 | |
160 api_key : "<api_key>" | |
161 method : "create_user" | |
162 args : { | |
163 "username" : "<username>", | |
164 "password" : "<password>", | |
2036
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1996
diff
changeset
|
165 "email" : "<useremail>", |
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1996
diff
changeset
|
166 "firstname" : "<firstname> = None", |
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1996
diff
changeset
|
167 "lastname" : "<lastname> = None", |
1676 | 168 "active" : "<bool> = True", |
169 "admin" : "<bool> = False", | |
170 "ldap_dn" : "<ldap_dn> = None" | |
171 } | |
1580 | 172 |
173 OUTPUT:: | |
174 | |
1676 | 175 result: { |
1928 | 176 "id" : "<new_user_id>", |
1676 | 177 "msg" : "created new user <username>" |
178 } | |
179 error: null | |
180 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
181 |
1676 | 182 get_users_group |
183 --------------- | |
184 | |
185 Gets an existing users group. This command can be executed only using api_key | |
186 belonging to user with admin rights. | |
187 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
188 |
1676 | 189 INPUT:: |
190 | |
191 api_key : "<api_key>" | |
192 method : "get_users_group" | |
193 args : { | |
194 "group_name" : "<name>" | |
195 } | |
196 | |
197 OUTPUT:: | |
198 | |
199 result : None if group not exist | |
200 { | |
1928 | 201 "id" : "<id>", |
202 "group_name" : "<groupname>", | |
203 "active": "<bool>", | |
1676 | 204 "members" : [ |
1928 | 205 { "id" : "<userid>", |
206 "username" : "<username>", | |
207 "firstname": "<firstname>", | |
208 "lastname" : "<lastname>", | |
209 "email" : "<email>", | |
210 "active" : "<bool>", | |
211 "admin" :Â "<bool>", | |
212 "ldap" : "<ldap_dn>" | |
213 }, | |
214 … | |
215 ] | |
1676 | 216 } |
217 error : null | |
218 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
219 |
1928 | 220 get_users_groups |
221 ---------------- | |
222 | |
223 Lists all existing users groups. This command can be executed only using | |
224 api_key belonging to user with admin rights. | |
225 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
226 |
1928 | 227 INPUT:: |
228 | |
229 api_key : "<api_key>" | |
230 method : "get_users_groups" | |
231 args : { } | |
232 | |
233 OUTPUT:: | |
234 | |
235 result : [ | |
236 { | |
237 "id" : "<id>", | |
238 "group_name" : "<groupname>", | |
239 "active": "<bool>", | |
240 "members" : [ | |
241 { | |
242 "id" : "<userid>", | |
243 "username" : "<username>", | |
244 "firstname": "<firstname>", | |
245 "lastname" : "<lastname>", | |
246 "email" : "<email>", | |
247 "active" : "<bool>", | |
248 "admin" :Â "<bool>", | |
249 "ldap" : "<ldap_dn>" | |
250 }, | |
251 … | |
252 ] | |
253 } | |
254 ] | |
255 error : null | |
256 | |
257 | |
1580 | 258 create_users_group |
259 ------------------ | |
260 | |
1676 | 261 Creates new users group. This command can be executed only using api_key |
1580 | 262 belonging to user with admin rights |
263 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
264 |
1580 | 265 INPUT:: |
266 | |
1676 | 267 api_key : "<api_key>" |
268 method : "create_users_group" | |
269 args: { | |
1928 | 270 "group_name": "<groupname>", |
1676 | 271 "active":"<bool> = True" |
272 } | |
273 | |
274 OUTPUT:: | |
275 | |
276 result: { | |
277 "id": "<newusersgroupid>", | |
1928 | 278 "msg": "created new users group <groupname>" |
1676 | 279 } |
280 error: null | |
281 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
282 |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
283 add_user_to_users_group |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
284 ----------------------- |
1676 | 285 |
2077 | 286 Adds a user to a users group. If user exists in that group success will be |
287 `false`. This command can be executed only using api_key | |
1676 | 288 belonging to user with admin rights |
289 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
290 |
1676 | 291 INPUT:: |
292 | |
293 api_key : "<api_key>" | |
294 method : "add_user_users_group" | |
295 args: { | |
296 "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
|
297 "username" : "<username>" |
1676 | 298 } |
299 | |
300 OUTPUT:: | |
301 | |
302 result: { | |
303 "id": "<newusersgroupmemberid>", | |
2077 | 304 "success": True|False # depends on if member is in group |
305 "msg": "added member <username> to users group <groupname> | | |
306 User is already in that group" | |
307 } | |
308 error: null | |
309 | |
310 | |
311 remove_user_from_users_group | |
312 ---------------------------- | |
313 | |
314 Removes a user from a users group. If user is not in given group success will | |
315 be `false`. This command can be executed only | |
316 using api_key belonging to user with admin rights | |
317 | |
318 | |
319 INPUT:: | |
320 | |
321 api_key : "<api_key>" | |
322 method : "remove_user_from_users_group" | |
323 args: { | |
324 "group_name" : "<groupname>", | |
325 "username" : "<username>" | |
326 } | |
327 | |
328 OUTPUT:: | |
329 | |
330 result: { | |
331 "success": True|False, # depends on if member is in group | |
332 "msg": "removed member <username> from users group <groupname> | | |
333 User wasn't in group" | |
1676 | 334 } |
335 error: null | |
336 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
337 |
1928 | 338 get_repo |
339 -------- | |
340 | |
341 Gets an existing repository. This command can be executed only using api_key | |
342 belonging to user with admin rights | |
343 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
344 |
1928 | 345 INPUT:: |
346 | |
347 api_key : "<api_key>" | |
348 method : "get_repo" | |
349 args: { | |
350 "repo_name" : "<reponame>" | |
351 } | |
352 | |
353 OUTPUT:: | |
354 | |
355 result: None if repository does not exist or | |
356 { | |
357 "id" : "<id>", | |
358 "repo_name" : "<reponame>" | |
359 "type" : "<type>", | |
360 "description" : "<description>", | |
361 "members" : [ | |
362 { "id" : "<userid>", | |
363 "username" : "<username>", | |
364 "firstname": "<firstname>", | |
365 "lastname" : "<lastname>", | |
366 "email" : "<email>", | |
367 "active" : "<bool>", | |
368 "admin" :Â "<bool>", | |
369 "ldap" : "<ldap_dn>", | |
370 "permission" : "repository.(read|write|admin)" | |
371 }, | |
372 … | |
373 { | |
374 "id" : "<usersgroupid>", | |
375 "name" : "<usersgroupname>", | |
376 "active": "<bool>", | |
377 "permission" : "repository.(read|write|admin)" | |
378 }, | |
379 … | |
380 ] | |
381 } | |
382 error: null | |
383 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
384 |
1676 | 385 get_repos |
386 --------- | |
387 | |
388 Lists all existing repositories. This command can be executed only using api_key | |
389 belonging to user with admin rights | |
390 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
391 |
1676 | 392 INPUT:: |
393 | |
394 api_key : "<api_key>" | |
395 method : "get_repos" | |
396 args: { } | |
1580 | 397 |
398 OUTPUT:: | |
399 | |
1676 | 400 result: [ |
401 { | |
402 "id" : "<id>", | |
1928 | 403 "repo_name" : "<reponame>" |
1676 | 404 "type" : "<type>", |
405 "description" : "<description>" | |
406 }, | |
407 … | |
408 ] | |
409 error: null | |
410 | |
411 | |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
412 get_repo_nodes |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
413 -------------- |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
414 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
415 returns a list of nodes and it's children in a flat list for a given path |
1928 | 416 at given revision. It's possible to specify ret_type to show only `files` or |
417 `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
|
418 with admin rights |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
419 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
420 |
1895
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
421 INPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
422 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
423 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
|
424 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
|
425 args: { |
1928 | 426 "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
|
427 "revision" : "<revision>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
428 "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
|
429 "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
|
430 } |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
431 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
432 OUTPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
433 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
434 result: [ |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
435 { |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
436 "name" : "<name>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
437 "type" : "<type>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
438 }, |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
439 … |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
440 ] |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
441 error: null |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
442 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1878
diff
changeset
|
443 |
1676 | 444 create_repo |
445 ----------- | |
446 | |
447 Creates a repository. This command can be executed only using api_key | |
448 belonging to user with admin rights. | |
449 If repository name contains "/", all needed repository groups will be created. | |
450 For example "foo/bar/baz" will create groups "foo", "bar" (with "foo" as parent), | |
451 and create "baz" repository with "bar" as group. | |
452 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
453 |
1676 | 454 INPUT:: |
455 | |
456 api_key : "<api_key>" | |
457 method : "create_repo" | |
458 args: { | |
1928 | 459 "repo_name" : "<reponame>", |
1676 | 460 "owner_name" : "<ownername>", |
461 "description" : "<description> = ''", | |
462 "repo_type" : "<type> = 'hg'", | |
463 "private" : "<bool> = False" | |
464 } | |
465 | |
466 OUTPUT:: | |
467 | |
1928 | 468 result: { |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
469 "id": "<newrepoid>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
470 "msg": "Created new repository <reponame>", |
1928 | 471 } |
1676 | 472 error: null |
473 | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
474 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
475 grant_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
476 --------------------- |
1676 | 477 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
478 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
|
479 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
|
480 with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
481 |
1676 | 482 |
483 INPUT:: | |
484 | |
485 api_key : "<api_key>" | |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
486 method : "grant_user_permission" |
1676 | 487 args: { |
488 "repo_name" : "<reponame>", | |
1928 | 489 "username" : "<username>", |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
490 "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
|
491 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
492 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
493 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
494 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
495 result: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
496 "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
|
497 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
498 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
499 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
500 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
501 revoke_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
502 ---------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
503 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
504 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
|
505 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
|
506 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
507 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
508 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
509 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
510 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
511 method : "revoke_user_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
512 args: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
513 "repo_name" : "<reponame>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
514 "username" : "<username>", |
1676 | 515 } |
516 | |
517 OUTPUT:: | |
518 | |
1928 | 519 result: { |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
520 "msg" : "Revoked perm for user: <suername> in repo: <reponame>" |
1928 | 521 } |
1676 | 522 error: null |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
523 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
524 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
525 grant_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
526 ---------------------------- |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
527 |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
528 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
|
529 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
|
530 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
|
531 |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
532 |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
533 INPUT:: |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
534 |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
535 api_key : "<api_key>" |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
536 method : "grant_users_group_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
537 args: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
538 "repo_name" : "<reponame>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
539 "group_name" : "<usersgroupname>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
540 "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
|
541 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
542 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
543 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
544 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
545 result: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
546 "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
|
547 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
548 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
549 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
550 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
551 revoke_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
552 ----------------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
553 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
554 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
|
555 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
|
556 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
557 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
558 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
559 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
560 method : "revoke_users_group_permission" |
1878
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
561 args: { |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
562 "repo_name" : "<reponame>", |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
563 "users_group" : "<usersgroupname>", |
1928 | 564 } |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
565 |
1928 | 566 OUTPUT:: |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
567 |
1928 | 568 result: { |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
569 "msg" : "Revoked perm for group: <usersgroupname> in repo: <reponame>" |
1928 | 570 } |
2070
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
2036
diff
changeset
|
571 error: null |