Sidebar

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

创建

Description 描述

object screenitem.create(object/array screenItems)

This method allows to create new screen items. 此方法允许创建一个新的聚合类型项

Parameters 参数

(object/array) Screen items to create.

(object/array)创建聚合图形项

The method accepts screen items with the standard screen item properties. 此方法接受聚合图形项关于standard screen item properties.

Return values 返回值

(object) Returns an object containing the IDs of the created screen items under the screenitemids property. The order of the returned IDs matches the order of the passed screen items. (object)返回一个对象,该对象包含在screenitemids属性下创建的聚合图形项的id。返回id的顺序与所传递的聚合图形项的顺序相匹配。

Examples 示例如下

Creating a screen item 创建一个聚合图形项

Create a screen item displaying a graph in the left-upper cell of the screen. 创建一个聚合图像项展示一个图像在左上角的聚合图形

Request:

{
           "jsonrpc": "2.0",
           "method": "screenitem.create",
           "params": {
               "screenid": 16,
               "resourcetype": 0,
               "resourceid": 612,
               "x": 0,
               "y": 0
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "screenitemids": [
                   "65"
               ]
           },
           "id": 1
       }

See also

Source

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