hostinterface.update

描述

object hostinterface.update(object/array hostInterfaces)

此方法用于 update 现有的 主机 接口。

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

参数

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

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

返回值

(object) 返回一个 object,其中包含更新后的 主机 接口的 ID,这些 ID 位于 interfaceids 属性下。

示例

更改主机接口端口

更改 一个主机 接口的端口。

执行请求:

{
           "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 文件中。