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

hostinterface.massremove

Description 说明

object hostinterface.massremove(object parameters)

This method allows to remove host interfaces from the given hosts.该方法允许从给定的主机中删除主机接口。

Parameters 参数

(object) Parameters containing the IDs of the hosts to be updated and the interfaces to be removed.含要更新的主机的ID和要删除的接口的参数。

参数 类 描述
hostids
(required)
string/array IDs of the hosts to be updated.要更新的主机的ID。
interfaces
(required)
object/array Host interfaces to remove from the given hosts. 要从给定主机中删除的主机接口。

The host interface object must have the ip, dns and port properties defined 主机接口对象必须具有定义的ip,dns和port属性

Return values 返回值

(object) Returns an object containing the IDs of the deleted host interfaces under the interfaceids property.返回包含“interfaceids”属性下删除的主机接口的ID的对象。

Examples 示例

Removing interfaces 删除接口

Remove the "127.0.0.1" SNMP interface from two hosts.从两台主机中删除“127.0.0.1”SNMP界面。

Request:

{
           "jsonrpc": "2.0",
           "method": "hostinterface.massremove",
           "params": {
               "hostids": [
                   "30050",
                   "30052"
               ],
               "interfaces": {
                   "dns": "",
                   "ip": "127.0.0.1",
                   "port": "161"
               }
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "interfaceids": [
                   "30069",
                   "30070"
               ]
           },
           "id": 1
       }

See also 参见

Source 来源

CHostInterface::massRemove() in frontends/php/include/classes/api/services/CHostInterface.php.