Instance相关接口
CCE Instance OpenAPI
创建节点(集群扩容)
描述
为集群添加节点
请求结构
POST /v2/cluster/{clusterID}/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
clusterID | String | 是 | URL 参数 | 集群ID |
无(RequestBody 为数组) | List<InstanceSet> | 是 | RequestBody 参数 | 为集群增加的节点列表 |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
cceInstanceIDs | List<String> | 是 | 新增节点的 ID 列表 |
requestID | String | 是 | 请求 ID, 问题定位提供该 ID |
请求示例:新建 BCC
POST /v2/cluster/cce-f7zeyx1u/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
[ {
"instanceSpec" : {
"instanceName" : "",
"clusterRole" : "node",
"existed" : false,
"machineType" : "BCC",
"instanceType" : "N3",
"vpcConfig" : {
"vpcID" : "vpc-mwbgygrjb72w",
"vpcSubnetID" : "sbn-mnbvhnuupv1u",
"availableZone" : "zoneA",
"securityGroup": {
"customSecurityGroups": [],
"enableCCERequiredSecurityGroup": true,
"enableCCEOptionalSecurityGroup": true
}
},
"instanceResource" : {
"cpu" : 1,
"mem" : 4,
"rootDiskSize" : 40,
"localDiskSize" : 0,
"cdsList" : [ ]
},
"imageID" : "m-gTpZ1k6n",
"instanceOS" : {
"imageType" : "System"
},
"needEIP" : false,
"bid":false,
"adminPassword" : "test123!T",
"sshKeyName" : "k-3uvrdvVq",
"instanceChargingType" : "Postpaid",
"runtimeType" : "docker"
},
"count" : 1
} ]
请求示例:使用已有节点
- 添加 Node 机器配置时,设置
instanceSpec.existed
为true
并设置instanceSpec.existedOption.existedInstanceID
为希望使用的已有节点 ID - 如果不希望重装系统,设置
instanceSpec.existedOption.rebuild
为false
并务必保证机器密码正确,否则节点会因无法部署相关服务而创建失败 - 如果不希望重装系统,无需设置
instanceSpec.instanceOS
与instanceSpec.machineType
- 其它参数参考 API 文档按需设置
[
{
"instanceSpec":{
"existed":true,
"existedOption":{
"existedInstanceID":"i-M56Un1DO",
"rebuild":true
},
"machineType":"BCC",
"instanceOS": {
"imageName": "7.5 x86_64 (64bit)",
"imageType": "System",
"osType": "linux",
"osName": "CentOS",
"osVersion": "7.5",
"osArch": "x86_64 (64bit)"
},
"adminPassword":"test123!T"
}
]
请求示例:挂载CDS
有时我们希望在新建节点的同时为节点挂载 1 到多个 CDS,此时在创建集群时,为节点设置 CDS 参数和相关挂载路径即可。示例如下。
需要注意的是,每个路径下只能挂载一个 CDS,但一个路径的子路径下可以挂载另一个 CDS,例如 /a 目录下仅可挂载一个 CDS,但 /a/b 目录下可以挂载另一个 CDS。
已有节点仅可挂载 CDS 到指定路径,不会新建 CDS。因此当已有节点试图挂载 CDS 到指定 Path 但找不到满足条件的 CDS 时,将会忽略相关 CDS 配置。
[
{
"instanceSpec":{
......
"instanceResource": {
"cdsList": [
{diskPath: "/home/cce", storageType: "cloud_hp1", cdsSize: 60}
]
},
......
}
}
]
请求示例:新建 BBC
智能卡 BBC 需要使用普通子网,需要安全组 ID;非智能卡 BBC 需要使用 BBC 型子网,不能传安全组ID。
POST /v2/cluster/cce-f7zeyx1u/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
[ {
"instanceSpec" : {
"instanceName" : "",
"clusterRole" : "node",
"existed" : false,
"machineType" : "BBC",
"vpcConfig" : {
"vpcSubnetID" : "sbn-mnbvhnuupv1u",
"securityGroupID" : "g-xh04bcdkq5n6"
},
"instanceResource" : {
"rootDiskSize" : 100,
"cdsList" : [ ]
},
"bbcOption": {
"flavor": "BBC-G4-02S",
"diskInfo": "NoRaid"
},
"imageID" : "m-zGnlzI5v",
"instanceOS" : {
"imageType" : "BbcSystem"
},
"adminPassword" : "test123!T",
"instanceChargingType" : "Postpaid",
"runtimeType" : "docker"
},
"count" : 1
} ]
返回示例
HTTP/1.1 200 OK
X-Bce-Request-Id: 58868d06-2e79-4d68-9f62-389e70f54996
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"cceInstanceIDs": [
"cce-f7zeyx1u-7ombtu3j"
],
"requestID": "58868d06-2e79-4d68-9f62-389e70f54996"
}
删除节点(集群缩容)
描述
为集群删除节点
请求结构
PUT /v2/cluster/{clusterID}/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
clusterID | String | 是 | URL参数 | 集群ID |
deleteOption | DeleteOption | 否 | RequestBody 参数 | 删除选项. 为空时使用节点自身的 DeleteOption 配置 |
instanceIDs | List<String> | 是 | RequestBody 参数 | 要删除的节点 ID 列表 |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
requestID | String | 是 | 响应的请求的ID |
请求示例:将节点从集群中移出后同时删除相关资源
PUT /v2/cluster/cce-f7zeyx1u/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"instanceIDs": [
"cce-f7zeyx1u-7ombtu3j"
],
"deleteOption": {
"moveOut": false,
"deleteResource": true,
"deleteCDSSnapshot": true
}
}
请求示例:仅将节点从集群中移出
PUT /v2/cluster/cce-f7zeyx1u/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"instanceIDs": [
"cce-f7zeyx1u-7ombtu3j"
],
"deleteOption": {
"moveOut": true
}
}
返回示例
HTTP/1.1 200 OK
X-Bce-Request-Id: 23a82d7e-954f-4539-b828-ce620eaa97b3
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"requestID": "23a82d7e-954f-4539-b828-ce620eaa97b3"
}
更新节点属性
描述
更新一个节点的某些配置信息。目前仅支持部分属性的更新。
请求结构
PUT /v2/cluster/{clusterID}/instance/{instanceID} HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
clusterID | String | 是 | URL 参数 | 集群 ID |
instanceID | String | 是 | URL 参数 | 节点 ID |
labels | Map<String,String> | 是 | RequestBody 参数 | 节点的标签 |
annotations | Map<String,String> | 否 | RequestBody 参数 | 节点的注解 |
taints | List<Taint> | 是 | RequestBody 参数 | 节点的污点 |
cceInstancePriority | Integer | 是 | RequestBody 参数 | 节点的优先级 |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
instance | Instance | 是 | 节点的查询结果 |
requestID | String | 是 | 请求 ID, 问题定位提供该 ID |
请求示例
PUT /v2/cluster/cce-oi0ihu53/instance/i-bn71n2eK HTTP/1.1
Host: cce.hkg.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"labels": {
"cluster-id": "cce-b3gzxpwg",
"cluster-role": "node",
"new-label-key": "new-label-value"
},
"taints": [
{
"key": "testKey",
"value": "testValue",
"effect": "NoSchedule"
}
],
"cceInstancePriority": 5
}
返回示例
HTTP/1.1 200 OK
X-Bce-Request-Id: 60dae0e8-8fa0-443c-a5d5-45b1e7beea68
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"instance": {
"spec": {
"cceInstanceID": "cce-oi0ihu53-pfmx3lu6",
"instanceName": "cce-oi0ihu53-pfmx3lu6",
"runtimeType": "docker",
"runtimeVersion": "18.9.2",
"clusterID": "cce-oi0ihu53",
"clusterRole": "node",
"userID": "eca97e148cb74e9683d7b7240829d1ff",
"instanceGroupID": "",
"instanceGroupName": "",
"machineType": "BCC",
"instanceType": "N3",
"bbcOption": {},
"vpcConfig": {
"vpcID": "vpc-epyxw9mwjc18",
"vpcSubnetID": "sbn-11gfqpsax4jn",
"securityGroupID": "g-urmir67c35x3",
"vpcSubnetType": "BCC",
"VPCSubnetCIDR": "192.168.0.0/16",
"VPCSubnetCIDRIPv6": "",
"availableZone": "zoneA"
},
"instanceResource": {
"cpu": 4,
"mem": 12,
"rootDiskType": "hp1",
"rootDiskSize": 40
},
"deployCustomConfig": {
"dockerConfig": {}
},
"imageID": "m-Yp443gTZ",
"instanceOS": {
"imageType": "System",
"imageName": "centos-7u5-x86_64-20200601203742",
"osType": "linux",
"osName": "CentOS",
"osVersion": "7.5",
"osArch": "x86_64 (64bit)",
"osBuild": "2020060100"
},
"needEIP": false,
"eipOption": {},
"sshKeyID": "",
"instanceChargingType": "Postpaid",
"deleteOption": {
"deleteResource": true,
"deleteCDSSnapshot": true
},
"labels": {
"cluster-id": "cce-oi0ihu53",
"cluster-role": "node"
},
"cceInstancePriority": 5
},
"status": {
"machine": {
"instanceID": "i-bn71n2eK",
"instanceUUID": "60c466f2-929a-4cf9-af7c-52af00fa4476",
"orderID": "0fe2237296b644da8ef2b215b4ff19c8",
"vpcIP": "192.168.0.31"
},
"instancePhase": "running",
"machineStatus": "ACTIVE"
},
"createdAt": "2020-09-15T06:43:20Z",
"updatedAt": "2020-09-25T06:03:40Z"
},
"requestID": "60dae0e8-8fa0-443c-a5d5-45b1e7beea68"
}
获取节点详情
描述
获取一个节点的详细信息
请求结构
GET /v2/cluster/{clusterID}/instance/{instanceID} HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
clusterID | String | 是 | URL 参数 | 集群 ID |
instanceID | String | 是 | URL 参数 | 节点 ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
instance | Instance | 是 | 节点的查询结果 |
requestID | String | 是 | 请求 ID, 问题定位提供该 ID |
请求示例
GET /v2/cluster/cce-oi0ihu53/instance/i-bn71n2eK HTTP/1.1
Host: cce.hkg.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
HTTP/1.1 200 OK
X-Bce-Request-Id: a13e8b5f-6878-4f1f-8746-3e986ee49a96
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"instance": {
"spec": {
"cceInstanceID": "cce-oi0ihu53-pfmx3lu6",
"instanceName": "cce-oi0ihu53-pfmx3lu6",
"runtimeType": "docker",
"runtimeVersion": "18.9.2",
"clusterID": "cce-oi0ihu53",
"clusterRole": "node",
"userID": "eca97e148cb74e9683d7b7240829d1ff",
"instanceGroupID": "",
"instanceGroupName": "",
"machineType": "BCC",
"instanceType": "N3",
"bbcOption": {},
"vpcConfig": {
"vpcID": "vpc-epyxw9mwjc18",
"vpcSubnetID": "sbn-11gfqpsax4jn",
"securityGroupID": "g-urmir67c35x3",
"vpcSubnetType": "BCC",
"VPCSubnetCIDR": "192.168.0.0/16",
"VPCSubnetCIDRIPv6": "",
"availableZone": "zoneA"
},
"instanceResource": {
"cpu": 4,
"mem": 12,
"rootDiskType": "hp1",
"rootDiskSize": 40
},
"deployCustomConfig": {
"dockerConfig": {}
},
"imageID": "m-Yp443gTZ",
"instanceOS": {
"imageType": "System",
"imageName": "centos-7u5-x86_64-20200601203742",
"osType": "linux",
"osName": "CentOS",
"osVersion": "7.5",
"osArch": "x86_64 (64bit)",
"osBuild": "2020060100"
},
"needEIP": false,
"eipOption": {},
"sshKeyID": "",
"instanceChargingType": "Postpaid",
"deleteOption": {
"deleteResource": true,
"deleteCDSSnapshot": true
},
"labels": {
"cluster-id": "cce-oi0ihu53",
"cluster-role": "node"
},
"cceInstancePriority": 5
},
"status": {
"machine": {
"instanceID": "i-bn71n2eK",
"instanceUUID": "60c466f2-929a-4cf9-af7c-52af00fa4476",
"orderID": "0fe2237296b644da8ef2b215b4ff19c8",
"vpcIP": "192.168.0.31"
},
"instancePhase": "running",
"machineStatus": "ACTIVE"
},
"createdAt": "2020-09-15T06:43:20Z",
"updatedAt": "2020-09-24T08:27:21Z"
},
"requestID": "74a74b2e-f439-4147-b27a-f473e3576338"
}
获取集群节点列表
描述
请求集群节点列表
请求结构
GET /v2/cluster/{clusterID}/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
clusterID | String | 是 | URL 参数 | 集群ID |
keywordType | String | 否 | Query 参数 | 集群模糊查询字段,可选 [ instanceName, instanceID, clusterRole],默认值为 instanceName |
keyword | String | 否 | Query 参数 | 查询关键词 |
orderBy | String | 否 | Query 参数 | 集群查询排序字段,可选 [ instanceName, instanceID, createdAt],默认值为 instance_name |
order | String | 否 | Query 参数 | 排序方式,可选 [ ASC, DESC ], ASC 为升序,DESC 为降序,默认值为 ASC |
pageNo | Integer | 否 | Query 参数 | 页码,默认值为1 |
pageSize | Integer | 否 | Query 参数 | 单页结果数,默认值为10 |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
instancePage | InstancePage | 是 | 集群的节点查询结果 |
requestID | String | 是 | 响应的请求的ID |
请求示例
GET /v2/cluster/cce-f7zeyx1u/instances?keywordType=instanceName&keyword=&orderBy=createdAt&order=asc&pageNo=1&pageSize=10 HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
HTTP/1.1 200 OK
X-Bce-Request-Id: a13e8b5f-6878-4f1f-8746-3e986ee49a96
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"instancePage": {
"clusterID": "cce-f7zeyx1u",
"keywordType": "instanceName",
"keyword": "",
"orderBy": "createdAt",
"order": "ASC",
"pageNo": 1,
"pageSize": 10,
"totalCount": 1,
"instanceList": [
{
"spec": {
"cceInstanceID": "cce-f7zeyx1u-vbsry5uc",
"instanceName": "cce-f7zeyx1u-vbsry5uc",
"runtimeType": "docker",
"runtimeVersion": "18.9.2",
"clusterID": "cce-f7zeyx1u",
"clusterRole": "node",
"userID": "eca97e148cb74e9683d7b7240829d1ff",
"instanceGroupID": "",
"instanceGroupName": "",
"machineType": "BCC",
"instanceType": "N3",
"bbcOption": {},
"vpcConfig": {
"vpcID": "vpc-mwbgygrjb72w",
"vpcSubnetID": "sbn-mnbvhnuupv1u",
"securityGroupID": "g-xh04bcdkq5n6",
"vpcSubnetType": "BCC",
"VPCSubnetCIDR": "192.168.0.0/20",
"VPCSubnetCIDRIPv6": "",
"availableZone": "zoneA"
},
"instanceResource": {
"cpu": 1,
"mem": 4,
"rootDiskType": "hp1",
"rootDiskSize": 40
},
"deployCustomConfig": {
"dockerConfig": {}
},
"imageID": "m-gTpZ1k6n",
"instanceOS": {
"imageType": "System",
"imageName": "centos-7u3-x86_64-20191105104647",
"osType": "linux",
"osName": "CentOS",
"osVersion": "7.3",
"osArch": "x86_64 (64bit)",
"osBuild": "2019110600"
},
"needEIP": false,
"eipOption": {},
"sshKeyID": "",
"instanceChargingType": "Postpaid",
"deleteOption": {},
"labels": {
"cluster-id": "",
"cluster-role": "node"
}
},
"status": {
"machine": {
"instanceID": "i-HJitrtYn",
"orderID": "b49e015b819c4fd1887b8848c7a38025",
"vpcIP": "192.168.4.25"
},
"instancePhase": "running",
"machineStatus": "ACTIVE"
},
"createdAt": "2020-07-21T12:12:54Z",
"updatedAt": "2020-07-21T12:15:00Z"
}
]
},
"requestID": "a13e8b5f-6878-4f1f-8746-3e986ee49a96"
}
获取节点组节点列表
描述
获取节点组节点列表
请求结构
GET /v2/cluster/{clusterID}/instancegroup/{instanceGroupID}/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
clusterID | String | 是 | URL 参数 | 集群 ID |
instanceGroupID | String | 是 | URL 参数 | 节点组 ID |
pageNo | Integer | 否 | Query 参数 | 页码,默认值为 0. 取值为 0 时返回节点组下的所有节点 |
pageSize | Integer | 否 | Query 参数 | 单页结果数,默认值为 0. 取值为 0 时返回节点组下的所有节点 |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
page | ListInstancesByInstanceGroupIDPage | 是 | 集群的节点查询结果 |
requestID | String | 是 | 响应的请求的 ID |
请求示例
GET /v2/cluster/cce-47bqnhmj/instancegroup/cce-ig-796lmt7a/instances?pageNo=1&pageSize=10 HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
HTTP/1.1 200 OK
X-Bce-Request-Id: d52c646c-207d-4630-95ba-0539124fd42b
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"requestID": "d52c646c-207d-4630-95ba-0539124fd42b",
"page": {
"pageNo": 0,
"pageSize": 0,
"totalCount": 3,
"list": [
{
"spec": {
"cceInstanceID": "cce-z6qjgcq7-7dd7z1fc",
"instanceName": "cce-z6qjgcq7-7dd7z1fc",
"runtimeType": "docker",
"runtimeVersion": "18.9.2",
"clusterID": "cce-z6qjgcq7",
"clusterRole": "node",
"instanceGroupID": "cce-ig-dvej1d3y",
"instanceGroupName": "sdk-testcase",
"existedOption": {},
"machineType": "BCC",
"instanceType": "N3",
"bbcOption": {},
"vpcConfig": {
"vpcID": "vpc-pi9fghaxcpnf",
"vpcSubnetID": "sbn-ww1xf6a5fi88",
"vpcSubnetType": "BCC",
"availableZone": "zoneA"
},
"instanceResource": {
"cpu": 1,
"mem": 4,
"rootDiskType": "hp1",
"rootDiskSize": 40
},
"imageID": "m-4Umtt2i5",
"instanceOS": {
"imageType": "System",
"imageName": "centos-8u0-x86_64-20200601205040",
"osType": "linux",
"osName": "CentOS",
"osVersion": "8.0",
"osArch": "x86_64 (64bit)",
"osBuild": "2020060100"
},
"eipOption": {},
"instanceChargingType": "Postpaid",
"instancePreChargingOption": {},
"deleteOption": {
"deleteResource": true,
"deleteCDSSnapshot": true
},
"deployCustomConfig": {
"dockerConfig": {}
},
"labels": {
"cluster-id": "cce-z6qjgcq7",
"cluster-role": "node",
"instance-group-id": "cce-ig-dvej1d3y"
},
"cceInstancePriority": 5
},
"status": {
"machine": {
"instanceID": "i-HVq1GwKr",
"orderID": "71f6d4249aed4a08b2bc1470fefd6b2a",
"vpcIP": "192.168.16.33"
},
"instancePhase": "running",
"machineStatus": "ACTIVE"
},
"createdAt": "2020-09-27T06:35:04Z",
"updatedAt": "2020-09-27T06:36:53Z"
},
{
"spec": {
"cceInstanceID": "cce-z6qjgcq7-asf0p09i",
"instanceName": "cce-z6qjgcq7-asf0p09i",
"runtimeType": "docker",
"runtimeVersion": "18.9.2",
"clusterID": "cce-z6qjgcq7",
"clusterRole": "node",
"instanceGroupID": "cce-ig-dvej1d3y",
"instanceGroupName": "sdk-testcase",
"existedOption": {},
"machineType": "BCC",
"instanceType": "N3",
"bbcOption": {},
"vpcConfig": {
"vpcID": "vpc-pi9fghaxcpnf",
"vpcSubnetID": "sbn-ww1xf6a5fi88",
"vpcSubnetType": "BCC",
"availableZone": "zoneA"
},
"instanceResource": {
"cpu": 1,
"mem": 4,
"rootDiskType": "hp1",
"rootDiskSize": 40
},
"imageID": "m-4Umtt2i5",
"instanceOS": {
"imageType": "System",
"imageName": "centos-8u0-x86_64-20200601205040",
"osType": "linux",
"osName": "CentOS",
"osVersion": "8.0",
"osArch": "x86_64 (64bit)",
"osBuild": "2020060100"
},
"eipOption": {},
"instanceChargingType": "Postpaid",
"instancePreChargingOption": {},
"deleteOption": {
"deleteResource": true,
"deleteCDSSnapshot": true
},
"deployCustomConfig": {
"dockerConfig": {}
},
"labels": {
"cluster-id": "cce-z6qjgcq7",
"cluster-role": "node",
"instance-group-id": "cce-ig-dvej1d3y"
},
"cceInstancePriority": 5
},
"status": {
"machine": {
"instanceID": "i-RndUYlWF",
"orderID": "71f6d4249aed4a08b2bc1470fefd6b2a",
"vpcIP": "192.168.16.34"
},
"instancePhase": "running",
"machineStatus": "ACTIVE"
},
"createdAt": "2020-09-27T06:35:06Z",
"updatedAt": "2020-09-27T06:36:58Z"
},
{
"spec": {
"cceInstanceID": "cce-z6qjgcq7-ibtt74zc",
"instanceName": "cce-z6qjgcq7-ibtt74zc",
"runtimeType": "docker",
"runtimeVersion": "18.9.2",
"clusterID": "cce-z6qjgcq7",
"clusterRole": "node",
"instanceGroupID": "cce-ig-dvej1d3y",
"instanceGroupName": "sdk-testcase",
"existedOption": {},
"machineType": "BCC",
"instanceType": "N3",
"bbcOption": {},
"vpcConfig": {
"vpcID": "vpc-pi9fghaxcpnf",
"vpcSubnetID": "sbn-ww1xf6a5fi88",
"vpcSubnetType": "BCC",
"availableZone": "zoneA"
},
"instanceResource": {
"cpu": 1,
"mem": 4,
"rootDiskType": "hp1",
"rootDiskSize": 40
},
"imageID": "m-4Umtt2i5",
"instanceOS": {
"imageType": "System",
"imageName": "centos-8u0-x86_64-20200601205040",
"osType": "linux",
"osName": "CentOS",
"osVersion": "8.0",
"osArch": "x86_64 (64bit)",
"osBuild": "2020060100"
},
"eipOption": {},
"instanceChargingType": "Postpaid",
"instancePreChargingOption": {},
"deleteOption": {
"deleteResource": true,
"deleteCDSSnapshot": true
},
"deployCustomConfig": {
"dockerConfig": {}
},
"labels": {
"cluster-id": "cce-z6qjgcq7",
"cluster-role": "node",
"instance-group-id": "cce-ig-dvej1d3y"
},
"cceInstancePriority": 5
},
"status": {
"machine": {
"instanceID": "i-aRGKcLtv",
"orderID": "71f6d4249aed4a08b2bc1470fefd6b2a",
"vpcIP": "192.168.16.35"
},
"instancePhase": "running",
"machineStatus": "ACTIVE"
},
"createdAt": "2020-09-27T06:35:07Z",
"updatedAt": "2020-09-27T06:37:02Z"
}
]
}
}
获取节点事件步骤
描述
获取创建或删除过程中节点所处的事件步骤,请求参数同时兼容cceInstanceID和instanceID
请求结构
GET /v2/event/instance/{instanceID} HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
instanceID | String | 是 | URL 参数 | 节点 ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 是否必选 | 描述 |
---|---|---|---|
status | String | 是 | 事件类型 |
steps | List<Step> | 是 | 集群操作步骤 |
requestID | String | 是 | 请求ID |
请求示例
GET /v2/event/instance/i-ezs9bmjY HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
HTTP/1.1 200 OK
X-Bce-Request-Id: 08eb305a-87fb-4360-8a27-42b9561edf4a
Date: Fri, 12 Aug 2022 03:10:30 GMT
Content-Type: application/json;charset=UTF-8
{
"status": "created",
"steps": [
{
"stepName": "准备机器",
"stepStatus": "done",
"ready": true,
"startTime": "2022-08-04T02:45:28Z",
"finishedTime": "2022-08-04T02:45:56Z",
"costSeconds": 28,
"retryCount": 1,
"errInfo": {}
},
{
"stepName": "绑定安全组",
"stepStatus": "done",
"ready": true,
"startTime": "2022-08-04T02:45:56Z",
"finishedTime": "2022-08-04T02:45:57Z",
"costSeconds": 1,
"retryCount": 1,
"errInfo": {}
},
{
"stepName": "前置检查",
"stepStatus": "done",
"ready": true,
"startTime": "2022-08-04T02:45:57Z",
"finishedTime": "2022-08-04T02:48:38Z",
"costSeconds": 161,
"retryCount": 2,
"errInfo": {}
},
{
"stepName": "部署 K8S",
"stepStatus": "done",
"ready": true,
"startTime": "2022-08-04T02:48:38Z",
"finishedTime": "2022-08-04T02:49:20Z",
"costSeconds": 42,
"retryCount": 1,
"errInfo": {}
},
{
"stepName": "等待就绪",
"stepStatus": "done",
"ready": true,
"startTime": "2022-08-04T03:40:41Z",
"finishedTime": "2022-08-04T03:40:41Z",
"retryCount": 1,
"errInfo": {}
}
],
"requestID": "08eb305a-87fb-4360-8a27-42b9561edf4a"
}
同步节点元信息
描述
同步并更新集群下所有节点的IAAS配置信息。例如:用户变更BCC付费方式,可通过接口进行数据同步。
请求结构
POST /v2/sync/cluster/{clusterID}/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
clusterID | String | 是 | URL 参数 | 集群 ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 是否必选 | 描述 |
---|---|---|---|
clusterID | String | 是 | 请求的集群ID |
requestID | String | 是 | 请求ID |
请求示例
POST /v2/sync/cluster/cce-f7zeyx1u/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{}
返回示例
HTTP/1.1 200 OK
X-Bce-Request-Id: 23a82d7e-954f-4539-b828-ce620eaa97b3
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"requestID": "23a82d7e-954f-4539-b828-ce620eaa97b3",
"clusterID": "cce-f7zeyx1u"
}