Mercurial > kallithea
annotate docs/api/api.rst @ 2009:b63adad7c4af beta
API updates
- update_user will do lookup by userid param that can be id or username
- all params are required for update_user api call
- get_user/s will return ldap_dn param which is more correct
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 21 Feb 2012 02:35:43 +0200 |
parents | 34d009e5147a |
children | 14dffcfebb02 |
rev | line source |
---|---|
1446 | 1 .. _api: |
2 | |
3 | |
4 API | |
5 === | |
6 | |
7 | |
8 Starting from RhodeCode version 1.2 a simple API was implemented. | |
1500 | 9 There's a single schema for calling all api methods. API is implemented |
1592 | 10 with JSON protocol both ways. An url to send API request in RhodeCode is |
1500 | 11 <your_server>/_admin/api |
1446 | 12 |
1839 | 13 API ACCESS FOR WEB VIEWS |
14 ++++++++++++++++++++++++ | |
1446 | 15 |
1911 | 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 | |
1812
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1810
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:
1810
diff
changeset
|
22 |
320dec24fb9a
Added instruction on enabling the API access to web views
Marcin Kuzminski <marcin@python-works.com>
parents:
1810
diff
changeset
|
23 |
1839 | 24 API ACCESS |
25 ++++++++++ | |
26 | |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
27 All clients are required to send JSON-RPC spec JSON data:: |
1446 | 28 |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
29 { |
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
30 "id:<id>, |
1446 | 31 "api_key":"<api_key>", |
32 "method":"<method_name>", | |
33 "args":{"<arg_key>":"<arg_val>"} | |
34 } | |
35 | |
1500 | 36 Example call for autopulling remotes repos using curl:: |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
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"}}' |
1500 | 38 |
1592 | 39 Simply provide |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
40 - *id* A value of any type, which is used to match the response with the request that it is replying to. |
1500 | 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 | |
1592 | 44 |
1446 | 45 .. note:: |
1592 | 46 |
47 api_key can be found in your user account page | |
48 | |
49 | |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
50 RhodeCode API will return always a JSON-RPC response:: |
1592 | 51 |
1708
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
52 { |
fee9895fa46e
changed API to match fully JSON-RPC specs
Marcin Kuzminski <marcin@python-works.com>
parents:
1592
diff
changeset
|
53 "id":<id>, |
1592 | 54 "result": "<result>", |
1446 | 55 "error": null |
56 } | |
57 | |
58 All responses from API will be `HTTP/1.0 200 OK`, if there's an error while | |
1592 | 59 calling api *error* key from response will contain failure description |
1446 | 60 and result will be null. |
61 | |
62 API METHODS | |
63 +++++++++++ | |
64 | |
1592 | 65 |
1446 | 66 pull |
67 ---- | |
68 | |
1592 | 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 | |
1500 | 71 belonging to user with admin rights |
72 | |
73 INPUT:: | |
74 | |
1592 | 75 api_key : "<api_key>" |
76 method : "pull" | |
77 args : { | |
1843 | 78 "repo_name" : "<reponame>" |
1592 | 79 } |
80 | |
81 OUTPUT:: | |
82 | |
1843 | 83 result : "Pulled from <reponame>" |
1592 | 84 error : null |
85 | |
86 | |
1843 | 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 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
94 |
1843 | 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>", | |
2009 | 114 "ldap_dn" : "<ldap_dn>" |
1843 | 115 } |
116 | |
117 error: null | |
118 | |
119 | |
1592 | 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 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
126 |
1592 | 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>", | |
2009 | 144 "ldap_dn" : "<ldap_dn>" |
1592 | 145 }, |
146 … | |
147 ] | |
148 error: null | |
149 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
150 |
1592 | 151 create_user |
152 ----------- | |
153 | |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
154 Creates new user. This command can |
1909
f2bd5b0c1094
create user api_doc update
Marcin Kuzminski <marcin@python-works.com>
parents:
1843
diff
changeset
|
155 be executed only using api_key belonging to user with admin rights. |
1592 | 156 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
157 |
1592 | 158 INPUT:: |
159 | |
160 api_key : "<api_key>" | |
161 method : "create_user" | |
162 args : { | |
163 "username" : "<username>", | |
164 "password" : "<password>", | |
1950
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1911
diff
changeset
|
165 "email" : "<useremail>", |
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1911
diff
changeset
|
166 "firstname" : "<firstname> = None", |
4ae17f819ee8
#344 optional firstname lastname on user creation
Marcin Kuzminski <marcin@python-works.com>
parents:
1911
diff
changeset
|
167 "lastname" : "<lastname> = None", |
1592 | 168 "active" : "<bool> = True", |
169 "admin" : "<bool> = False", | |
170 "ldap_dn" : "<ldap_dn> = None" | |
171 } | |
1500 | 172 |
173 OUTPUT:: | |
174 | |
1592 | 175 result: { |
1843 | 176 "id" : "<new_user_id>", |
1592 | 177 "msg" : "created new user <username>" |
178 } | |
179 error: null | |
180 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
181 |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
182 update_user |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
183 ----------- |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
184 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
185 updates current one if such user exists. This command can |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
186 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:
1989
diff
changeset
|
187 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
188 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
189 INPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
190 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
191 api_key : "<api_key>" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
192 method : "update_user" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
193 args : { |
2009 | 194 "userid" : "<user_id or username>", |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
195 "username" : "<username>", |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
196 "password" : "<password>", |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
197 "email" : "<useremail>", |
2009 | 198 "firstname" : "<firstname>", |
199 "lastname" : "<lastname>", | |
200 "active" : "<bool>", | |
201 "admin" : "<bool>", | |
202 "ldap_dn" : "<ldap_dn>" | |
2002
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
203 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
204 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
205 OUTPUT:: |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
206 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
207 result: { |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
208 "id" : "<edited_user_id>", |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
209 "msg" : "updated user <username>" |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
210 } |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
211 error: null |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
212 |
bdc0ad168006
API added explicit method for updating user account
Marcin Kuzminski <marcin@python-works.com>
parents:
1989
diff
changeset
|
213 |
1592 | 214 get_users_group |
215 --------------- | |
216 | |
217 Gets an existing users group. This command can be executed only using api_key | |
218 belonging to user with admin rights. | |
219 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
220 |
1592 | 221 INPUT:: |
222 | |
223 api_key : "<api_key>" | |
224 method : "get_users_group" | |
225 args : { | |
226 "group_name" : "<name>" | |
227 } | |
228 | |
229 OUTPUT:: | |
230 | |
231 result : None if group not exist | |
232 { | |
1843 | 233 "id" : "<id>", |
234 "group_name" : "<groupname>", | |
235 "active": "<bool>", | |
1592 | 236 "members" : [ |
1843 | 237 { "id" : "<userid>", |
238 "username" : "<username>", | |
239 "firstname": "<firstname>", | |
240 "lastname" : "<lastname>", | |
241 "email" : "<email>", | |
242 "active" : "<bool>", | |
243 "admin" :Â "<bool>", | |
244 "ldap" : "<ldap_dn>" | |
245 }, | |
246 … | |
247 ] | |
1592 | 248 } |
249 error : null | |
250 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
251 |
1843 | 252 get_users_groups |
253 ---------------- | |
254 | |
255 Lists all existing users groups. This command can be executed only using | |
256 api_key belonging to user with admin rights. | |
257 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
258 |
1843 | 259 INPUT:: |
260 | |
261 api_key : "<api_key>" | |
262 method : "get_users_groups" | |
263 args : { } | |
264 | |
265 OUTPUT:: | |
266 | |
267 result : [ | |
268 { | |
269 "id" : "<id>", | |
270 "group_name" : "<groupname>", | |
271 "active": "<bool>", | |
272 "members" : [ | |
273 { | |
274 "id" : "<userid>", | |
275 "username" : "<username>", | |
276 "firstname": "<firstname>", | |
277 "lastname" : "<lastname>", | |
278 "email" : "<email>", | |
279 "active" : "<bool>", | |
280 "admin" :Â "<bool>", | |
281 "ldap" : "<ldap_dn>" | |
282 }, | |
283 … | |
284 ] | |
285 } | |
286 ] | |
287 error : null | |
288 | |
289 | |
1500 | 290 create_users_group |
291 ------------------ | |
292 | |
1592 | 293 Creates new users group. This command can be executed only using api_key |
1500 | 294 belonging to user with admin rights |
295 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
296 |
1500 | 297 INPUT:: |
298 | |
1592 | 299 api_key : "<api_key>" |
300 method : "create_users_group" | |
301 args: { | |
1843 | 302 "group_name": "<groupname>", |
1592 | 303 "active":"<bool> = True" |
304 } | |
305 | |
306 OUTPUT:: | |
307 | |
308 result: { | |
309 "id": "<newusersgroupid>", | |
1843 | 310 "msg": "created new users group <groupname>" |
1592 | 311 } |
312 error: null | |
313 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
314 |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
315 add_user_to_users_group |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
316 ----------------------- |
1592 | 317 |
1989 | 318 Adds a user to a users group. If user exists in that group success will be |
319 `false`. This command can be executed only using api_key | |
1592 | 320 belonging to user with admin rights |
321 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
322 |
1592 | 323 INPUT:: |
324 | |
325 api_key : "<api_key>" | |
326 method : "add_user_users_group" | |
327 args: { | |
328 "group_name" : "<groupname>", | |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
329 "username" : "<username>" |
1592 | 330 } |
331 | |
332 OUTPUT:: | |
333 | |
334 result: { | |
335 "id": "<newusersgroupmemberid>", | |
1989 | 336 "success": True|False # depends on if member is in group |
337 "msg": "added member <username> to users group <groupname> | | |
338 User is already in that group" | |
339 } | |
340 error: null | |
341 | |
342 | |
343 remove_user_from_users_group | |
344 ---------------------------- | |
345 | |
346 Removes a user from a users group. If user is not in given group success will | |
347 be `false`. This command can be executed only | |
348 using api_key belonging to user with admin rights | |
349 | |
350 | |
351 INPUT:: | |
352 | |
353 api_key : "<api_key>" | |
354 method : "remove_user_from_users_group" | |
355 args: { | |
356 "group_name" : "<groupname>", | |
357 "username" : "<username>" | |
358 } | |
359 | |
360 OUTPUT:: | |
361 | |
362 result: { | |
363 "success": True|False, # depends on if member is in group | |
364 "msg": "removed member <username> from users group <groupname> | | |
365 User wasn't in group" | |
1592 | 366 } |
367 error: null | |
368 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
369 |
1843 | 370 get_repo |
371 -------- | |
372 | |
373 Gets an existing repository. This command can be executed only using api_key | |
374 belonging to user with admin rights | |
375 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
376 |
1843 | 377 INPUT:: |
378 | |
379 api_key : "<api_key>" | |
380 method : "get_repo" | |
381 args: { | |
382 "repo_name" : "<reponame>" | |
383 } | |
384 | |
385 OUTPUT:: | |
386 | |
387 result: None if repository does not exist or | |
388 { | |
389 "id" : "<id>", | |
390 "repo_name" : "<reponame>" | |
391 "type" : "<type>", | |
392 "description" : "<description>", | |
393 "members" : [ | |
394 { "id" : "<userid>", | |
395 "username" : "<username>", | |
396 "firstname": "<firstname>", | |
397 "lastname" : "<lastname>", | |
398 "email" : "<email>", | |
399 "active" : "<bool>", | |
400 "admin" :Â "<bool>", | |
401 "ldap" : "<ldap_dn>", | |
402 "permission" : "repository.(read|write|admin)" | |
403 }, | |
404 … | |
405 { | |
406 "id" : "<usersgroupid>", | |
407 "name" : "<usersgroupname>", | |
408 "active": "<bool>", | |
409 "permission" : "repository.(read|write|admin)" | |
410 }, | |
411 … | |
412 ] | |
413 } | |
414 error: null | |
415 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
416 |
1592 | 417 get_repos |
418 --------- | |
419 | |
420 Lists all existing repositories. This command can be executed only using api_key | |
421 belonging to user with admin rights | |
422 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
423 |
1592 | 424 INPUT:: |
425 | |
426 api_key : "<api_key>" | |
427 method : "get_repos" | |
428 args: { } | |
1500 | 429 |
430 OUTPUT:: | |
431 | |
1592 | 432 result: [ |
433 { | |
434 "id" : "<id>", | |
1843 | 435 "repo_name" : "<reponame>" |
1592 | 436 "type" : "<type>", |
437 "description" : "<description>" | |
438 }, | |
439 … | |
440 ] | |
441 error: null | |
442 | |
443 | |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
444 get_repo_nodes |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
445 -------------- |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
446 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
447 returns a list of nodes and it's children in a flat list for a given path |
1843 | 448 at given revision. It's possible to specify ret_type to show only `files` or |
449 `dirs`. This command can be executed only using api_key belonging to user | |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
450 with admin rights |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
451 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
452 |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
453 INPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
454 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
455 api_key : "<api_key>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
456 method : "get_repo_nodes" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
457 args: { |
1843 | 458 "repo_name" : "<reponame>", |
1810
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
459 "revision" : "<revision>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
460 "root_path" : "<root_path>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
461 "ret_type" : "<ret_type>" = 'all' |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
462 } |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
463 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
464 OUTPUT:: |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
465 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
466 result: [ |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
467 { |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
468 "name" : "<name>" |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
469 "type" : "<type>", |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
470 }, |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
471 … |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
472 ] |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
473 error: null |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
474 |
203af05539e0
implements #330 api method for listing nodes at particular revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1793
diff
changeset
|
475 |
1592 | 476 create_repo |
477 ----------- | |
478 | |
479 Creates a repository. This command can be executed only using api_key | |
480 belonging to user with admin rights. | |
481 If repository name contains "/", all needed repository groups will be created. | |
482 For example "foo/bar/baz" will create groups "foo", "bar" (with "foo" as parent), | |
483 and create "baz" repository with "bar" as group. | |
484 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
485 |
1592 | 486 INPUT:: |
487 | |
488 api_key : "<api_key>" | |
489 method : "create_repo" | |
490 args: { | |
1843 | 491 "repo_name" : "<reponame>", |
1592 | 492 "owner_name" : "<ownername>", |
493 "description" : "<description> = ''", | |
494 "repo_type" : "<type> = 'hg'", | |
2006
34d009e5147a
added clone_uri to API method for creating users
Marcin Kuzminski <marcin@python-works.com>
parents:
2003
diff
changeset
|
495 "private" : "<bool> = False", |
34d009e5147a
added clone_uri to API method for creating users
Marcin Kuzminski <marcin@python-works.com>
parents:
2003
diff
changeset
|
496 "clone_uri" : "<clone_uri> = None", |
1592 | 497 } |
498 | |
499 OUTPUT:: | |
500 | |
1843 | 501 result: { |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
502 "id": "<newrepoid>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
503 "msg": "Created new repository <reponame>", |
1843 | 504 } |
1592 | 505 error: null |
506 | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
507 |
2003
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
508 delete_repo |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
509 ----------- |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
510 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
511 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:
2002
diff
changeset
|
512 belonging to user with admin rights. |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
513 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
514 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
515 INPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
516 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
517 api_key : "<api_key>" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
518 method : "delete_repo" |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
519 args: { |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
520 "repo_name" : "<reponame>", |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
521 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
522 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
523 OUTPUT:: |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
524 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
525 result: { |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
526 "msg": "Deleted repository <reponame>", |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
527 } |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
528 error: null |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
529 |
7dfcdf4c7dd2
implements #361 API method for deleting repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
2002
diff
changeset
|
530 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
531 grant_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
532 --------------------- |
1592 | 533 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
534 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:
1950
diff
changeset
|
535 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:
1950
diff
changeset
|
536 with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
537 |
1592 | 538 |
539 INPUT:: | |
540 | |
541 api_key : "<api_key>" | |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
542 method : "grant_user_permission" |
1592 | 543 args: { |
544 "repo_name" : "<reponame>", | |
1843 | 545 "username" : "<username>", |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
546 "perm" : "(repository.(none|read|write|admin))", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
547 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
548 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
549 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
550 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
551 result: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
552 "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:
1950
diff
changeset
|
553 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
554 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
555 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
556 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
557 revoke_user_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
558 ---------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
559 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
560 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:
1950
diff
changeset
|
561 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:
1950
diff
changeset
|
562 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
563 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
564 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
565 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
566 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
567 method : "revoke_user_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
568 args: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
569 "repo_name" : "<reponame>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
570 "username" : "<username>", |
1592 | 571 } |
572 | |
573 OUTPUT:: | |
574 | |
1843 | 575 result: { |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
576 "msg" : "Revoked perm for user: <suername> in repo: <reponame>" |
1843 | 577 } |
1592 | 578 error: null |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
579 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
580 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
581 grant_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
582 ---------------------------- |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
583 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
584 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:
1950
diff
changeset
|
585 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:
1950
diff
changeset
|
586 api_key belonging to user with admin rights. |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
587 |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
588 |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
589 INPUT:: |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
590 |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
591 api_key : "<api_key>" |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
592 method : "grant_users_group_permission" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
593 args: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
594 "repo_name" : "<reponame>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
595 "group_name" : "<usersgroupname>", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
596 "perm" : "(repository.(none|read|write|admin))", |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
597 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
598 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
599 OUTPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
600 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
601 result: { |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
602 "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:
1950
diff
changeset
|
603 } |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
604 error: null |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
605 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
606 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
607 revoke_users_group_permission |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
608 ----------------------------- |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
609 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
610 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:
1950
diff
changeset
|
611 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:
1950
diff
changeset
|
612 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
613 INPUT:: |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
614 |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
615 api_key : "<api_key>" |
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
616 method : "revoke_users_group_permission" |
1793
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
617 args: { |
631caf880b87
implements #329
Marcin Kuzminski <marcin@python-works.com>
parents:
1708
diff
changeset
|
618 "repo_name" : "<reponame>", |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
619 "users_group" : "<usersgroupname>", |
1843 | 620 } |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
621 |
1843 | 622 OUTPUT:: |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
623 |
1843 | 624 result: { |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
625 "msg" : "Revoked perm for group: <usersgroupname> in repo: <reponame>" |
1843 | 626 } |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1950
diff
changeset
|
627 error: null |