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

复制

Description 说明

object templatescreen.copy(object parameters)

This method allows to copy template screens to the given templates. 此方法允许将聚合图形模板复制到指定的模板中。

Parameters 参数

(object) Parameters defining the template screens to copy and the target templates. (object)定义了复制的聚合图形模板参数以及目标模板。

Parameter 参数 T pe 类型 Des ription 说明
screenIds
(required 必填)
string/array 字符串/数组 IDs f template screens to copy. 需要复制的聚合图形模板ID。
templateIds
(required 必填)
string/array 字符串/数组 IDs f templates to copy the screens to. 将聚合图形复制到模板的ID。

Return values 返回值

(boolean) Returns true if the copying was successful. (boolean)如果复制成功,则返回true

Examples 范例

Copy a template screen 复制聚合图形模板

Copy template screen "25" to template "30085". 将聚合图形模板"25"复制到模板"30085"。

Request 请求:

{
           "jsonrpc": "2.0",
           "method": "templatescreen.copy",
           "params": {
               "screenIds": "25",
               "templateIds": "30085"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response 响应:

{
           "jsonrpc": "2.0",
           "result": true,
           "id": 1
       }

Source 源码

CTemplateScreen::copy() in frontends/php/include/classes/api/services/CTemplateScreen.php. CTemplateScreen::copy()方法可在frontends/php/include/classes/api/services/CTemplateScreen.php中参考。