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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes ListClusterHostGroup

The operation that you want to perform. This parameter is required for API requests that you create by piecing together HTTP or HTTPS URLs. Set this parameter to ListClusterHostGroup.

ClusterId String Yes C-D7958B72E59B****

The ID of the cluster. You can call ListClusters Interface to view the cluster ID.

RegionId String Yes cn-hangzhou

The ID of the region to which the cluster belongs. You can call DescribeRegions Interface to view the latest list of Alibaba Cloud regions.

HostGroupId String No G-76D09CF110A3****

The ID of the host group you want to query.

HostGroupName String No core_group

The name of the host group you want to query.

HostGroupType String No CORE

The type of the machine group to be queried:

  • MASTER: MASTER instance Group
  • CORE: CORE instance Group
  • TASK: compute instance Group
StatusList.N RepeatList No NORMAL

The machine group of the status list to be queried:

  • NORMAL
  • ABNORMAL
  • DELETED
PageNumber Integer No 1

The number of the page to return. Pages start from page 1.

PageSize Integer No 10

The number of entries returned per page.

Response parameters

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

The ID of the cluster.

HostGroupList Array of HostGroup

The list of host groups in the cluster.

HostGroup
ChargeType String PostPaid

Payment method of the current machine group:

  • PostPaid: pay-as-you-go clusters
  • PrePaid: subscription cluster
Comment String Remarks

The remarks about the host group.

CostSavingPercent Float 0

A reserved parameter. You do not need to specify this parameter.

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 upgrade task. Valid values:

  • IN_PROGRESS: processing
  • COMPLETED: The job is COMPLETED.
  • FAILED
HostGroupChangeType String RESIZE_DISK

Machine Group the current operation type.

  • RESIZE_DISK
  • MODIFY_INSTANCE_TYPE
  • RESTART_HOST_GROUP
HostGroupId String G-EBAA5D6566E7****

The ID of the host group.

HostGroupName String Core_Group

The name of the host group.

HostGroupSubType String AutoScaling

The subtype of the machine group. Such as AutoScaling.

HostGroupType String CORE

Machine group type:

  • MASTER: The MASTER instance node.
  • CORE: CORE instance node
  • TASK: compute instance node
InstanceType String ecs.c5.xlarge

The type of instances in the host group.

LockReason String Your account balance is insufficient

The reason why the host group was locked.

LockType String ACCOUNTARREARS

Machine Group locking classes:

  • CLUSTER_EXPIRED (cluster expiration)
  • ACCOUNT_ARREARS (overdue payment of the account)
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.

ScalingGroupActiveStatus String N/A

A reserved parameter.

ScalingGroupBizId String N/A

A reserved parameter.

ScalingGroupConfigState String N/A

A reserved parameter.

ScalingGroupMaxNode Integer 0

A reserved parameter. You do not need to specify this parameter.

ScalingGroupMinNode Integer 0

A reserved parameter. You do not need to specify this parameter.

ScalingInMode String N/A

A reserved parameter.

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-bp1aij6ynkt53ntnf****

The ID of the vSwitch.

gmtCreate String 1597042920000

The time when the host group was created.

gmtModified String 1597043525000

The time when the host group was modified.

PageNumber Integer 1

The number of the returned page.

PageSize Integer 100

The number of automatic snapshot tasks returned per 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 requests

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

Sample success responses

XML format

<RequestId>9807D530-57B4-4BA7-93E8-E4F2B3826345</RequestId>
<PageSize>100</PageSize>
<PageNumber>1</PageNumber>
<HostGroupList>
    <HostGroup>
        <HostGroupType>CORE</HostGroupType>
        <Status>NORMAL</Status>
        <Comment/>
        <gmtModified>1597043525000</gmtModified>
        <NodeCount>2</NodeCount>
        <SystemDiskSize>120</SystemDiskSize>
        <Memory>8</Memory>
        <Cpu>4</Cpu>
        <DataDiskCount>4</DataDiskCount>
        <PayType>PostPaid</PayType>
        <HostGroupName>Core instance group</HostGroupName>
        <gmtCreate>1597042920000</gmtCreate>
        <VswitchId>vsw-bp1aij6ynkt53ntnffynb</VswitchId>
        <SystemDiskType>CLOUD_SSD</SystemDiskType>
        <HostGroupId>G-519D30DDF1D6B3E1</HostGroupId>
        <DataDiskType>CLOUD_SSD</DataDiskType>
        <ChargeType>PostPaid</ChargeType>
        <DataDiskSize>80</DataDiskSize>
        <InstanceType>ecs.n4.xlarge</InstanceType>
    </HostGroup>
    <HostGroup>
        <HostGroupType>MASTER</HostGroupType>
        <Status>NORMAL</Status>
        <Comment/>
        <gmtModified>1597043525000</gmtModified>
        <NodeCount>1</NodeCount>
        <SystemDiskSize>120</SystemDiskSize>
        <Memory>8</Memory>
        <Cpu>4</Cpu>
        <DataDiskCount>1</DataDiskCount>
        <PayType>PostPaid</PayType>
        <HostGroupName>Master instance group</HostGroupName>
        <gmtCreate>1597042920000</gmtCreate>
        <VswitchId>vsw-bp1aij6ynkt53ntnffynb</VswitchId>
        <SystemDiskType>CLOUD_SSD</SystemDiskType>
        <HostGroupId>G-FFE7A21D570D050E</HostGroupId>
        <DataDiskType>CLOUD_SSD</DataDiskType>
        <ChargeType>PostPaid</ChargeType>
        <DataDiskSize>80</DataDiskSize>
        <InstanceType>ecs.n4.xlarge</InstanceType>
    </HostGroup>
</HostGroupList>

JSON Syntax

{
    "RequestId": "9807D530-57B4-4BA7-93E8-E4F2B3826345",
    "PageSize": 100,
    "PageNumber": 1,
    "HostGroupList": {
        "HostGroup": [
            {
                "HostGroupType": "CORE",
                "Status": "NORMAL",
                "Comment": "",
                "gmtModified": 1597043525000,
                "NodeCount": 2,
                "SystemDiskSize": 120,
                "Memory": 8,
                "Cpu": 4,
                "DataDiskCount": 4,
                "PayType": "PostPaid",
                "HostGroupName": "Core instance group",
                "gmtCreate": 1597042920000,
                "VswitchId": "vsw-bp1aij6ynkt53ntnffynb",
                "SystemDiskType": "CLOUD_SSD",
                "HostGroupId": "G-519D30DDF1D6B3E1",
                "DataDiskType": "CLOUD_SSD",
                "ChargeType": "PostPaid",
                "DataDiskSize": 80,
                "InstanceType": "ecs.n4.xlarge"
            },
            {
                "HostGroupType": "MASTER",
                "Status": "NORMAL",
                "Comment": "",
                "gmtModified": 1597043525000,
                "NodeCount": 1,
                "SystemDiskSize": 120,
                "Memory": 8,
                "Cpu": 4,
                "DataDiskCount": 1,
                "PayType": "PostPaid",
                "HostGroupName": "Master instance group",
                "gmtCreate": 1597042920000,
                "VswitchId": "vsw-bp1aij6ynkt53ntnffynb",
                "SystemDiskType": "CLOUD_SSD",
                "HostGroupId": "G-FFE7A21D570D050E",
                "DataDiskType": "CLOUD_SSD",
                "ChargeType": "PostPaid",
                "DataDiskSize": 80,
                "InstanceType": "ecs.n4.xlarge"
            }
        ]
    }
}