Show More
@@ -0,0 +1,37 b'' | |||
|
1 | .. _store-methods-ref: | |
|
2 | ||
|
3 | store methods | |
|
4 | ============= | |
|
5 | ||
|
6 | file_store_add (EE only) | |
|
7 | ------------------------ | |
|
8 | ||
|
9 | .. py:function:: file_store_add(apiuser, filename, content) | |
|
10 | ||
|
11 | Upload API for the file_store | |
|
12 | ||
|
13 | Example usage from CLI:: | |
|
14 | rhodecode-api --instance-name=enterprise-1 upload_file "{"content": "$(cat image.jpg | base64)", "filename":"image.jpg"}" | |
|
15 | ||
|
16 | This command takes the following options: | |
|
17 | ||
|
18 | :param apiuser: This is filled automatically from the |authtoken|. | |
|
19 | :type apiuser: AuthUser | |
|
20 | :param filename: name of the file uploaded | |
|
21 | :type filename: str | |
|
22 | :param content: base64 encoded content of the uploaded file | |
|
23 | :type content: str | |
|
24 | ||
|
25 | Example output: | |
|
26 | ||
|
27 | .. code-block:: bash | |
|
28 | ||
|
29 | id : <id_given_in_input> | |
|
30 | result: { | |
|
31 | "access_path": "/_file_store/download/84d156f7-8323-4ad3-9fce-4a8e88e1deaf-0.jpg", | |
|
32 | "access_path_fqn": "http://server.domain.com/_file_store/download/84d156f7-8323-4ad3-9fce-4a8e88e1deaf-0.jpg", | |
|
33 | "store_fid": "84d156f7-8323-4ad3-9fce-4a8e88e1deaf-0.jpg" | |
|
34 | } | |
|
35 | error : null | |
|
36 | ||
|
37 |
@@ -196,7 +196,8 b' are not required in args.' | |||
|
196 | 196 | .. --- API DEFS MARKER --- |
|
197 | 197 | .. toctree:: |
|
198 | 198 | |
|
199 |
methods/ |
|
|
199 | methods/repo-methods | |
|
200 | methods/store-methods | |
|
200 | 201 | methods/license-methods |
|
201 | 202 | methods/deprecated-methods |
|
202 | 203 | methods/gist-methods |
@@ -83,7 +83,7 b' comment_pull_request' | |||
|
83 | 83 | create_pull_request |
|
84 | 84 | ------------------- |
|
85 | 85 | |
|
86 | .. py:function:: create_pull_request(apiuser, source_repo, target_repo, source_ref, target_ref, title=<Optional:''>, description=<Optional:''>, description_renderer=<Optional:''>, reviewers=<Optional:None>) | |
|
86 | .. py:function:: create_pull_request(apiuser, source_repo, target_repo, source_ref, target_ref, owner=<Optional:<OptionalAttr:apiuser>>, title=<Optional:''>, description=<Optional:''>, description_renderer=<Optional:''>, reviewers=<Optional:None>) | |
|
87 | 87 | |
|
88 | 88 | Creates a new pull request. |
|
89 | 89 | |
@@ -104,6 +104,8 b' create_pull_request' | |||
|
104 | 104 | :type source_ref: str |
|
105 | 105 | :param target_ref: Set the target ref name. |
|
106 | 106 | :type target_ref: str |
|
107 | :param owner: user_id or username | |
|
108 | :type owner: Optional(str) | |
|
107 | 109 | :param title: Optionally Set the pull request title, it's generated otherwise |
|
108 | 110 | :type title: str |
|
109 | 111 | :param description: Set the pull request description. |
@@ -248,7 +250,7 b' get_pull_request_comments' | |||
|
248 | 250 | get_pull_requests |
|
249 | 251 | ----------------- |
|
250 | 252 | |
|
251 | .. py:function:: get_pull_requests(apiuser, repoid, status=<Optional:'new'>) | |
|
253 | .. py:function:: get_pull_requests(apiuser, repoid, status=<Optional:'new'>, merge_state=<Optional:True>) | |
|
252 | 254 | |
|
253 | 255 | Get all pull requests from the repository specified in `repoid`. |
|
254 | 256 | |
@@ -262,6 +264,9 b' get_pull_requests' | |||
|
262 | 264 | * ``open`` |
|
263 | 265 | * ``closed`` |
|
264 | 266 | :type status: str |
|
267 | :param merge_state: Optional calculate merge state for each repository. | |
|
268 | This could result in longer time to fetch the data | |
|
269 | :type merge_state: bool | |
|
265 | 270 | |
|
266 | 271 | Example output: |
|
267 | 272 | |
@@ -358,6 +363,7 b' merge_pull_request' | |||
|
358 | 363 | "result": { |
|
359 | 364 | "executed": "<bool>", |
|
360 | 365 | "failure_reason": "<int>", |
|
366 | "merge_status_message": "<str>", | |
|
361 | 367 | "merge_commit_id": "<merge_commit_id>", |
|
362 | 368 | "possible": "<bool>", |
|
363 | 369 | "merge_ref": { |
@@ -394,6 +394,105 b' get_repo_changesets' | |||
|
394 | 394 | of changed files. |
|
395 | 395 | |
|
396 | 396 | |
|
397 | get_repo_comments | |
|
398 | ----------------- | |
|
399 | ||
|
400 | .. py:function:: get_repo_comments(apiuser, repoid, commit_id=<Optional:None>, comment_type=<Optional:None>, userid=<Optional:None>) | |
|
401 | ||
|
402 | Get all comments for a repository | |
|
403 | ||
|
404 | :param apiuser: This is filled automatically from the |authtoken|. | |
|
405 | :type apiuser: AuthUser | |
|
406 | :param repoid: Set the repository name or repository ID. | |
|
407 | :type repoid: str or int | |
|
408 | :param commit_id: Optionally filter the comments by the commit_id | |
|
409 | :type commit_id: Optional(str), default: None | |
|
410 | :param comment_type: Optionally filter the comments by the comment_type | |
|
411 | one of: 'note', 'todo' | |
|
412 | :type comment_type: Optional(str), default: None | |
|
413 | :param userid: Optionally filter the comments by the author of comment | |
|
414 | :type userid: Optional(str or int), Default: None | |
|
415 | ||
|
416 | Example error output: | |
|
417 | ||
|
418 | .. code-block:: bash | |
|
419 | ||
|
420 | { | |
|
421 | "id" : <id_given_in_input>, | |
|
422 | "result" : [ | |
|
423 | { | |
|
424 | "comment_author": <USER_DETAILS>, | |
|
425 | "comment_created_on": "2017-02-01T14:38:16.309", | |
|
426 | "comment_f_path": "file.txt", | |
|
427 | "comment_id": 282, | |
|
428 | "comment_lineno": "n1", | |
|
429 | "comment_resolved_by": null, | |
|
430 | "comment_status": [], | |
|
431 | "comment_text": "This file needs a header", | |
|
432 | "comment_type": "todo" | |
|
433 | } | |
|
434 | ], | |
|
435 | "error" : null | |
|
436 | } | |
|
437 | ||
|
438 | ||
|
439 | get_repo_file | |
|
440 | ------------- | |
|
441 | ||
|
442 | .. py:function:: get_repo_file(apiuser, repoid, commit_id, file_path, max_file_bytes=<Optional:None>, details=<Optional:'basic'>, cache=<Optional:True>) | |
|
443 | ||
|
444 | Returns a single file from repository at given revision. | |
|
445 | ||
|
446 | This command can only be run using an |authtoken| with admin rights, | |
|
447 | or users with at least read rights to |repos|. | |
|
448 | ||
|
449 | :param apiuser: This is filled automatically from the |authtoken|. | |
|
450 | :type apiuser: AuthUser | |
|
451 | :param repoid: The repository name or repository ID. | |
|
452 | :type repoid: str or int | |
|
453 | :param commit_id: The revision for which listing should be done. | |
|
454 | :type commit_id: str | |
|
455 | :param file_path: The path from which to start displaying. | |
|
456 | :type file_path: str | |
|
457 | :param details: Returns different set of information about nodes. | |
|
458 | The valid options are ``minimal`` ``basic`` and ``full``. | |
|
459 | :type details: Optional(str) | |
|
460 | :param max_file_bytes: Only return file content under this file size bytes | |
|
461 | :type max_file_bytes: Optional(int) | |
|
462 | :param cache: Use internal caches for fetching files. If disabled fetching | |
|
463 | files is slower but more memory efficient | |
|
464 | :type cache: Optional(bool) | |
|
465 | Example output: | |
|
466 | ||
|
467 | .. code-block:: bash | |
|
468 | ||
|
469 | id : <id_given_in_input> | |
|
470 | result: { | |
|
471 | "binary": false, | |
|
472 | "extension": "py", | |
|
473 | "lines": 35, | |
|
474 | "content": "....", | |
|
475 | "md5": "76318336366b0f17ee249e11b0c99c41", | |
|
476 | "mimetype": "text/x-python", | |
|
477 | "name": "python.py", | |
|
478 | "size": 817, | |
|
479 | "type": "file", | |
|
480 | } | |
|
481 | error: null | |
|
482 | ||
|
483 | ||
|
484 | get_repo_fts_tree | |
|
485 | ----------------- | |
|
486 | ||
|
487 | .. py:function:: get_repo_fts_tree(apiuser, repoid, commit_id, root_path) | |
|
488 | ||
|
489 | Returns a list of tree nodes for path at given revision. This api is built | |
|
490 | strictly for usage in full text search building, and shouldn't be consumed | |
|
491 | ||
|
492 | This command can only be run using an |authtoken| with admin rights, | |
|
493 | or users with at least read rights to |repos|. | |
|
494 | ||
|
495 | ||
|
397 | 496 | get_repo_nodes |
|
398 | 497 | -------------- |
|
399 | 498 | |
@@ -419,8 +518,8 b' get_repo_nodes' | |||
|
419 | 518 | ``all`` (default), ``files`` and ``dirs``. |
|
420 | 519 | :type ret_type: Optional(str) |
|
421 | 520 | :param details: Returns extended information about nodes, such as |
|
422 |
md5, binary, and or content. |
|
|
423 | ``full``. | |
|
521 | md5, binary, and or content. | |
|
522 | The valid options are ``basic`` and ``full``. | |
|
424 | 523 | :type details: Optional(str) |
|
425 | 524 | :param max_file_bytes: Only return file content under this file size bytes |
|
426 | 525 | :type details: Optional(int) |
@@ -432,10 +531,17 b' get_repo_nodes' | |||
|
432 | 531 | id : <id_given_in_input> |
|
433 | 532 | result: [ |
|
434 | 533 | { |
|
435 |
|
|
|
436 |
"t |
|
|
437 | "binary": "<true|false>" (only in extended mode) | |
|
438 | "md5" : "<md5 of file content>" (only in extended mode) | |
|
534 | "binary": false, | |
|
535 | "content": "File line | |
|
536 | Line2 | |
|
537 | ", | |
|
538 | "extension": "md", | |
|
539 | "lines": 2, | |
|
540 | "md5": "059fa5d29b19c0657e384749480f6422", | |
|
541 | "mimetype": "text/x-minidsrc", | |
|
542 | "name": "file.md", | |
|
543 | "size": 580, | |
|
544 | "type": "file" | |
|
439 | 545 | }, |
|
440 | 546 | ... |
|
441 | 547 | ] |
@@ -103,7 +103,7 b' get_method' | |||
|
103 | 103 | :param apiuser: This is filled automatically from the |authtoken|. |
|
104 | 104 | :type apiuser: AuthUser |
|
105 | 105 | :param pattern: pattern to match method names against |
|
106 |
:type |
|
|
106 | :type pattern: Optional("*") | |
|
107 | 107 | |
|
108 | 108 | Example output: |
|
109 | 109 | |
@@ -232,3 +232,37 b' rescan_repos' | |||
|
232 | 232 | } |
|
233 | 233 | |
|
234 | 234 | |
|
235 | store_exception | |
|
236 | --------------- | |
|
237 | ||
|
238 | .. py:function:: store_exception(apiuser, exc_data_json, prefix=<Optional:'rhodecode'>) | |
|
239 | ||
|
240 | Stores sent exception inside the built-in exception tracker in |RCE| server. | |
|
241 | ||
|
242 | This command can only be run using an |authtoken| with admin rights to | |
|
243 | the specified repository. | |
|
244 | ||
|
245 | This command takes the following options: | |
|
246 | ||
|
247 | :param apiuser: This is filled automatically from the |authtoken|. | |
|
248 | :type apiuser: AuthUser | |
|
249 | ||
|
250 | :param exc_data_json: JSON data with exception e.g | |
|
251 | {"exc_traceback": "Value `1` is not allowed", "exc_type_name": "ValueError"} | |
|
252 | :type exc_data_json: JSON data | |
|
253 | ||
|
254 | :param prefix: prefix for error type, e.g 'rhodecode', 'vcsserver', 'rhodecode-tools' | |
|
255 | :type prefix: Optional("rhodecode") | |
|
256 | ||
|
257 | Example output: | |
|
258 | ||
|
259 | .. code-block:: bash | |
|
260 | ||
|
261 | id : <id_given_in_input> | |
|
262 | "result": { | |
|
263 | "exc_id": 139718459226384, | |
|
264 | "exc_url": "http://localhost:8080/_admin/settings/exceptions/139718459226384" | |
|
265 | } | |
|
266 | error : null | |
|
267 | ||
|
268 |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now