All Products
Search
Document Center

Server Load Balancer:GetListenerHealthStatus

Last Updated:Dec 02, 2024

Queries the health check status of a Gateway Load Balancer (GWLB) 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
gwlb:GetListenerHealthStatusget
*LoadBalancer
acs:gwlb:{#regionId}:{#accountId}:loadbalancer/{#LoadbalancerId}
*Listener
acs:gwlb:{#regionId}:{#accountId}:listener/{#ListenerId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ListenerIdstringYes

The listener ID.

lsn-7sixpvm5fc3v0b****
NextTokenstringNo

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

  • If NextToken is empty, no next page exists.
  • If a value of NextToken is returned, the value indicates the token that is used for the next query.
4f1d7cc9f51e18904e8a063603a6b0c3d03bc69f78734254e0b5e8707e68****
MaxResultsintegerNo

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

20
SkipintegerNo

The number of entries to be skipped in the call.

10
Filterarray<object>No

The filter conditions. You can specify at most 20 filter conditions.

objectNo

The filter condition.

NamestringNo

The filter condition name. You can filter by one or more filter condition names. The URL must meet the following requirements:

  • Status: the health status.
  • ReasonCode: the cause of an unhealthy server.
  • ServerId: the ID of the backend server.
  • ServerIp: the IP address of the backend server.
Status
ValuesarrayNo

The filter condition values. You can specify at most 20 condition values.

stringNo

The filter condition value. The valid values vary based on the specified filter condition name in the response.

Unhealthy

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

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 listener ID.

lsn-sg8aha6pzjavvo****
ServerGroupInfosarray<object>

The information about the server groups.

ServerGroupInfoobject

The information about the server group.

HealthCheckEnabledboolean

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

  • true
  • false
true
ServerGroupIdstring

The server group ID.

sgp-0vdsbyszro3nr6****
Serversarray<object>

The backend servers.

serverobject

The backend server.

Portinteger

The backend port.

6081
Reasonobject

The reason why Status indicates an unhealthy status.

ReasonCodestring

The reason why Status indicates an unhealthy status. Valid values:

  • CONNECT_TIMEOUT: The GWLB instance failed to connect to the backend server within the specified period of time.
  • CONNECT_FAILED: The GWLB instance failed to connect to the backend server.
  • RECV_RESPONSE_TIMEOUT: The GWLB 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 servers is invalid.
CONNECT_TIMEOUT
ServerIdstring

The backend server ID.

i-2ze4rnh8yj9kif3z****
ServerIpstring

The IP address of the server.

192.168.0.XXX
Statusstring

The health status of the backend server. Valid values:

  • Initial: Health checks are configured for the GWLB instance, but no data is found.
  • Unhealthy: The backend server consecutively fails health checks.
  • Unused: The backend server is not in use.
  • Unavailable: Health checks are disabled.
  • Healthy: The backend server is healthy.
Healthy
MaxResultsinteger

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

20
NextTokenstring

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 a value of NextToken is returned, the value indicates the token that is used for the next query.
U12WEI6Ro2ol3wA54rBNSwdC5+lYy6q5SjIQEvc1wz5mjZxV+YjsHRdXV8XauY1BpOQIvwX63E0en54H3D****
RequestIdstring

The request ID.

0ED4F222-36A0-5470-8A9A-AAB4E96BAC1A
TotalCountinteger

The total number of entries returned.

31

Examples

Sample success responses

JSONformat

{
  "ListenerHealthStatus": [
    {
      "ListenerId": "lsn-sg8aha6pzjavvo****",
      "ServerGroupInfos": [
        {
          "HealthCheckEnabled": true,
          "ServerGroupId": "sgp-0vdsbyszro3nr6****",
          "Servers": [
            {
              "Port": 6081,
              "Reason": {
                "ReasonCode": "CONNECT_TIMEOUT"
              },
              "ServerId": "i-2ze4rnh8yj9kif3z****",
              "ServerIp": "192.168.0.XXX",
              "Status": "Healthy"
            }
          ]
        }
      ]
    }
  ],
  "MaxResults": 20,
  "NextToken": "U12WEI6Ro2ol3wA54rBNSwdC5+lYy6q5SjIQEvc1wz5mjZxV+YjsHRdXV8XauY1BpOQIvwX63E0en54H3D****",
  "RequestId": "0ED4F222-36A0-5470-8A9A-AAB4E96BAC1A",
  "TotalCount": 31
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.FilterValueThe param of %s is illegal.The parameter of FilterValue is illegal.
400IllegalParam.FilterNameThe param of %s is illegal.The parameter of FilterName is illegal.
404ResourceNotFound.ListenerThe specified resource of %s is not found.The specified resource of %s is not found.

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