Modify Load Balancer
Operation description
Through this interface, you can modify multiple configurations of the load balancer, including but not limited to the name of the load balancer, whether to enable acceleration, session persistence strategy, and various advanced settings related to traffic routing.
Debugging
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 Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| esa:UpdateLoadBalancer | update | *Site acs:esa:{#regionId}:{#accountId}:site/{#SiteId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Enabled | boolean | No | Whether the load balancer is enabled.
| true |
| SiteId | long | Yes | Site ID, which can be obtained by calling the ListSites interface. | 1159101787**** |
| AdaptiveRouting | object | No | Configuration for fallback across pools. | |
| FailoverAcrossPools | boolean | No | Whether to fallback across pools.
| false |
| DefaultPools | array | No | List of default pool IDs. | |
| long | No | Default pool ID, integer type. | 96228666776**** | |
| FallbackPool | long | No | Fallback pool ID, where traffic will be directed when all other pools are unavailable. | 96228666776**** |
| RandomSteering | object | No | Weighted round-robin configuration, used to control the traffic distribution weights among different pools. | |
| DefaultWeight | integer | No | Default round-robin weight, used for all pools that do not have a separately specified weight. Value range: integers between 0-100. | 50 |
| PoolWeights | object | No | Weight configuration for each backend server pool, where the key is the pool ID and the value is the weight factor. The weight factor represents the proportion of relative traffic distribution. | |
| integer | No | Weight of a single origin pool, a number between 0-100, where 0 indicates no traffic should be routed to this pool. | 50 | |
| Rules | array<object> | No | Rule configuration list, used to define behavior overrides under specific conditions. | |
| object | No | Rule information. | ||
| RuleName | string | No | Rule name. This parameter does not need to be set when adding global configurations. | rule_1 |
| Rule | string | No | Rule content, using conditional expressions to match user requests. This parameter does not need to be set when adding global configurations. There are two usage scenarios:
| http.request.method eq "GET" |
| RuleEnable | string | No | Rule switch. This parameter does not need to be set when adding global configurations. Value range:
| on |
| FixedResponse | object | No | Execute a specified response after matching the rule. | |
| ContentType | string | No | Content-Type field in the HTTP Header. | application/json |
| Location | string | No | Location field in the HTTP response. | http://www.example.com/index.html |
| MessageBody | string | No | Response body value. | Hello World! |
| StatusCode | integer | No | Response status code. | 200 |
| Overrides | any | No | Modify the corresponding load balancing configuration after matching the rule. The fields in the configuration will override the corresponding fields in the load balancer 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 order of the rule. It can be left blank, in which case the rules will be executed in the order they appear in the list. If specified, it must be a positive integer, with higher values indicating higher priority. | 1 |
| Terminates | boolean | No | Whether to terminate the execution of subsequent rules.
| true |
| SessionAffinity | string | No | Session persistence, with possible values:
| ip |
| SteeringPolicy | string | No | Load balancing policy. | order |
| Description | string | No | Detailed description of the load balancer, for easier management and identification. | Load balancer description |
| Ttl | integer | No | TTL value, the time-to-live for DNS records, with a default of 30 and a range of 10-600. | 300 |
| Monitor | object | No | Monitor configuration for health checks. | |
| Type | string | No | Monitor protocol type, such as HTTP, used for health checks. When set to 'off', no checks are performed. | HTTP |
| Method | string | No | Monitor request method, such as GET, which is a method in the HTTP protocol. | GET |
| Port | integer | No | Origin server port. | 80 |
| Path | string | No | Monitor check path, such as /healthcheck, which is the HTTP request path. | /health |
| Interval | integer | No | Monitor interval, such as 60 seconds, which is the frequency of checks. | 100 |
| Timeout | integer | No | Application health check timeout, in seconds, with a range of 1-10. | 5 |
| ExpectedCodes | string | No | Expected status codes, such as 200,202, which indicate successful HTTP responses. | 200,202 |
| FollowRedirects | boolean | No | Whether to follow redirects.
| true |
| ConsecutiveUp | integer | No | Number of consecutive successful probes required to consider the target healthy, such as 3. | 3 |
| ConsecutiveDown | integer | No | Number of consecutive failed probes required to consider the target unhealthy, such as 5. | 5 |
| Header | any | No | Monitor request header configuration. | { "host": [ "example1.com", "example2.com" ] } |
| Id | long | Yes | Load balancer ID, which can be obtained by calling the ListLoadBalancers API. | 95913670174**** |
| RegionPools | any | No | Address pool corresponding to the primary region. | { "ENAM": [ 12345678**** ], "WNAM": [ 23456789****, 23456789**** ] } |
| SubRegionPools | any | No | Address pool corresponding to the secondary region. When multiple secondary regions share the same address pool, the regions can be concatenated with commas as the key. | {"AL,MO": [92298024898****],"CN-SH,CN-SX,CN-SC":[92304347804****,92843536908****]} |
Response parameters
Examples
Sample success responses
JSONformat
{
"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. |
| 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. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-02-13 | The Error code has changed. The request parameters of the API has changed | View Change Details |
