hostinterface.update

描述

object hostinterface.update(object/array hostInterfaces)

此方法允许更新现有的主机接口。

此方法仅适用于管理员超级管理员用户类型。调用该方法的权限可在用户角色设置中撤销。更多信息请参阅User roles

参数

(object/array) 主机接口 待更新。

每个主机接口必须定义interfaceid属性, 其他属性均为可选。仅指定的属性会被更新, 其余属性将保持不变。

(object) 返回一个包含更新后的 interfaceids 属性下 主机 接口ID的 object

示例

更改主机接口端口

修改主机接口的端口号

请求:

{
           "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() 方法位于 ui/include/classes/api/services/CHostInterface.php 文件中。