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
|
||||
|
||||
"id": <id_given_in_input>,
|
||||
"result":
|
||||
{
|
||||
"id": <id_given_in_input>,
|
||||
"result": {
|
||||
"pull_request_id": "<int>",
|
||||
"closed": "<bool>"
|
||||
},
|
||||
"error": null
|
||||
"error": null
|
||||
|
||||
|
||||
comment_pull_request
|
||||
|
|
@ -67,15 +66,14 @@ comment_pull_request
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
id : <id_given_in_input>
|
||||
result :
|
||||
{
|
||||
id : <id_given_in_input>
|
||||
result : {
|
||||
"pull_request_id": "<Integer>",
|
||||
"comment_id": "<Integer>",
|
||||
"status": {"given": <given_status>,
|
||||
"was_changed": <bool status_was_actually_changed> },
|
||||
}
|
||||
error : null
|
||||
},
|
||||
error : null
|
||||
|
||||
|
||||
create_pull_request
|
||||
|
|
@ -109,9 +107,8 @@ create_pull_request
|
|||
:param reviewers: Set the new pull request reviewers list.
|
||||
:type reviewers: Optional(list)
|
||||
Accepts username strings or objects of the format:
|
||||
{
|
||||
'username': 'nick', 'reasons': ['original author']
|
||||
}
|
||||
|
||||
{'username': 'nick', 'reasons': ['original author']}
|
||||
|
||||
|
||||
get_pull_request
|
||||
|
|
@ -305,9 +302,8 @@ merge_pull_request
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
"id": <id_given_in_input>,
|
||||
"result":
|
||||
{
|
||||
"id": <id_given_in_input>,
|
||||
"result": {
|
||||
"executed": "<bool>",
|
||||
"failure_reason": "<int>",
|
||||
"merge_commit_id": "<merge_commit_id>",
|
||||
|
|
@ -318,7 +314,7 @@ merge_pull_request
|
|||
"name": "<name>"
|
||||
}
|
||||
},
|
||||
"error": null
|
||||
"error": null
|
||||
|
||||
|
||||
update_pull_request
|
||||
|
|
@ -349,9 +345,8 @@ update_pull_request
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
id : <id_given_in_input>
|
||||
result :
|
||||
{
|
||||
id : <id_given_in_input>
|
||||
result : {
|
||||
"msg": "Updated pull request `63`",
|
||||
"pull_request": <pull_request_object>,
|
||||
"updated_reviewers": {
|
||||
|
|
@ -371,6 +366,6 @@ update_pull_request
|
|||
"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
|
||||
---------------
|
||||
|
||||
|
|
|
|||
|
|
@ -41,15 +41,16 @@ create_user
|
|||
:type force_password_change: Optional(``True`` | ``False``)
|
||||
:param create_personal_repo_group: Create personal repo group for this user
|
||||
:type create_personal_repo_group: Optional(``True`` | ``False``)
|
||||
|
||||
Example output:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
id : <id_given_in_input>
|
||||
result: {
|
||||
"msg" : "created new user `<username>`",
|
||||
"user": <user_obj>
|
||||
}
|
||||
"msg" : "created new user `<username>`",
|
||||
"user": <user_obj>
|
||||
}
|
||||
error: null
|
||||
|
||||
Example error output:
|
||||
|
|
@ -98,9 +99,9 @@ delete_user
|
|||
|
||||
id : <id_given_in_input>
|
||||
result: {
|
||||
"msg" : "deleted user ID:<userid> <username>",
|
||||
"user": null
|
||||
}
|
||||
"msg" : "deleted user ID:<userid> <username>",
|
||||
"user": null
|
||||
}
|
||||
error: null
|
||||
|
||||
Example error output:
|
||||
|
|
@ -145,8 +146,8 @@ get_user
|
|||
"result": {
|
||||
"active": true,
|
||||
"admin": false,
|
||||
"api_key": "api-key",
|
||||
"api_keys": [ list of keys ],
|
||||
"auth_tokens": [ list of tokens with details ],
|
||||
"email": "user@example.com",
|
||||
"emails": [
|
||||
"user@example.com"
|
||||
|
|
@ -157,6 +158,7 @@ get_user
|
|||
"ip_addresses": [],
|
||||
"language": null,
|
||||
"last_login": "Timestamp",
|
||||
"last_activity": "Timestamp",
|
||||
"lastname": "surnae",
|
||||
"permissions": {
|
||||
"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
|
||||
--------------
|
||||
|
||||
|
|
@ -232,7 +260,7 @@ get_users
|
|||
.. code-block:: bash
|
||||
|
||||
id : <id_given_in_input>
|
||||
result: [<user_object>, ...]
|
||||
result: [<user_object>, ...]
|
||||
error: null
|
||||
|
||||
|
||||
|
|
@ -279,9 +307,9 @@ update_user
|
|||
|
||||
id : <id_given_in_input>
|
||||
result: {
|
||||
"msg" : "updated user ID:<userid> <username>",
|
||||
"user": <user_object>,
|
||||
}
|
||||
"msg" : "updated user ID:<userid> <username>",
|
||||
"user": <user_object>,
|
||||
}
|
||||
error: null
|
||||
|
||||
Example error output:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue