Modifies the configuration of a load balancer that you specify by ID.
Operation description
You can modify a load balancer's name, acceleration status, session persistence policy, and advanced traffic routing settings.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
esa:UpdateLoadBalancer |
update |
*Site
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Enabled |
boolean |
No |
Whether the load balancer is enabled.
Valid values:
|
true |
| SiteId |
integer |
Yes |
The site ID. You can call the ListSites operation to obtain this ID. |
1159101787**** |
| AdaptiveRouting |
object |
No |
Configures origin-pull behavior across address pools. |
|
| FailoverAcrossPools |
boolean |
No |
Whether to perform origin-pull across address pools.
|
false |
| OriginLevelRetry |
boolean |
No |
||
| DefaultPools |
array |
No |
A list of default address pool IDs. |
|
|
integer |
No |
The ID of a default address pool. |
96228666776**** |
|
| FallbackPool |
integer |
No |
The ID of the fallback address pool. Traffic is routed to this pool when all other address pools are unavailable. |
96228666776**** |
| RandomSteering |
object |
No |
The weighted round-robin configuration that controls how traffic is distributed across address pools. |
|
| DefaultWeight |
integer |
No |
The default weight for address pools without a specific weight. Valid values: 0 to 100. |
50 |
| PoolWeights |
object |
No |
A map of pool IDs to weights that determine the proportion of traffic routed to each pool. |
|
|
integer |
No |
The weight for a single origin pool. Valid values: 0 to 100. A value of 0 routes no traffic to this pool. |
50 |
|
| Rules |
array<object> |
No |
A list of rules that define behavior overrides for specific conditions. |
|
|
array<object> |
No |
The configuration of a single rule. |
||
| RuleName |
string |
No |
The name of the rule. This parameter is not required when you configure global settings. |
rule_1 |
| Rule |
string |
No |
The content of the rule, specified as a conditional expression to match user requests. This parameter is not required when you configure global settings. Use cases:
|
http.request.method eq "GET" |
| RuleEnable |
string |
No |
Whether the rule is enabled. Not required for global settings. Valid values:
|
on |
| FixedResponse |
object |
No |
The fixed response to return when the rule's condition is met. |
|
| ContentType |
string |
No |
The value of the |
application/json |
| Location |
string |
No |
The value of the |
http://www.example.com/index.html |
| MessageBody |
string |
No |
The content of the response body. |
Hello World! |
| StatusCode |
integer |
No |
The HTTP status code of the response. |
200 |
| Overrides |
any |
No |
The settings to override when a request matches this rule. These take precedence over the load balancer's main configuration. |
{ "adaptive_routing": { "failover_across_pools": true }, "sub_region_pools": { "AL,AT": [ 92298024898****, 92304347804**** ], "BG,BY": [ 92298024898**** ] }, "default_pools": [ 92298024898****, 92304347804**** ], "fallback_pool": 92298024898****, "location_strategy": { "mode": "resolver_ip", "prefer_ecs": "always" }, "random_steering": { "default_weight": 0.3, "pool_weights": { "92298024898****": 0.7, "92304347804****": 0.8 } }, "region_pools": { "CN,SEAS": [ 92298024898****, 92304347804**** ], "SAF,SAS": [ 92304347804**** ] }, "session_affinity": "ip", "steering_policy": "geo", "ttl": 30 } |
| Sequence |
integer |
No |
The execution priority of the rule. If not specified, rules run in listed order. If specified, the value must be an integer greater than 0. A larger value indicates a higher priority. |
1 |
| Terminates |
boolean |
No |
Whether to stop processing subsequent rules after this rule is matched.
|
true |
| SessionAffinity |
string |
No |
The session affinity method, which routes requests from the same client to the same origin server. Valid values:
|
ip |
| SteeringPolicy |
string |
No |
The traffic steering policy, which determines how traffic is distributed among the address pools. |
order |
| Description |
string |
No |
A description of the load balancer for identification and management. |
Load Balancer Description |
| Ttl |
integer |
No |
The Time to Live (TTL) for the DNS record, in seconds. Default value: 30. Valid values: 10 to 600. |
300 |
| Monitor |
object |
No |
The health check monitor configuration. |
|
| Type |
string |
No |
The protocol to use for the health check, such as |
HTTP |
| Method |
string |
No |
The HTTP method to use for the health check. For example, |
GET |
| Port |
integer |
No |
The port on the origin server to use for the health check. |
80 |
| Path |
string |
No |
The path on the origin server to request for the health check. For example, |
/health |
| Interval |
integer |
No |
The interval in seconds between each health check. For example, |
100 |
| Timeout |
integer |
No |
The timeout for the health check, in seconds. Valid values: 1 to 10. |
5 |
| ExpectedCodes |
string |
No |
The expected HTTP status codes that indicate a healthy response. For example, |
200,202 |
| FollowRedirects |
boolean |
No |
Whether the health check monitor follows HTTP redirects.
|
true |
| ConsecutiveUp |
integer |
No |
The number of consecutive successful health checks required to mark an origin server as healthy. |
3 |
| ConsecutiveDown |
integer |
No |
The number of consecutive failed health checks required to mark an origin server as unhealthy. |
5 |
| Header |
any |
No |
The HTTP request headers to send with each health check. |
{ "host": [ "example1.com", "example2.com" ] } |
| MonitoringRegion |
string |
No |
The regions from which the health checks are performed. The default value is
Valid values:
|
Global |
| Id |
integer |
Yes |
The load balancer ID. You can call the ListLoadBalancers operation to obtain this ID. |
95913670174**** |
| RegionPools |
any |
No |
A map of primary regions to their corresponding address pools. |
{ "ENAM": [ 12345678**** ], "WNAM": [ 23456789****, 23456789**** ] } |
| SubRegionPools |
any |
No |
A map of secondary regions to their corresponding address pools. To assign the same address pools to multiple secondary regions, combine their codes into a single, comma-separated key. |
{"AL,MO": [92298024898****],"CN-SH,CN-SX,CN-SC":[92304347804****,92843536908****]} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response returned when the load balancer is updated. |
||
| RequestId |
string |
The ID of the request. |
EEEBE525-F576-1196-8DAF-2D70CA3F4D2F |
Examples
Success response
JSON format
{
"RequestId": "EEEBE525-F576-1196-8DAF-2D70CA3F4D2F\n"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 400 | LoadBalancerQuotaCheckFailed | Load balancer enable quota check failed. | Your current plan cannot use the load balancer related functions. If you need to use it, upgrade the plan. |
| 400 | LoadBalancerNumberExceedQuotaLimit | The number of load balancers you have added has reached the limit of the plan quota. Please delete the unused load balancers or upgrade the plan and try again. | The number of load balancers you have added has reached the limit of the plan quota. Please delete the unused load balancers or upgrade the plan and try again. |
| 400 | LoadBalancerRuleQuotaCheckFailed | Your current plan does not support configuring load balancer custom rules, or the load balancer rules you have added exceed the plan quota limit. Please upgrade the plan or delete the rules that are no longer in use and try again. | Your current plan does not support configuring load balancer custom rules, or the load balancer rules you have added exceed the plan quota limit. Please upgrade the plan or delete the rules that are no longer in use and try again. |
| 400 | LoadBalancerPolicyCheckFailed | Your current plan does not support the load balancer scheduling policy. Upgrade the plan and try again. | Your current plan does not support the load balancer scheduling policy. Upgrade the plan and try again. |
| 400 | LoadBalancerHealthDetectionQuotaCheckFailed | Your current plan does not allow you to configure the load balancer's health detection. Upgrade the plan and try again. | Your current plan does not allow you to configure the load balancer's health detection. Upgrade the plan and try again. |
| 400 | LoadBalancerHealthDetectionIntervalCheckFailed | The configured load balancer health detection interval exceeds the quota range allowed by the plan. Please revise the interval within the range or upgrade the plan and try again. | The configured load balancer health detection interval exceeds the quota range allowed by the plan. Please revise the interval within the range or upgrade the plan and try again. |
| 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 | Instance.NotOnline | Your plan is unavailable due to an overdue payment. Complete the payment first. | Your plan is unavailable due to an overdue payment. Complete the payment first. |
| 400 | MonitorExpectedBodyInvalid | Invalid response body. Specify a response body that does not exceed 102,400 characters in length in your custom rule. | Invalid response body. Specify a response body that does not exceed 102,400 characters in length in your custom rule. |
| 400 | MonitorExpectedCodesInvalid | Invalid expected status code for the probe.Make sure that you specify no more than 10 status codes in the probe settings, and each status code must be 3 to 4 characters in length.Examples: 200, 301, 3xx, 8000, and 88xx. | Invalid expected status code for the probe.Make sure that you specify no more than 10 status codes in the probe settings, and each status code must be 3 to 4 characters in length.Examples: 200, 301, 3xx, 8000, and 88xx. |
| 400 | MonitorHeaderInvalid | Invalid request header for the probe. You can add up to 10 request headers, each with 1 to 9 values. The combined length of all headers and values cannot exceed 6,000 characters. You cannot configure the User-Agent header. | The incoming monitor is carrying an illegal request header. Make sure that the number of request headers does not exceed 10, that each request header has a value length between 1 and 10, and that you must not use the User-Agent request header (which is reserved for internal specific scenarios). In addition, the total length of all request headers and their values must not exceed 6000 characters. Please check and correct the request header configuration and try again. |
| 400 | MonitorMethodNotSupport | Invalid HTTP method for the probe request. Valid values are GET and HEAD. | Invalid HTTP method for the probe request. Valid values are GET and HEAD. |
| 400 | MonitorPathNotSupport | Invalid probe URL path.If you set the probe protocol to HTTP or HTTPS, make sure you specify a probe URL path that does not exceed 1,024 characters in length. | Invalid probe URL path.If you set the probe protocol to HTTP or HTTPS, make sure you specify a probe URL path that does not exceed 1,024 characters in length. |
| 400 | MonitorPortNotSupport | Invalid probe port. Specify a valid port from 1 to 65535 for the probe request. Then, try again. | The incoming monitor listening port is not supported. The port value range is [1-65535]. Please ensure that the port is within the value range and try again. |
| 400 | MonitorRetriesInvalid | Invalid number of probe retries. Specify an integer from 0 to 5. Then, try again. | Invalid number of probe retries. Specify an integer from 0 to 5. Then try again. |
| 400 | MonitorTimeoutInvalid | Invalid timeout for the probe. Valid values are 1 to 10. | Invalid timeout for the probe. Valid values are 1 to 10. |
| 400 | MonitorTypeNotSupport | Invalid protocol. Valid values are off, HTTP, HTTPS, TCP, UDP, ICMP Ping, and SMTP. | Invalid protocol. Valid values are off, HTTP, HTTPS, TCP, UDP, ICMP Ping, and SMTP. |
| 400 | OriginPoolNotExist | The specified origin pool does not exist or does not belong to your account or website. Check and try again. | The specified origin pool does not exist or does not belong to your account or website. Check and try again. |
| 400 | LoadBalancerNameConflict | The load balancer name or the hostname for the origin pool already exists. Try again with a unique name. | The load balancer name or the hostname for the origin pool already exists. Try again with a unique name. |
| 400 | LockFailed | The system is handling requests you previously submitted. Try again later. | The system is handling requests you previously submitted. Try again later. |
| 400 | SourceCircleExist | The host record of the resource to be operated on is already the source station of another resource, or the source station of the current resource has been added as a host record. To avoid loopback, modify the host record or source station and retry. | The host record of the resource to be operated on is already the source station of another resource, or the source station of the current resource has been added as a host record. To avoid loopback, modify the host record or source station and retry. |
| 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. |
| 400 | MissingParameter | The specified ArgName is required for this function. | When configuring a specific function, the required parameter is missing. |
| 400 | CompileRuleError | Rule compilation failed, please check the rule information passed in to ensure that the rule is written according to the syntax described in the document. | Rule compilation failed. Check the incoming rule configuration. For details, see the rule configuration format described in the interface document. |
| 400 | InstanceNotExist | The instance does not exist. Check whether the specified instance ID is correct or whether the instance belongs to your account. | The instance does not exist. Check whether the specified instance ID is correct or whether the instance belongs to your account. |
| 403 | QuotaExceeded | The quota is exceeded. | The quota is exceeded. |
| 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.