object hostinterface.replacehostinterfaces(object parameters)
此方法允许给指定主机替换所有主机接口。
该方法适用于管理员和超级管理员用户类型。可以在用户角色设置中撤销调用该方法的权限。有关详细信息,参阅用户角色。
(object) 包含要更新的主机ID和新主机接口的参数。
(object) 在interfaceids属性中返回已创建主机接口ID的对象。
用单个代理接口替换所有主机接口。
请求:
{ "jsonrpc": "2.0", "method": "hostinterface.replacehostinterfaces", "params": { "hostid": "30052", "interfaces": { "dns": "", "ip": "127.0.0.1", "main": 1, "port": "10050", "type": 1, "useip": 1 } }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 }响应:
CHostInterface::replaceHostInterfaces() in ui/include/classes/api/services/CHostInterface.php。