创建主机
更新时间:2025-08-05
接口说明
创建主机
请求URI
POST /v1/host/
请求体参数
请求体字段数据结构说明
参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |
---|---|---|---|---|
clusterId | String | 是 | 集群id | hme-bj-xxxx |
resourceId | String | 是 | 资源id | i-instancexxxx |
account | String | 是 | 用户名称,4-32位 | admin |
hostName | String | 是 | 主机名 | testHost |
purchaseLength | Integer | 是 | 购买时长,1-60 | 12 |
domains | List<String> | 是 | 域名列表 | |
hostContact | HostContact | 否 | 联系方式 | |
backendStrategy | String | 否 | 后端策略 | DEFAULT |
HostContact字段数据结构说明
参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |
---|---|---|---|---|
name | String | 否 | 名称 | admin |
String | 否 | 邮箱 | admin@xxx.com | |
mobilePhone | String | 否 | 手机号 | 11111111111 |
响应体参数
响应体字段数据结构说明
参数名称 | 参数类型 | 描述 | 示例值 |
---|---|---|---|
totalCount | String | 总数 | 10 |
result | List<Result> |
Result字段数据结构说明
参数名称 | 参数类型 | 描述 | 示例值 |
---|---|---|---|
resourceId | String | 资源id | xxxx-xxxx-xxxx |
instanceName | String | 资源名称 | |
instanceType | String | 资源类型 | BCC |
instanceStatus | String | 资源状态 | RUNNING |
publicIp | String | 公网ip | |
internalIp | String | 内网ip | 192.168.4.1 |
nodeStatus | String | 节点状态 | |
hostsCapacity | Integer | 站点容量 | 100 |
occupiedHosts | Integer | 使用站点数 | 1 |
weight | Integer | 权重 | 0 |
port | Integer | 端口 | 80 |
请求示例
JSON
1POST /v1/host/
2<公共请求头>
3
4
5{
6 "clusterId" : "hme-bj-66f8175aa42248f0",
7 "resourceId" : "dacda95f-0308-409f-a178-7c96d59cca89",
8 "account" : "6bdde20797034a068167b767e63e6a48",
9 "hostName" : "6bdde20797034a068167b767e63e6a48",
10 "purchaseLength" : 1,
11 "domains" : [ "aaa.com", "bbb.cn" ],
12 "hostContact" : {
13 "name" : "管理员",
14 "email" : "13112345678",
15 "mobilePhone" : "example@baidu.com"
16 }
17}
响应示例
JSON
1HTTP/1.1 200 OK
2<公共响应头>
3
4{
5 "hostId":"77341667a45142b0",
6 "account":"6bdde20797034a068167b767e63e6a48",
7 "hostName":"6bdde20797034a068167b767e63e6a48",
8 "tempDomain":"6bdde20797034a068167b767e63e6a48.qahmeapi1.bigenemy.cn",
9 "expireTime":"2025-08-05T13:55:53Z",
10 "autoSwitchHk":false,
11 "neverExpire":false,
12 "flowStrategyEnabled":false,
13 "backendConfigured":false
14}
错误码
请参考通用错误码