object host.massremove(object parameters)
       此方法允许从多个 主机 中移除相关的 objects。
此方法仅对 Admin 和 Super admin 用户类型可用。调用该方法的权限可以在用户角色设置中撤销。更多信息请参见 User roles。
(object) 参数包含要 update 的 主机 的 ID 以及应移除的 objects。
| 参数 | 数据类型 | 描述 | 
|---|---|---|
| hostids | ID/array | 要更新的 主机 的 ID。 参数行为: - 必填  | 
       
| groupids | ID/array | 从中移除指定 主机 的 host groups 的 ID。 | 
| interfaces | object/array | 从指定的 主机 中移除的 Host interfaces。 主机 接口 object 必须仅定义 ip、dns 和 port 属性。 | 
       
| macros | string/array | 从指定的 主机 中 delete 的 User macros。 | 
| templateids | ID/array | 从指定的 主机 中取消关联的 templates 的 ID。 | 
| templateids_clear | ID/array | 从指定的 主机 中取消关联并 clear 的 templates 的 ID。 | 
(object) 返回一个 object,其中包含更新后的 主机 的 ID,这些 ID 位于 hostids 属性下。
从两个 主机 和 delete 解除模板链接,并解除所有模板实体的链接。
执行请求:
{
           "jsonrpc": "2.0",
           "method": "host.massremove",
           "params": {
               "hostids": ["69665", "69666"],
               "templateids_clear": "325"
           },
           "id": 1
       }响应:
CHost::massRemove() 在 ui/include/classes/api/services/CHost.php 中。