object hostinterface.massremove(object parameters)
该方法允许从给定主机中删除主机接口。
此方法仅适用于 Admin 和 Super admin 用户类型。调用该方法的权限可在用户角色设置中撤销。更多信息请参阅 用户角色。
(object) 参数,其中包含要更新的主机 ID 和要删除的接口。
| 参数 | 类型 | 说明 | 
|---|---|---|
| interfaces | object/array | 要从给定的主机删除的 主机接口。 主机接口对象必须只定义 ip、dns和port属性。参数行为: - 必须 | 
| hostids | ID/array | 要更新的主机 ID。 参数行为: - 必须 | 
(object) 返回一个对象,其中在 interfaceids 属性下包含已删除主机接口的 ID。
从两台主机上删除 "127.0.0.1" SNMP 接口。
请求:
{
           "jsonrpc": "2.0",
           "method": "hostinterface.massremove",
           "params": {
               "hostids": [
                   "30050",
                   "30052"
               ],
               "interfaces": {
                   "dns": "",
                   "ip": "127.0.0.1",
                   "port": "161"
               }
           },
           "id": 1
       }响应:
CHostInterface::massRemove() 在 ui/include/classes/api/services/CHostInterface.php。