Sidebar

2022 Zabbix中国峰会
2022 Zabbix中国峰会

screen.get

说明

integer/array screen.get(object parameters)

该方法允许根据给定的参数检索screen。

参数

(object) 定义所需输出的参数。 该方法支持以下参数。

属性 类 说明
screenids string/array 只返回具有给定ID的screen。
userids string/array 仅返回属于给定用户ID的screen
screenitemids string/array 只返回包含给定screen item的屏幕。
selectUsers query 返回用户在users属性中共享screen。
selectUserGroups query 返回在userGroups'属性中分享screen的用户组。 \| ^ \|\|\| \| selectScreenItems \| query \| 返回screen中使用的screen item。 \| ^ \|\|\| \| sortfield \| string/array \| 按照给定的属性对结果进行排序。 可能的值为:screenidname''。
countOutput flag 这些参数对于所有的“获取”方法是常见的,在参考评论页中有详细描述。
editable boolean
excludeSearch flag
filter object
limit integer
output query
preservekeys flag
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch flag

返回值

(integer/array) 返回:

  • 一组对象;
  • 如果已经使用“countOutput”参数,则检索到的对象的计数。

示例

按ID检索Screen

Retrieve all data about screen "26" and its screen items.

Request:

{
           "jsonrpc": "2.0",
           "method": "screen.get",
           "params": {
               "output": "extend",
               "selectScreenItems": "extend",
               "selectUsers": "extend",
               "selectUserGroups": "extend",
               "screenids": "26"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": [    
               {
                   "screenitems": [
                       {
                           "screenitemid": "67",
                           "screenid": "26",
                           "resourcetype": "0",
                           "resourceid": "612",
                           "width": "320",
                           "height": "200",
                           "x": "0",
                           "y": "0",
                           "colspan": "0",
                           "rowspan": "0",
                           "elements": "25",
                           "valign": "0",
                           "halign": "0",
                           "style": "0",
                           "url": "",
                           "dynamic": "0",
                           "sort_triggers": "0"
                       }
                   ],
                   "users": [
                       {
                           "sysmapuserid": "1",
                           "userid": "2",
                           "permission": "2"
                       }
                   ],
                   "userGroups": [
                       {
                           "screenusrgrpid": "1",
                           "usrgrpid": "7",
                           "permission": "3"
                       }
                   ],
                   "screenid": "26",
                   "name": "CPU Graphs",
                   "hsize": "3",
                   "vsize": "2",
                   "templateid": "0",
                   "userid": "1",
                   "private": "1"
               }
           ],
           "id": 1
       }

参见

来源

CScreen::get() in frontends/php/include/classes/api/services/CScreen.php.