# HG changeset patch # User Marcin Kuzminski # Date 2017-02-05 16:07:54 # Node ID ac28bdfc846fa9ff01ac69a70254fd130fe5bf6a # Parent ece260335ee9676b811a0963916b2b6f10c60c24 docs: updated API docs diff --git a/docs/api/methods/pull-request-methods.rst b/docs/api/methods/pull-request-methods.rst --- a/docs/api/methods/pull-request-methods.rst +++ b/docs/api/methods/pull-request-methods.rst @@ -36,7 +36,7 @@ close_pull_request comment_pull_request -------------------- -.. py:function:: comment_pull_request(apiuser, repoid, pullrequestid, message=, status=, userid=>) +.. py:function:: comment_pull_request(apiuser, repoid, pullrequestid, message=, commit_id=, status=, comment_type=, resolves_comment_id=, userid=>) 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": "", - "comment_id": "" + "comment_id": "", + "status": {"given": , + "was_changed": }, } error : null diff --git a/docs/api/methods/repo-methods.rst b/docs/api/methods/repo-methods.rst --- a/docs/api/methods/repo-methods.rst +++ b/docs/api/methods/repo-methods.rst @@ -28,7 +28,7 @@ add_field_to_repo comment_commit -------------- -.. py:function:: comment_commit(apiuser, repoid, commit_id, message, userid=>, status=) +.. py:function:: comment_commit(apiuser, repoid, commit_id, message, status=, comment_type=, resolves_comment_id=, userid=>) 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" : , @@ -539,7 +541,7 @@ get_repo_settings get_repos --------- -.. py:function:: get_repos(apiuser) +.. py:function:: get_repos(apiuser, root=, traverse=) 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: diff --git a/docs/api/methods/server-methods.rst b/docs/api/methods/server-methods.rst --- a/docs/api/methods/server-methods.rst +++ b/docs/api/methods/server-methods.rst @@ -3,6 +3,49 @@ server methods ============== +cleanup_sessions +---------------- + +.. py:function:: cleanup_sessions(apiuser, older_then=) + + 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 : + result: { + "backend": "", + "sessions_removed": + } + error : null + + Example error output: + + .. code-block:: bash + + id : + result : null + error : { + 'Error occurred during session cleanup' + } + + get_ip ------