User api calls - Gargravarr2112/vFense GitHub Wiki
All arguments must be added into the payload for all POST, PUT, and DELETE http methods.
Fetch Users
uri = /api/v1/users http method = GET
key | value_type | example_value | default | required |
---|---|---|---|---|
view_context | string | global | None | False |
all_views | boolean | true or false | false | False |
user_name | string | global_admin | None | False |
regex | str | ^]w+_admin | None | False |
count | integer | 30 | 30 | False |
offset | integer | 0 | 0 | False |
sort | str | asc or desc | asc | False |
sort_by | str | user_name | user_name | False |
Example of what this api returns
{
"count": 1,
"vfense_status_code": 1001,
"uri": "/api/v1/users",
"http_method": "GET",
"http_status": 200,
"message": "dataset retrieved",
"data": [
{
"default_view": "global",
"groups": [
{
"permissions": [
"administrator"
],
"group_id": "ba9bc494-43b9-4805-9321-a9ed123e3c93",
"views": [
"global"
],
"group_name": "Global Administrator"
}
],
"views": [
{
"administrator": true,
"view_name": "global"
}
],
"current_view": "global",
"global": true,
"enabled": true,
"full_name": "Global Administrator",
"user_name": "global_admin",
"email": null
}
]
}
Create User
uri = /api/v1/users http method = POST
key | value_type | example_value | default | required |
---|---|---|---|---|
user_name | string | linuxdynasty | True | |
password | string | vFense#123 (1 digit, 1 uppercase, 1 lowercase, 1 special, total 8 characters | True | |
full_name | string | Linux Dynasty | None | False |
str | [email protected] | None | False | |
is_global | boolean | true or false | false | False |
enabled | boolean | true or false | true | True |
group_ids | list | [group_id1, group_id2] | False | |
view_context | string | global | current_view | False |
Example of what this api returns
Delete Users
uri = /api/v1/users http method = DELETE
key | value_type | example_value | default | required |
---|---|---|---|---|
user_names | list | [linuxdynasty, foo, bar] | True |