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