Instance Related Interface
CCE Instance OpenAPI
Create Node (Cluster Expansion)
Description
Adds cluster nodes
Request Structure
POST /v2/cluster/{clusterID}/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
Request header fields
No other special header fields are available, except for common header fields.
Request Parameter
Parameter Name | Type | Required or not | Parameter Position | Description |
---|---|---|---|---|
clusterID | String | Yes | URL parameter | Cluster ID |
None (The RequestBody is an array) | List<InstanceSet> | Yes | RequestBody parameter | The list of nodes added to the cluster |
Return Header Field
No other special header fields are available, except for common header fields.
Return Parameters
Parameter Name | Type | Required or not | Description |
---|---|---|---|
cceInstanceIDs | List<String> | Yes | The ID list of new nodes |
requestID | String | Yes | The request ID, which is provided by the problem location. |
Request Example
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",
"securityGroupID" : "g-xh04bcdkq5n6",
"availableZone" : "zoneA"
},
"instanceResource" : {
"cpu" : 1,
"mem" : 4,
"rootDiskSize" : 40,
"localDiskSize" : 0,
"cdsList" : [ ]
},
"imageID" : "m-gTpZ1k6n",
"instanceOS" : {
"imageType" : "System"
},
"needEIP" : false,
"adminPassword" : "test123!T",
"sshKeyName" : "k-3uvrdvVq",
"instanceChargingType" : "postpay",
"runtimeType" : "docker"
},
"count" : 1
} ]
Return Example
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"
}
Delete Node (Cluster Scale-down)
Description
Deletes a cluster node
Request Structure
PUT /v2/cluster/{clusterID}/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
Request Hheader Fields
No other special header fields are available, except for common header fields.
Request Parameter
Parameter Name | Type | Required or not | Parameter Position | Description |
---|---|---|---|---|
clusterID | String | Yes | URL parameter | Cluster ID |
deleteOption | DeleteOption | No | RequestBody parameter | The deletion option. It is DeleteOption configuration of the node when this field is empty. |
instanceIDs | List<String> | Yes | RequestBody parameter | The ID list of nodes to be deleted. |
Return Header Field
No other special header fields are available, except for common header fields.
Return Parameters
Parameter Name | Type | Required or not | Description |
---|---|---|---|
requestID | String | Yes | The response request ID |
Request Example
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
}
}
Return Example
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"
}
Update Node Attribute
Description
Updates some configuration information of a node. At present, you can update partial attributes only.
Request Structure
PUT /v2/cluster/{clusterID}/instance/{instanceID} HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
Request Header Fields
No other special header fields are available, except for common header fields.
Request Parameter
Parameter Name | Type | Required or not | Parameter Position | Description |
---|---|---|---|---|
clusterID | String | Yes | URL parameter | Cluster ID |
instanceID | String | Yes | URL parameter | Node ID |
labels | Map<String,String> | Yes | RequestBody parameter | Node tag |
taints | List<Taint> | Yes | RequestBody parameter | The node taint |
cceInstancePriority | Integer | Yes | RequestBody parameter | The node priority |
Return Header Field
No other special header fields are available, except for common header fields.
Return Parameters
Parameter Name | Type | Required or not | Description |
---|---|---|---|
instance | Instance | Yes | The node query result |
requestID | String | Yes | The request ID, which is provided by the problem location. |
Request Examples
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
}
Return Examples
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 Node Details
Description
Gets the detail of a node
Request Structure
GET /v2/cluster/{clusterID}/instance/{instanceID} HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
Request Header Fields
No other special header fields are available, except for common header fields.
Request Parameter
Parameter Name | Type | Required | Parameter Position | Description |
---|---|---|---|---|
clusterID | String | Yes | URL parameter | The cluster ID |
instanceID | String | Yes | URL parameter | The node ID |
Return Header Field
No other special header fields are available, except for common header fields.
Return Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
instance | Instance | Yes | The node query result |
requestID | String | Yes | The request ID, which is provided by the problem location. |
Request Examples
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
Return Examples
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"
}
Gets Cluster Node List
Description
Requests the cluster node list.
Request Structure
GET /v2/cluster/{clusterID}/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
Request Header Fields
No other special header fields are available, except for common header fields.
Request Parameter
Parameter Name | Type | Required or not | Parameter Position | Description |
---|---|---|---|---|
clusterID | String | Yes | URL parameter | Cluster ID |
keywordType | String | No | Query parameter | The cluster fuzzy query field. You can select it between [instanceName and instanceID]. Its default value is instanceName. |
keyword | String | No | Query parameter | Query the keyword |
orderBy | String | No | Query parameter | The cluster query sorting field. You can select it among [instanceName, instanceID, and createdAt ]. Its default value is instance_name. |
order | String | No | Query parameter | The sorting method. You can select it between [ASC and DESC]. ASC represents the ascending order and DESC the descending order. Its default value is ASC. |
pageNo | Integer | No | Query parameter | Page, The default Value is 1 |
pageSize | Integer | No | Query parameter | The number of results on a single page. Its default value is 10. |
Return Header Field
No other special header fields are available, except for common header fields.
Return Parameters
Parameter Name | Type | Required or not | Description |
---|---|---|---|
instancePage | InstancePage | Yes | The cluster node query result |
requestID | String | Yes | The response request ID |
Request Example
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
Return Example
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 List of Nodes in Node Group
Description
Gets a list of nodes in a node group.
Request Structure
GET /v2/cluster/{clusterID}/instancegroup/{instanceGroupID}/instances HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: authorization string
Request Header Fields
No other special header fields are available, except for common header fields.
Request Parameter
Parameter Name | Type | Required or not | Parameter Position | Description |
---|---|---|---|---|
clusterID | String | Yes | URL parameter | Cluster ID |
instanceGroupID | String | Yes | URL parameter | Node group ID |
pageNo | Integer | No | Query parameter | The page number, which is 0 by default. When the value is 0, return all the nodes under the node group. |
pageSize | Integer | No | Query parameter | The number of results on a single page. Its default value is 0. |
Return Header Field
No other special header fields are available, except for common header fields.
Return Parameters
Parameter Name | Type | Required or not | Description |
---|---|---|---|
instancePage | ListInstancesByInstanceGroupIDPage | Yes | The cluster node query result |
requestID | String | Yes | The response request ID |
Request Example
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
Return Example
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"
}
]
}
}