All Products
Search
Document Center

Server Load Balancer:GetListenerHealthStatus

Last Updated:Mar 13, 2024

Queries the health check status of a listener that is added to 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.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
nlb:GetListenerHealthStatusRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ListenerIdstringYes

The ID of the listener of the NLB instance.

lsn-bp1bpn0kn908w4nbw****
NextTokenstringNo

The token that is used for the next query. Valid values:

  • If this is your first query or no next query is to be sent, ignore this parameter.
  • If a next query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultsintegerNo

The number of entries to return on each page. Valid values: 1 to 100. Default value: 20.

20
RegionIdstringNo

The ID of the region where the NLB instance is deployed.

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

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

RpcResponse

RequestIdstring

The ID of the request.

54B48E3D-DF70-471B-AA93-08E683A1B45
ListenerHealthStatusobject []

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

ListenerIdstring

The ID of the listener of the NLB instance.

lsn-agkd9gmjx8nd85jjs0****
ListenerPortinteger

The listening port.

80
ListenerProtocolstring

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

TCPSSL
ServerGroupInfosobject []

The information about the server groups.

HeathCheckEnabledboolean

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

  • true: enabled
  • false: disabled
true
ServerGroupIdstring

The ID of the server group.

sgp-ppdpc14gdm3x4o****
NonNormalServersobject []

A list of unhealthy backend servers.

Statusstring

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.
Initial
Portinteger

The backend port.

80
Reasonobject

The cause of the health check failure.

ReasonCodestring

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 servers was interrupted.
  • HTTP_CODE_NOT_MATCH: The HTTP status code from the backend servers was not the expected one.
  • HTTP_INVALID_HEADER: The format of the response from the backend servers is invalid.
CONNECT_TIMEOUT
ServerIdstring

The ID of the backend server.

i-bp1bt75jaujl7tjl****
ServerIpstring

The IP address of the backend server.

192.168.8.10
TotalCountinteger

The number of entries returned.

10
NextTokenstring

The token that is used for the next query. Valid values:

  • If NextToken is empty, it indicates that no next query is to be sent.
  • If a value of NextToken is returned, the value is the token used for the next query.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultsinteger

The number of entries returned per page.

20

Examples

Sample success responses

JSONformat

{
  "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 Service error codes.

Change history

Change timeSummary of changesOperation
2023-10-10The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 404
    Added Error Codes: 403
2023-10-09The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 404
    Added Error Codes: 400
2023-09-26The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 404 change
2023-09-13The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Added Error Codes: 404