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"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

响应:

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

来源

CHostInterface::update() 位于 ui/include/classes/api/services/CHostInterface.php 文件中.