##// END OF EJS Templates
docs: updated API documentation
marcink -
r4455:043990e1 default
parent child Browse files
Show More
@@ -1,447 +1,448 b''
1 1 .. _pull-request-methods-ref:
2 2
3 3 pull_request methods
4 4 ====================
5 5
6 6 close_pull_request
7 7 ------------------
8 8
9 9 .. py:function:: close_pull_request(apiuser, pullrequestid, repoid=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>, message=<Optional:''>)
10 10
11 11 Close the pull request specified by `pullrequestid`.
12 12
13 13 :param apiuser: This is filled automatically from the |authtoken|.
14 14 :type apiuser: AuthUser
15 15 :param repoid: Repository name or repository ID to which the pull
16 16 request belongs.
17 17 :type repoid: str or int
18 18 :param pullrequestid: ID of the pull request to be closed.
19 19 :type pullrequestid: int
20 20 :param userid: Close the pull request as this user.
21 21 :type userid: Optional(str or int)
22 22 :param message: Optional message to close the Pull Request with. If not
23 23 specified it will be generated automatically.
24 24 :type message: Optional(str)
25 25
26 26 Example output:
27 27
28 28 .. code-block:: bash
29 29
30 30 "id": <id_given_in_input>,
31 31 "result": {
32 32 "pull_request_id": "<int>",
33 33 "close_status": "<str:status_lbl>,
34 34 "closed": "<bool>"
35 35 },
36 36 "error": null
37 37
38 38
39 39 comment_pull_request
40 40 --------------------
41 41
42 42 .. py:function:: comment_pull_request(apiuser, pullrequestid, repoid=<Optional:None>, message=<Optional:None>, commit_id=<Optional:None>, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, extra_recipients=<Optional:[]>, userid=<Optional:<OptionalAttr:apiuser>>, send_email=<Optional:True>)
43 43
44 44 Comment on the pull request specified with the `pullrequestid`,
45 45 in the |repo| specified by the `repoid`, and optionally change the
46 46 review status.
47 47
48 48 :param apiuser: This is filled automatically from the |authtoken|.
49 49 :type apiuser: AuthUser
50 50 :param repoid: Optional repository name or repository ID.
51 51 :type repoid: str or int
52 52 :param pullrequestid: The pull request ID.
53 53 :type pullrequestid: int
54 54 :param commit_id: Specify the commit_id for which to set a comment. If
55 55 given commit_id is different than latest in the PR status
56 56 change won't be performed.
57 57 :type commit_id: str
58 58 :param message: The text content of the comment.
59 59 :type message: str
60 60 :param status: (**Optional**) Set the approval status of the pull
61 61 request. One of: 'not_reviewed', 'approved', 'rejected',
62 62 'under_review'
63 63 :type status: str
64 64 :param comment_type: Comment type, one of: 'note', 'todo'
65 65 :type comment_type: Optional(str), default: 'note'
66 66 :param resolves_comment_id: id of comment which this one will resolve
67 67 :type resolves_comment_id: Optional(int)
68 68 :param extra_recipients: list of user ids or usernames to add
69 69 notifications for this comment. Acts like a CC for notification
70 70 :type extra_recipients: Optional(list)
71 71 :param userid: Comment on the pull request as this user
72 72 :type userid: Optional(str or int)
73 73 :param send_email: Define if this comment should also send email notification
74 74 :type send_email: Optional(bool)
75 75
76 76 Example output:
77 77
78 78 .. code-block:: bash
79 79
80 80 id : <id_given_in_input>
81 81 result : {
82 82 "pull_request_id": "<Integer>",
83 83 "comment_id": "<Integer>",
84 84 "status": {"given": <given_status>,
85 85 "was_changed": <bool status_was_actually_changed> },
86 86 },
87 87 error : null
88 88
89 89
90 90 create_pull_request
91 91 -------------------
92 92
93 93 .. py:function:: create_pull_request(apiuser, source_repo, target_repo, source_ref, target_ref, owner=<Optional:<OptionalAttr:apiuser>>, title=<Optional:''>, description=<Optional:''>, description_renderer=<Optional:''>, reviewers=<Optional:None>)
94 94
95 95 Creates a new pull request.
96 96
97 97 Accepts refs in the following formats:
98 98
99 99 * branch:<branch_name>:<sha>
100 100 * branch:<branch_name>
101 101 * bookmark:<bookmark_name>:<sha> (Mercurial only)
102 102 * bookmark:<bookmark_name> (Mercurial only)
103 103
104 104 :param apiuser: This is filled automatically from the |authtoken|.
105 105 :type apiuser: AuthUser
106 106 :param source_repo: Set the source repository name.
107 107 :type source_repo: str
108 108 :param target_repo: Set the target repository name.
109 109 :type target_repo: str
110 110 :param source_ref: Set the source ref name.
111 111 :type source_ref: str
112 112 :param target_ref: Set the target ref name.
113 113 :type target_ref: str
114 114 :param owner: user_id or username
115 115 :type owner: Optional(str)
116 116 :param title: Optionally Set the pull request title, it's generated otherwise
117 117 :type title: str
118 118 :param description: Set the pull request description.
119 119 :type description: Optional(str)
120 120 :type description_renderer: Optional(str)
121 121 :param description_renderer: Set pull request renderer for the description.
122 122 It should be 'rst', 'markdown' or 'plain'. If not give default
123 123 system renderer will be used
124 124 :param reviewers: Set the new pull request reviewers list.
125 125 Reviewer defined by review rules will be added automatically to the
126 126 defined list.
127 127 :type reviewers: Optional(list)
128 128 Accepts username strings or objects of the format:
129 129
130 130 [{'username': 'nick', 'reasons': ['original author'], 'mandatory': <bool>}]
131 131
132 132
133 133 get_pull_request
134 134 ----------------
135 135
136 136 .. py:function:: get_pull_request(apiuser, pullrequestid, repoid=<Optional:None>, merge_state=<Optional:False>)
137 137
138 138 Get a pull request based on the given ID.
139 139
140 140 :param apiuser: This is filled automatically from the |authtoken|.
141 141 :type apiuser: AuthUser
142 142 :param repoid: Optional, repository name or repository ID from where
143 143 the pull request was opened.
144 144 :type repoid: str or int
145 145 :param pullrequestid: ID of the requested pull request.
146 146 :type pullrequestid: int
147 147 :param merge_state: Optional calculate merge state for each repository.
148 148 This could result in longer time to fetch the data
149 149 :type merge_state: bool
150 150
151 151 Example output:
152 152
153 153 .. code-block:: bash
154 154
155 155 "id": <id_given_in_input>,
156 156 "result":
157 157 {
158 158 "pull_request_id": "<pull_request_id>",
159 159 "url": "<url>",
160 160 "title": "<title>",
161 161 "description": "<description>",
162 162 "status" : "<status>",
163 163 "created_on": "<date_time_created>",
164 164 "updated_on": "<date_time_updated>",
165 165 "versions": "<number_or_versions_of_pr>",
166 166 "commit_ids": [
167 167 ...
168 168 "<commit_id>",
169 169 "<commit_id>",
170 170 ...
171 171 ],
172 172 "review_status": "<review_status>",
173 173 "mergeable": {
174 174 "status": "<bool>",
175 175 "message": "<message>",
176 176 },
177 177 "source": {
178 178 "clone_url": "<clone_url>",
179 179 "repository": "<repository_name>",
180 180 "reference":
181 181 {
182 182 "name": "<name>",
183 183 "type": "<type>",
184 184 "commit_id": "<commit_id>",
185 185 }
186 186 },
187 187 "target": {
188 188 "clone_url": "<clone_url>",
189 189 "repository": "<repository_name>",
190 190 "reference":
191 191 {
192 192 "name": "<name>",
193 193 "type": "<type>",
194 194 "commit_id": "<commit_id>",
195 195 }
196 196 },
197 197 "merge": {
198 198 "clone_url": "<clone_url>",
199 199 "reference":
200 200 {
201 201 "name": "<name>",
202 202 "type": "<type>",
203 203 "commit_id": "<commit_id>",
204 204 }
205 205 },
206 206 "author": <user_obj>,
207 207 "reviewers": [
208 208 ...
209 209 {
210 210 "user": "<user_obj>",
211 211 "review_status": "<review_status>",
212 212 }
213 213 ...
214 214 ]
215 215 },
216 216 "error": null
217 217
218 218
219 219 get_pull_request_comments
220 220 -------------------------
221 221
222 222 .. py:function:: get_pull_request_comments(apiuser, pullrequestid, repoid=<Optional:None>)
223 223
224 224 Get all comments of pull request specified with the `pullrequestid`
225 225
226 226 :param apiuser: This is filled automatically from the |authtoken|.
227 227 :type apiuser: AuthUser
228 228 :param repoid: Optional repository name or repository ID.
229 229 :type repoid: str or int
230 230 :param pullrequestid: The pull request ID.
231 231 :type pullrequestid: int
232 232
233 233 Example output:
234 234
235 235 .. code-block:: bash
236 236
237 237 id : <id_given_in_input>
238 238 result : [
239 239 {
240 240 "comment_author": {
241 241 "active": true,
242 242 "full_name_or_username": "Tom Gore",
243 243 "username": "admin"
244 244 },
245 245 "comment_created_on": "2017-01-02T18:43:45.533",
246 246 "comment_f_path": null,
247 247 "comment_id": 25,
248 248 "comment_lineno": null,
249 249 "comment_status": {
250 250 "status": "under_review",
251 251 "status_lbl": "Under Review"
252 252 },
253 253 "comment_text": "Example text",
254 254 "comment_type": null,
255 "comment_last_version: 0,
255 256 "pull_request_version": null,
256 257 "comment_commit_id": None,
257 258 "comment_pull_request_id": <pull_request_id>
258 259 }
259 260 ],
260 261 error : null
261 262
262 263
263 264 get_pull_requests
264 265 -----------------
265 266
266 267 .. py:function:: get_pull_requests(apiuser, repoid, status=<Optional:'new'>, merge_state=<Optional:False>)
267 268
268 269 Get all pull requests from the repository specified in `repoid`.
269 270
270 271 :param apiuser: This is filled automatically from the |authtoken|.
271 272 :type apiuser: AuthUser
272 273 :param repoid: Optional repository name or repository ID.
273 274 :type repoid: str or int
274 275 :param status: Only return pull requests with the specified status.
275 276 Valid options are.
276 277 * ``new`` (default)
277 278 * ``open``
278 279 * ``closed``
279 280 :type status: str
280 281 :param merge_state: Optional calculate merge state for each repository.
281 282 This could result in longer time to fetch the data
282 283 :type merge_state: bool
283 284
284 285 Example output:
285 286
286 287 .. code-block:: bash
287 288
288 289 "id": <id_given_in_input>,
289 290 "result":
290 291 [
291 292 ...
292 293 {
293 294 "pull_request_id": "<pull_request_id>",
294 295 "url": "<url>",
295 296 "title" : "<title>",
296 297 "description": "<description>",
297 298 "status": "<status>",
298 299 "created_on": "<date_time_created>",
299 300 "updated_on": "<date_time_updated>",
300 301 "commit_ids": [
301 302 ...
302 303 "<commit_id>",
303 304 "<commit_id>",
304 305 ...
305 306 ],
306 307 "review_status": "<review_status>",
307 308 "mergeable": {
308 309 "status": "<bool>",
309 310 "message: "<message>",
310 311 },
311 312 "source": {
312 313 "clone_url": "<clone_url>",
313 314 "reference":
314 315 {
315 316 "name": "<name>",
316 317 "type": "<type>",
317 318 "commit_id": "<commit_id>",
318 319 }
319 320 },
320 321 "target": {
321 322 "clone_url": "<clone_url>",
322 323 "reference":
323 324 {
324 325 "name": "<name>",
325 326 "type": "<type>",
326 327 "commit_id": "<commit_id>",
327 328 }
328 329 },
329 330 "merge": {
330 331 "clone_url": "<clone_url>",
331 332 "reference":
332 333 {
333 334 "name": "<name>",
334 335 "type": "<type>",
335 336 "commit_id": "<commit_id>",
336 337 }
337 338 },
338 339 "author": <user_obj>,
339 340 "reviewers": [
340 341 ...
341 342 {
342 343 "user": "<user_obj>",
343 344 "review_status": "<review_status>",
344 345 }
345 346 ...
346 347 ]
347 348 }
348 349 ...
349 350 ],
350 351 "error": null
351 352
352 353
353 354 merge_pull_request
354 355 ------------------
355 356
356 357 .. py:function:: merge_pull_request(apiuser, pullrequestid, repoid=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>)
357 358
358 359 Merge the pull request specified by `pullrequestid` into its target
359 360 repository.
360 361
361 362 :param apiuser: This is filled automatically from the |authtoken|.
362 363 :type apiuser: AuthUser
363 364 :param repoid: Optional, repository name or repository ID of the
364 365 target repository to which the |pr| is to be merged.
365 366 :type repoid: str or int
366 367 :param pullrequestid: ID of the pull request which shall be merged.
367 368 :type pullrequestid: int
368 369 :param userid: Merge the pull request as this user.
369 370 :type userid: Optional(str or int)
370 371
371 372 Example output:
372 373
373 374 .. code-block:: bash
374 375
375 376 "id": <id_given_in_input>,
376 377 "result": {
377 378 "executed": "<bool>",
378 379 "failure_reason": "<int>",
379 380 "merge_status_message": "<str>",
380 381 "merge_commit_id": "<merge_commit_id>",
381 382 "possible": "<bool>",
382 383 "merge_ref": {
383 384 "commit_id": "<commit_id>",
384 385 "type": "<type>",
385 386 "name": "<name>"
386 387 }
387 388 },
388 389 "error": null
389 390
390 391
391 392 update_pull_request
392 393 -------------------
393 394
394 395 .. py:function:: update_pull_request(apiuser, pullrequestid, repoid=<Optional:None>, title=<Optional:''>, description=<Optional:''>, description_renderer=<Optional:''>, reviewers=<Optional:None>, update_commits=<Optional:None>)
395 396
396 397 Updates a pull request.
397 398
398 399 :param apiuser: This is filled automatically from the |authtoken|.
399 400 :type apiuser: AuthUser
400 401 :param repoid: Optional repository name or repository ID.
401 402 :type repoid: str or int
402 403 :param pullrequestid: The pull request ID.
403 404 :type pullrequestid: int
404 405 :param title: Set the pull request title.
405 406 :type title: str
406 407 :param description: Update pull request description.
407 408 :type description: Optional(str)
408 409 :type description_renderer: Optional(str)
409 410 :param description_renderer: Update pull request renderer for the description.
410 411 It should be 'rst', 'markdown' or 'plain'
411 412 :param reviewers: Update pull request reviewers list with new value.
412 413 :type reviewers: Optional(list)
413 414 Accepts username strings or objects of the format:
414 415
415 416 [{'username': 'nick', 'reasons': ['original author'], 'mandatory': <bool>}]
416 417
417 418 :param update_commits: Trigger update of commits for this pull request
418 419 :type: update_commits: Optional(bool)
419 420
420 421 Example output:
421 422
422 423 .. code-block:: bash
423 424
424 425 id : <id_given_in_input>
425 426 result : {
426 427 "msg": "Updated pull request `63`",
427 428 "pull_request": <pull_request_object>,
428 429 "updated_reviewers": {
429 430 "added": [
430 431 "username"
431 432 ],
432 433 "removed": []
433 434 },
434 435 "updated_commits": {
435 436 "added": [
436 437 "<sha1_hash>"
437 438 ],
438 439 "common": [
439 440 "<sha1_hash>",
440 441 "<sha1_hash>",
441 442 ],
442 443 "removed": []
443 444 }
444 445 }
445 446 error : null
446 447
447 448
@@ -1,1140 +1,1206 b''
1 1 .. _repo-methods-ref:
2 2
3 3 repo methods
4 4 ============
5 5
6 6 add_field_to_repo
7 7 -----------------
8 8
9 9 .. py:function:: add_field_to_repo(apiuser, repoid, key, label=<Optional:''>, description=<Optional:''>)
10 10
11 11 Adds an extra field to a repository.
12 12
13 13 This command can only be run using an |authtoken| with at least
14 14 write permissions to the |repo|.
15 15
16 16 :param apiuser: This is filled automatically from the |authtoken|.
17 17 :type apiuser: AuthUser
18 18 :param repoid: Set the repository name or repository id.
19 19 :type repoid: str or int
20 20 :param key: Create a unique field key for this repository.
21 21 :type key: str
22 22 :param label:
23 23 :type label: Optional(str)
24 24 :param description:
25 25 :type description: Optional(str)
26 26
27 27
28 28 comment_commit
29 29 --------------
30 30
31 31 .. py:function:: comment_commit(apiuser, repoid, commit_id, message, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, extra_recipients=<Optional:[]>, userid=<Optional:<OptionalAttr:apiuser>>, send_email=<Optional:True>)
32 32
33 33 Set a commit comment, and optionally change the status of the commit.
34 34
35 35 :param apiuser: This is filled automatically from the |authtoken|.
36 36 :type apiuser: AuthUser
37 37 :param repoid: Set the repository name or repository ID.
38 38 :type repoid: str or int
39 39 :param commit_id: Specify the commit_id for which to set a comment.
40 40 :type commit_id: str
41 41 :param message: The comment text.
42 42 :type message: str
43 43 :param status: (**Optional**) status of commit, one of: 'not_reviewed',
44 44 'approved', 'rejected', 'under_review'
45 45 :type status: str
46 46 :param comment_type: Comment type, one of: 'note', 'todo'
47 47 :type comment_type: Optional(str), default: 'note'
48 48 :param resolves_comment_id: id of comment which this one will resolve
49 49 :type resolves_comment_id: Optional(int)
50 50 :param extra_recipients: list of user ids or usernames to add
51 51 notifications for this comment. Acts like a CC for notification
52 52 :type extra_recipients: Optional(list)
53 53 :param userid: Set the user name of the comment creator.
54 54 :type userid: Optional(str or int)
55 55 :param send_email: Define if this comment should also send email notification
56 56 :type send_email: Optional(bool)
57 57
58 58 Example error output:
59 59
60 60 .. code-block:: bash
61 61
62 62 {
63 63 "id" : <id_given_in_input>,
64 64 "result" : {
65 65 "msg": "Commented on commit `<commit_id>` for repository `<repoid>`",
66 66 "status_change": null or <status>,
67 67 "success": true
68 68 },
69 69 "error" : null
70 70 }
71 71
72 72
73 73 create_repo
74 74 -----------
75 75
76 76 .. py:function:: create_repo(apiuser, repo_name, repo_type, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, push_uri=<Optional:None>, landing_rev=<Optional:None>, enable_statistics=<Optional:False>, enable_locking=<Optional:False>, enable_downloads=<Optional:False>, copy_permissions=<Optional:False>)
77 77
78 78 Creates a repository.
79 79
80 80 * If the repository name contains "/", repository will be created inside
81 81 a repository group or nested repository groups
82 82
83 83 For example "foo/bar/repo1" will create |repo| called "repo1" inside
84 84 group "foo/bar". You have to have permissions to access and write to
85 85 the last repository group ("bar" in this example)
86 86
87 87 This command can only be run using an |authtoken| with at least
88 88 permissions to create repositories, or write permissions to
89 89 parent repository groups.
90 90
91 91 :param apiuser: This is filled automatically from the |authtoken|.
92 92 :type apiuser: AuthUser
93 93 :param repo_name: Set the repository name.
94 94 :type repo_name: str
95 95 :param repo_type: Set the repository type; 'hg','git', or 'svn'.
96 96 :type repo_type: str
97 97 :param owner: user_id or username
98 98 :type owner: Optional(str)
99 99 :param description: Set the repository description.
100 100 :type description: Optional(str)
101 101 :param private: set repository as private
102 102 :type private: bool
103 103 :param clone_uri: set clone_uri
104 104 :type clone_uri: str
105 105 :param push_uri: set push_uri
106 106 :type push_uri: str
107 107 :param landing_rev: <rev_type>:<rev>, e.g branch:default, book:dev, rev:abcd
108 108 :type landing_rev: str
109 109 :param enable_locking:
110 110 :type enable_locking: bool
111 111 :param enable_downloads:
112 112 :type enable_downloads: bool
113 113 :param enable_statistics:
114 114 :type enable_statistics: bool
115 115 :param copy_permissions: Copy permission from group in which the
116 116 repository is being created.
117 117 :type copy_permissions: bool
118 118
119 119
120 120 Example output:
121 121
122 122 .. code-block:: bash
123 123
124 124 id : <id_given_in_input>
125 125 result: {
126 126 "msg": "Created new repository `<reponame>`",
127 127 "success": true,
128 128 "task": "<celery task id or None if done sync>"
129 129 }
130 130 error: null
131 131
132 132
133 133 Example error output:
134 134
135 135 .. code-block:: bash
136 136
137 137 id : <id_given_in_input>
138 138 result : null
139 139 error : {
140 140 'failed to create repository `<repo_name>`'
141 141 }
142 142
143 143
144 144 delete_repo
145 145 -----------
146 146
147 147 .. py:function:: delete_repo(apiuser, repoid, forks=<Optional:''>)
148 148
149 149 Deletes a repository.
150 150
151 151 * When the `forks` parameter is set it's possible to detach or delete
152 152 forks of deleted repository.
153 153
154 154 This command can only be run using an |authtoken| with admin
155 155 permissions on the |repo|.
156 156
157 157 :param apiuser: This is filled automatically from the |authtoken|.
158 158 :type apiuser: AuthUser
159 159 :param repoid: Set the repository name or repository ID.
160 160 :type repoid: str or int
161 161 :param forks: Set to `detach` or `delete` forks from the |repo|.
162 162 :type forks: Optional(str)
163 163
164 164 Example error output:
165 165
166 166 .. code-block:: bash
167 167
168 168 id : <id_given_in_input>
169 169 result: {
170 170 "msg": "Deleted repository `<reponame>`",
171 171 "success": true
172 172 }
173 173 error: null
174 174
175 175
176 edit_comment
177 ------------
178
179 .. py:function:: edit_comment(apiuser, message, comment_id, version, userid=<Optional:<OptionalAttr:apiuser>>)
180
181 Edit comment on the pull request or commit,
182 specified by the `comment_id` and version. Initially version should be 0
183
184 :param apiuser: This is filled automatically from the |authtoken|.
185 :type apiuser: AuthUser
186 :param comment_id: Specify the comment_id for editing
187 :type comment_id: int
188 :param version: version of the comment that will be created, starts from 0
189 :type version: int
190 :param message: The text content of the comment.
191 :type message: str
192 :param userid: Comment on the pull request as this user
193 :type userid: Optional(str or int)
194
195 Example output:
196
197 .. code-block:: bash
198
199 id : <id_given_in_input>
200 result : {
201 "comment": "<comment data>",
202 "version": "<Integer>",
203 },
204 error : null
205
206
176 207 fork_repo
177 208 ---------
178 209
179 210 .. py:function:: fork_repo(apiuser, repoid, fork_name, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, landing_rev=<Optional:None>, copy_permissions=<Optional:False>)
180 211
181 212 Creates a fork of the specified |repo|.
182 213
183 214 * If the fork_name contains "/", fork will be created inside
184 215 a repository group or nested repository groups
185 216
186 217 For example "foo/bar/fork-repo" will create fork called "fork-repo"
187 218 inside group "foo/bar". You have to have permissions to access and
188 219 write to the last repository group ("bar" in this example)
189 220
190 221 This command can only be run using an |authtoken| with minimum
191 222 read permissions of the forked repo, create fork permissions for an user.
192 223
193 224 :param apiuser: This is filled automatically from the |authtoken|.
194 225 :type apiuser: AuthUser
195 226 :param repoid: Set repository name or repository ID.
196 227 :type repoid: str or int
197 228 :param fork_name: Set the fork name, including it's repository group membership.
198 229 :type fork_name: str
199 230 :param owner: Set the fork owner.
200 231 :type owner: str
201 232 :param description: Set the fork description.
202 233 :type description: str
203 234 :param copy_permissions: Copy permissions from parent |repo|. The
204 235 default is False.
205 236 :type copy_permissions: bool
206 237 :param private: Make the fork private. The default is False.
207 238 :type private: bool
208 239 :param landing_rev: Set the landing revision. E.g branch:default, book:dev, rev:abcd
209 240
210 241 Example output:
211 242
212 243 .. code-block:: bash
213 244
214 245 id : <id_for_response>
215 246 api_key : "<api_key>"
216 247 args: {
217 248 "repoid" : "<reponame or repo_id>",
218 249 "fork_name": "<forkname>",
219 250 "owner": "<username or user_id = Optional(=apiuser)>",
220 251 "description": "<description>",
221 252 "copy_permissions": "<bool>",
222 253 "private": "<bool>",
223 254 "landing_rev": "<landing_rev>"
224 255 }
225 256
226 257 Example error output:
227 258
228 259 .. code-block:: bash
229 260
230 261 id : <id_given_in_input>
231 262 result: {
232 263 "msg": "Created fork of `<reponame>` as `<forkname>`",
233 264 "success": true,
234 265 "task": "<celery task id or None if done sync>"
235 266 }
236 267 error: null
237 268
238 269
270 get_comment
271 -----------
272
273 .. py:function:: get_comment(apiuser, comment_id)
274
275 Get single comment from repository or pull_request
276
277 :param apiuser: This is filled automatically from the |authtoken|.
278 :type apiuser: AuthUser
279 :param comment_id: comment id found in the URL of comment
280 :type comment_id: str or int
281
282 Example error output:
283
284 .. code-block:: bash
285
286 {
287 "id" : <id_given_in_input>,
288 "result" : {
289 "comment_author": <USER_DETAILS>,
290 "comment_created_on": "2017-02-01T14:38:16.309",
291 "comment_f_path": "file.txt",
292 "comment_id": 282,
293 "comment_lineno": "n1",
294 "comment_resolved_by": null,
295 "comment_status": [],
296 "comment_text": "This file needs a header",
297 "comment_type": "todo",
298 "comment_last_version: 0
299 },
300 "error" : null
301 }
302
303
239 304 get_repo
240 305 --------
241 306
242 307 .. py:function:: get_repo(apiuser, repoid, cache=<Optional:True>)
243 308
244 309 Gets an existing repository by its name or repository_id.
245 310
246 311 The members section so the output returns users groups or users
247 312 associated with that repository.
248 313
249 314 This command can only be run using an |authtoken| with admin rights,
250 315 or users with at least read rights to the |repo|.
251 316
252 317 :param apiuser: This is filled automatically from the |authtoken|.
253 318 :type apiuser: AuthUser
254 319 :param repoid: The repository name or repository id.
255 320 :type repoid: str or int
256 321 :param cache: use the cached value for last changeset
257 322 :type: cache: Optional(bool)
258 323
259 324 Example output:
260 325
261 326 .. code-block:: bash
262 327
263 328 {
264 329 "error": null,
265 330 "id": <repo_id>,
266 331 "result": {
267 332 "clone_uri": null,
268 333 "created_on": "timestamp",
269 334 "description": "repo description",
270 335 "enable_downloads": false,
271 336 "enable_locking": false,
272 337 "enable_statistics": false,
273 338 "followers": [
274 339 {
275 340 "active": true,
276 341 "admin": false,
277 342 "api_key": "****************************************",
278 343 "api_keys": [
279 344 "****************************************"
280 345 ],
281 346 "email": "user@example.com",
282 347 "emails": [
283 348 "user@example.com"
284 349 ],
285 350 "extern_name": "rhodecode",
286 351 "extern_type": "rhodecode",
287 352 "firstname": "username",
288 353 "ip_addresses": [],
289 354 "language": null,
290 355 "last_login": "2015-09-16T17:16:35.854",
291 356 "lastname": "surname",
292 357 "user_id": <user_id>,
293 358 "username": "name"
294 359 }
295 360 ],
296 361 "fork_of": "parent-repo",
297 362 "landing_rev": [
298 363 "rev",
299 364 "tip"
300 365 ],
301 366 "last_changeset": {
302 367 "author": "User <user@example.com>",
303 368 "branch": "default",
304 369 "date": "timestamp",
305 370 "message": "last commit message",
306 371 "parents": [
307 372 {
308 373 "raw_id": "commit-id"
309 374 }
310 375 ],
311 376 "raw_id": "commit-id",
312 377 "revision": <revision number>,
313 378 "short_id": "short id"
314 379 },
315 380 "lock_reason": null,
316 381 "locked_by": null,
317 382 "locked_date": null,
318 383 "owner": "owner-name",
319 384 "permissions": [
320 385 {
321 386 "name": "super-admin-name",
322 387 "origin": "super-admin",
323 388 "permission": "repository.admin",
324 389 "type": "user"
325 390 },
326 391 {
327 392 "name": "owner-name",
328 393 "origin": "owner",
329 394 "permission": "repository.admin",
330 395 "type": "user"
331 396 },
332 397 {
333 398 "name": "user-group-name",
334 399 "origin": "permission",
335 400 "permission": "repository.write",
336 401 "type": "user_group"
337 402 }
338 403 ],
339 404 "private": true,
340 405 "repo_id": 676,
341 406 "repo_name": "user-group/repo-name",
342 407 "repo_type": "hg"
343 408 }
344 409 }
345 410
346 411
347 412 get_repo_changeset
348 413 ------------------
349 414
350 415 .. py:function:: get_repo_changeset(apiuser, repoid, revision, details=<Optional:'basic'>)
351 416
352 417 Returns information about a changeset.
353 418
354 419 Additionally parameters define the amount of details returned by
355 420 this function.
356 421
357 422 This command can only be run using an |authtoken| with admin rights,
358 423 or users with at least read rights to the |repo|.
359 424
360 425 :param apiuser: This is filled automatically from the |authtoken|.
361 426 :type apiuser: AuthUser
362 427 :param repoid: The repository name or repository id
363 428 :type repoid: str or int
364 429 :param revision: revision for which listing should be done
365 430 :type revision: str
366 431 :param details: details can be 'basic|extended|full' full gives diff
367 432 info details like the diff itself, and number of changed files etc.
368 433 :type details: Optional(str)
369 434
370 435
371 436 get_repo_changesets
372 437 -------------------
373 438
374 439 .. py:function:: get_repo_changesets(apiuser, repoid, start_rev, limit, details=<Optional:'basic'>)
375 440
376 441 Returns a set of commits limited by the number starting
377 442 from the `start_rev` option.
378 443
379 444 Additional parameters define the amount of details returned by this
380 445 function.
381 446
382 447 This command can only be run using an |authtoken| with admin rights,
383 448 or users with at least read rights to |repos|.
384 449
385 450 :param apiuser: This is filled automatically from the |authtoken|.
386 451 :type apiuser: AuthUser
387 452 :param repoid: The repository name or repository ID.
388 453 :type repoid: str or int
389 454 :param start_rev: The starting revision from where to get changesets.
390 455 :type start_rev: str
391 456 :param limit: Limit the number of commits to this amount
392 457 :type limit: str or int
393 458 :param details: Set the level of detail returned. Valid option are:
394 459 ``basic``, ``extended`` and ``full``.
395 460 :type details: Optional(str)
396 461
397 462 .. note::
398 463
399 464 Setting the parameter `details` to the value ``full`` is extensive
400 465 and returns details like the diff itself, and the number
401 466 of changed files.
402 467
403 468
404 469 get_repo_comments
405 470 -----------------
406 471
407 472 .. py:function:: get_repo_comments(apiuser, repoid, commit_id=<Optional:None>, comment_type=<Optional:None>, userid=<Optional:None>)
408 473
409 474 Get all comments for a repository
410 475
411 476 :param apiuser: This is filled automatically from the |authtoken|.
412 477 :type apiuser: AuthUser
413 478 :param repoid: Set the repository name or repository ID.
414 479 :type repoid: str or int
415 480 :param commit_id: Optionally filter the comments by the commit_id
416 481 :type commit_id: Optional(str), default: None
417 482 :param comment_type: Optionally filter the comments by the comment_type
418 483 one of: 'note', 'todo'
419 484 :type comment_type: Optional(str), default: None
420 485 :param userid: Optionally filter the comments by the author of comment
421 486 :type userid: Optional(str or int), Default: None
422 487
423 488 Example error output:
424 489
425 490 .. code-block:: bash
426 491
427 492 {
428 493 "id" : <id_given_in_input>,
429 494 "result" : [
430 495 {
431 496 "comment_author": <USER_DETAILS>,
432 497 "comment_created_on": "2017-02-01T14:38:16.309",
433 498 "comment_f_path": "file.txt",
434 499 "comment_id": 282,
435 500 "comment_lineno": "n1",
436 501 "comment_resolved_by": null,
437 502 "comment_status": [],
438 503 "comment_text": "This file needs a header",
439 "comment_type": "todo"
504 "comment_type": "todo",
505 "comment_last_version: 0
440 506 }
441 507 ],
442 508 "error" : null
443 509 }
444 510
445 511
446 512 get_repo_file
447 513 -------------
448 514
449 515 .. py:function:: get_repo_file(apiuser, repoid, commit_id, file_path, max_file_bytes=<Optional:None>, details=<Optional:'basic'>, cache=<Optional:True>)
450 516
451 517 Returns a single file from repository at given revision.
452 518
453 519 This command can only be run using an |authtoken| with admin rights,
454 520 or users with at least read rights to |repos|.
455 521
456 522 :param apiuser: This is filled automatically from the |authtoken|.
457 523 :type apiuser: AuthUser
458 524 :param repoid: The repository name or repository ID.
459 525 :type repoid: str or int
460 526 :param commit_id: The revision for which listing should be done.
461 527 :type commit_id: str
462 528 :param file_path: The path from which to start displaying.
463 529 :type file_path: str
464 530 :param details: Returns different set of information about nodes.
465 531 The valid options are ``minimal`` ``basic`` and ``full``.
466 532 :type details: Optional(str)
467 533 :param max_file_bytes: Only return file content under this file size bytes
468 534 :type max_file_bytes: Optional(int)
469 535 :param cache: Use internal caches for fetching files. If disabled fetching
470 536 files is slower but more memory efficient
471 537 :type cache: Optional(bool)
472 538
473 539 Example output:
474 540
475 541 .. code-block:: bash
476 542
477 543 id : <id_given_in_input>
478 544 result: {
479 545 "binary": false,
480 546 "extension": "py",
481 547 "lines": 35,
482 548 "content": "....",
483 549 "md5": "76318336366b0f17ee249e11b0c99c41",
484 550 "mimetype": "text/x-python",
485 551 "name": "python.py",
486 552 "size": 817,
487 553 "type": "file",
488 554 }
489 555 error: null
490 556
491 557
492 558 get_repo_fts_tree
493 559 -----------------
494 560
495 561 .. py:function:: get_repo_fts_tree(apiuser, repoid, commit_id, root_path)
496 562
497 563 Returns a list of tree nodes for path at given revision. This api is built
498 564 strictly for usage in full text search building, and shouldn't be consumed
499 565
500 566 This command can only be run using an |authtoken| with admin rights,
501 567 or users with at least read rights to |repos|.
502 568
503 569
504 570 get_repo_nodes
505 571 --------------
506 572
507 573 .. py:function:: get_repo_nodes(apiuser, repoid, revision, root_path, ret_type=<Optional:'all'>, details=<Optional:'basic'>, max_file_bytes=<Optional:None>)
508 574
509 575 Returns a list of nodes and children in a flat list for a given
510 576 path at given revision.
511 577
512 578 It's possible to specify ret_type to show only `files` or `dirs`.
513 579
514 580 This command can only be run using an |authtoken| with admin rights,
515 581 or users with at least read rights to |repos|.
516 582
517 583 :param apiuser: This is filled automatically from the |authtoken|.
518 584 :type apiuser: AuthUser
519 585 :param repoid: The repository name or repository ID.
520 586 :type repoid: str or int
521 587 :param revision: The revision for which listing should be done.
522 588 :type revision: str
523 589 :param root_path: The path from which to start displaying.
524 590 :type root_path: str
525 591 :param ret_type: Set the return type. Valid options are
526 592 ``all`` (default), ``files`` and ``dirs``.
527 593 :type ret_type: Optional(str)
528 594 :param details: Returns extended information about nodes, such as
529 595 md5, binary, and or content.
530 596 The valid options are ``basic`` and ``full``.
531 597 :type details: Optional(str)
532 598 :param max_file_bytes: Only return file content under this file size bytes
533 599 :type details: Optional(int)
534 600
535 601 Example output:
536 602
537 603 .. code-block:: bash
538 604
539 605 id : <id_given_in_input>
540 606 result: [
541 607 {
542 608 "binary": false,
543 609 "content": "File line",
544 610 "extension": "md",
545 611 "lines": 2,
546 612 "md5": "059fa5d29b19c0657e384749480f6422",
547 613 "mimetype": "text/x-minidsrc",
548 614 "name": "file.md",
549 615 "size": 580,
550 616 "type": "file"
551 617 },
552 618 ...
553 619 ]
554 620 error: null
555 621
556 622
557 623 get_repo_refs
558 624 -------------
559 625
560 626 .. py:function:: get_repo_refs(apiuser, repoid)
561 627
562 628 Returns a dictionary of current references. It returns
563 629 bookmarks, branches, closed_branches, and tags for given repository
564 630
565 631 It's possible to specify ret_type to show only `files` or `dirs`.
566 632
567 633 This command can only be run using an |authtoken| with admin rights,
568 634 or users with at least read rights to |repos|.
569 635
570 636 :param apiuser: This is filled automatically from the |authtoken|.
571 637 :type apiuser: AuthUser
572 638 :param repoid: The repository name or repository ID.
573 639 :type repoid: str or int
574 640
575 641 Example output:
576 642
577 643 .. code-block:: bash
578 644
579 645 id : <id_given_in_input>
580 646 "result": {
581 647 "bookmarks": {
582 648 "dev": "5611d30200f4040ba2ab4f3d64e5b06408a02188",
583 649 "master": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf"
584 650 },
585 651 "branches": {
586 652 "default": "5611d30200f4040ba2ab4f3d64e5b06408a02188",
587 653 "stable": "367f590445081d8ec8c2ea0456e73ae1f1c3d6cf"
588 654 },
589 655 "branches_closed": {},
590 656 "tags": {
591 657 "tip": "5611d30200f4040ba2ab4f3d64e5b06408a02188",
592 658 "v4.4.0": "1232313f9e6adac5ce5399c2a891dc1e72b79022",
593 659 "v4.4.1": "cbb9f1d329ae5768379cdec55a62ebdd546c4e27",
594 660 "v4.4.2": "24ffe44a27fcd1c5b6936144e176b9f6dd2f3a17",
595 661 }
596 662 }
597 663 error: null
598 664
599 665
600 666 get_repo_settings
601 667 -----------------
602 668
603 669 .. py:function:: get_repo_settings(apiuser, repoid, key=<Optional:None>)
604 670
605 671 Returns all settings for a repository. If key is given it only returns the
606 672 setting identified by the key or null.
607 673
608 674 :param apiuser: This is filled automatically from the |authtoken|.
609 675 :type apiuser: AuthUser
610 676 :param repoid: The repository name or repository id.
611 677 :type repoid: str or int
612 678 :param key: Key of the setting to return.
613 679 :type: key: Optional(str)
614 680
615 681 Example output:
616 682
617 683 .. code-block:: bash
618 684
619 685 {
620 686 "error": null,
621 687 "id": 237,
622 688 "result": {
623 689 "extensions_largefiles": true,
624 690 "extensions_evolve": true,
625 691 "hooks_changegroup_push_logger": true,
626 692 "hooks_changegroup_repo_size": false,
627 693 "hooks_outgoing_pull_logger": true,
628 694 "phases_publish": "True",
629 695 "rhodecode_hg_use_rebase_for_merging": true,
630 696 "rhodecode_pr_merge_enabled": true,
631 697 "rhodecode_use_outdated_comments": true
632 698 }
633 699 }
634 700
635 701
636 702 get_repos
637 703 ---------
638 704
639 705 .. py:function:: get_repos(apiuser, root=<Optional:None>, traverse=<Optional:True>)
640 706
641 707 Lists all existing repositories.
642 708
643 709 This command can only be run using an |authtoken| with admin rights,
644 710 or users with at least read rights to |repos|.
645 711
646 712 :param apiuser: This is filled automatically from the |authtoken|.
647 713 :type apiuser: AuthUser
648 714 :param root: specify root repository group to fetch repositories.
649 715 filters the returned repositories to be members of given root group.
650 716 :type root: Optional(None)
651 717 :param traverse: traverse given root into subrepositories. With this flag
652 718 set to False, it will only return top-level repositories from `root`.
653 719 if root is empty it will return just top-level repositories.
654 720 :type traverse: Optional(True)
655 721
656 722
657 723 Example output:
658 724
659 725 .. code-block:: bash
660 726
661 727 id : <id_given_in_input>
662 728 result: [
663 729 {
664 730 "repo_id" : "<repo_id>",
665 731 "repo_name" : "<reponame>"
666 732 "repo_type" : "<repo_type>",
667 733 "clone_uri" : "<clone_uri>",
668 734 "private": : "<bool>",
669 735 "created_on" : "<datetimecreated>",
670 736 "description" : "<description>",
671 737 "landing_rev": "<landing_rev>",
672 738 "owner": "<repo_owner>",
673 739 "fork_of": "<name_of_fork_parent>",
674 740 "enable_downloads": "<bool>",
675 741 "enable_locking": "<bool>",
676 742 "enable_statistics": "<bool>",
677 743 },
678 744 ...
679 745 ]
680 746 error: null
681 747
682 748
683 749 grant_user_group_permission
684 750 ---------------------------
685 751
686 752 .. py:function:: grant_user_group_permission(apiuser, repoid, usergroupid, perm)
687 753
688 754 Grant permission for a user group on the specified repository,
689 755 or update existing permissions.
690 756
691 757 This command can only be run using an |authtoken| with admin
692 758 permissions on the |repo|.
693 759
694 760 :param apiuser: This is filled automatically from the |authtoken|.
695 761 :type apiuser: AuthUser
696 762 :param repoid: Set the repository name or repository ID.
697 763 :type repoid: str or int
698 764 :param usergroupid: Specify the ID of the user group.
699 765 :type usergroupid: str or int
700 766 :param perm: Set the user group permissions using the following
701 767 format: (repository.(none|read|write|admin))
702 768 :type perm: str
703 769
704 770 Example output:
705 771
706 772 .. code-block:: bash
707 773
708 774 id : <id_given_in_input>
709 775 result : {
710 776 "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`",
711 777 "success": true
712 778
713 779 }
714 780 error : null
715 781
716 782 Example error output:
717 783
718 784 .. code-block:: bash
719 785
720 786 id : <id_given_in_input>
721 787 result : null
722 788 error : {
723 789 "failed to edit permission for user group: `<usergroup>` in repo `<repo>`'
724 790 }
725 791
726 792
727 793 grant_user_permission
728 794 ---------------------
729 795
730 796 .. py:function:: grant_user_permission(apiuser, repoid, userid, perm)
731 797
732 798 Grant permissions for the specified user on the given repository,
733 799 or update existing permissions if found.
734 800
735 801 This command can only be run using an |authtoken| with admin
736 802 permissions on the |repo|.
737 803
738 804 :param apiuser: This is filled automatically from the |authtoken|.
739 805 :type apiuser: AuthUser
740 806 :param repoid: Set the repository name or repository ID.
741 807 :type repoid: str or int
742 808 :param userid: Set the user name.
743 809 :type userid: str
744 810 :param perm: Set the user permissions, using the following format
745 811 ``(repository.(none|read|write|admin))``
746 812 :type perm: str
747 813
748 814 Example output:
749 815
750 816 .. code-block:: bash
751 817
752 818 id : <id_given_in_input>
753 819 result: {
754 820 "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`",
755 821 "success": true
756 822 }
757 823 error: null
758 824
759 825
760 826 invalidate_cache
761 827 ----------------
762 828
763 829 .. py:function:: invalidate_cache(apiuser, repoid, delete_keys=<Optional:False>)
764 830
765 831 Invalidates the cache for the specified repository.
766 832
767 833 This command can only be run using an |authtoken| with admin rights to
768 834 the specified repository.
769 835
770 836 This command takes the following options:
771 837
772 838 :param apiuser: This is filled automatically from |authtoken|.
773 839 :type apiuser: AuthUser
774 840 :param repoid: Sets the repository name or repository ID.
775 841 :type repoid: str or int
776 842 :param delete_keys: This deletes the invalidated keys instead of
777 843 just flagging them.
778 844 :type delete_keys: Optional(``True`` | ``False``)
779 845
780 846 Example output:
781 847
782 848 .. code-block:: bash
783 849
784 850 id : <id_given_in_input>
785 851 result : {
786 852 'msg': Cache for repository `<repository name>` was invalidated,
787 853 'repository': <repository name>
788 854 }
789 855 error : null
790 856
791 857 Example error output:
792 858
793 859 .. code-block:: bash
794 860
795 861 id : <id_given_in_input>
796 862 result : null
797 863 error : {
798 864 'Error occurred during cache invalidation action'
799 865 }
800 866
801 867
802 868 lock
803 869 ----
804 870
805 871 .. py:function:: lock(apiuser, repoid, locked=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>)
806 872
807 873 Sets the lock state of the specified |repo| by the given user.
808 874 From more information, see :ref:`repo-locking`.
809 875
810 876 * If the ``userid`` option is not set, the repository is locked to the
811 877 user who called the method.
812 878 * If the ``locked`` parameter is not set, the current lock state of the
813 879 repository is displayed.
814 880
815 881 This command can only be run using an |authtoken| with admin rights to
816 882 the specified repository.
817 883
818 884 This command takes the following options:
819 885
820 886 :param apiuser: This is filled automatically from the |authtoken|.
821 887 :type apiuser: AuthUser
822 888 :param repoid: Sets the repository name or repository ID.
823 889 :type repoid: str or int
824 890 :param locked: Sets the lock state.
825 891 :type locked: Optional(``True`` | ``False``)
826 892 :param userid: Set the repository lock to this user.
827 893 :type userid: Optional(str or int)
828 894
829 895 Example error output:
830 896
831 897 .. code-block:: bash
832 898
833 899 id : <id_given_in_input>
834 900 result : {
835 901 'repo': '<reponame>',
836 902 'locked': <bool: lock state>,
837 903 'locked_since': <int: lock timestamp>,
838 904 'locked_by': <username of person who made the lock>,
839 905 'lock_reason': <str: reason for locking>,
840 906 'lock_state_changed': <bool: True if lock state has been changed in this request>,
841 907 'msg': 'Repo `<reponame>` locked by `<username>` on <timestamp>.'
842 908 or
843 909 'msg': 'Repo `<repository name>` not locked.'
844 910 or
845 911 'msg': 'User `<user name>` set lock state for repo `<repository name>` to `<new lock state>`'
846 912 }
847 913 error : null
848 914
849 915 Example error output:
850 916
851 917 .. code-block:: bash
852 918
853 919 id : <id_given_in_input>
854 920 result : null
855 921 error : {
856 922 'Error occurred locking repository `<reponame>`'
857 923 }
858 924
859 925
860 926 maintenance
861 927 -----------
862 928
863 929 .. py:function:: maintenance(apiuser, repoid)
864 930
865 931 Triggers a maintenance on the given repository.
866 932
867 933 This command can only be run using an |authtoken| with admin
868 934 rights to the specified repository. For more information,
869 935 see :ref:`config-token-ref`.
870 936
871 937 This command takes the following options:
872 938
873 939 :param apiuser: This is filled automatically from the |authtoken|.
874 940 :type apiuser: AuthUser
875 941 :param repoid: The repository name or repository ID.
876 942 :type repoid: str or int
877 943
878 944 Example output:
879 945
880 946 .. code-block:: bash
881 947
882 948 id : <id_given_in_input>
883 949 result : {
884 950 "msg": "executed maintenance command",
885 951 "executed_actions": [
886 952 <action_message>, <action_message2>...
887 953 ],
888 954 "repository": "<repository name>"
889 955 }
890 956 error : null
891 957
892 958 Example error output:
893 959
894 960 .. code-block:: bash
895 961
896 962 id : <id_given_in_input>
897 963 result : null
898 964 error : {
899 965 "Unable to execute maintenance on `<reponame>`"
900 966 }
901 967
902 968
903 969 pull
904 970 ----
905 971
906 972 .. py:function:: pull(apiuser, repoid, remote_uri=<Optional:None>)
907 973
908 974 Triggers a pull on the given repository from a remote location. You
909 975 can use this to keep remote repositories up-to-date.
910 976
911 977 This command can only be run using an |authtoken| with admin
912 978 rights to the specified repository. For more information,
913 979 see :ref:`config-token-ref`.
914 980
915 981 This command takes the following options:
916 982
917 983 :param apiuser: This is filled automatically from the |authtoken|.
918 984 :type apiuser: AuthUser
919 985 :param repoid: The repository name or repository ID.
920 986 :type repoid: str or int
921 987 :param remote_uri: Optional remote URI to pass in for pull
922 988 :type remote_uri: str
923 989
924 990 Example output:
925 991
926 992 .. code-block:: bash
927 993
928 994 id : <id_given_in_input>
929 995 result : {
930 996 "msg": "Pulled from url `<remote_url>` on repo `<repository name>`"
931 997 "repository": "<repository name>"
932 998 }
933 999 error : null
934 1000
935 1001 Example error output:
936 1002
937 1003 .. code-block:: bash
938 1004
939 1005 id : <id_given_in_input>
940 1006 result : null
941 1007 error : {
942 1008 "Unable to push changes from `<remote_url>`"
943 1009 }
944 1010
945 1011
946 1012 remove_field_from_repo
947 1013 ----------------------
948 1014
949 1015 .. py:function:: remove_field_from_repo(apiuser, repoid, key)
950 1016
951 1017 Removes an extra field from a repository.
952 1018
953 1019 This command can only be run using an |authtoken| with at least
954 1020 write permissions to the |repo|.
955 1021
956 1022 :param apiuser: This is filled automatically from the |authtoken|.
957 1023 :type apiuser: AuthUser
958 1024 :param repoid: Set the repository name or repository ID.
959 1025 :type repoid: str or int
960 1026 :param key: Set the unique field key for this repository.
961 1027 :type key: str
962 1028
963 1029
964 1030 revoke_user_group_permission
965 1031 ----------------------------
966 1032
967 1033 .. py:function:: revoke_user_group_permission(apiuser, repoid, usergroupid)
968 1034
969 1035 Revoke the permissions of a user group on a given repository.
970 1036
971 1037 This command can only be run using an |authtoken| with admin
972 1038 permissions on the |repo|.
973 1039
974 1040 :param apiuser: This is filled automatically from the |authtoken|.
975 1041 :type apiuser: AuthUser
976 1042 :param repoid: Set the repository name or repository ID.
977 1043 :type repoid: str or int
978 1044 :param usergroupid: Specify the user group ID.
979 1045 :type usergroupid: str or int
980 1046
981 1047 Example output:
982 1048
983 1049 .. code-block:: bash
984 1050
985 1051 id : <id_given_in_input>
986 1052 result: {
987 1053 "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`",
988 1054 "success": true
989 1055 }
990 1056 error: null
991 1057
992 1058
993 1059 revoke_user_permission
994 1060 ----------------------
995 1061
996 1062 .. py:function:: revoke_user_permission(apiuser, repoid, userid)
997 1063
998 1064 Revoke permission for a user on the specified repository.
999 1065
1000 1066 This command can only be run using an |authtoken| with admin
1001 1067 permissions on the |repo|.
1002 1068
1003 1069 :param apiuser: This is filled automatically from the |authtoken|.
1004 1070 :type apiuser: AuthUser
1005 1071 :param repoid: Set the repository name or repository ID.
1006 1072 :type repoid: str or int
1007 1073 :param userid: Set the user name of revoked user.
1008 1074 :type userid: str or int
1009 1075
1010 1076 Example error output:
1011 1077
1012 1078 .. code-block:: bash
1013 1079
1014 1080 id : <id_given_in_input>
1015 1081 result: {
1016 1082 "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`",
1017 1083 "success": true
1018 1084 }
1019 1085 error: null
1020 1086
1021 1087
1022 1088 set_repo_settings
1023 1089 -----------------
1024 1090
1025 1091 .. py:function:: set_repo_settings(apiuser, repoid, settings)
1026 1092
1027 1093 Update repository settings. Returns true on success.
1028 1094
1029 1095 :param apiuser: This is filled automatically from the |authtoken|.
1030 1096 :type apiuser: AuthUser
1031 1097 :param repoid: The repository name or repository id.
1032 1098 :type repoid: str or int
1033 1099 :param settings: The new settings for the repository.
1034 1100 :type: settings: dict
1035 1101
1036 1102 Example output:
1037 1103
1038 1104 .. code-block:: bash
1039 1105
1040 1106 {
1041 1107 "error": null,
1042 1108 "id": 237,
1043 1109 "result": true
1044 1110 }
1045 1111
1046 1112
1047 1113 strip
1048 1114 -----
1049 1115
1050 1116 .. py:function:: strip(apiuser, repoid, revision, branch)
1051 1117
1052 1118 Strips the given revision from the specified repository.
1053 1119
1054 1120 * This will remove the revision and all of its decendants.
1055 1121
1056 1122 This command can only be run using an |authtoken| with admin rights to
1057 1123 the specified repository.
1058 1124
1059 1125 This command takes the following options:
1060 1126
1061 1127 :param apiuser: This is filled automatically from the |authtoken|.
1062 1128 :type apiuser: AuthUser
1063 1129 :param repoid: The repository name or repository ID.
1064 1130 :type repoid: str or int
1065 1131 :param revision: The revision you wish to strip.
1066 1132 :type revision: str
1067 1133 :param branch: The branch from which to strip the revision.
1068 1134 :type branch: str
1069 1135
1070 1136 Example output:
1071 1137
1072 1138 .. code-block:: bash
1073 1139
1074 1140 id : <id_given_in_input>
1075 1141 result : {
1076 1142 "msg": "'Stripped commit <commit_hash> from repo `<repository name>`'"
1077 1143 "repository": "<repository name>"
1078 1144 }
1079 1145 error : null
1080 1146
1081 1147 Example error output:
1082 1148
1083 1149 .. code-block:: bash
1084 1150
1085 1151 id : <id_given_in_input>
1086 1152 result : null
1087 1153 error : {
1088 1154 "Unable to strip commit <commit_hash> from repo `<repository name>`"
1089 1155 }
1090 1156
1091 1157
1092 1158 update_repo
1093 1159 -----------
1094 1160
1095 1161 .. py:function:: update_repo(apiuser, repoid, repo_name=<Optional:None>, owner=<Optional:<OptionalAttr:apiuser>>, description=<Optional:''>, private=<Optional:False>, clone_uri=<Optional:None>, push_uri=<Optional:None>, landing_rev=<Optional:None>, fork_of=<Optional:None>, enable_statistics=<Optional:False>, enable_locking=<Optional:False>, enable_downloads=<Optional:False>, fields=<Optional:''>)
1096 1162
1097 1163 Updates a repository with the given information.
1098 1164
1099 1165 This command can only be run using an |authtoken| with at least
1100 1166 admin permissions to the |repo|.
1101 1167
1102 1168 * If the repository name contains "/", repository will be updated
1103 1169 accordingly with a repository group or nested repository groups
1104 1170
1105 1171 For example repoid=repo-test name="foo/bar/repo-test" will update |repo|
1106 1172 called "repo-test" and place it inside group "foo/bar".
1107 1173 You have to have permissions to access and write to the last repository
1108 1174 group ("bar" in this example)
1109 1175
1110 1176 :param apiuser: This is filled automatically from the |authtoken|.
1111 1177 :type apiuser: AuthUser
1112 1178 :param repoid: repository name or repository ID.
1113 1179 :type repoid: str or int
1114 1180 :param repo_name: Update the |repo| name, including the
1115 1181 repository group it's in.
1116 1182 :type repo_name: str
1117 1183 :param owner: Set the |repo| owner.
1118 1184 :type owner: str
1119 1185 :param fork_of: Set the |repo| as fork of another |repo|.
1120 1186 :type fork_of: str
1121 1187 :param description: Update the |repo| description.
1122 1188 :type description: str
1123 1189 :param private: Set the |repo| as private. (True | False)
1124 1190 :type private: bool
1125 1191 :param clone_uri: Update the |repo| clone URI.
1126 1192 :type clone_uri: str
1127 1193 :param landing_rev: Set the |repo| landing revision. e.g branch:default, book:dev, rev:abcd
1128 1194 :type landing_rev: str
1129 1195 :param enable_statistics: Enable statistics on the |repo|, (True | False).
1130 1196 :type enable_statistics: bool
1131 1197 :param enable_locking: Enable |repo| locking.
1132 1198 :type enable_locking: bool
1133 1199 :param enable_downloads: Enable downloads from the |repo|, (True | False).
1134 1200 :type enable_downloads: bool
1135 1201 :param fields: Add extra fields to the |repo|. Use the following
1136 1202 example format: ``field_key=field_val,field_key2=fieldval2``.
1137 1203 Escape ', ' with \,
1138 1204 :type fields: str
1139 1205
1140 1206
General Comments 0
You need to be logged in to leave comments. Login now