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