Instance Related Interfaces
CCE Instance OpenAPI
Create node (cluster scale-up)
Description
Add node to the cluster
Request structure
1POST /v2/cluster/{clusterID}/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| clusterID | String | Yes | URL parameter | Cluster ID |
| None (RequestBody is an array) | List<[InstanceSet](CCE/API_V2 Reference/Appendix.md#InstanceSet)> | Yes | RequestBody | List of nodes added to the cluster |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Required or not | Description |
|---|---|---|---|
| cceInstanceIDs | List |
Yes | List of IDs for newly added nodes |
| requestID | String | Yes | Request ID. This ID is provided for issue localization. |
Request example: Create BCC
1POST /v2/cluster/cce-f7zeyx1u/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4[ {
5 "instanceSpec" : {
6 "instanceName" : "",
7 "clusterRole" : "node",
8 "existed" : false,
9 "machineType" : "BCC",
10 "instanceType" : "N3",
11 "vpcConfig" : {
12 "vpcID" : "vpc-mwbgygrjb72w",
13 "vpcSubnetID" : "sbn-mnbvhnuupv1u",
14 "availableZone" : "zoneA",
15 "securityGroup": {
16 "customSecurityGroups": [],
17 "enableCCERequiredSecurityGroup": true,
18 "enableCCEOptionalSecurityGroup": true
19 }
20 },
21 "instanceResource" : {
22 "cpu" : 1,
23 "mem" : 4,
24 "rootDiskSize" : 40,
25 "localDiskSize" : 0,
26 "cdsList" : [ ]
27 },
28 "imageID" : "m-gTpZ1k6n",
29 "instanceOS" : {
30 "imageType" : "System"
31 },
32 "needEIP" : false,
33 "bid":false,
34 "adminPassword" : "test123!T",
35 "sshKeyName" : "k-3uvrdvVq",
36 "instanceChargingType" : "Postpaid",
37 "runtimeType" : "docker"
38 },
39 "count" : 1
40} ]
Request example: Using existing nodes
- When adding node machine configuration, set
instanceSpec.existedtotrue, and setinstanceSpec.existedOption.existedInstanceIDto the existing node ID to be used - If you do not want to reinstall the system, set
instanceSpec.existedOption.rebuildtofalse, and ensure the machine password is correct. Otherwise, node creation will fail due to inability to deploy related services. - If you do not want to reinstall the system, there is no need to set
instanceSpec.instanceOSandinstanceSpec.machineType - Set other parameters as needed by referring to the API documentation
1[
2 {
3 "instanceSpec":{
4 "existed":true,
5 "existedOption":{
6 "existedInstanceID":"i-M56Un1DO",
7 "rebuild":true
8 },
9 "machineType":"BCC",
10 "instanceOS": {
11 "imageName": "7.5 x86_64 (64bit)",
12 "imageType": "System",
13 "osType": "linux",
14 "osName": "CentOS",
15 "osVersion": "7.5",
16 "osArch": "x86_64 (64bit)"
17 },
18 "adminPassword":"test123!T"
19 }
20]
Request example: Mount CDS
Sometimes, we want to mount 1 or more CDSs to nodes while creating new nodes. In this case, set CDS parameters and relevant mount paths for nodes during cluster creation. An example is as follows.
Note that only one CDS can be mounted in each path, but another CDS can be mounted in a subpath of each path. For example, only one CDS can be mounted in /a directory, but another CDS can be mounted in /a/b directory.
Existing nodes can only mount CDS to a specified path and will not create new CDS. Thus, when existing nodes attempt to mount CDS to a specified path, but no eligible CDS is found, the relevant CDS configurations will be ignored.
1[
2 {
3 "instanceSpec":{
4 ......
5 "instanceResource": {
6 "cdsList": [
7 {diskPath: "/home/cce", storageType: "cloud_hp1", cdsSize: 60}
8 ]
9 },
10 ......
11 }
12 }
13]
Request example: Create BBC
For smart card BBC, provide regular subnet and security group IDs; for non-smart card BBC, provide BBC-specific subnet IDs instead of security group IDs.
1POST /v2/cluster/cce-f7zeyx1u/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4[ {
5 "instanceSpec" : {
6 "instanceName" : "",
7 "clusterRole" : "node",
8 "existed" : false,
9 "machineType" : "BBC",
10 "vpcConfig" : {
11 "vpcSubnetID" : "sbn-mnbvhnuupv1u",
12 "securityGroupID" : "g-xh04bcdkq5n6"
13 },
14 "instanceResource" : {
15 "rootDiskSize" : 100,
16 "cdsList" : [ ]
17 },
18 "bbcOption": {
19 "flavor": "BBC-G4-02S",
20 "diskInfo": "NoRaid"
21 },
22 "imageID" : "m-zGnlzI5v",
23 "instanceOS" : {
24 "imageType" : "BbcSystem"
25 },
26 "adminPassword" : "test123!T",
27 "instanceChargingType" : "Postpaid",
28 "runtimeType" : "docker"
29 },
30 "count" : 1
31} ]
Response example
1HTTP/1.1 200 OK
2X-Bce-Request-Id: 58868d06-2e79-4d68-9f62-389e70f54996
3Date: Thu, 16 Mar 2020 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5{
6 "cceInstanceIDs": [
7 "cce-f7zeyx1u-7ombtu3j"
8 ],
9 "requestID": "58868d06-2e79-4d68-9f62-389e70f54996"
10}
Delete node (cluster scale-down)
Description
Delete node from the cluster
Request structure
1PUT /v2/cluster/{clusterID}/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| clusterID | String | Yes | URL parameter | Cluster ID |
| deleteOption | [DeleteOption](CCE/API_V2 Reference/Appendix.md#DeleteOption) | No | RequestBody | Delete option. When null, use the DeleteOption configuration of the node |
| instanceIDs | List |
Yes | RequestBody | List of node IDs to be deleted |
| scaleDown | Boolean | No | RequestBody | Whether to simultaneously reduce the desired nodes in the node group where the deleted nodes are located |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Required or not | Description |
|---|---|---|---|
| requestID | String | Yes | ID of the response request |
Request example: Delete related resources after removing nodes from the cluster
1PUT /v2/cluster/cce-f7zeyx1u/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4{
5 "instanceIDs": [
6 "cce-f7zeyx1u-7ombtu3j"
7 ],
8
9 "deleteOption": {
10 "moveOut": false,
11 "deleteResource": true,
12 "deleteCDSSnapshot": true
13 }
14}
Request example: Only remove nodes from the cluster
1PUT /v2/cluster/cce-f7zeyx1u/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4{
5 "instanceIDs": [
6 "cce-f7zeyx1u-7ombtu3j"
7 ],
8
9 "deleteOption": {
10 "moveOut": true
11 }
12}
Response example
1HTTP/1.1 200 OK
2X-Bce-Request-Id: 23a82d7e-954f-4539-b828-ce620eaa97b3
3Date: Thu, 16 Mar 2020 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5{
6 "requestID": "23a82d7e-954f-4539-b828-ce620eaa97b3"
7}
Update node attributes
Description
Update specific configuration details of a node. Currently, only certain attributes can be updated.
Request structure
1PUT /v2/cluster/{clusterID}/instance/{instanceID} HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| clusterID | String | Yes | URL parameter | Cluster ID |
| instanceID | String | Yes | URL parameter | Node ID |
| labels | Map<String,String> | Yes | RequestBody | Node tag |
| annotations | Map<String,String> | No | RequestBody | Node annotation |
| taints | List<[Taint](CCE/API_V2 Reference/Appendix.md#Taint)> | Yes | RequestBody | Node taint |
| cceInstancePriority | Integer | Yes | RequestBody | Node priority |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Required or not | Description |
|---|---|---|---|
| instance | [Instance](CCE/API_V2 Reference/Appendix.md#Instance) | Yes | Node query result |
| requestID | String | Yes | Request ID. This ID is provided for issue localization. |
Request example
1PUT /v2/cluster/cce-oi0ihu53/instance/i-bn71n2eK HTTP/1.1
2Host: cce.hkg.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4{
5 "labels": {
6 "cluster-id": "cce-b3gzxpwg",
7 "cluster-role": "node",
8 "new-label-key": "new-label-value"
9 },
10 "taints": [
11 {
12 "key": "testKey",
13 "value": "testValue",
14 "effect": "NoSchedule"
15 }
16 ],
17 "cceInstancePriority": 5
18}
Response example
1HTTP/1.1 200 OK
2X-Bce-Request-Id: 60dae0e8-8fa0-443c-a5d5-45b1e7beea68
3Date: Thu, 16 Mar 2020 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5{
6 "instance": {
7 "spec": {
8 "cceInstanceID": "cce-oi0ihu53-pfmx3lu6",
9 "instanceName": "cce-oi0ihu53-pfmx3lu6",
10 "runtimeType": "docker",
11 "runtimeVersion": "18.9.2",
12 "clusterID": "cce-oi0ihu53",
13 "clusterRole": "node",
14 "userID": "eca97e148cb74e9683d7b7240829d1ff",
15 "instanceGroupID": "",
16 "instanceGroupName": "",
17 "machineType": "BCC",
18 "instanceType": "N3",
19 "bbcOption": {},
20 "vpcConfig": {
21 "vpcID": "vpc-epyxw9mwjc18",
22 "vpcSubnetID": "sbn-11gfqpsax4jn",
23 "securityGroupID": "g-urmir67c35x3",
24 "vpcSubnetType": "BCC",
25 "VPCSubnetCIDR": "192.168.0.0/16",
26 "VPCSubnetCIDRIPv6": "",
27 "availableZone": "zoneA"
28 },
29 "instanceResource": {
30 "cpu": 4,
31 "mem": 12,
32 "rootDiskType": "hp1",
33 "rootDiskSize": 40
34 },
35 "deployCustomConfig": {
36 "dockerConfig": {}
37 },
38 "imageID": "m-Yp443gTZ",
39 "instanceOS": {
40 "imageType": "System",
41 "imageName": "centos-7u5-x86_64-20200601203742",
42 "osType": "linux",
43 "osName": "CentOS",
44 "osVersion": "7.5",
45 "osArch": "x86_64 (64bit)",
46 "osBuild": "2020060100"
47 },
48 "needEIP": false,
49 "eipOption": {},
50 "sshKeyID": "",
51 "instanceChargingType": "Postpaid",
52 "deleteOption": {
53 "deleteResource": true,
54 "deleteCDSSnapshot": true
55 },
56 "labels": {
57 "cluster-id": "cce-oi0ihu53",
58 "cluster-role": "node"
59 },
60 "cceInstancePriority": 5
61 },
62 "status": {
63 "machine": {
64 "instanceID": "i-bn71n2eK",
65 "instanceUUID": "60c466f2-929a-4cf9-af7c-52af00fa4476",
66 "orderID": "0fe2237296b644da8ef2b215b4ff19c8",
67 "vpcIP": "192.168.0.31"
68 },
69 "instancePhase": "running",
70 "machineStatus": "ACTIVE"
71 },
72 "createdAt": "2020-09-15T06:43:20Z",
73 "updatedAt": "2020-09-25T06:03:40Z"
74 },
75 "requestID": "60dae0e8-8fa0-443c-a5d5-45b1e7beea68"
76}
Retrieve node details
Description
Retrieve detailed information of a node
Request structure
1GET /v2/cluster/{clusterID}/instance/{instanceID} HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| clusterID | String | Yes | URL parameter | Cluster ID |
| instanceID | String | Yes | URL parameter | Node ID |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Required or not | Description |
|---|---|---|---|
| instance | [Instance](CCE/API_V2 Reference/Appendix.md#Instance) | Yes | Node query result |
| requestID | String | Yes | Request ID. This ID is provided for issue localization. |
Request example
1GET /v2/cluster/cce-oi0ihu53/instance/i-bn71n2eK HTTP/1.1
2Host: cce.hkg.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Response example
1HTTP/1.1 200 OK
2X-Bce-Request-Id: a13e8b5f-6878-4f1f-8746-3e986ee49a96
3Date: Thu, 16 Mar 2020 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5{
6 "instance": {
7 "spec": {
8 "cceInstanceID": "cce-oi0ihu53-pfmx3lu6",
9 "instanceName": "cce-oi0ihu53-pfmx3lu6",
10 "runtimeType": "docker",
11 "runtimeVersion": "18.9.2",
12 "clusterID": "cce-oi0ihu53",
13 "clusterRole": "node",
14 "userID": "eca97e148cb74e9683d7b7240829d1ff",
15 "instanceGroupID": "",
16 "instanceGroupName": "",
17 "machineType": "BCC",
18 "instanceType": "N3",
19 "bbcOption": {},
20 "vpcConfig": {
21 "vpcID": "vpc-epyxw9mwjc18",
22 "vpcSubnetID": "sbn-11gfqpsax4jn",
23 "securityGroupID": "g-urmir67c35x3",
24 "vpcSubnetType": "BCC",
25 "VPCSubnetCIDR": "192.168.0.0/16",
26 "VPCSubnetCIDRIPv6": "",
27 "availableZone": "zoneA"
28 },
29 "instanceResource": {
30 "cpu": 4,
31 "mem": 12,
32 "rootDiskType": "hp1",
33 "rootDiskSize": 40
34 },
35 "deployCustomConfig": {
36 "dockerConfig": {}
37 },
38 "imageID": "m-Yp443gTZ",
39 "instanceOS": {
40 "imageType": "System",
41 "imageName": "centos-7u5-x86_64-20200601203742",
42 "osType": "linux",
43 "osName": "CentOS",
44 "osVersion": "7.5",
45 "osArch": "x86_64 (64bit)",
46 "osBuild": "2020060100"
47 },
48 "needEIP": false,
49 "eipOption": {},
50 "sshKeyID": "",
51 "instanceChargingType": "Postpaid",
52 "deleteOption": {
53 "deleteResource": true,
54 "deleteCDSSnapshot": true
55 },
56 "labels": {
57 "cluster-id": "cce-oi0ihu53",
58 "cluster-role": "node"
59 },
60 "cceInstancePriority": 5
61 },
62 "status": {
63 "machine": {
64 "instanceID": "i-bn71n2eK",
65 "instanceUUID": "60c466f2-929a-4cf9-af7c-52af00fa4476",
66 "orderID": "0fe2237296b644da8ef2b215b4ff19c8",
67 "vpcIP": "192.168.0.31"
68 },
69 "instancePhase": "running",
70 "machineStatus": "ACTIVE"
71 },
72 "createdAt": "2020-09-15T06:43:20Z",
73 "updatedAt": "2020-09-24T08:27:21Z"
74 },
75 "requestID": "74a74b2e-f439-4147-b27a-f473e3576338"
76}
Retrieve the node list of a cluster
Description
Request cluster node list
Request structure
1GET /v2/cluster/{clusterID}/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| clusterID | String | Yes | URL parameter | Cluster ID |
| keywordType | String | No | Query | Cluster fuzzy query fields, options [instanceName, instanceID, clusterRole], defaulting to instanceName |
| keyword | String | No | Query | Query keyword |
| orderBy | String | No | Query | Cluster query sorting fields, options: [instanceName, instanceID, createdAt], defaulting to instance_name |
| order | String | No | Query | Sorting method, options: [ASC, DESC]. ASC represents ascending while DESC represents descending. Default is ASC. |
| pageNo | Integer | No | Query | Page number, defaulting to 1 |
| pageSize | Integer | No | Query | Count of results per page, defaulting to 10 |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Required or not | Description |
|---|---|---|---|
| instancePage | [InstancePage](CCE/API_V2 Reference/Appendix.md#InstancePage) | Yes | Cluster node query results |
| requestID | String | Yes | ID of the response request |
Request example
1GET /v2/cluster/cce-f7zeyx1u/instances?keywordType=instanceName&keyword=&orderBy=createdAt&order=asc&pageNo=1&pageSize=10 HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Response example
1HTTP/1.1 200 OK
2X-Bce-Request-Id: a13e8b5f-6878-4f1f-8746-3e986ee49a96
3Date: Thu, 16 Mar 2020 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5{
6 "instancePage": {
7 "clusterID": "cce-f7zeyx1u",
8 "keywordType": "instanceName",
9 "keyword": "",
10 "orderBy": "createdAt",
11 "order": "ASC",
12 "pageNo": 1,
13 "pageSize": 10,
14 "totalCount": 1,
15 "instanceList": [
16 {
17 "spec": {
18 "cceInstanceID": "cce-f7zeyx1u-vbsry5uc",
19 "instanceName": "cce-f7zeyx1u-vbsry5uc",
20 "runtimeType": "docker",
21 "runtimeVersion": "18.9.2",
22 "clusterID": "cce-f7zeyx1u",
23 "clusterRole": "node",
24 "userID": "eca97e148cb74e9683d7b7240829d1ff",
25 "instanceGroupID": "",
26 "instanceGroupName": "",
27 "machineType": "BCC",
28 "instanceType": "N3",
29 "bbcOption": {},
30 "vpcConfig": {
31 "vpcID": "vpc-mwbgygrjb72w",
32 "vpcSubnetID": "sbn-mnbvhnuupv1u",
33 "securityGroupID": "g-xh04bcdkq5n6",
34 "vpcSubnetType": "BCC",
35 "VPCSubnetCIDR": "192.168.0.0/20",
36 "VPCSubnetCIDRIPv6": "",
37 "availableZone": "zoneA"
38 },
39 "instanceResource": {
40 "cpu": 1,
41 "mem": 4,
42 "rootDiskType": "hp1",
43 "rootDiskSize": 40
44 },
45 "deployCustomConfig": {
46 "dockerConfig": {}
47 },
48 "imageID": "m-gTpZ1k6n",
49 "instanceOS": {
50 "imageType": "System",
51 "imageName": "centos-7u3-x86_64-20191105104647",
52 "osType": "linux",
53 "osName": "CentOS",
54 "osVersion": "7.3",
55 "osArch": "x86_64 (64bit)",
56 "osBuild": "2019110600"
57 },
58 "needEIP": false,
59 "eipOption": {},
60 "sshKeyID": "",
61 "instanceChargingType": "Postpaid",
62 "deleteOption": {},
63 "labels": {
64 "cluster-id": "",
65 "cluster-role": "node"
66 }
67 },
68 "status": {
69 "machine": {
70 "instanceID": "i-HJitrtYn",
71 "orderID": "b49e015b819c4fd1887b8848c7a38025",
72 "vpcIP": "192.168.4.25"
73 },
74 "instancePhase": "running",
75 "machineStatus": "ACTIVE"
76 },
77 "createdAt": "2020-07-21T12:12:54Z",
78 "updatedAt": "2020-07-21T12:15:00Z"
79 }
80 ]
81 },
82 "requestID": "a13e8b5f-6878-4f1f-8746-3e986ee49a96"
83}
Get the node list of node group
Description
Get the node list of node group
Request structure
1GET /v2/cluster/{clusterID}/instancegroup/{instanceGroupID}/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| clusterID | String | Yes | URL parameter | Cluster ID |
| instanceGroupID | String | Yes | URL parameter | Node group ID |
| pageNo | Integer | No | Query | Page number, defaulting to 0. When the value is 0, all nodes in the node group will be returned |
| pageSize | Integer | No | Query | Results per page defaulting to 0. When the value is 0, all nodes in the node group will be returned |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Required or not | Description |
|---|---|---|---|
| page | [ListInstancesByInstanceGroupIDPage](CCE/API_V2 Reference/Appendix.md#ListInstancesByInstanceGroupIDPage) | Yes | Cluster node query results |
| requestID | String | Yes | ID of the response request |
Request example
1GET /v2/cluster/cce-47bqnhmj/instancegroup/cce-ig-796lmt7a/instances?pageNo=1&pageSize=10 HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Response example
1HTTP/1.1 200 OK
2X-Bce-Request-Id: d52c646c-207d-4630-95ba-0539124fd42b
3Date: Thu, 16 Mar 2020 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5{
6 "requestID": "d52c646c-207d-4630-95ba-0539124fd42b",
7 "page": {
8 "pageNo": 0,
9 "pageSize": 0,
10 "totalCount": 3,
11 "list": [
12 {
13 "spec": {
14 "cceInstanceID": "cce-z6qjgcq7-7dd7z1fc",
15 "instanceName": "cce-z6qjgcq7-7dd7z1fc",
16 "runtimeType": "docker",
17 "runtimeVersion": "18.9.2",
18 "clusterID": "cce-z6qjgcq7",
19 "clusterRole": "node",
20 "instanceGroupID": "cce-ig-dvej1d3y",
21 "instanceGroupName": "sdk-testcase",
22 "existedOption": {},
23 "machineType": "BCC",
24 "instanceType": "N3",
25 "bbcOption": {},
26 "vpcConfig": {
27 "vpcID": "vpc-pi9fghaxcpnf",
28 "vpcSubnetID": "sbn-ww1xf6a5fi88",
29 "vpcSubnetType": "BCC",
30 "availableZone": "zoneA"
31 },
32 "instanceResource": {
33 "cpu": 1,
34 "mem": 4,
35 "rootDiskType": "hp1",
36 "rootDiskSize": 40
37 },
38 "imageID": "m-4Umtt2i5",
39 "instanceOS": {
40 "imageType": "System",
41 "imageName": "centos-8u0-x86_64-20200601205040",
42 "osType": "linux",
43 "osName": "CentOS",
44 "osVersion": "8.0",
45 "osArch": "x86_64 (64bit)",
46 "osBuild": "2020060100"
47 },
48 "eipOption": {},
49 "instanceChargingType": "Postpaid",
50 "instancePreChargingOption": {},
51 "deleteOption": {
52 "deleteResource": true,
53 "deleteCDSSnapshot": true
54 },
55 "deployCustomConfig": {
56 "dockerConfig": {}
57 },
58 "labels": {
59 "cluster-id": "cce-z6qjgcq7",
60 "cluster-role": "node",
61 "instance-group-id": "cce-ig-dvej1d3y"
62 },
63 "cceInstancePriority": 5
64 },
65 "status": {
66 "machine": {
67 "instanceID": "i-HVq1GwKr",
68 "orderID": "71f6d4249aed4a08b2bc1470fefd6b2a",
69 "vpcIP": "192.168.16.33"
70 },
71 "instancePhase": "running",
72 "machineStatus": "ACTIVE"
73 },
74 "createdAt": "2020-09-27T06:35:04Z",
75 "updatedAt": "2020-09-27T06:36:53Z"
76 },
77 {
78 "spec": {
79 "cceInstanceID": "cce-z6qjgcq7-asf0p09i",
80 "instanceName": "cce-z6qjgcq7-asf0p09i",
81 "runtimeType": "docker",
82 "runtimeVersion": "18.9.2",
83 "clusterID": "cce-z6qjgcq7",
84 "clusterRole": "node",
85 "instanceGroupID": "cce-ig-dvej1d3y",
86 "instanceGroupName": "sdk-testcase",
87 "existedOption": {},
88 "machineType": "BCC",
89 "instanceType": "N3",
90 "bbcOption": {},
91 "vpcConfig": {
92 "vpcID": "vpc-pi9fghaxcpnf",
93 "vpcSubnetID": "sbn-ww1xf6a5fi88",
94 "vpcSubnetType": "BCC",
95 "availableZone": "zoneA"
96 },
97 "instanceResource": {
98 "cpu": 1,
99 "mem": 4,
100 "rootDiskType": "hp1",
101 "rootDiskSize": 40
102 },
103 "imageID": "m-4Umtt2i5",
104 "instanceOS": {
105 "imageType": "System",
106 "imageName": "centos-8u0-x86_64-20200601205040",
107 "osType": "linux",
108 "osName": "CentOS",
109 "osVersion": "8.0",
110 "osArch": "x86_64 (64bit)",
111 "osBuild": "2020060100"
112 },
113 "eipOption": {},
114 "instanceChargingType": "Postpaid",
115 "instancePreChargingOption": {},
116 "deleteOption": {
117 "deleteResource": true,
118 "deleteCDSSnapshot": true
119 },
120 "deployCustomConfig": {
121 "dockerConfig": {}
122 },
123 "labels": {
124 "cluster-id": "cce-z6qjgcq7",
125 "cluster-role": "node",
126 "instance-group-id": "cce-ig-dvej1d3y"
127 },
128 "cceInstancePriority": 5
129 },
130 "status": {
131 "machine": {
132 "instanceID": "i-RndUYlWF",
133 "orderID": "71f6d4249aed4a08b2bc1470fefd6b2a",
134 "vpcIP": "192.168.16.34"
135 },
136 "instancePhase": "running",
137 "machineStatus": "ACTIVE"
138 },
139 "createdAt": "2020-09-27T06:35:06Z",
140 "updatedAt": "2020-09-27T06:36:58Z"
141 },
142 {
143 "spec": {
144 "cceInstanceID": "cce-z6qjgcq7-ibtt74zc",
145 "instanceName": "cce-z6qjgcq7-ibtt74zc",
146 "runtimeType": "docker",
147 "runtimeVersion": "18.9.2",
148 "clusterID": "cce-z6qjgcq7",
149 "clusterRole": "node",
150 "instanceGroupID": "cce-ig-dvej1d3y",
151 "instanceGroupName": "sdk-testcase",
152 "existedOption": {},
153 "machineType": "BCC",
154 "instanceType": "N3",
155 "bbcOption": {},
156 "vpcConfig": {
157 "vpcID": "vpc-pi9fghaxcpnf",
158 "vpcSubnetID": "sbn-ww1xf6a5fi88",
159 "vpcSubnetType": "BCC",
160 "availableZone": "zoneA"
161 },
162 "instanceResource": {
163 "cpu": 1,
164 "mem": 4,
165 "rootDiskType": "hp1",
166 "rootDiskSize": 40
167 },
168 "imageID": "m-4Umtt2i5",
169 "instanceOS": {
170 "imageType": "System",
171 "imageName": "centos-8u0-x86_64-20200601205040",
172 "osType": "linux",
173 "osName": "CentOS",
174 "osVersion": "8.0",
175 "osArch": "x86_64 (64bit)",
176 "osBuild": "2020060100"
177 },
178 "eipOption": {},
179 "instanceChargingType": "Postpaid",
180 "instancePreChargingOption": {},
181 "deleteOption": {
182 "deleteResource": true,
183 "deleteCDSSnapshot": true
184 },
185 "deployCustomConfig": {
186 "dockerConfig": {}
187 },
188 "labels": {
189 "cluster-id": "cce-z6qjgcq7",
190 "cluster-role": "node",
191 "instance-group-id": "cce-ig-dvej1d3y"
192 },
193 "cceInstancePriority": 5
194 },
195 "status": {
196 "machine": {
197 "instanceID": "i-aRGKcLtv",
198 "orderID": "71f6d4249aed4a08b2bc1470fefd6b2a",
199 "vpcIP": "192.168.16.35"
200 },
201 "instancePhase": "running",
202 "machineStatus": "ACTIVE"
203 },
204 "createdAt": "2020-09-27T06:35:07Z",
205 "updatedAt": "2020-09-27T06:37:02Z"
206 }
207 ]
208 }
209}
Retrieve node event steps
Description
Retrieve event steps of nodes during creation or deletion. Request parameters are compatible with both cceInstanceID and instanceID
Request structure
1GET /v2/event/instance/{instanceID} HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| instanceID | String | Yes | URL parameter | Node ID |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Required or not | Description |
|---|---|---|---|
| status | String | Yes | Event type |
| steps | List<[Step](CCE/API_V2 Reference/Appendix.md#Step)> | Yes | Cluster operation steps |
| requestID | String | Yes | Request ID |
Request example
1GET /v2/event/instance/i-ezs9bmjY HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Response example
1HTTP/1.1 200 OK
2X-Bce-Request-Id: 08eb305a-87fb-4360-8a27-42b9561edf4a
3Date: Fri, 12 Aug 2022 03:10:30 GMT
4Content-Type: application/json;charset=UTF-8
5{
6 "status": "created",
7 "steps": [
8 {
9 "stepName": "Prepare machine",
10 "stepStatus": "done",
11 "ready": true,
12 "startTime": "2022-08-04T02:45:28Z",
13 "finishedTime": "2022-08-04T02:45:56Z",
14 "costSeconds": 28,
15 "retryCount": 1,
16 "errInfo": {}
17 },
18 {
19 "stepName": "Bind security group",
20 "stepStatus": "done",
21 "ready": true,
22 "startTime": "2022-08-04T02:45:56Z",
23 "finishedTime": "2022-08-04T02:45:57Z",
24 "costSeconds": 1,
25 "retryCount": 1,
26 "errInfo": {}
27 },
28 {
29 "stepName": "Pre-check",
30 "stepStatus": "done",
31 "ready": true,
32 "startTime": "2022-08-04T02:45:57Z",
33 "finishedTime": "2022-08-04T02:48:38Z",
34 "costSeconds": 161,
35 "retryCount": 2,
36 "errInfo": {}
37 },
38 {
39 "stepName": "Deploy K8S",
40 "stepStatus": "done",
41 "ready": true,
42 "startTime": "2022-08-04T02:48:38Z",
43 "finishedTime": "2022-08-04T02:49:20Z",
44 "costSeconds": 42,
45 "retryCount": 1,
46 "errInfo": {}
47 },
48 {
49 "stepName": "Waiting for readiness",
50 "stepStatus": "done",
51 "ready": true,
52 "startTime": "2022-08-04T03:40:41Z",
53 "finishedTime": "2022-08-04T03:40:41Z",
54 "retryCount": 1,
55 "errInfo": {}
56 }
57 ],
58 "requestID": "08eb305a-87fb-4360-8a27-42b9561edf4a"
59}
Synchronize node metadata
Description
Synchronize and refresh the IAAS configuration details of all nodes within the cluster. For example, when users modify the BCC billing type, the data can be updated via the API.
Request structure
1POST /v2/sync/cluster/{clusterID}/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| clusterID | String | Yes | URL parameter | Cluster ID |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Required or not | Description |
|---|---|---|---|
| clusterID | String | Yes | Requested cluster ID |
| requestID | String | Yes | Request ID |
Request example
1POST /v2/sync/cluster/cce-f7zeyx1u/instances HTTP/1.1
2Host: cce.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4{}
Response example
1HTTP/1.1 200 OK
2X-Bce-Request-Id: 23a82d7e-954f-4539-b828-ce620eaa97b3
3Date: Thu, 16 Mar 2020 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5{
6 "requestID": "23a82d7e-954f-4539-b828-ce620eaa97b3",
7 "clusterID": "cce-f7zeyx1u"
8}
