Queries the list of load balancers under a site and returns load balancing information. You can query by load balancer name. Paging is supported.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
esa:ListLoadBalancers |
list |
*Site
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PageNumber |
integer |
No |
The page number settings for the paging query. The value must be greater than or equal to 1. |
2 |
| PageSize |
integer |
No |
The number of entries per page for the paging query. Valid values: 1 to 500. |
20 |
| Name |
string |
No |
The load balancing name. You can query by name. |
lb.example.com |
| MatchType |
string |
No |
The name matching strategy when querying by name. Valid values:
|
fuzzy |
| OrderBy |
string |
No |
The sort field. Currently, only sorting by ID is supported. id indicates ascending order by ID, and -id indicates descending order by ID. The ID value is positively correlated with the creation time. If this parameter is not specified, the default sort order is descending by ID. |
id |
| SiteId |
integer |
Yes |
The site ID. You can call the ListSites operation to obtain the site ID. |
21655860979**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
CB1A380B-09F0-41BB-A198-72F8FD6DA2FE |
| LoadBalancers |
array<object> |
The list of load balancing instances returned in array format. |
|
|
array<object> |
The details of a load balancing instance. |
||
| Id |
integer |
The unique identity ID of the load balancing instance. |
998676487607104 |
| Name |
string |
The name of the load balancing instance. |
lb.example.com |
| SiteId |
integer |
The ID of the site to which the load balancing instance belongs. |
1159101787**** |
| Enabled |
boolean |
Indicates whether the load balancing instance is enabled. Valid values:
|
false |
| Ttl |
integer |
The TTL value, which specifies the time-to-live of the DNS record. Default value: 30. |
30 |
| SessionAffinity |
string |
The session persistence mode. Valid values:
|
ip |
| FallbackPool |
integer |
The ID of the fallback address pool. When all other address pools are unavailable, traffic is redirected to this address pool. |
96228666776**** |
| SteeringPolicy |
string |
The load balancing policy. |
order |
| Description |
string |
The description of the load balancing instance. |
test |
| AdaptiveRouting |
object |
The cross-origin address pool back-to-origin configuration. |
|
| FailoverAcrossPools |
boolean |
Indicates whether to enable failover across pools.
|
true |
| OriginLevelRetry |
boolean |
true |
|
| DefaultPools |
array |
The list of default address pool IDs. |
|
|
integer |
The default address pool. |
96228666776**** |
|
| RandomSteering |
object |
The weighted round-robin configuration, which controls the traffic distribution weight across different address pools. |
|
| DefaultWeight |
integer |
The default weight applied to any pool not defined in |
50 |
| PoolWeights |
object |
The weight configuration for each backend pool, where the key is the pool ID and the value is the weight. |
|
|
integer |
The weight value for a pool. Valid values range from 0 to 100. A value of 0 routes no traffic to this pool. |
50 |
|
| Rules |
array<object> |
The list of rule configurations that define behaviors under specific conditions. |
|
|
array<object> |
The rule configuration in the rule set. |
||
| FixedResponse |
object |
Specifies the response to return when a rule matches. |
|
| ContentType |
string |
The |
application/json |
| Location |
string |
The |
http://www.example.com/index.html |
| MessageBody |
string |
The content of the response body. |
Hello World. |
| StatusCode |
integer |
The status code. |
200 |
| Overrides |
any |
The load balancer settings to override when a rule matches. Any field you specify overwrites the load balancer's corresponding setting. |
{ "adaptive_routing": { "failover_across_pools": true }, "sub_region_pools": { "GB": [ 96228666776**** ], "US": [ 96228666776**** ] }, "default_pools": [ 96228666776****, 96228666776**** ], "fallback_pool": 96228666776****, "location_strategy": { "mode": "resolver_ip", "prefer_ecs": "always" }, "random_steering": { "default_weight": 30, "pool_weights": { "96228666776****": 70, "96228666776****": 80 } }, "region_pools": { "ENAM": [ 96228666776****, 92843536908**** ], "WNAM": [ 92843536908**** ] }, "session_affinity": "cookie", "session_affinity_attributes": { "drain_duration": 100, "headers": ["none"], "require_all_headers": false, "samesite": "Auto", "secure": "Auto", "zero_downtime_failover": "sticky" }, "session_affinity_ttl": 1800, "steering_policy": "dynamic_latency", "ttl": 30 } |
| Rule |
string |
The rule expression that matches user requests. This parameter is not required for global configurations. Use cases:
|
http.request.uri.path contains "/testing" |
| RuleName |
string |
The name of the rule. This parameter is not required for global configurations. |
r2 |
| RuleEnable |
string |
Indicates whether the rule is enabled. This parameter is not required for global configurations. Valid values:
|
on |
| Sequence |
integer |
The execution priority of the rule. Higher values indicate higher priority. |
1 |
| Terminates |
boolean |
Specifies whether to stop executing subsequent rules after this rule matches.
|
true |
| Monitor |
object |
The monitor configuration. |
|
| Type |
string |
The protocol for the health check, such as |
HTTP |
| Method |
string |
The method used for the health check. |
GET |
| Port |
integer |
The destination port for the health check. |
80 |
| Path |
string |
The path to request for the health check. |
/ |
| Interval |
integer |
The interval between health checks, in seconds. |
60 |
| ExpectedCodes |
string |
The expected HTTP status codes that indicate a successful health check, such as |
200,202 |
| FollowRedirects |
boolean |
Indicates whether the health check should follow redirects.
|
true |
| ConsecutiveUp |
integer |
The number of consecutive successful health checks required to consider a pool healthy. For example, |
3 |
| ConsecutiveDown |
integer |
The number of consecutive failed health checks required to consider a pool unhealthy. For example, |
5 |
| Header |
any |
The HTTP headers to include in the health check probe. |
{ "host": [ "example1.com", "example2.com" ] } |
| Timeout |
integer |
The timeout for a single health check, in seconds. |
5 |
| MonitoringRegion |
string |
The probe locations for health checks. The default is
|
Global |
| Status |
string |
The status of the load balancing instance. |
healthy |
| SubRegionPools |
any |
The address pools mapped to secondary regions. When multiple secondary regions share the same set of address pools, the secondary region names can be concatenated with commas as the key. |
{"AL,MO": [92298024898****],"CN-SH,CN-SX,CN-SC":[92304347804****,92843536908****]} |
| RegionPools |
any |
The address pools mapped to primary regions. |
{ "ENAM": [ 12345678**** ], "WNAM": [ 23456789****, 23456789**** ] } |
| PageNumber |
integer |
The page number, which is the same as the PageNumber request parameter. |
1 |
| PageSize |
integer |
The number of entries per page. |
10 |
| TotalCount |
integer |
The total number of entries. |
100 |
| TotalPage |
integer |
The total number of pages. |
10 |
Examples
Success response
JSON format
{
"RequestId": "CB1A380B-09F0-41BB-A198-72F8FD6DA2FE",
"LoadBalancers": [
{
"Id": 998676487607104,
"Name": "lb.example.com\n",
"SiteId": 0,
"Enabled": false,
"Ttl": 30,
"SessionAffinity": "ip",
"FallbackPool": 0,
"SteeringPolicy": "order",
"Description": "test",
"AdaptiveRouting": {
"FailoverAcrossPools": true,
"OriginLevelRetry": true
},
"DefaultPools": [
0
],
"RandomSteering": {
"DefaultWeight": 50,
"PoolWeights": {
"key": 50
}
},
"Rules": [
{
"FixedResponse": {
"ContentType": "application/json\n",
"Location": "http://www.example.com/index.html\n",
"MessageBody": "Hello World.\n",
"StatusCode": 200
},
"Overrides": "{\n \"adaptive_routing\": {\n \"failover_across_pools\": true\n },\n \"sub_region_pools\": {\n \"GB\": [\n 96228666776****\n ],\n \"US\": [\n 96228666776****\n ]\n },\n \"default_pools\": [\n 96228666776****,\n 96228666776****\n ],\n \"fallback_pool\": 96228666776****,\n \"location_strategy\": {\n \"mode\": \"resolver_ip\",\n \"prefer_ecs\": \"always\"\n },\n \"random_steering\": {\n \"default_weight\": 30,\n \"pool_weights\": {\n \"96228666776****\": 70,\n \"96228666776****\": 80\n }\n },\n \"region_pools\": {\n \"ENAM\": [\n 96228666776****,\n 92843536908****\n ],\n \"WNAM\": [\n 92843536908****\n ]\n },\n \"session_affinity\": \"cookie\",\n \"session_affinity_attributes\": {\n \"drain_duration\": 100,\n \"headers\": [\"none\"],\n \"require_all_headers\": false,\n \"samesite\": \"Auto\",\n \"secure\": \"Auto\",\n \"zero_downtime_failover\": \"sticky\"\n },\n \"session_affinity_ttl\": 1800,\n \"steering_policy\": \"dynamic_latency\",\n \"ttl\": 30\n }",
"Rule": "http.request.uri.path contains \"/testing\"\n",
"RuleName": "r2",
"RuleEnable": "on",
"Sequence": 1,
"Terminates": true
}
],
"Monitor": {
"Type": "HTTP\n",
"Method": "GET\n",
"Port": 80,
"Path": "/\n",
"Interval": 60,
"ExpectedCodes": "200,202\n",
"FollowRedirects": true,
"ConsecutiveUp": 3,
"ConsecutiveDown": 5,
"Header": "{\n \"host\": [\n \"example1.com\",\n \"example2.com\"\n ]\n }",
"Timeout": 5,
"MonitoringRegion": "Global"
},
"Status": "healthy",
"SubRegionPools": "{\"AL,MO\": [92298024898****],\"CN-SH,CN-SX,CN-SC\":[92304347804****,92843536908****]}",
"RegionPools": "{\n \"ENAM\": [\n 12345678****\n ],\n \"WNAM\": [\n 23456789****,\n 23456789****\n ]\n}"
}
],
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 100,
"TotalPage": 10
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 400 | InternalException | Failed to call the service. Try again later or contact technical support. | Failed to call the service. Try again later or contact technical support. |
| 404 | SiteNotFound | The website does not exist or does not belong to you. | The website does not exist or does not belong to you. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.