InstanceGroup Related Interface
Create Node Group
Description
Creates a node group.
Request Structure
POST /v2/cluster/{clusterID}/instancegroup 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 | The cluster ID |
instanceGroupName | String | Yes | Request Body Parameter | The node group name, which cannot be empty |
clusterRole | String | No | Request Body Parameter | The role of a node in a cluster. At present, it supports the node-type stage group. Its default value is the node. |
shrinkPolicy | String | No | Request Body Parameter | The node group shrink policy. You can select it between [Priority, Priority]. It is the priority by default, i.e., it takes the priority to shrink the nodes with a lower priority value. |
updatePolicy | String | No | Request Body Parameter | The node group update policy. You can select it between [Rolling and Concurrency]. By default, it is Concurrency. |
cleanPolicy | String | No | Request Body Parameter | The node cleaning policy. You can select it between [Remain and Delete]. By default, it is Remain. |
instanceTemplate | InstanceTemplate | Yes | Request Body Parameter | The node configuration of node group |
replicas | Integer | Yes | Request Body Parameter | The number of replicas required for the nodes in the node group, whose value range is the natural number set. |
clusterAutoscalerSpec | ClusterAutoscalerSpec | No | Request Body Parameter | The autoscaler configuration of clusters |
Return Header Field
No other special header fields are available, except for common header fields.
Return Parameter
Parameter Name | Type | Required or not | Description |
---|---|---|---|
instanceGroupID | String | Yes | Node group ID |
requestID | String | Yes | The request ID, which is provided by the problem location. |
Request Example
POST /v2/cluster/cce-f7zeyx1u/instancegroup HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"instanceGroupName": "sdk-testcase",
"selector": null,
"cleanPolicy": "Delete",
"instanceTemplate": {
"instanceName": "",
"runtimeType": "docker",
"clusterRole": "node",
"existedOption": {},
"machineType": "BCC",
"instanceType": "N3",
"vpcConfig": {
"vpcID": "vpc-pi9fghaxcpnf",
"vpcSubnetID": "sbn-ww1xf6a5fi88",
"securityGroupID": "g-4mnvpnrfscm1",
"availableZone": "zoneA"
},
"instanceResource": {
"cpu": 1,
"mem": 4,
"rootDiskSize": 40
},
"imageID": "305eeb25-a693-4cc0-832a-57bccf855771",
"instanceOS": {
"imageType": "System"
},
"instanceChargingType": "Postpaid",
"instancePreChargingOption": {},
"deployCustomConfig": {
"dockerConfig": {},
"preUserScript": "ls",
"postUserScript": "ls"
}
},
"replicas": 3
}
Return Example
HTTP/1.1 200 OK
X-Bce-Request-Id: aef503ab-66e2-4b7f-9044-e922389ed03f
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"requestID": "aef503ab-66e2-4b7f-9044-e922389ed03f",
"instanceGroupID": "cce-ig-dvej1d3y"
}
Get Node Group Details
Description
Get the node group details.
Request Structure
GET /v2/cluster/{clusterID}/instancegroup/{instanceGroupID} 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 | The cluster ID |
instanceGroupID | String | Yes | URL parameter | The node group ID |
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 request ID, which is provided by the problem location. |
instanceGroup | InstanceGroup | Yes | The queried node group details |
Request Example
GET /v2/cluster/cce-47bqnhmj/instancegroup/cce-ig-796lmt7a 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: 9ccdfbcf-f989-49e6-9701-6996dee804b1
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"requestID": "9ccdfbcf-f989-49e6-9701-6996dee804b1",
"instanceGroup": {
"spec": {
"cceInstanceGroupID": "cce-ig-dvej1d3y",
"instanceGroupName": "sdk-testcase",
"clusterID": "cce-z6qjgcq7",
"clusterRole": "node",
"shrinkPolicy": "Priority",
"updatePolicy": "Concurrency",
"cleanPolicy": "Delete",
"instanceTemplate": {
"instanceName": "",
"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",
"securityGroupID": "g-4mnvpnrfscm1",
"vpcSubnetType": "BCC",
"vpcSubnetCIDR": "192.168.16.0/24",
"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": {},
"preUserScript": "bHM=",
"postUserScript": "bHM="
},
"labels": {
"cluster-id": "cce-z6qjgcq7",
"cluster-role": "node",
"instance-group-id": "cce-ig-dvej1d3y"
},
"cceInstancePriority": 5
},
"replicas": 3,
"clusterAutoscalerSpec": {
"enabled": false,
"minReplicas": 0,
"maxReplicas": 0,
"scalingGroupPriority": 0
}
},
"status": {
"readyReplicas": 3,
"pause": {
"paused": false,
"reason": ""
}
},
"createdAt": "2020-09-27T06:34:51Z"
}
}
Delete Node Group
Description
Deletes a node group.
Request Structure
DELETE /v2/cluster/{clusterID}/instancegroup/{instanceGroupID} 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 | The cluster ID |
instanceGroupID | String | Yes | URL parameter | The node group ID |
deleteInstances | Boolean | No | Query parameter | Whether to delete a node in the node group. It is false by default. |
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 request ID, which is provided by the problem location. |
Request Example
DELETE /v2/cluster/cce-f7zeyx1u/instancegroup/cce-ig-dvej1d3y?deleteInstances=true 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: b1a9e426-c0ca-4668-a1d8-624c5000d365
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"requestID": "b1a9e426-c0ca-4668-a1d8-624c5000d365"
}
Modify Node Autoscaler Configurationin Node Group
Description
Modify the autoscaler configuration of the node in the node group.
Request Structure
PUT /v2/cluster/{clusterID}/instancegroup/{instanceGroupID}/autoscaler 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 | The cluster ID |
instanceGroupID | String | Yes | URL parameter | The node group ID |
enabled | Boolean | Yes | Request Body Parameter | Whether to enable the Autoscaler |
minReplicas | Integer | Yes | Request Body Parameter | The minimum number of replicas, whose value range is the natural number set. |
maxReplicas | Integer | Yes | Request Body Parameter | The maximum number of replicas, whose value range is the natural number set and which should be bigger than the minReplicas. |
scalingGroupPriority | Integer | Yes | Request Body Parameter | The scaling group priority, whose value range is the natural number set. |
Return Header Field
No other special header fields are available, except for common header fields.
Return Parameter
Parameter Name | Type | Required or not | Description |
---|---|---|---|
requestID | String | Yes | The request ID, which is provided by the problem location method. |
Request Example
PUT /v2/cluster/cce-f7zeyx1u/instancegroup/cce-ig-dvej1d3y/autoscaler HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"enabled": true,
"minReplicas": 2,
"maxReplicas": 5,
"scalingGroupPriority": 1
}
Return Example
HTTP/1.1 200 OK
X-Bce-Request-Id: 27f91a44-7257-48e7-a8d8-849f45a32da4
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"requestID": "27f91a44-7257-48e7-a8d8-849f45a32da4"
}
Modify Number of Node Replicas in Node Group
Description
Modifies the number of node replicas in a node group.
Request Structure
PUT /v2/cluster/{clusterID}/instancegroup/{instanceGroupID}/replicas 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 | The cluster ID |
instanceGroupID | String | Yes | URL parameter | The node group ID |
replicas | Integer | Yes | Request Body Parameter | The expected number of node replicas in a node group, whose value range is the natural number set. |
instanceIDs | List |
No | Request Body Parameter | Specifies the node ID set added or deleted in the priority |
deleteInstance | Boolean | No | Request Body Parameter | Whether to delete the node deleted during the node group shrink. By default, it is false. This value has a priority over the node group CleanPolicy. The shrunk node should use this configuration. |
deleteOption | DeleteOption | No | Request Body Parameter | Modifies the deletion option of the specified node. |
Return Header Field
No other special header fields are available, except for common header fields.
Return Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
requestID | String | Yes | The request ID, which is provided by the problem location. |
Request Example
PUT /v2/cluster/cce-f7zeyx1u/instancegroup/cce-ig-dvej1d3y/replicas HTTP/1.1
Host: cce.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2019-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"replicas": 1,
"instanceIDs": null,
"deleteInstance": true,
"deleteOption": {
"deleteResource": true,
"deleteCDSSnapshot": true
}
}
Return Example
HTTP/1.1 200 OK
X-Bce-Request-Id: 6f593304-6787-45ea-8e0f-426ee331cc8b
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"requestID": "6f593304-6787-45ea-8e0f-426ee331cc8b"
}
Get List of Cluster Nodes in Node Group
Description
Gets the list of nodes in a cluster group.
Request Structure
GET /v2/cluster/{clusterID}/instancegroups 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 | The cluster ID |
pageNo | Integer | No | Query parameter | Queries the page number. When the pageNo or pageSize is 0, return all node groups of the cluster. |
pageSize | Integer | No | Query parameter | The number of query results on each page. When the pageNo or pageSize is 0, return all the node groups of 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 |
---|---|---|---|
page | ListInstanceGroupPage | Yes | The query result page of node group |
requestID | String | Yes | The request ID, which is provided by the problem location. |
Request Example
GET /v2/cluster/cce-f7zeyx1u/instancegroups?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: 1a65cc49-f3da-4d66-b994-7d7cd6797af5
Date: Thu, 16 Mar 2020 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
{
"requestID": "1a65cc49-f3da-4d66-b994-7d7cd6797af5",
"page": {
"pageNo": 0,
"pageSize": 0,
"totalCount": 1,
"list": [
{
"spec": {
"cceInstanceGroupID": "cce-ig-dvej1d3y",
"instanceGroupName": "sdk-testcase",
"clusterID": "cce-z6qjgcq7",
"clusterRole": "node",
"shrinkPolicy": "Priority",
"updatePolicy": "Concurrency",
"cleanPolicy": "Delete",
"instanceTemplate": {
"instanceName": "",
"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",
"securityGroupID": "g-4mnvpnrfscm1",
"vpcSubnetType": "BCC",
"vpcSubnetCIDR": "192.168.16.0/24",
"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": {},
"preUserScript": "bHM=",
"postUserScript": "bHM="
},
"labels": {
"cluster-id": "cce-z6qjgcq7",
"cluster-role": "node",
"instance-group-id": "cce-ig-dvej1d3y"
},
"cceInstancePriority": 5
},
"replicas": 3,
"clusterAutoscalerSpec": {
"enabled": false,
"minReplicas": 0,
"maxReplicas": 0,
"scalingGroupPriority": 0
}
},
"status": {
"readyReplicas": 3,
"pause": {
"paused": false,
"reason": ""
}
},
"createdAt": "2020-09-27T06:34:51Z"
}
]
}
}