Zabbix Documentation 4.0

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

zh:manual:api:reference:templatescreen:copy

复制

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 参数 Type 类型 Description 说明
screenIds
(required 必填)
string/array 字符串/数组 IDs of template screens to copy. 需要复制的聚合图形模板ID。
templateIds
(required 必填)
string/array 字符串/数组 IDs of 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中参考。