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:template:delete

删除

Description 说明

object template.delete(array templateIds)

This method allows to delete templates. 此方法允许删除模板。

Parameters 参数

(array) IDs of the templates to delete. (array)需要删除的模板ID。

Return values 返回值

(object) Returns an object containing the IDs of the deleted templates under the templateids property. (object)返回一个对象,包含templateids属性中被删除模板的ID。

Examples 范例

Deleting multiple templates 删除多个模板

Delete two templates. 删除两个模板。

Request 请求:

{
    "jsonrpc": "2.0",
    "method": "template.delete",
    "params": [
        "13",
        "32"
    ],
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}

Response 响应:

{
    "jsonrpc": "2.0",
    "result": {
        "templateids": [
            "13",
            "32"
        ]
    },
    "id": 1
}

Source 源码

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