All Products
Search
Document Center

Server Load Balancer:GetListenerHealthStatus

Last Updated:Oct 12, 2024

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

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:GetListenerHealthStatusget
  • LoadBalancer
    acs:nlb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ListenerIdstringYes

The ID of the listener of the NLB instance.

lsn-bp1bpn0kn908w4nbw****@80
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
ListenerHealthStatusarray<object>

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

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-bp1bpn0kn908w4nbw****@80
ListenerPortinteger

The listening port.

80
ListenerProtocolstring

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

TCPSSL
ServerGroupInfosarray<object>

The information about the server groups.

ServerGroupInfoobject

The information about the server group.

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****
NonNormalServersarray<object>

A list of unhealthy backend servers.

AbnormalServerobject

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": "\tlsn-bp1bpn0kn908w4nbw****@80",
      "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

HTTP status codeError codeError messageDescription
400SystemBusySystem is busy, please try again later.-
403Forbidden.NoPermissionAuthentication is failed for NoPermission.Authentication is failed for NoPermission.
404ResourceNotFound.loadBalancerThe specified resource of loadbalancer is not found.The specified load balancer resource was not found. Please check the input parameters.
404ResourceNotFound.listenerThe specified resource %s is not found.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-08-16The Error code has changed. The request parameters of the API has changedView Change Details
2023-10-10The Error code has changedView Change Details
2023-10-09The Error code has changedView Change Details
2023-09-26The Error code has changedView Change Details
2023-09-13The Error code has changedView Change Details