docs: updated API docs
This commit is contained in:
parent
00fa6c3e5c
commit
19e8cae7a5
3 changed files with 71 additions and 13 deletions
|
|
@ -36,7 +36,7 @@ close_pull_request
|
|||
comment_pull_request
|
||||
--------------------
|
||||
|
||||
.. py:function:: comment_pull_request(apiuser, repoid, pullrequestid, message=<Optional:None>, status=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>)
|
||||
.. py:function:: comment_pull_request(apiuser, repoid, pullrequestid, message=<Optional:None>, commit_id=<Optional:None>, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>)
|
||||
|
||||
Comment on the pull request specified with the `pullrequestid`,
|
||||
in the |repo| specified by the `repoid`, and optionally change the
|
||||
|
|
@ -48,15 +48,18 @@ comment_pull_request
|
|||
:type repoid: str or int
|
||||
:param pullrequestid: The pull request ID.
|
||||
:type pullrequestid: int
|
||||
:param commit_id: Specify the commit_id for which to set a comment. If
|
||||
given commit_id is different than latest in the PR status
|
||||
change won't be performed.
|
||||
:type commit_id: str
|
||||
:param message: The text content of the comment.
|
||||
:type message: str
|
||||
:param status: (**Optional**) Set the approval status of the pull
|
||||
request. Valid options are:
|
||||
* not_reviewed
|
||||
* approved
|
||||
* rejected
|
||||
* under_review
|
||||
request. One of: 'not_reviewed', 'approved', 'rejected',
|
||||
'under_review'
|
||||
:type status: str
|
||||
:param comment_type: Comment type, one of: 'note', 'todo'
|
||||
:type comment_type: Optional(str), default: 'note'
|
||||
:param userid: Comment on the pull request as this user
|
||||
:type userid: Optional(str or int)
|
||||
|
||||
|
|
@ -68,7 +71,9 @@ comment_pull_request
|
|||
result :
|
||||
{
|
||||
"pull_request_id": "<Integer>",
|
||||
"comment_id": "<Integer>"
|
||||
"comment_id": "<Integer>",
|
||||
"status": {"given": <given_status>,
|
||||
"was_changed": <bool status_was_actually_changed> },
|
||||
}
|
||||
error : null
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ add_field_to_repo
|
|||
comment_commit
|
||||
--------------
|
||||
|
||||
.. py:function:: comment_commit(apiuser, repoid, commit_id, message, userid=<Optional:<OptionalAttr:apiuser>>, status=<Optional:None>)
|
||||
.. py:function:: comment_commit(apiuser, repoid, commit_id, message, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>)
|
||||
|
||||
Set a commit comment, and optionally change the status of the commit.
|
||||
|
||||
|
|
@ -40,15 +40,17 @@ comment_commit
|
|||
:type commit_id: str
|
||||
:param message: The comment text.
|
||||
:type message: str
|
||||
:param status: (**Optional**) status of commit, one of: 'not_reviewed',
|
||||
'approved', 'rejected', 'under_review'
|
||||
:type status: str
|
||||
:param comment_type: Comment type, one of: 'note', 'todo'
|
||||
:type comment_type: Optional(str), default: 'note'
|
||||
:param userid: Set the user name of the comment creator.
|
||||
:type userid: Optional(str or int)
|
||||
:param status: status, one of 'not_reviewed', 'approved', 'rejected',
|
||||
'under_review'
|
||||
:type status: str
|
||||
|
||||
Example error output:
|
||||
|
||||
.. code-block:: json
|
||||
.. code-block:: bash
|
||||
|
||||
{
|
||||
"id" : <id_given_in_input>,
|
||||
|
|
@ -539,7 +541,7 @@ get_repo_settings
|
|||
get_repos
|
||||
---------
|
||||
|
||||
.. py:function:: get_repos(apiuser)
|
||||
.. py:function:: get_repos(apiuser, root=<Optional:None>, traverse=<Optional:True>)
|
||||
|
||||
Lists all existing repositories.
|
||||
|
||||
|
|
@ -548,6 +550,14 @@ get_repos
|
|||
|
||||
:param apiuser: This is filled automatically from the |authtoken|.
|
||||
:type apiuser: AuthUser
|
||||
:param root: specify root repository group to fetch repositories.
|
||||
filters the returned repositories to be members of given root group.
|
||||
:type root: Optional(None)
|
||||
:param traverse: traverse given root into subrepositories. With this flag
|
||||
set to False, it will only return top-level repositories from `root`.
|
||||
if root is empty it will return just top-level repositories.
|
||||
:type traverse: Optional(True)
|
||||
|
||||
|
||||
Example output:
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,49 @@
|
|||
server methods
|
||||
==============
|
||||
|
||||
cleanup_sessions
|
||||
----------------
|
||||
|
||||
.. py:function:: cleanup_sessions(apiuser, older_then=<Optional:60>)
|
||||
|
||||
Triggers a session cleanup action.
|
||||
|
||||
If the ``older_then`` option is set, only sessions that hasn't been
|
||||
accessed in the given number of days will be removed.
|
||||
|
||||
This command can only be run using an |authtoken| with admin rights to
|
||||
the specified repository.
|
||||
|
||||
This command takes the following options:
|
||||
|
||||
:param apiuser: This is filled automatically from the |authtoken|.
|
||||
:type apiuser: AuthUser
|
||||
:param older_then: Deletes session that hasn't been accessed
|
||||
in given number of days.
|
||||
:type older_then: Optional(int)
|
||||
|
||||
Example output:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
id : <id_given_in_input>
|
||||
result: {
|
||||
"backend": "<type of backend>",
|
||||
"sessions_removed": <number_of_removed_sessions>
|
||||
}
|
||||
error : null
|
||||
|
||||
Example error output:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
id : <id_given_in_input>
|
||||
result : null
|
||||
error : {
|
||||
'Error occurred during session cleanup'
|
||||
}
|
||||
|
||||
|
||||
get_ip
|
||||
------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue