Queries the health check status of a Network Load Balancer (NLB) instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetListenerHealthStatus

The operation that you want to perform. Set the value to GetListenerHealthStatus.

ListenerId String Yes lsn-bp1bpn0kn908w4nbw****

The ID of the listener of the NLB instance.

NextToken String No FFmyTO70tTpLG6I3FmYAXGKPd****

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • You do not need to specify this parameter for the first request.
  • You must specify the token that is obtained from the previous query as the value of NextToken.
MaxResults Integer No 20

The number of entries per page. Valid values: 1 to 100. Default value: 20.

RegionId String No cn-hangzhou

The region ID of the NLB instance.

You can call the DescribeRegions operation to query the most recent region list.

Response parameters

Parameter Type Example Description
RequestId String 54B48E3D-DF70-471B-AA93-08E683A1B45

The request ID.

ListenerHealthStatus Array of ListenerHealthStatus

The health check status of the server groups that are associated with the listener.

ListenerId String lsn-agkd9gmjx8nd85jjs0****

The ID of the listener of the NLB instance.

ListenerPort Integer 80

The listener port.

ListenerProtocol String TCPSSL

The listener protocol. Valid values: TCP, UDP, and TCPSSL.

ServerGroupInfos Array of ServerGroupInfo

The information about the server groups.

HeathCheckEnabled Boolean true

Indicates whether the health check feature is enabled. Valid values:

  • true
  • false
ServerGroupId String sgp-ppdpc14gdm3x4o****

The server group ID.

NonNormalServers Array of AbnormalServer

The unhealthy backend servers.

Status String Initial

The health check status. Valid values:

  • Initial: indicates that health checks are configured for the NLB instance, but no data was found.
  • Unhealthy: indicates that the backend server consecutively fails health checks.
  • Unused: indicates that the weight of the backend server is 0.
  • Unavailable: indicates that health checks are disabled.
Port Integer 80

The backend port.

Reason Object

The cause of the health check failure.

ReasonCode String CONNECT_TIMEOUT

The reason why the status is abnormal. Valid values:

  • CONNECT_TIMEOUT: The NLB instance failed to connect to the backend server within the specified period of time.
  • CONNECT_FAILED: The NLB instance failed to connect to the backend server.
  • RECV_RESPONSE_TIMEOUT: The NLB instance failed to receive a response from the backend server within the specified period of time.
  • CONNECT_INTERRUPT: The connection between the health check and the backend server was interrupted.
  • HTTP_CODE_NOT_MATCH: The HTTP status code from the backend server is not the expected one.
  • HTTP_INVALID_HEADER: The format of the response from the backend server is invalid.
ServerId String i-bp1bt75jaujl7tjl****

The ID of the backend server.

ServerIp String 192.168.8.10

The IP address of the backend server.

TotalCount Integer 10

The total number of entries returned.

NextToken String FFmyTO70tTpLG6I3FmYAXGKPd****

A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next page exists.
  • If NextToken is returned, the value indicates the token that is used for the next query.
MaxResults Integer 20

The number of entries per page.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetListenerHealthStatus
&ListenerId=lsn-bp1bpn0kn908w4nbw****
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=20
&RegionId=cn-hangzhou
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetListenerHealthStatusResponse>
    <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
    <ListenerHealthStatus>
        <ListenerId>lsn-agkd9gmjx8nd85jjs0****</ListenerId>
        <ListenerPort>80</ListenerPort>
        <ListenerProtocol>TCPSSL</ListenerProtocol>
        <ServerGroupInfos>
            <HeathCheckEnabled>true</HeathCheckEnabled>
            <ServerGroupId>sgp-ppdpc14gdm3x4o****</ServerGroupId>
            <NonNormalServers>
                <Status>Initial</Status>
                <Port>80</Port>
                <Reason>
                    <ReasonCode>CONNECT_TIMEOUT</ReasonCode>
                </Reason>
                <ServerId>i-bp1bt75jaujl7tjl****</ServerId>
                <ServerIp>192.168.8.10</ServerIp>
            </NonNormalServers>
        </ServerGroupInfos>
    </ListenerHealthStatus>
    <TotalCount>10</TotalCount>
    <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
    <MaxResults>20</MaxResults>
</GetListenerHealthStatusResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B45",
  "ListenerHealthStatus" : [ {
    "ListenerId" : "lsn-agkd9gmjx8nd85jjs0****",
    "ListenerPort" : 80,
    "ListenerProtocol" : "TCPSSL",
    "ServerGroupInfos" : [ {
      "HeathCheckEnabled" : true,
      "ServerGroupId" : "sgp-ppdpc14gdm3x4o****",
      "NonNormalServers" : [ {
        "Status" : "Initial",
        "Port" : 80,
        "Reason" : {
          "ReasonCode" : "CONNECT_TIMEOUT"
        },
        "ServerId" : "i-bp1bt75jaujl7tjl****",
        "ServerIp" : "192.168.8.10"
      } ]
    } ]
  } ],
  "TotalCount" : 10,
  "NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "MaxResults" : 20
}

Error codes

For a list of error codes, visit the API Error Center.