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

screenitem.get

描述

integer/array screenitem.get(对象 参数)

根据给定的参数检索聚合图形项目的方法.

参数

(对象) 定义参数的输出.

该方法支持以下参数.

Parameter Type Description
screenitemids string/array 返回给定的聚合图形项目的ID.
screenids string/array 返回聚合图形给定的聚合图形项目.
sortfield string/array 返回给定属性的排序.

可用值: screenitemidscreenid.
countOutput flag 返回给定参数的所有内容的数量,参数参考reference commentary page 页面.
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可用.

示例

获取聚合图形中聚合图形项目

从聚合图形中获取所有的聚合图形项目.

Request:

{
           "jsonrpc": "2.0",
           "method": "screenitem.get",
           "params": {
               "output": "extend",
               "screenids": "3"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "screenitemid": "20",
                   "screenid": "3",
                   "resourcetype": "0",
                   "resourceid": "433",
                   "width": "500",
                   "height": "120",
                   "x": "0",
                   "y": "0",
                   "colspan": "1",
                   "rowspan": "1",
                   "elements": "0",
                   "valign": "1",
                   "halign": "0",
                   "style": "0",
                   "url": "",
                   "dynamic": "0",
                   "sort_triggers": "0",
                   "application": "",
                   "max_columns": "3"            
               },
               {
                   "screenitemid": "21",
                   "screenid": "3",
                   "resourcetype": "0",
                   "resourceid": "387",
                   "width": "500",
                   "height": "100",
                   "x": "0",
                   "y": "1",
                   "colspan": "1",
                   "rowspan": "1",
                   "elements": "0",
                   "valign": "1",
                   "halign": "0",
                   "style": "0",
                   "url": "",
                   "dynamic": "0",
                   "sort_triggers": "0",
                   "application": "",
                   "max_columns": "3"
               },
               {
                   "screenitemid": "22",
                   "screenid": "3",
                   "resourcetype": "1",
                   "resourceid": "10013",
                   "width": "500",
                   "height": "148",
                   "x": "1",
                   "y": "0",
                   "colspan": "1",
                   "rowspan": "1",
                   "elements": "0",
                   "valign": "1",
                   "halign": "0",
                   "style": "0",
                   "url": "",
                   "dynamic": "0",
                   "sort_triggers": "0",
                   "application": "",
                   "max_columns": "3"
               },
               {
                   "screenitemid": "23",
                   "screenid": "3",
                   "resourcetype": "1",
                   "resourceid": "22181",
                   "width": "500",
                   "height": "184",
                   "x": "1",
                   "y": "1",
                   "colspan": "1",
                   "rowspan": "1",
                   "elements": "0",
                   "valign": "1",
                   "halign": "0",
                   "style": "0",
                   "url": "",
                   "dynamic": "0",
                   "sort_triggers": "0",
                   "application": "",
                   "max_columns": "3"
               }
           ],
           "id": 1
       }

来源

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