All Products
Search
Document Center

Edge Security Acceleration:GetLoadBalancer

Last Updated:Nov 07, 2025
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Query a Specific Load Balancer

Operation description

This API allows users to query the configuration details of a specific load balancer by providing necessary authentication information and resource identifiers, including but not limited to name, session persistence strategy, routing policy, etc.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
esa:GetLoadBalancerget
*Site
acs:esa:{#regionId}:{#accountId}:site/{#SiteId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
IdlongYes

The ID of the load balancer, used to uniquely identify the load balancer to be queried. This ID is returned directly when the load balancer is created, or it can be obtained through the ListLoadBalancers interface for querying all load balancers under a site.

99867648760****
SiteIdlongYes

The site ID, which can be obtained by calling the ListSites interface.

1159101787****

Response parameters

ParameterTypeDescriptionExample
object

The data structure returned in a successful response, containing detailed configuration information of the load balancer.

RequestIdstring

Request ID.

EEEBE525-F576-1196-8DAF-2D70CA3F4D2F
Idlong

The unique identifier ID of the load balancer.

99867648760****
Namestring

The name of the load balancer.

lb.example.com
SiteIdlong

The site ID to which the load balancer belongs.

11591017874****
Enabledboolean

Whether the load balancer is enabled.

  • true: Enabled.
  • false: Not enabled.
true
Ttlinteger

TTL value, the time-to-live for DNS records, with a default of 30 seconds.

60
SessionAffinitystring

Session persistence, with values:

  • off: Not enabled.
  • ip: Session persistence by IP.
  • cookie: Session persistence by cookie.
ip
FallbackPoollong

The fallback pool ID, to which traffic will be redirected if all other pools are unavailable.

96228666776****
SteeringPolicystring

Load balancing policy.

order
Descriptionstring

Description of the load balancer.

test
AdaptiveRoutingobject

Cross-pool failover configuration.

FailoverAcrossPoolsboolean

Whether to fail over across pools.

  • true: Yes.
  • false: No.
true
DefaultPoolsarray

List of default pool IDs.

DefaultPoollong

Default pool.

96228666776****
RandomSteeringobject

Weighted round-robin configuration, used to control the traffic distribution weights among different pools.

DefaultWeightinteger

The default round-robin weight, used for all pools that do not have individually specified weights. The value range is 0-100.

50
PoolWeightsobject

Weight configurations for each backend server pool, where the key is the pool ID and the value is the weight coefficient. The weight coefficient represents the relative traffic distribution ratio.

integer

The weight of a single origin pool, a number between 0-100, where 0 indicates no traffic should be directed to that pool.

50
Rulesarray<object>

A list of rule configurations, used to define behavior under specific conditions.

Ruleobject

Configuration of rules within the rule set.

FixedResponseobject

Executes a specified response after matching the rule.

ContentTypestring

The Content-Type field in the HTTP Header.

application/json
Locationstring

The location field in the HTTP response.

http://www.example.com/index.html
MessageBodystring

The body value of the response.

Hello World.
StatusCodeinteger

Status code.

200
Overridesany

Modifies the load balancer configuration for the corresponding request after matching the rule. The fields in this configuration will override the corresponding fields in the load balancer's 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 }
Rulestring

Rule content, using conditional expressions to match user requests. This parameter is not required when adding global configurations. There are two usage scenarios:

  • Match all incoming requests: Set the value to true
  • Match specific requests: Set the value to a custom expression, for example: (http.host eq "video.example.com")
http.request.uri.path contains "/testing"
RuleNamestring

Rule name. This parameter is not required when adding global configurations.

r2
RuleEnablestring

Rule switch. This parameter is not required when adding global configurations. Possible values:

  • on: Enabled.
  • off: Disabled.
off
Sequenceinteger

Rule execution order. The higher the number, the higher the priority.

1
Terminatesboolean

Whether to terminate the execution of subsequent rules.

  • true: Yes.
  • false: No, default value.
true
Monitorobject

Monitor configuration.

Typestring

Monitor protocol type, such as HTTP, used for health checks. When the value is off, it indicates that no check is performed.

HTTP
Methodstring

Health check method.

GET
Portinteger

Target port.

80
Pathstring

Path.

/
Intervalinteger

Health check interval, in seconds.

60
ExpectedCodesstring

Expected status codes, such as 200, 202, for successful HTTP responses.

200,202
FollowRedirectsboolean

Whether to follow redirects.

  • true: Yes.
  • false: No.
true
ConsecutiveUpinteger

The number of consecutive successful probes required to consider the target as healthy, for example, 3.

3
ConsecutiveDowninteger

The number of consecutive failed probes required to consider the target as unhealthy, for example, 5.

5
Headerany

The HTTP headers to be included in the probe request.

{ "host": [ "example1.com", "example2.com" ] }
Timeoutinteger

The timeout for the health check, in seconds.

5
Statusstring

The status of the load balancer.

healthy
SubRegionPoolsany

Address pools corresponding to secondary regions. When multiple secondary regions share a set of address pools, the keys can be concatenated with commas.

{"AL,MO": [92298024898****],"CN-SH,CN-SX,CN-SC":[92304347804****,92843536908****]}
RegionPoolsany

Address pools corresponding to primary regions.

{ "ENAM": [ 12345678**** ], "WNAM": [ 23456789****, 23456789**** ] }

Examples

Sample success responses

JSONformat

{
  "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
  },
  "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": {
      "host": [
        "example1.com",
        "example2.com"
      ]
    },
    "Timeout": 5
  },
  "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 codeError codeError messageDescription
400InternalExceptionFailed to call the service. Try again later or contact technical support.Failed to call the service. Try again later or contact technical support.
400LoadBalancerNotExistThe 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.
404SiteNotFoundThe website does not exist or does not belong to you.The website does not exist or does not belong to you.

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