更新

描述

object hostinterface.update(object/array hostInterfaces)

该方法允许更新已存在的主机接口

该方法适用于管理员超级管理员用户类型。可以在用户角色设置中撤销调用该方法的权限。有关详细信息,参阅用户角色

参数

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

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

返回值

(object)interfaceids属性中返回已更新主机接口ID的对象。

示例

更新主机接口端口

更新主机接口的端口

请求:

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

响应:

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

来源

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