更新

描述

object hostinterface.update(object/array hostInterfaces)

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

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

参数

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

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

返回值

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

示例

更改一个主机接口端口

更改主机接口的端口。

请求

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "hostinterface.update",
  4. "params": {
  5. "interfaceid": "30048",
  6. "port": "30050"
  7. },
  8. "id": 1
  9. }

响应:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "interfaceids": [
  5. "30048"
  6. ]
  7. },
  8. "id": 1
  9. }

来源

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