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

hostinterface.update

描述

object hostinterface.update(object/array hostInterfaces)

这种方法可以更新现有的主机接口。

此方法仅适用于 AdminSuper admin 用户类型。调用该方法的权限可在用户角色设置中撤销。更多信息请参阅 用户角色

参数

(object/array) 要更新的 主机接口属性

interfaceids 属性必须为每个主机接口定义,所有其他属性均为可选属性。只有给定的属性会被更新,所有其他属性将保持不变。

返回值

(object) 返回一个对象,其中在 interfaceids 属性下包含更新的主机接口 ID。

示例

更改一个主机接口端口

更改主机接口的端口。

请求

{
           "jsonrpc": "2.0",
           "method": "hostinterface.update",
           "params": {
               "interfaceid": "30048",
               "port": "30050"
           },
           "id": 1
       }

响应:

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

来源

CHostInterface::update() 在 ui/include/classes/api/services/CHostInterface.php