You can call this operation to query host groups in a cluster.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Example Description
Action String Yes ListClusterHostGroup

The operation that you want to perform. Set this parameter to ListClusterHostGroup.

ClusterId String Yes C-D7958B72E59B****

The ID of the cluster.

RegionId String Yes cn-hangzhou

The ID of the region.

AccessKeyId String No LTAI8ljWyu7y****

The AccessKey ID provided to you by Alibaba Cloud.

HostGroupId String No G-76D09CF110A3****

The ID of the host group to be queried.

HostGroupName String No core_group

The name of the host group to be queried.

HostGroupType String No CORE

The type of the host group to be queried. Valid values: MASTER, CORE, and TASK.

PageNumber Integer No 1

The number of the page to return.

PageSize Integer No 10

The number of entries to return on each page.

StatusList.N RepeatList No NORMAL

The status list of the host group to be queried. Valid values: NORMAL, ABNORMAL, and DELETED.

Response parameters

Parameter Type Example Description
ClusterId String C-D7958B72E59B****

The ID of the cluster.

HostGroupList

The list of host groups in the cluster.

ChargeType String PostPaid

The billing method of the host group.

Comment String Remarks

The remarks about the host group.

Cpu Integer 4

The CPU specifications of nodes in the host group.

DataDiskCount Integer 4

The number of data disks used by nodes in the host group.

DataDiskSize Integer 100

The size of a single data disk used by nodes in the host group. Unit: GB

DataDiskType String CLOUD_SSD

The type of data disks used by nodes in the host group.

HostGroupChangeStatus String IN_PROGRESS

The execution status of the configuration upgrade task. Valid values: IN_PROGRESS, COMPLETED, and FAILED.

HostGroupChangeType String RESIZE_DISK

The type of the configuration upgrade operation on the host group. Valid values: RESIZE_DISK, MODIFY_INSTANCE_TYPE, and RESTART_HOST_GROUP.

HostGroupId String G-EBAA5D6566E76F55

The ID of the host group.

HostGroupName String Core_Group

The name of the host group.

HostGroupSubType String AutoScaling

The sub-type of the host group, for example, AutoScaling.

HostGroupType String CORE

The type of the host group. Valid values: MASTER, CORE, and TASK.

InstanceType String ecs.c5.xlarge

The specifications of nodes in the host group.

LockReason String Your account balance is insufficient

The reason why the host group was locked.

LockType String ACCOUNTARREARS

The lock type of the host group. Valid values: CLUSTER_EXPIRED (the cluster has expired) and ACCOUNT_ARREARS (the account balance is insufficient).

Memory Integer 8

The memory specifications of nodes in the host group.

NodeCount Integer 3

The number of nodes in the host group.

PayType String PostPaid

The billing method of the host group.

SecurityGroupId String sg-xxx

The ID of the security group.

Status String NORMAL

The status of the host group.

SystemDiskCount Integer 1

The number of system disks used by nodes in the host group.

SystemDiskSize Integer 40

The size of a single system disk used by nodes in the host group. Unit: GB

SystemDiskType String CLOUD_SSD

The type of system disks used by nodes in the host group.

VswitchId String vsw-bp161s00cryyb4bs1****

The ID of the VSwitch.

gmtCreate String 1564472329000

The time when the host group was created.

gmtModified String 1564472889000

The time when the host group was modified.

PageNumber Integer 1

The number of the page returned.

PageSize Integer 10

The number of entries returned on each page.

RequestId String BF4FBAC6-B03E-4BFB-B6DB-EB53C34F2E22

The ID of the request.

Total Integer 15

The total number of host groups queried.

Examples

Sample request


http(s)://[Endpoint]/? Action=ListClusterHostGroup
&ClusterId=C-D7958B72E59B****
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success response

XML format

