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