integer/array usergroup.get(object parameters)
该方法允许根据给定的参数检索用户组.
此方法只有Super admin(超级管理员)用户可用。可以在用户角色设置中撤销调用该方法的权限。更多信息请查看用户角色.
(object)
定义所需输出的参数.
该方法支持以下参数.
参数 | 类型 | 描述 |
---|---|---|
status | integer | 只返回具有给定状态的用户组. 参阅 用户组页面 获取支持的状态列表. |
userids | string/array | 只返回包含给定用户的用户组. |
usrgrpids | string/array | 只返回具有给定ID的用户组. |
selectTagFilters | query | 在 标签权限 属性中返回用户标签权限. 它具有以下属性: groupid - (string) 主机组ID;tag - (string) 标签名;value - (string) 标签值. |
selectUsers | query | 在 用户 属性中返回用户组中的用户. |
selectRights | query | 在 权限 属性中返回用户组权限. 它具有以下属性: permission - (integer) 访问级别到主机组;id - (string) 主机组的ID.参阅 用户组页面 获取主机组的访问级别列表. |
limitSelects | integer | 限制子选择返回的记录数. |
sortfield | string/array | 按照给定的属性对结果进行排序. 可接受的值: usrgrpid , name . |
countOutput | boolean | get 方法的常用参数都被记录在 参考说明. |
editable | boolean | |
excludeSearch | boolean | |
filter | object | |
limit | integer | |
output | query | |
preservekeys | boolean | |
search | object | |
searchByAny | boolean | |
searchWildcardsEnabled | boolean | |
sortorder | string/array | |
startSearch | boolean |
(integer/array)
返回结果二选一:
countOutput
参数,返回检索到的对象总数.查询所有启用状态的用户组.
请求:
{
"jsonrpc": "2.0",
"method": "usergroup.get",
"params": {
"output": "extend",
"status": 0
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
返回:
{
"jsonrpc": "2.0",
"result": [
{
"usrgrpid": "7",
"name": "Zabbix administrators",
"gui_access": "0",
"users_status": "0",
"debug_mode": "1"
},
{
"usrgrpid": "8",
"name": "Guests",
"gui_access": "0",
"users_status": "0",
"debug_mode": "0"
},
{
"usrgrpid": "11",
"name": "Enabled debug mode",
"gui_access": "0",
"users_status": "0",
"debug_mode": "1"
},
{
"usrgrpid": "12",
"name": "No access to the frontend",
"gui_access": "2",
"users_status": "0",
"debug_mode": "0"
},
{
"usrgrpid": "14",
"name": "Read only",
"gui_access": "0",
"users_status": "0",
"debug_mode": "0"
},
{
"usrgrpid": "18",
"name": "Deny",
"gui_access": "0",
"users_status": "0",
"debug_mode": "0"
}
],
"id": 1
}
CUserGroup::get() in ui/include/classes/api/services/CUserGroup.php.