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