Queries the health check status of a listener and its forwarding rules.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
alb:GetListenerHealthStatus |
get |
*LoadBalancer
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ListenerId |
string |
Yes |
The listener ID of the instance. |
lsn-o4u54y73wq7b****** |
| IncludeRule |
boolean |
No |
Specifies whether to include the health check results of forwarding rules. Valid values:
|
true |
| NextToken |
string |
No |
Specifies whether there is a token for the next query. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| MaxResults |
integer |
No |
The maximum number of entries to return per page in a paginated query. Valid values: 1 to 30. Default value: 20. |
20 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Queries the health check status of a listener and the forwarding rules in its corresponding configurations. |
||
| ListenerHealthStatus |
array<object> |
The health check status list of server groups associated with the listener. |
|
|
array<object> |
The health check status structure of server groups associated with the listener. |
||
| ListenerId |
string |
The listener ID of the instance. |
lsn-o4u54y73wq7b****** |
| ListenerPort |
integer |
The listener port. |
80 |
| ListenerProtocol |
string |
The listener protocol. |
http |
| ServerGroupInfos |
array<object> |
The server group information. |
|
|
array<object> |
The server group information. |
||
| HealthCheckEnabled |
string |
The health check status. Valid values: on: Health check is enabled. |
on |
| NonNormalServers |
array<object> |
The list of backend servers in abnormal state. |
|
|
array<object> |
The list of backend servers in abnormal state. |
||
| Port |
integer |
The backend server port. |
90 |
| Reason |
object |
The reason for the abnormal state. |
|
| ActualResponse |
string |
The actual response code returned by the backend server, such as 302. Note
This value is returned only when ReasonCode is RESPONSE_MISMATCH. |
302 |
| ExpectedResponse |
string |
The expected response code from the backend server. Valid values: HTTP_2xx, HTTP_3xx, HTTP_4xx, and HTTP_5xx. Multiple response codes are separated by commas (,). Note
This value is returned only when ReasonCode is RESPONSE_MISMATCH. |
HTTP_2xx |
| ReasonCode |
string |
The detailed reason when Status is abnormal. Currently, only HTTP and HTTPS listeners and forwarding rules support viewing abnormal status reasons:
|
RESPONSE_MISMATCH |
| ServerId |
string |
The backend server ID. |
i-uf62h8v****** |
| ServerIp |
string |
The backend server IP address. |
192.168.8.10 |
| Status |
string |
The health check status. Valid values:
|
Initial |
| ServerGroupId |
string |
The associated server group ID. |
sgp-8ilqs4axp6****** |
| ActionType |
string |
The server group usage type. Valid values:
|
TrafficMirror |
| ServerCount |
integer |
The number of servers in the server group. |
1 |
| RequestId |
string |
The request ID. |
CEF72CEB-54B6-4AE8-B225-F876F****** |
| RuleHealthStatus |
array<object> |
The health status list of forwarding rules. |
|
|
array<object> |
The health status structure of a forwarding rule. |
||
| RuleId |
string |
The forwarding rule ID. |
rule-hp34s2h0xx1ht4nwo**** |
| ServerGroupInfos |
array<object> |
The list of server groups. |
|
|
array<object> |
The server group structure. |
||
| HealthCheckEnabled |
string |
The health check status. Valid values: on: Health check is enabled. |
on |
| NonNormalServers |
array<object> |
The list of backend servers in abnormal state. |
|
|
array<object> |
The list of backend servers in abnormal state. |
||
| Port |
integer |
The backend server port. |
90 |
| Reason |
object |
The reason for the abnormal state. |
|
| ActualResponse |
string |
The actual response code returned by the backend server, such as 302. Note
This value is returned only when ReasonCode is RESPONSE_MISMATCH. |
302 |
| ExpectedResponse |
string |
The expected response code from the backend server. Valid values: HTTP_2xx, HTTP_3xx, HTTP_4xx, and HTTP_5xx. Multiple response codes are separated by commas (,). Note
This value is returned only when ReasonCode is RESPONSE_MISMATCH. |
HTTP_2xx |
| ReasonCode |
string |
The detailed reason when Status is abnormal. Currently, only HTTP and HTTPS listeners and forwarding rules support viewing abnormal status reasons:
|
RESPONSE_MISMATCH |
| ServerId |
string |
The backend server ID. |
i-uf62h8v****** |
| ServerIp |
string |
The backend server group IP address. |
192.168.2.11 |
| Status |
string |
The health check status. Valid values:
|
Initial |
| ServerGroupId |
string |
The associated server group ID. |
sgp-8ilqs4axp6****** |
| ActionType |
string |
The server group usage type. |
TrafficMirror |
| ServerCount |
integer |
The number of servers in the server group. |
1 |
| NextToken |
string |
Indicates whether a next query token exists. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
Examples
Success response
JSON format
{
"ListenerHealthStatus": [
{
"ListenerId": "lsn-o4u54y73wq7b******",
"ListenerPort": 80,
"ListenerProtocol": "http",
"ServerGroupInfos": [
{
"HealthCheckEnabled": "on",
"NonNormalServers": [
{
"Port": 90,
"Reason": {
"ActualResponse": "302",
"ExpectedResponse": "HTTP_2xx",
"ReasonCode": "RESPONSE_MISMATCH"
},
"ServerId": "i-uf62h8v******",
"ServerIp": "192.168.8.10",
"Status": "Initial"
}
],
"ServerGroupId": "sgp-8ilqs4axp6******",
"ActionType": "TrafficMirror",
"ServerCount": 1
}
]
}
],
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876F******",
"RuleHealthStatus": [
{
"RuleId": "rule-hp34s2h0xx1ht4nwo****",
"ServerGroupInfos": [
{
"HealthCheckEnabled": "on",
"NonNormalServers": [
{
"Port": 90,
"Reason": {
"ActualResponse": "302",
"ExpectedResponse": "HTTP_2xx",
"ReasonCode": "RESPONSE_MISMATCH"
},
"ServerId": "i-uf62h8v******",
"ServerIp": "192.168.2.11",
"Status": "Initial"
}
],
"ServerGroupId": "sgp-8ilqs4axp6******",
"ActionType": "TrafficMirror",
"ServerCount": 1
}
]
}
],
"NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 403 | Forbidden.LoadBalancer | Authentication is failed for %s. | Authentication is failed for %s. |
| 404 | ResourceNotFound.LoadBalancer | The specified resource %s is not found. | The specified resource %s is not found. |
| 404 | ResourceNotFound.Listener | The specified resource %s is not found. | The listener does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.