Retrieves the details of a specific load balancer based on the specified site ID and load balancer ID.
Operation description
This API allows you to query the configuration details of a specific load balancer by providing the required authentication information and resource identity. The details include but are not limited to the name, session persistence policy, and load balancing policy.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
esa:GetLoadBalancer |
get |
*Site
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Id |
integer |
Yes |
The load balancer ID, which uniquely identifies the load balancer to query. This ID is returned when the load balancer is created. You can also call the ListLoadBalancers operation to obtain all load balancers under a site. |
99867648760**** |
| SiteId |
integer |
Yes |
The site ID. You can call the ListSites operation to obtain the site ID. |
1159101787**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data structure returned upon a successful response, which contains the detailed configuration of the load balancer. |
||
| RequestId |
string |
The request ID. |
EEEBE525-F576-1196-8DAF-2D70CA3F4D2F |
| Id |
integer |
The unique ID of the load balancer. |
99867648760**** |
| Name |
string |
The name of the load balancer. |
lb.example.com |
| SiteId |
integer |
The ID of the site to which the load balancer belongs. |
11591017874**** |
| Enabled |
boolean |
Indicates whether the load balancer is enabled.
|
true |
| Ttl |
integer |
The TTL value, which specifies the time-to-live of the DNS record. Default value: 30 seconds. |
60 |
| SessionAffinity |
string |
The session persistence setting. Valid values:
|
ip |
| FallbackPool |
integer |
The fallback pool ID. When all other pools are unavailable, traffic is redirected to this pool. |
96228666776**** |
| SteeringPolicy |
string |
The load balancing policy. |
order |
| Description |
string |
The description of the load balancer. |
test |
| AdaptiveRouting |
object |
The cross-origin pool back-to-origin configuration. |
|
| FailoverAcrossPools |
boolean |
Indicates whether failover across origin pools is enabled.
|
true |
| OriginLevelRetry |
boolean |
Specifies whether to retry the next IP address when back-to-origin fails and the origin server is a domain name that resolves to multiple IP addresses. |
false |
| DefaultPools |
array |
The list of default pool IDs. |
|
|
integer |
The default pool. |
96228666776**** |
|
| RandomSteering |
object |
The weighted round-robin configuration, which controls the traffic distribution weight across different pools. |
|
| DefaultWeight |
integer |
The default round-robin weight applied to all pools that do not have an individually specified weight. Valid values: 0 to 100. |
50 |
| PoolWeights |
object |
The weight configuration for each backend server pool. The key is the pool ID and the value is the weight coefficient. The weight coefficient represents the relative proportion of traffic distribution. |
|
|
integer |
The weight of a single origin pool. Valid values: 0 to 100. A value of 0 indicates that no traffic is routed to this origin 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 |
The fixed response content returned when the rule is matched. |
|
| ContentType |
string |
The value for the |
application/json |
| Location |
string |
The value for the |
http://www.example.com/index.html |
| MessageBody |
string |
The content of the response body. |
Hello World. |
| StatusCode |
integer |
The HTTP status code. |
200 |
| Overrides |
any |
The load balancing configuration overrides applied to matching requests. The configured fields override the corresponding fields in the load balancer configuration. |
{ "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 content, which uses conditional expressions to match user requests. This parameter is not required when you add a global configuration. Two scenarios are supported:
|
http.request.uri.path contains "/testing" |
| RuleName |
string |
The rule name. This parameter is not required when you add a global configuration. |
r2 |
| RuleEnable |
string |
The rule switch. This parameter is not required when you add a global configuration. Valid values:
|
off |
| Sequence |
integer |
The rule execution order. A larger value indicates a higher priority. |
1 |
| Terminates |
boolean |
Indicates whether to terminate the execution of subsequent rules.
|
true |
| Monitor |
object |
The monitor configuration. |
|
| Type |
string |
The monitor protocol type, such as HTTP, used for health checks. A value of off indicates that no health check is performed. |
HTTP |
| Method |
string |
The health check method. |
GET |
| Port |
integer |
The target port. |
80 |
| Path |
string |
The path. |
/ |
| Interval |
integer |
The health check interval. Unit: seconds. |
60 |
| ExpectedCodes |
string |
The expected status codes for a successful HTTP response, such as 200,202. |
200,202 |
| FollowRedirects |
boolean |
Indicates whether to follow redirects.
|
true |
| ConsecutiveUp |
integer |
The number of consecutive successful probes required to consider the check successful, such as |
3 |
| ConsecutiveDown |
integer |
The number of consecutive failed probes required to consider the check failed, such as |
5 |
| Header |
any |
The HTTP header information included in the probe request. |
{ "host": [ "example1.com", "example2.com" ] } |
| Timeout |
integer |
The health check timeout period. Unit: seconds. |
5 |
| MonitoringRegion |
string |
The region where the probe nodes are located. Default value: Global.
|
Global |
| Status |
string |
The status of the load balancer. |
healthy |
| SubRegionPools |
any |
The pools mapped to secondary regions. When multiple secondary regions share the same set of pools, you can concatenate multiple secondary regions with commas as the key. |
{"AL,MO": [92298024898****],"CN-SH,CN-SX,CN-SC":[92304347804****,92843536908****]} |
| RegionPools |
any |
The pools mapped to primary regions. |
{ "ENAM": [ 12345678**** ], "WNAM": [ 23456789****, 23456789**** ] } |
Examples
Success response
JSON format
{
"RequestId": "EEEBE525-F576-1196-8DAF-2D70CA3F4D2F",
"Id": 0,
"Name": "lb.example.com",
"SiteId": 0,
"Enabled": true,
"Ttl": 60,
"SessionAffinity": "ip",
"FallbackPool": 0,
"SteeringPolicy": "order",
"Description": "test",
"AdaptiveRouting": {
"FailoverAcrossPools": true,
"OriginLevelRetry": false
},
"DefaultPools": [
0
],
"RandomSteering": {
"DefaultWeight": 50,
"PoolWeights": {
"key": 50
}
},
"Rules": [
{
"FixedResponse": {
"ContentType": "application/json",
"Location": "http://www.example.com/index.html",
"MessageBody": "Hello World.",
"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\"",
"RuleName": "r2",
"RuleEnable": "off",
"Sequence": 1,
"Terminates": true
}
],
"Monitor": {
"Type": "HTTP",
"Method": "GET",
"Port": 80,
"Path": "/",
"Interval": 60,
"ExpectedCodes": "200,202",
"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}"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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. |
| 400 | LoadBalancerNotExist | The specified load balancer name is invalid or load balancing is not enabled for your website.Make sure that you specify a valid load balancer name and load balancing is enabled. Then, try again. | The specified load balancer name is invalid or load balancing is not enabled for your website.Make sure that you specify a valid load balancer name and load balancing is enabled. Then, try again. |
| 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.