Zabbix Documentation 3.4

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


Sidebar

zh:manual:api:reference:host:delete

host.delete

Description 说明

object host.delete(array hosts)

This method allows to delete hosts.此方法允许删除主机。

Parameters 参数

(array) IDs of hosts to delete. 删除主机的ID

Return values 返回值

(object) Returns an object containing the IDs of the deleted hosts under the hostids property.返回一个对象其中包含在hostids属性下已删除主机的ID。

Examples 范例

Deleting multiple hosts 删除多个主机

Delete two hosts.删除两个主机。

Request:

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

Response:

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

Source 来源

CHost::delete() in frontends/php/include/classes/api/services/CHost.php.