<ListClusterHostGroupResponse>
	  <code>200</code>
	  <data>
		    <hostGroupList>
			      <chargeType>PostPaid</chargeType>
			      <cpu>4</cpu>
			      <dataDiskCount>4</dataDiskCount>
			      <dataDiskSize>100</dataDiskSize>
			      <dataDiskType>CLOUD_SSD</dataDiskType>
			      <gmtCreate>1564472329000</gmtCreate>
			      <gmtModified>1564472889000</gmtModified>
			      <hostGroupId>G-EBAA5D6566E7****</hostGroupId>
			      <hostGroupName>Core_Group</hostGroupName>
			      <hostGroupType>CORE</hostGroupType>
			      <instanceType>ecs.c5.xlarge</instanceType>
			      <memory>8</memory>
			      <nodeCount>3</nodeCount>
			      <payType>PostPaid</payType>
			      <status>NORMAL</status>
			      <systemDiskSize>200</systemDiskSize>
			      <systemDiskType>CLOUD_SSD</systemDiskType>
			      <vswitchId>vsw-bp161s00cryyb4bs1****</vswitchId>
		    </hostGroupList>
		    <hostGroupList>
			      <chargeType>PostPaid</chargeType>
			      <cpu>4</cpu>
			      <dataDiskCount>3</dataDiskCount>
			      <dataDiskSize>500</dataDiskSize>
			      <dataDiskType>CLOUD_SSD</dataDiskType>
			      <gmtCreate>1564472329000</gmtCreate>
			      <gmtModified>1564472889000</gmtModified>
			      <hostGroupId>G-3379C5DEBA14****</hostGroupId>
			      <hostGroupName>Master_Group</hostGroupName>
			      <hostGroupType>MASTER</hostGroupType>
			      <instanceType>ecs.g5.xlarge</instanceType>
			      <memory>16</memory>
			      <nodeCount>3</nodeCount>
			      <payType>PostPaid</payType>
			      <status>NORMAL</status>
			      <systemDiskSize>200</systemDiskSize>
			      <systemDiskType>CLOUD_SSD</systemDiskType>
			      <vswitchId>vsw-bp161s00cryyb4bs1****</vswitchId>
		    </hostGroupList>
		    <pageNumber>1</pageNumber>
		    <pageSize>500</pageSize>
		    <requestId>9E395024-CE21-42F7-A777-69DD7AFFBE1F</requestId>
	  </data>
	  <success>true</success>
</ListClusterHostGroupResponse>

JSON format

{
	"data":{
		"hostGroupList":[
			{
				"gmtModified":"1564472889000",
				"gmtCreate":"1564472329000",
				"status":"NORMAL",
				"dataDiskType":"CLOUD_SSD",
				"cpu":4,
				"dataDiskCount":4,
				"hostGroupId":"G-EBAA5D6566E7****",
				"hostGroupName":"Core_Group",
				"dataDiskSize":100,
				"memory":8,
				"instanceType":"ecs.c5.xlarge",
				"systemDiskSize":200,
				"systemDiskType":"CLOUD_SSD",
				"payType":"PostPaid",
				"vswitchId":"vsw-bp161s00cryyb4bs1****",
				"chargeType":"PostPaid",
				"nodeCount":3,
				"hostGroupType":"CORE"
			},
			{
				"gmtModified":"1564472889000",
				"gmtCreate":"1564472329000",
				"status":"NORMAL",
				"dataDiskType":"CLOUD_SSD",
				"cpu":4,
				"dataDiskCount":3,
				"hostGroupId":"G-3379C5DEBA14****",
				"hostGroupName":"Master_Group",
				"dataDiskSize":500,
				"memory":16,
				"instanceType":"ecs.g5.xlarge",
				"systemDiskSize":200,
				"systemDiskType":"CLOUD_SSD",
				"payType":"PostPaid",
				"vswitchId":"vsw-bp161s00cryyb4bs1****",
				"chargeType":"PostPaid",
				"nodeCount":3,
				"hostGroupType":"MASTER"
			}
		],
		"requestId":"9E395024-CE21-42F7-A777-69DD7AFFBE1F",
		"pageSize":500,
		"pageNumber":1
	},
	"code":"200",
	"success":true
}

Error codes

For more information about error codes, see API Error Center.