##// END OF EJS Templates
docs: update API documentation.
marcink -
r1603:a0209c61 default
parent child Browse files
Show More
@@ -24,13 +24,12 b' close_pull_request'
24
24
25 .. code-block:: bash
25 .. code-block:: bash
26
26
27 "id": <id_given_in_input>,
27 "id": <id_given_in_input>,
28 "result":
28 "result": {
29 {
30 "pull_request_id": "<int>",
29 "pull_request_id": "<int>",
31 "closed": "<bool>"
30 "closed": "<bool>"
32 },
31 },
33 "error": null
32 "error": null
34
33
35
34
36 comment_pull_request
35 comment_pull_request
@@ -67,15 +66,14 b' comment_pull_request'
67
66
68 .. code-block:: bash
67 .. code-block:: bash
69
68
70 id : <id_given_in_input>
69 id : <id_given_in_input>
71 result :
70 result : {
72 {
73 "pull_request_id": "<Integer>",
71 "pull_request_id": "<Integer>",
74 "comment_id": "<Integer>",
72 "comment_id": "<Integer>",
75 "status": {"given": <given_status>,
73 "status": {"given": <given_status>,
76 "was_changed": <bool status_was_actually_changed> },
74 "was_changed": <bool status_was_actually_changed> },
77 }
75 },
78 error : null
76 error : null
79
77
80
78
81 create_pull_request
79 create_pull_request
@@ -109,9 +107,8 b' create_pull_request'
109 :param reviewers: Set the new pull request reviewers list.
107 :param reviewers: Set the new pull request reviewers list.
110 :type reviewers: Optional(list)
108 :type reviewers: Optional(list)
111 Accepts username strings or objects of the format:
109 Accepts username strings or objects of the format:
112 {
110
113 'username': 'nick', 'reasons': ['original author']
111 {'username': 'nick', 'reasons': ['original author']}
114 }
115
112
116
113
117 get_pull_request
114 get_pull_request
@@ -305,9 +302,8 b' merge_pull_request'
305
302
306 .. code-block:: bash
303 .. code-block:: bash
307
304
308 "id": <id_given_in_input>,
305 "id": <id_given_in_input>,
309 "result":
306 "result": {
310 {
311 "executed": "<bool>",
307 "executed": "<bool>",
312 "failure_reason": "<int>",
308 "failure_reason": "<int>",
313 "merge_commit_id": "<merge_commit_id>",
309 "merge_commit_id": "<merge_commit_id>",
@@ -318,7 +314,7 b' merge_pull_request'
318 "name": "<name>"
314 "name": "<name>"
319 }
315 }
320 },
316 },
321 "error": null
317 "error": null
322
318
323
319
324 update_pull_request
320 update_pull_request
@@ -349,9 +345,8 b' update_pull_request'
349
345
350 .. code-block:: bash
346 .. code-block:: bash
351
347
352 id : <id_given_in_input>
348 id : <id_given_in_input>
353 result :
349 result : {
354 {
355 "msg": "Updated pull request `63`",
350 "msg": "Updated pull request `63`",
356 "pull_request": <pull_request_object>,
351 "pull_request": <pull_request_object>,
357 "updated_reviewers": {
352 "updated_reviewers": {
@@ -371,6 +366,6 b' update_pull_request'
371 "removed": []
366 "removed": []
372 }
367 }
373 }
368 }
374 error : null
369 error : null
375
370
376
371
@@ -85,6 +85,58 b' get_ip'
85 }
85 }
86
86
87
87
88 get_method
89 ----------
90
91 .. py:function:: get_method(apiuser, pattern=<Optional:'*'>)
92
93 Returns list of all available API methods. By default match pattern
94 os "*" but any other pattern can be specified. eg *comment* will return
95 all methods with comment inside them. If just single method is matched
96 returned data will also include method specification
97
98 This command can only be run using an |authtoken| with admin rights to
99 the specified repository.
100
101 This command takes the following options:
102
103 :param apiuser: This is filled automatically from the |authtoken|.
104 :type apiuser: AuthUser
105 :param pattern: pattern to match method names against
106 :type older_then: Optional("*")
107
108 Example output:
109
110 .. code-block:: bash
111
112 id : <id_given_in_input>
113 "result": [
114 "changeset_comment",
115 "comment_pull_request",
116 "comment_commit"
117 ]
118 error : null
119
120 .. code-block:: bash
121
122 id : <id_given_in_input>
123 "result": [
124 "comment_commit",
125 {
126 "apiuser": "<RequiredType>",
127 "comment_type": "<Optional:u'note'>",
128 "commit_id": "<RequiredType>",
129 "message": "<RequiredType>",
130 "repoid": "<RequiredType>",
131 "request": "<RequiredType>",
132 "resolves_comment_id": "<Optional:None>",
133 "status": "<Optional:None>",
134 "userid": "<Optional:<OptionalAttr:apiuser>>"
135 }
136 ]
137 error : null
138
139
88 get_server_info
140 get_server_info
89 ---------------
141 ---------------
90
142
@@ -41,15 +41,16 b' create_user'
41 :type force_password_change: Optional(``True`` | ``False``)
41 :type force_password_change: Optional(``True`` | ``False``)
42 :param create_personal_repo_group: Create personal repo group for this user
42 :param create_personal_repo_group: Create personal repo group for this user
43 :type create_personal_repo_group: Optional(``True`` | ``False``)
43 :type create_personal_repo_group: Optional(``True`` | ``False``)
44
44 Example output:
45 Example output:
45
46
46 .. code-block:: bash
47 .. code-block:: bash
47
48
48 id : <id_given_in_input>
49 id : <id_given_in_input>
49 result: {
50 result: {
50 "msg" : "created new user `<username>`",
51 "msg" : "created new user `<username>`",
51 "user": <user_obj>
52 "user": <user_obj>
52 }
53 }
53 error: null
54 error: null
54
55
55 Example error output:
56 Example error output:
@@ -98,9 +99,9 b' delete_user'
98
99
99 id : <id_given_in_input>
100 id : <id_given_in_input>
100 result: {
101 result: {
101 "msg" : "deleted user ID:<userid> <username>",
102 "msg" : "deleted user ID:<userid> <username>",
102 "user": null
103 "user": null
103 }
104 }
104 error: null
105 error: null
105
106
106 Example error output:
107 Example error output:
@@ -145,8 +146,8 b' get_user'
145 "result": {
146 "result": {
146 "active": true,
147 "active": true,
147 "admin": false,
148 "admin": false,
148 "api_key": "api-key",
149 "api_keys": [ list of keys ],
149 "api_keys": [ list of keys ],
150 "auth_tokens": [ list of tokens with details ],
150 "email": "user@example.com",
151 "email": "user@example.com",
151 "emails": [
152 "emails": [
152 "user@example.com"
153 "user@example.com"
@@ -157,6 +158,7 b' get_user'
157 "ip_addresses": [],
158 "ip_addresses": [],
158 "language": null,
159 "language": null,
159 "last_login": "Timestamp",
160 "last_login": "Timestamp",
161 "last_activity": "Timestamp",
160 "lastname": "surnae",
162 "lastname": "surnae",
161 "permissions": {
163 "permissions": {
162 "global": [
164 "global": [
@@ -183,6 +185,32 b' get_user'
183 }
185 }
184
186
185
187
188 get_user_audit_logs
189 -------------------
190
191 .. py:function:: get_user_audit_logs(apiuser, userid=<Optional:<OptionalAttr:apiuser>>)
192
193 Fetches all action logs made by the specified user.
194
195 This command takes the following options:
196
197 :param apiuser: This is filled automatically from the |authtoken|.
198 :type apiuser: AuthUser
199 :param userid: Sets the userid whose list of locked |repos| will be
200 displayed.
201 :type userid: Optional(str or int)
202
203 Example output:
204
205 .. code-block:: bash
206
207 id : <id_given_in_input>
208 result : {
209 [action, action,...]
210 }
211 error : null
212
213
186 get_user_locks
214 get_user_locks
187 --------------
215 --------------
188
216
@@ -232,7 +260,7 b' get_users'
232 .. code-block:: bash
260 .. code-block:: bash
233
261
234 id : <id_given_in_input>
262 id : <id_given_in_input>
235 result: [<user_object>, ...]
263 result: [<user_object>, ...]
236 error: null
264 error: null
237
265
238
266
@@ -279,9 +307,9 b' update_user'
279
307
280 id : <id_given_in_input>
308 id : <id_given_in_input>
281 result: {
309 result: {
282 "msg" : "updated user ID:<userid> <username>",
310 "msg" : "updated user ID:<userid> <username>",
283 "user": <user_object>,
311 "user": <user_object>,
284 }
312 }
285 error: null
313 error: null
286
314
287 Example error output:
315 Example error output:
@@ -244,9 +244,8 b' def merge_pull_request(request, apiuser,'
244
244
245 .. code-block:: bash
245 .. code-block:: bash
246
246
247 "id": <id_given_in_input>,
247 "id": <id_given_in_input>,
248 "result":
248 "result": {
249 {
250 "executed": "<bool>",
249 "executed": "<bool>",
251 "failure_reason": "<int>",
250 "failure_reason": "<int>",
252 "merge_commit_id": "<merge_commit_id>",
251 "merge_commit_id": "<merge_commit_id>",
@@ -257,8 +256,7 b' def merge_pull_request(request, apiuser,'
257 "name": "<name>"
256 "name": "<name>"
258 }
257 }
259 },
258 },
260 "error": null
259 "error": null
261
262 """
260 """
263 repo = get_repo_or_error(repoid)
261 repo = get_repo_or_error(repoid)
264 if not isinstance(userid, Optional):
262 if not isinstance(userid, Optional):
@@ -321,13 +319,12 b' def close_pull_request(request, apiuser,'
321
319
322 .. code-block:: bash
320 .. code-block:: bash
323
321
324 "id": <id_given_in_input>,
322 "id": <id_given_in_input>,
325 "result":
323 "result": {
326 {
327 "pull_request_id": "<int>",
324 "pull_request_id": "<int>",
328 "closed": "<bool>"
325 "closed": "<bool>"
329 },
326 },
330 "error": null
327 "error": null
331
328
332 """
329 """
333 repo = get_repo_or_error(repoid)
330 repo = get_repo_or_error(repoid)
@@ -396,15 +393,14 b' def comment_pull_request('
396
393
397 .. code-block:: bash
394 .. code-block:: bash
398
395
399 id : <id_given_in_input>
396 id : <id_given_in_input>
400 result :
397 result : {
401 {
402 "pull_request_id": "<Integer>",
398 "pull_request_id": "<Integer>",
403 "comment_id": "<Integer>",
399 "comment_id": "<Integer>",
404 "status": {"given": <given_status>,
400 "status": {"given": <given_status>,
405 "was_changed": <bool status_was_actually_changed> },
401 "was_changed": <bool status_was_actually_changed> },
406 }
402 },
407 error : null
403 error : null
408 """
404 """
409 repo = get_repo_or_error(repoid)
405 repo = get_repo_or_error(repoid)
410 if not isinstance(userid, Optional):
406 if not isinstance(userid, Optional):
@@ -535,9 +531,8 b' def create_pull_request('
535 :param reviewers: Set the new pull request reviewers list.
531 :param reviewers: Set the new pull request reviewers list.
536 :type reviewers: Optional(list)
532 :type reviewers: Optional(list)
537 Accepts username strings or objects of the format:
533 Accepts username strings or objects of the format:
538 {
534
539 'username': 'nick', 'reasons': ['original author']
535 {'username': 'nick', 'reasons': ['original author']}
540 }
541 """
536 """
542
537
543 source = get_repo_or_error(source_repo)
538 source = get_repo_or_error(source_repo)
@@ -633,9 +628,8 b' def update_pull_request('
633
628
634 .. code-block:: bash
629 .. code-block:: bash
635
630
636 id : <id_given_in_input>
631 id : <id_given_in_input>
637 result :
632 result : {
638 {
639 "msg": "Updated pull request `63`",
633 "msg": "Updated pull request `63`",
640 "pull_request": <pull_request_object>,
634 "pull_request": <pull_request_object>,
641 "updated_reviewers": {
635 "updated_reviewers": {
@@ -655,7 +649,7 b' def update_pull_request('
655 "removed": []
649 "removed": []
656 }
650 }
657 }
651 }
658 error : null
652 error : null
659 """
653 """
660
654
661 repo = get_repo_or_error(repoid)
655 repo = get_repo_or_error(repoid)
@@ -133,7 +133,7 b' def get_users(request, apiuser):'
133 .. code-block:: bash
133 .. code-block:: bash
134
134
135 id : <id_given_in_input>
135 id : <id_given_in_input>
136 result: [<user_object>, ...]
136 result: [<user_object>, ...]
137 error: null
137 error: null
138 """
138 """
139
139
@@ -191,15 +191,16 b' def create_user(request, apiuser, userna'
191 :type force_password_change: Optional(``True`` | ``False``)
191 :type force_password_change: Optional(``True`` | ``False``)
192 :param create_personal_repo_group: Create personal repo group for this user
192 :param create_personal_repo_group: Create personal repo group for this user
193 :type create_personal_repo_group: Optional(``True`` | ``False``)
193 :type create_personal_repo_group: Optional(``True`` | ``False``)
194
194 Example output:
195 Example output:
195
196
196 .. code-block:: bash
197 .. code-block:: bash
197
198
198 id : <id_given_in_input>
199 id : <id_given_in_input>
199 result: {
200 result: {
200 "msg" : "created new user `<username>`",
201 "msg" : "created new user `<username>`",
201 "user": <user_obj>
202 "user": <user_obj>
202 }
203 }
203 error: null
204 error: null
204
205
205 Example error output:
206 Example error output:
@@ -305,9 +306,9 b' def update_user(request, apiuser, userid'
305
306
306 id : <id_given_in_input>
307 id : <id_given_in_input>
307 result: {
308 result: {
308 "msg" : "updated user ID:<userid> <username>",
309 "msg" : "updated user ID:<userid> <username>",
309 "user": <user_object>,
310 "user": <user_object>,
310 }
311 }
311 error: null
312 error: null
312
313
313 Example error output:
314 Example error output:
@@ -384,9 +385,9 b' def delete_user(request, apiuser, userid'
384
385
385 id : <id_given_in_input>
386 id : <id_given_in_input>
386 result: {
387 result: {
387 "msg" : "deleted user ID:<userid> <username>",
388 "msg" : "deleted user ID:<userid> <username>",
388 "user": null
389 "user": null
389 }
390 }
390 error: null
391 error: null
391
392
392 Example error output:
393 Example error output:
General Comments 0
You need to be logged in to leave comments. Login now