docs: update API documentation.
This commit is contained in:
parent
2d179b79f4
commit
bf27cbaf6d
5 changed files with 132 additions and 62 deletions
|
|
@ -24,13 +24,12 @@ close_pull_request
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
"id": <id_given_in_input>,
|
"id": <id_given_in_input>,
|
||||||
"result":
|
"result": {
|
||||||
{
|
|
||||||
"pull_request_id": "<int>",
|
"pull_request_id": "<int>",
|
||||||
"closed": "<bool>"
|
"closed": "<bool>"
|
||||||
},
|
},
|
||||||
"error": null
|
"error": null
|
||||||
|
|
||||||
|
|
||||||
comment_pull_request
|
comment_pull_request
|
||||||
|
|
@ -67,15 +66,14 @@ comment_pull_request
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result :
|
result : {
|
||||||
{
|
|
||||||
"pull_request_id": "<Integer>",
|
"pull_request_id": "<Integer>",
|
||||||
"comment_id": "<Integer>",
|
"comment_id": "<Integer>",
|
||||||
"status": {"given": <given_status>,
|
"status": {"given": <given_status>,
|
||||||
"was_changed": <bool status_was_actually_changed> },
|
"was_changed": <bool status_was_actually_changed> },
|
||||||
}
|
},
|
||||||
error : null
|
error : null
|
||||||
|
|
||||||
|
|
||||||
create_pull_request
|
create_pull_request
|
||||||
|
|
@ -109,9 +107,8 @@ create_pull_request
|
||||||
:param reviewers: Set the new pull request reviewers list.
|
:param reviewers: Set the new pull request reviewers list.
|
||||||
:type reviewers: Optional(list)
|
:type reviewers: Optional(list)
|
||||||
Accepts username strings or objects of the format:
|
Accepts username strings or objects of the format:
|
||||||
{
|
|
||||||
'username': 'nick', 'reasons': ['original author']
|
{'username': 'nick', 'reasons': ['original author']}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
get_pull_request
|
get_pull_request
|
||||||
|
|
@ -305,9 +302,8 @@ merge_pull_request
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
"id": <id_given_in_input>,
|
"id": <id_given_in_input>,
|
||||||
"result":
|
"result": {
|
||||||
{
|
|
||||||
"executed": "<bool>",
|
"executed": "<bool>",
|
||||||
"failure_reason": "<int>",
|
"failure_reason": "<int>",
|
||||||
"merge_commit_id": "<merge_commit_id>",
|
"merge_commit_id": "<merge_commit_id>",
|
||||||
|
|
@ -318,7 +314,7 @@ merge_pull_request
|
||||||
"name": "<name>"
|
"name": "<name>"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": null
|
"error": null
|
||||||
|
|
||||||
|
|
||||||
update_pull_request
|
update_pull_request
|
||||||
|
|
@ -349,9 +345,8 @@ update_pull_request
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result :
|
result : {
|
||||||
{
|
|
||||||
"msg": "Updated pull request `63`",
|
"msg": "Updated pull request `63`",
|
||||||
"pull_request": <pull_request_object>,
|
"pull_request": <pull_request_object>,
|
||||||
"updated_reviewers": {
|
"updated_reviewers": {
|
||||||
|
|
@ -371,6 +366,6 @@ update_pull_request
|
||||||
"removed": []
|
"removed": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
error : null
|
error : null
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,58 @@ get_ip
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
get_method
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. py:function:: get_method(apiuser, pattern=<Optional:'*'>)
|
||||||
|
|
||||||
|
Returns list of all available API methods. By default match pattern
|
||||||
|
os "*" but any other pattern can be specified. eg *comment* will return
|
||||||
|
all methods with comment inside them. If just single method is matched
|
||||||
|
returned data will also include method specification
|
||||||
|
|
||||||
|
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 pattern: pattern to match method names against
|
||||||
|
:type older_then: Optional("*")
|
||||||
|
|
||||||
|
Example output:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
id : <id_given_in_input>
|
||||||
|
"result": [
|
||||||
|
"changeset_comment",
|
||||||
|
"comment_pull_request",
|
||||||
|
"comment_commit"
|
||||||
|
]
|
||||||
|
error : null
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
id : <id_given_in_input>
|
||||||
|
"result": [
|
||||||
|
"comment_commit",
|
||||||
|
{
|
||||||
|
"apiuser": "<RequiredType>",
|
||||||
|
"comment_type": "<Optional:u'note'>",
|
||||||
|
"commit_id": "<RequiredType>",
|
||||||
|
"message": "<RequiredType>",
|
||||||
|
"repoid": "<RequiredType>",
|
||||||
|
"request": "<RequiredType>",
|
||||||
|
"resolves_comment_id": "<Optional:None>",
|
||||||
|
"status": "<Optional:None>",
|
||||||
|
"userid": "<Optional:<OptionalAttr:apiuser>>"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
error : null
|
||||||
|
|
||||||
|
|
||||||
get_server_info
|
get_server_info
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,16 @@ create_user
|
||||||
:type force_password_change: Optional(``True`` | ``False``)
|
:type force_password_change: Optional(``True`` | ``False``)
|
||||||
:param create_personal_repo_group: Create personal repo group for this user
|
:param create_personal_repo_group: Create personal repo group for this user
|
||||||
:type create_personal_repo_group: Optional(``True`` | ``False``)
|
:type create_personal_repo_group: Optional(``True`` | ``False``)
|
||||||
|
|
||||||
Example output:
|
Example output:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result: {
|
result: {
|
||||||
"msg" : "created new user `<username>`",
|
"msg" : "created new user `<username>`",
|
||||||
"user": <user_obj>
|
"user": <user_obj>
|
||||||
}
|
}
|
||||||
error: null
|
error: null
|
||||||
|
|
||||||
Example error output:
|
Example error output:
|
||||||
|
|
@ -98,9 +99,9 @@ delete_user
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result: {
|
result: {
|
||||||
"msg" : "deleted user ID:<userid> <username>",
|
"msg" : "deleted user ID:<userid> <username>",
|
||||||
"user": null
|
"user": null
|
||||||
}
|
}
|
||||||
error: null
|
error: null
|
||||||
|
|
||||||
Example error output:
|
Example error output:
|
||||||
|
|
@ -145,8 +146,8 @@ get_user
|
||||||
"result": {
|
"result": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"admin": false,
|
"admin": false,
|
||||||
"api_key": "api-key",
|
|
||||||
"api_keys": [ list of keys ],
|
"api_keys": [ list of keys ],
|
||||||
|
"auth_tokens": [ list of tokens with details ],
|
||||||
"email": "user@example.com",
|
"email": "user@example.com",
|
||||||
"emails": [
|
"emails": [
|
||||||
"user@example.com"
|
"user@example.com"
|
||||||
|
|
@ -157,6 +158,7 @@ get_user
|
||||||
"ip_addresses": [],
|
"ip_addresses": [],
|
||||||
"language": null,
|
"language": null,
|
||||||
"last_login": "Timestamp",
|
"last_login": "Timestamp",
|
||||||
|
"last_activity": "Timestamp",
|
||||||
"lastname": "surnae",
|
"lastname": "surnae",
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"global": [
|
"global": [
|
||||||
|
|
@ -183,6 +185,32 @@ get_user
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
get_user_audit_logs
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
.. py:function:: get_user_audit_logs(apiuser, userid=<Optional:<OptionalAttr:apiuser>>)
|
||||||
|
|
||||||
|
Fetches all action logs made by the specified user.
|
||||||
|
|
||||||
|
This command takes the following options:
|
||||||
|
|
||||||
|
:param apiuser: This is filled automatically from the |authtoken|.
|
||||||
|
:type apiuser: AuthUser
|
||||||
|
:param userid: Sets the userid whose list of locked |repos| will be
|
||||||
|
displayed.
|
||||||
|
:type userid: Optional(str or int)
|
||||||
|
|
||||||
|
Example output:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
id : <id_given_in_input>
|
||||||
|
result : {
|
||||||
|
[action, action,...]
|
||||||
|
}
|
||||||
|
error : null
|
||||||
|
|
||||||
|
|
||||||
get_user_locks
|
get_user_locks
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
|
@ -232,7 +260,7 @@ get_users
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result: [<user_object>, ...]
|
result: [<user_object>, ...]
|
||||||
error: null
|
error: null
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -279,9 +307,9 @@ update_user
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result: {
|
result: {
|
||||||
"msg" : "updated user ID:<userid> <username>",
|
"msg" : "updated user ID:<userid> <username>",
|
||||||
"user": <user_object>,
|
"user": <user_object>,
|
||||||
}
|
}
|
||||||
error: null
|
error: null
|
||||||
|
|
||||||
Example error output:
|
Example error output:
|
||||||
|
|
|
||||||
|
|
@ -244,9 +244,8 @@ def merge_pull_request(request, apiuser, repoid, pullrequestid,
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
"id": <id_given_in_input>,
|
"id": <id_given_in_input>,
|
||||||
"result":
|
"result": {
|
||||||
{
|
|
||||||
"executed": "<bool>",
|
"executed": "<bool>",
|
||||||
"failure_reason": "<int>",
|
"failure_reason": "<int>",
|
||||||
"merge_commit_id": "<merge_commit_id>",
|
"merge_commit_id": "<merge_commit_id>",
|
||||||
|
|
@ -257,8 +256,7 @@ def merge_pull_request(request, apiuser, repoid, pullrequestid,
|
||||||
"name": "<name>"
|
"name": "<name>"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": null
|
"error": null
|
||||||
|
|
||||||
"""
|
"""
|
||||||
repo = get_repo_or_error(repoid)
|
repo = get_repo_or_error(repoid)
|
||||||
if not isinstance(userid, Optional):
|
if not isinstance(userid, Optional):
|
||||||
|
|
@ -321,13 +319,12 @@ def close_pull_request(request, apiuser, repoid, pullrequestid,
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
"id": <id_given_in_input>,
|
"id": <id_given_in_input>,
|
||||||
"result":
|
"result": {
|
||||||
{
|
|
||||||
"pull_request_id": "<int>",
|
"pull_request_id": "<int>",
|
||||||
"closed": "<bool>"
|
"closed": "<bool>"
|
||||||
},
|
},
|
||||||
"error": null
|
"error": null
|
||||||
|
|
||||||
"""
|
"""
|
||||||
repo = get_repo_or_error(repoid)
|
repo = get_repo_or_error(repoid)
|
||||||
|
|
@ -396,15 +393,14 @@ def comment_pull_request(
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result :
|
result : {
|
||||||
{
|
|
||||||
"pull_request_id": "<Integer>",
|
"pull_request_id": "<Integer>",
|
||||||
"comment_id": "<Integer>",
|
"comment_id": "<Integer>",
|
||||||
"status": {"given": <given_status>,
|
"status": {"given": <given_status>,
|
||||||
"was_changed": <bool status_was_actually_changed> },
|
"was_changed": <bool status_was_actually_changed> },
|
||||||
}
|
},
|
||||||
error : null
|
error : null
|
||||||
"""
|
"""
|
||||||
repo = get_repo_or_error(repoid)
|
repo = get_repo_or_error(repoid)
|
||||||
if not isinstance(userid, Optional):
|
if not isinstance(userid, Optional):
|
||||||
|
|
@ -535,9 +531,8 @@ def create_pull_request(
|
||||||
:param reviewers: Set the new pull request reviewers list.
|
:param reviewers: Set the new pull request reviewers list.
|
||||||
:type reviewers: Optional(list)
|
:type reviewers: Optional(list)
|
||||||
Accepts username strings or objects of the format:
|
Accepts username strings or objects of the format:
|
||||||
{
|
|
||||||
'username': 'nick', 'reasons': ['original author']
|
{'username': 'nick', 'reasons': ['original author']}
|
||||||
}
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
source = get_repo_or_error(source_repo)
|
source = get_repo_or_error(source_repo)
|
||||||
|
|
@ -633,9 +628,8 @@ def update_pull_request(
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result :
|
result : {
|
||||||
{
|
|
||||||
"msg": "Updated pull request `63`",
|
"msg": "Updated pull request `63`",
|
||||||
"pull_request": <pull_request_object>,
|
"pull_request": <pull_request_object>,
|
||||||
"updated_reviewers": {
|
"updated_reviewers": {
|
||||||
|
|
@ -655,7 +649,7 @@ def update_pull_request(
|
||||||
"removed": []
|
"removed": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
error : null
|
error : null
|
||||||
"""
|
"""
|
||||||
|
|
||||||
repo = get_repo_or_error(repoid)
|
repo = get_repo_or_error(repoid)
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ def get_users(request, apiuser):
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result: [<user_object>, ...]
|
result: [<user_object>, ...]
|
||||||
error: null
|
error: null
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -191,15 +191,16 @@ def create_user(request, apiuser, username, email, password=Optional(''),
|
||||||
:type force_password_change: Optional(``True`` | ``False``)
|
:type force_password_change: Optional(``True`` | ``False``)
|
||||||
:param create_personal_repo_group: Create personal repo group for this user
|
:param create_personal_repo_group: Create personal repo group for this user
|
||||||
:type create_personal_repo_group: Optional(``True`` | ``False``)
|
:type create_personal_repo_group: Optional(``True`` | ``False``)
|
||||||
|
|
||||||
Example output:
|
Example output:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result: {
|
result: {
|
||||||
"msg" : "created new user `<username>`",
|
"msg" : "created new user `<username>`",
|
||||||
"user": <user_obj>
|
"user": <user_obj>
|
||||||
}
|
}
|
||||||
error: null
|
error: null
|
||||||
|
|
||||||
Example error output:
|
Example error output:
|
||||||
|
|
@ -305,9 +306,9 @@ def update_user(request, apiuser, userid, username=Optional(None),
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result: {
|
result: {
|
||||||
"msg" : "updated user ID:<userid> <username>",
|
"msg" : "updated user ID:<userid> <username>",
|
||||||
"user": <user_object>,
|
"user": <user_object>,
|
||||||
}
|
}
|
||||||
error: null
|
error: null
|
||||||
|
|
||||||
Example error output:
|
Example error output:
|
||||||
|
|
@ -384,9 +385,9 @@ def delete_user(request, apiuser, userid):
|
||||||
|
|
||||||
id : <id_given_in_input>
|
id : <id_given_in_input>
|
||||||
result: {
|
result: {
|
||||||
"msg" : "deleted user ID:<userid> <username>",
|
"msg" : "deleted user ID:<userid> <username>",
|
||||||
"user": null
|
"user": null
|
||||||
}
|
}
|
||||||
error: null
|
error: null
|
||||||
|
|
||||||
Example error output:
|
Example error output:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue