跳至主内容

createIntegration

使用此方法在 集成中心 .

参数

参数

描述

请求包含项

类型

取值

companyId

需配置集成的公司ID。

可选

字符串

无额外要求。

默认值:发起请求所用API密钥所属公司的ID。

name

集成名称。

必填

字符串

取值长度需介于 1128 个字符之间

type

集成类型。

必填

整数

可选值:

  • 1 - VMware集成

specifics

集成的配置参数。

必填

对象

参考 详细配置 .

对象

详细配置

参数

描述

是否包含在请求中

类型

主机名

vCenter服务器的 IP主机名 ,用于指定需要集成的目标服务器。

必填

字符串

端口

用于连接vCenter的端口号。

默认值: 443

可选

整数

用户名

用于vCenter认证的用户名。

必填

字符串

密码

用于vCenter身份验证的密码。

必填

字符串

retryAuthentication

决定集成是否应在失败时重试身份验证。

默认值: true .

可选

布尔值

retryAuthenticationTimeToWait

身份验证重试之间的等待时间(秒)。

默认值: 5

可选

整数

retryAuthenticationMaxAttempts

允许的最大身份验证重试次数。

默认值: 3

可选

整数

verifyTLSCertificate

指定连接到vCenter服务器时是否验证TLS证书。

默认值: true .

可选

布尔值

viewType

定义vCenter的视图模式。

可选值:

  • 1 - 虚拟机与模板

  • 2 - 主机与集群

默认值: 1

注意

使用任何无效值将导致采用默认值。

可选

整数

返回值

属性

类型

描述

result

对象

包含请求的结果。

对象

result

属性

类型

描述

success

布尔值

指示请求是否成功。

records

字符串数组

所创建集成项的MongoDB对象ID列表。

示例

请求 :

{
  "method": "createIntegration",
  "id": "0a686101-1b31-46d3-b8ee-f59c186fa25b",
  "jsonrpc": "2.0",
  "params": {
    "companyId": "67602c8682f2caf2080d7d67",
    "name": "integrationjDAAdvXoYt77FP6Eu4O3",
    "type": 1,
    "specifics": {
      "hostname": "LMzsN5Arp7.com",
      "port": 443,
      "username": "username",
      "password": "password",
      "retryAuthentication": true,
      "retryAuthenticationTimeToWait": 10,
      "retryAuthenticationMaxAttempts": 6,
      "verifyTLSCertificate": true,
      "viewType": 2
    }
  }
}

响应 :

{
  "id": "0a686101-1b31-46d3-b8ee-f59c186fa25b",
  "jsonrpc": "2.0",
  "result": {
    "success": true,
    "records": [
      "67602cbd67c92338e4028e1a"
    ]
  }
}