Instance Group Interface
Create instance group
Request structure
Method: Post
Url: /csm/api/v1/userId/{userId}/instance-group
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| mergedGroup | MergedGroup | Yes | requestBody |
Response parameters
| Name | Types | Description |
|---|---|---|
| id | Long | Instance group ID |
| name | String | Instance group name |
| serviceName | String | Service Name |
| typeName | String | Object type |
| region | String | Region |
| userId | String | User ID |
| uuid | String | Instance group UUID |
| count | int | Instance group contains instance count |
| serviceNameAlias | String | Chinese name of the cloud service |
| typeNameAlias | String | Object type name |
| regionAlias | String | Region name in Chinese |
| tagKey | String |
Request example
POST /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance-group
request body:
{
"name": "group_name",
"region": "bj",
"typeName": "Instance",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"serviceName": "BCE_BCC",
"resourceIdList": [
{
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"region": "bj",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"resourceId": "InstanceId:04b91096-a294-477d-bd11-1a7bcfbxxxxx"
}
]
}Response example
{
"id": 7900,
"name": "group_name",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"region": "bj",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"uuid": "6c9a3ce6-b984-4bf7-9868-b81ec17xxxxx",
"count": 0,
"serviceNameAlias": null,
"typeNameAlias": null,
"regionAlias": null,
"tagKey": "",
"typeTarget": ""
}Update instance group name
Request structure
Method: Patch
Url:/csm/api/v1/userId/{userId}/instance-group
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| group | Group | Instance group information | Yes | requestBody |
Group
| Name | Types | Description | Required or not |
|---|---|---|---|
| id | Long | Instance group ID | Yes |
| name | String | Updated instance group name | Yes |
| serviceName | String | Service Name | Yes |
| typeName | String | Object type, e.g., instance, cluster | Yes |
| region | String | Region | Yes |
Response parameters
| Name | Types | Description |
|---|---|---|
| id | Long | Instance group ID |
| name | String | Instance group name |
| serviceName | String | Service Name |
| typeName | String | Object type |
| region | String | Region |
| userId | String | User ID |
| uuid | String | Instance group UUID |
| count | int | Instance group contains instance count |
| serviceNameAlias | String | Chinese name of the cloud service |
| typeNameAlias | String | Object type name |
| regionAlias | String | Region name in Chinese |
| tagKey | String |
Request example
PATCH /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance-group
request Body
{
"id":7900,
"name":"group_name_new",
"region":"bj",
"serviceName":"BCE_BCC",
"typeName":"Instance"
}Response example
{
"id": 7900,
"name": "group_name_new",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"region": "bj",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"uuid": "5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"count": 0,
"serviceNameAlias": null,
"typeNameAlias": null,
"regionAlias": null,
"tagKey": "",
"typeTarget": ""
}Delete instance group
Request structure
Method: Delete
Url: /csm/api/v1/userId/{userId}/instance-group/{id}
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| id | Long | Instance group ID | Yes | Path |
Response parameters
| Name | Types | Description |
|---|---|---|
| id | Long | Instance group ID |
| name | String | Instance group name |
| serviceName | String | Service Name |
| typeName | String | Object type |
| region | String | Region |
| userId | String | User ID |
| uuid | String | Instance group UUID |
| count | int | Instance group contains instance count |
| serviceNameAlias | String | Chinese name of the cloud service |
| typeNameAlias | String | Object type name |
| regionAlias | String | Region name in Chinese |
| tagKey | String |
Request example
DELETE /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance-group/7900Response example
{
"id": 7900,
"name": "group_name_new",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"region": "bj",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"uuid": "5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"count": 0,
"serviceNameAlias": null,
"typeNameAlias": null,
"regionAlias": null,
"tagKey": "",
"typeTarget": ""
}Retrieve instance group details
Request structure
Method: Get
Url: /csm/api/v1/userId/{userId}/instance-group/{id}
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| id | Long | Instance group ID | Yes | Path |
Response parameters
| Name | Types | Description |
|---|---|---|
| id | Long | Instance group ID |
| name | String | Instance group name |
| serviceName | String | Service Name |
| typeName | String | Object type |
| region | String | Region |
| userId | String | User ID |
| uuid | String | Instance group UUID |
| count | int | Instance group contains instance count |
| serviceNameAlias | String | Chinese name of the cloud service |
| typeNameAlias | String | Object type name |
| regionAlias | String | Region name in Chinese |
| tagKey | String |
Request example
GET /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance-group/7900Response example
{
"id": 7900,
"name": "group_name",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"region": "bj",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"uuid": "5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"count": 1,
"serviceNameAlias": "Baidu Cloud Compute (BCC)",
"typeNameAlias": "Baidu Cloud Compute (BCC)",
"regionAlias": "Beijing",
"tagKey": "INSTANCE_GROUP_5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx:5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"typeTarget": ""
}Query instance group list
Request structure
Method: Get
Url: /csm/api/v1/userId/{userId}/instance-group/list
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| name | String | Instance group name | No | Param |
| serviceName | String | Service Name | No | Param |
| region | String | Region | No | Param |
| typeName | String | Instance type | No | Param |
| pageNo | int | Number of pages | Yes | Param |
| pageSize | int | Number of returned items per page | Yes | Param |
Request example
GET /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance-group/list?
name=group_name
&serviceName=BCE_BCC
®ion=bj
&typeName=Instance
&pageNo=1
&pageSize=10Response example
{
"orderBy": "",
"order": "",
"pageNo": 1,
"pageSize": 10,
"totalCount": 1,
"result": [
{
"id": 7900,
"name": "group_name",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"region": "bj",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"uuid": "5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"count": 1,
"serviceNameAlias": "Baidu Cloud Compute (BCC)",
"typeNameAlias": "Baidu Cloud Compute (BCC)",
"regionAlias": "Beijing",
"tagKey": "INSTANCE_GROUP_5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx:5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"typeTarget": ""
}
]
}Add instance members to Instance Group
Request structure
Method: Post
Url: /csm/api/v1/userId/{userId}/instance-group/{id}/instance/add
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| id | Long | Instance group ID | Yes | Path |
| mergedGroup | MergedGroup | Yes | requestBody |
Response parameters
| Name | Types | Description |
|---|---|---|
| id | Long | Instance group ID |
| name | String | Instance group name |
| serviceName | String | Service Name |
| typeName | String | Object type |
| region | String | Region |
| userId | String | User ID |
| uuid | String | Instance group UUID |
| count | int | Instance group contains instance count |
| serviceNameAlias | String | Chinese name of the cloud service |
| typeNameAlias | String | Object type name |
| regionAlias | String | Region name in Chinese |
| tagKey | String |
Request example
POST /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance-group/7900/instance/add
request Body
{
"id": 7900,
"name": "group_name",
"region": "bj",
"typeName": "Instance",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"resourceIdList": [
{
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"region": "bj",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"resourceId": "InstanceId:dd0109a3-a7fe-4ffb-b2ae-3c6aa0bxxxxx"
}
]
}Response example
Response description: return to the information before adding instances to the Instance Group
{
"id": 7900,
"name": "group_name",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"region": "bj",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"uuid": "5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"count": 1,
"serviceNameAlias": "Baidu Cloud Compute (BCC)",
"typeNameAlias": "Baidu Cloud Compute (BCC)",
"regionAlias": "Beijing",
"tagKey": "INSTANCE_GROUP_5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx:5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"typeTarget": ""
}Retrieve instance group member list.
Request structure
Method: Get
Url: /csm/api/v1/userId/{userId}/instance-group/instance/list
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| id | Long | Instance ID | Yes | Param |
| serviceName | String | Service Name | Yes | Param |
| typeName | String | Object type | Yes | Param |
| region | String | Region | Yes | Param |
| viewType | ViewType (enumerated types) | Parameter for querying instance list headers: LIST_VIEW; for querying instance group member list headers: DETAIL_VIEW | Yes | Param |
| pageNo | int | Number of pages | Yes | Param |
| pageSize | int | Number of returned items per page | Yes | Param |
Response parameters
| Name | Types | Description |
|---|---|---|
| orderBy | String | Sorting field |
| order | String | Sorting method |
| pageNo | int | Number of pages |
| pageSize | int | Number of returned items per page |
| totalCount | int | Number of instances in Instance Group |
| result | Instance information in Instance Group |
Request example
GET /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance-group/instance/list?
id=7900
&serviceName=BCE_BCC
&typeName=Instance
®ion=bj
&viewType=DETAIL_VIEW
&pageNo=1
&pageSize=10Response example
{
"orderBy": "",
"order": "",
"pageNo": 1,
"pageSize": 10,
"totalCount": 2,
"result": [
[
{
"itemName": "id",
"itemAlias": "Instance ID",
"itemValue": "04b91096-a294-477d-bd11-1a7bcfxxxxx",
"itemSeq": 2,
"itemIdentitable": true,
"itemDimension": "InstanceId",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "name",
"itemAlias": "Instance name",
"itemValue": "bcc_name",
"itemSeq": 1,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "internalIp",
"itemAlias": "Intranet IP",
"itemValue": "192.168.xx.xx",
"itemSeq": 2,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "publicIp",
"itemAlias": "Public IP",
"itemValue": "",
"itemSeq": 4,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": false
}
],
[
{
"itemName": "id",
"itemAlias": "Instance ID",
"itemValue": "dd0109a3-a7fe-4ffb-b2ae-3c6aa0bxxxxx",
"itemSeq": 2,
"itemIdentitable": true,
"itemDimension": "InstanceId",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "name",
"itemAlias": "Instance name",
"itemValue": "bcc_name_2",
"itemSeq": 1,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "internalIp",
"itemAlias": "Intranet IP",
"itemValue": "192.168.xx.xx",
"itemSeq": 2,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "publicIp",
"itemAlias": "Public IP",
"itemValue": "",
"itemSeq": 4,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": false
}
]
]
}Remove instance members from Instance Group
Request structure
Method: Post
Url: /csm/api/v1/userId/{userId}/instance-group/{id}/instance/remove
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| id | Long | Instance group ID | Yes | Path |
| mergedGroup | MergedGroup | Yes | requestBody |
Response parameters
| Name | Types | Description |
|---|---|---|
| id | Long | Instance group ID |
| name | String | Instance group name |
| serviceName | String | Service Name |
| typeName | String | Object type |
| region | String | Region |
| userId | String | User ID |
| uuid | String | Instance group UUID |
| count | int | Instance group contains instance count |
| serviceNameAlias | String | Chinese name of the cloud service |
| typeNameAlias | String | Object type name |
| regionAlias | String | Region name in Chinese |
| tagKey | String | |
| typeTarget | String | Dimension content contained in the object type |
Request example
POST /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance-group/7900/instance/remove
request Body
{
"id": 7900,
"name": "group_name",
"region": "bj",
"typeName": "Instance",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"resourceIdList": [
{
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"region": "bj",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"resourceId": "InstanceId:dd0109a3-a7fe-4ffb-b2ae-3c6aa0bxxxxx"
}
]
}Response example
Response description: return to the information before removing instances to the Instance Group
{
"id": 7900,
"name": "group_name",
"serviceName": "BCE_BCC",
"typeName": "Instance",
"region": "bj",
"userId": "a0d04d7c202140cb80155ff7b67xxxxx",
"uuid": "5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"count": 2,
"serviceNameAlias": "Baidu Cloud Compute (BCC)",
"typeNameAlias": "Baidu Cloud Compute (BCC)",
"regionAlias": "Beijing",
"tagKey": "INSTANCE_GROUP_5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx:5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxx",
"typeTarget": ""
}View Instance List API (used when creating instance groups)
Request structure
Method: Get
Url:/csm/api/v1/userId/{userId}/instance/list
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| serviceName | String | Service Name | Yes | Param |
| typeName | String | Object type | Yes | Param |
| region | String | Region | Yes | Param |
| viewType | ViewType | Parameter for querying instance list: LIST_VIEW; for querying instance group member list: DETAIL_VIEW | Yes | Param |
| pageNo | int | Number of pages | Yes | Param |
| pageSize | int | Number of returned items per page | Yes | Param |
| keywordType | String | Attribute for fuzzy query | Yes | Param |
| keyword | String | Value for fuzzy search | Yes | Param |
Request example
GET /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance/list?
serviceName=BCE_BCC
&typeName=Instance
®ion=bj
&viewType=LIST_VIEW
&pageNo=1
&pageSize=10
&keywordType=name
&keyword=Response example
{
"orderBy": "",
"order": "",
"pageNo": 1,
"pageSize": 10,
"totalCount": 58,
"result": [
[
{
"itemName": "name",
"itemAlias": "Instance name",
"itemValue": "bcc_name",
"itemSeq": 1,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": true
},
{
"itemName": "internalIp",
"itemAlias": "Intranet IP",
"itemValue": "192.168.xx.xx",
"itemSeq": 3,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "id",
"itemAlias": "Instance ID",
"itemValue": "04b91096-a294-477d-bd11-1a7bcfbxxxxx",
"itemSeq": 2,
"itemIdentitable": true,
"itemDimension": "InstanceId",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "shortId",
"itemAlias": "Instance short ID",
"itemValue": "i-mPkxxxxx",
"itemSeq": 4,
"itemIdentitable": false,
"itemDimension": "InstanceShortId",
"itemIsConn": true,
"itemView": false
}
]
...
]
}View instance list (used to add instances to an existing Instance Group - filtering out already added instances)
Request structure
Method: Get
Url:/csm/api/v1/userId/{userId}/instance/filteredList
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| serviceName | String | Service Name | Yes | Param |
| typeName | String | Object region | Yes | Param |
| region | String | Region | Yes | Param |
| viewType | ViewType | Parameter for querying instance list: LIST_VIEW; for querying instance group member list: DETAIL_VIEW | Yes | Param |
| pageNo | int | Number of pages | Yes | Param |
| pageSize | int | Number of returned items per page | Yes | Param |
| keywordType | String | Attribute for fuzzy query | Yes | Param |
| keyword | String | Value for fuzzy search | Yes | Param |
| id | Long | Instance group ID | Yes | Param |
| uuid | String | Instance group unique identifier | Yes | Param |
Request example
GET /csm/api/v1/userId/a0d04d7c202140cb80155ff7b67xxxxx/instance/filteredList
serviceName=BCE_BCC
&typeName=Instance
®ion=bj
&viewType=LIST_VIEW
&pageNo=1
&pageSize=10
&keywordType=name
&keyword=
&id=7900
&uuid=5ac4bdcd-4ba5-46c8-b879-36f57f3xxxxxResponse example
{
"orderBy": "",
"order": "",
"pageNo": 1,
"pageSize": 10,
"totalCount": 57,
"result": [
[
{
"itemName": "name",
"itemAlias": "Instance name",
"itemValue": "bcc_name_3",
"itemSeq": 1,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": true
},
{
"itemName": "internalIp",
"itemAlias": "Intranet IP",
"itemValue": "192.168.xx.xx",
"itemSeq": 3,
"itemIdentitable": false,
"itemDimension": "",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "id",
"itemAlias": "Instance ID",
"itemValue": "dd0109a3-a7fe-4ffb-b2ae-3c6aa0bxxxxx",
"itemSeq": 2,
"itemIdentitable": true,
"itemDimension": "InstanceId",
"itemIsConn": true,
"itemView": false
},
{
"itemName": "shortId",
"itemAlias": "Instance short ID",
"itemValue": "i-6nfxxxxx",
"itemSeq": 4,
"itemIdentitable": false,
"itemDimension": "InstanceShortId",
"itemIsConn": true,
"itemView": false
}
],
...
]
}Appendix
MergedGroup
| Name | Types | Description | Required or not |
|---|---|---|---|
| userId | String | User ID | Yes |
| region | String | Region | Yes |
| serviceName | String | Service Name | Yes |
| typeName | String | Object type | Yes |
| name | String | Instance group name | Yes |
| resourceIdList | List < MonitorResource > | When adding instances, provide information only for new instances. | Yes |
| typeTarget | String | eg:{"resourceType":"RD_ST_INSTANCE","resourceId":["ClusterId","NodeId"]} | No |
MonitorResource
| Name | Types | Description | Required or not |
|---|---|---|---|
| userId | String | User ID | Yes |
| region | String | Region | Yes |
| serviceName | String | Service Name | Yes |
| resourceId | String | Instance ID, format: Dimension name: Dimension ID | Yes |
| typeName | String | Object type | Yes |
InstanceGroupViewConfig
| Name | Types | Description |
|---|---|---|
| itemName | String | Attribute name |
| itemAlias | String | Attribute alias |
| itemValue | String | Attribute value |
| itemSeq | int | Attribute order |
| itemIdentitable | boolean | Whether the attribute is an instance attribute |
| itemDimension | String | Name of instance attribute |
| itemIsConn | boolean | Whether frontend display concatenates |
| itemView | boolean | Whether to display this attribute on the frontend |
