##// END OF EJS Templates
docs: update API documentation.
marcink -
r1603:a0209c61 default
parent child Browse files
Show More
@@ -25,8 +25,7 b' close_pull_request'
25 25 .. code-block:: bash
26 26
27 27 "id": <id_given_in_input>,
28 "result":
29 {
28 "result": {
30 29 "pull_request_id": "<int>",
31 30 "closed": "<bool>"
32 31 },
@@ -68,13 +67,12 b' comment_pull_request'
68 67 .. code-block:: bash
69 68
70 69 id : <id_given_in_input>
71 result :
72 {
70 result : {
73 71 "pull_request_id": "<Integer>",
74 72 "comment_id": "<Integer>",
75 73 "status": {"given": <given_status>,
76 74 "was_changed": <bool status_was_actually_changed> },
77 }
75 },
78 76 error : null
79 77
80 78
@@ -109,9 +107,8 b' create_pull_request'
109 107 :param reviewers: Set the new pull request reviewers list.
110 108 :type reviewers: Optional(list)
111 109 Accepts username strings or objects of the format:
112 {
113 'username': 'nick', 'reasons': ['original author']
114 }
110
111 {'username': 'nick', 'reasons': ['original author']}
115 112
116 113
117 114 get_pull_request
@@ -306,8 +303,7 b' merge_pull_request'
306 303 .. code-block:: bash
307 304
308 305 "id": <id_given_in_input>,
309 "result":
310 {
306 "result": {
311 307 "executed": "<bool>",
312 308 "failure_reason": "<int>",
313 309 "merge_commit_id": "<merge_commit_id>",
@@ -350,8 +346,7 b' update_pull_request'
350 346 .. code-block:: bash
351 347
352 348 id : <id_given_in_input>
353 result :
354 {
349 result : {
355 350 "msg": "Updated pull request `63`",
356 351 "pull_request": <pull_request_object>,
357 352 "updated_reviewers": {
@@ -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 140 get_server_info
89 141 ---------------
90 142
@@ -41,6 +41,7 b' create_user'
41 41 :type force_password_change: Optional(``True`` | ``False``)
42 42 :param create_personal_repo_group: Create personal repo group for this user
43 43 :type create_personal_repo_group: Optional(``True`` | ``False``)
44
44 45 Example output:
45 46
46 47 .. code-block:: bash
@@ -145,8 +146,8 b' get_user'
145 146 "result": {
146 147 "active": true,
147 148 "admin": false,
148 "api_key": "api-key",
149 149 "api_keys": [ list of keys ],
150 "auth_tokens": [ list of tokens with details ],
150 151 "email": "user@example.com",
151 152 "emails": [
152 153 "user@example.com"
@@ -157,6 +158,7 b' get_user'
157 158 "ip_addresses": [],
158 159 "language": null,
159 160 "last_login": "Timestamp",
161 "last_activity": "Timestamp",
160 162 "lastname": "surnae",
161 163 "permissions": {
162 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 214 get_user_locks
187 215 --------------
188 216
@@ -245,8 +245,7 b' def merge_pull_request(request, apiuser,'
245 245 .. code-block:: bash
246 246
247 247 "id": <id_given_in_input>,
248 "result":
249 {
248 "result": {
250 249 "executed": "<bool>",
251 250 "failure_reason": "<int>",
252 251 "merge_commit_id": "<merge_commit_id>",
@@ -258,7 +257,6 b' def merge_pull_request(request, apiuser,'
258 257 }
259 258 },
260 259 "error": null
261
262 260 """
263 261 repo = get_repo_or_error(repoid)
264 262 if not isinstance(userid, Optional):
@@ -322,8 +320,7 b' def close_pull_request(request, apiuser,'
322 320 .. code-block:: bash
323 321
324 322 "id": <id_given_in_input>,
325 "result":
326 {
323 "result": {
327 324 "pull_request_id": "<int>",
328 325 "closed": "<bool>"
329 326 },
@@ -397,13 +394,12 b' def comment_pull_request('
397 394 .. code-block:: bash
398 395
399 396 id : <id_given_in_input>
400 result :
401 {
397 result : {
402 398 "pull_request_id": "<Integer>",
403 399 "comment_id": "<Integer>",
404 400 "status": {"given": <given_status>,
405 401 "was_changed": <bool status_was_actually_changed> },
406 }
402 },
407 403 error : null
408 404 """
409 405 repo = get_repo_or_error(repoid)
@@ -535,9 +531,8 b' def create_pull_request('
535 531 :param reviewers: Set the new pull request reviewers list.
536 532 :type reviewers: Optional(list)
537 533 Accepts username strings or objects of the format:
538 {
539 'username': 'nick', 'reasons': ['original author']
540 }
534
535 {'username': 'nick', 'reasons': ['original author']}
541 536 """
542 537
543 538 source = get_repo_or_error(source_repo)
@@ -634,8 +629,7 b' def update_pull_request('
634 629 .. code-block:: bash
635 630
636 631 id : <id_given_in_input>
637 result :
638 {
632 result : {
639 633 "msg": "Updated pull request `63`",
640 634 "pull_request": <pull_request_object>,
641 635 "updated_reviewers": {
@@ -191,6 +191,7 b' def create_user(request, apiuser, userna'
191 191 :type force_password_change: Optional(``True`` | ``False``)
192 192 :param create_personal_repo_group: Create personal repo group for this user
193 193 :type create_personal_repo_group: Optional(``True`` | ``False``)
194
194 195 Example output:
195 196
196 197 .. code-block:: bash
General Comments 0
You need to be logged in to leave comments. Login now