Updates the configuration of a Network Load Balancer (NLB) server group.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
nlb:UpdateServerGroupAttribute |
update |
*ServerGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ServerGroupId |
string |
Yes |
The server group ID. |
sgp-atstuj3rtoptyui**** |
| ServerGroupName |
string |
No |
The new name of the server group. The name must be 2 to 128 characters in length, and must start with an uppercase letter, lowercase letter, or Chinese character. It can contain digits, periods (.), underscores (_), and hyphens (-). |
NLB_ServerGroup1 |
| ConnectionDrainEnabled |
boolean |
No |
Specifies whether to enable connection draining. Valid values:
|
false |
| ConnectionDrainTimeout |
integer |
No |
The timeout period of connection draining. Unit: seconds. Valid values: 0 to 900. |
10 |
| Scheduler |
string |
No |
The scheduling algorithm. Valid values:
Note
QUIC ID hashing is supported only when the backend protocol is UDP. |
Wrr |
| IpVersionAffinityMode |
string |
No |
The traffic scheduling policy in dual-stack mode:
Note
This parameter takes effect only when AddressIPVersion is set to DualStack. |
Affinity |
| PreserveClientIpEnabled |
boolean |
No |
Specifies whether to enable client IP preservation. Valid values:
Note
If PreserveClientIpEnabled is set to false and the server group is associated with a TCPSSL listener, you cannot change the value of this parameter to true. |
false |
| HealthCheckConfig |
object |
No |
The health check configuration. |
|
| HealthCheckEnabled |
boolean |
No |
Specifies whether to enable health checks. Valid values:
|
false |
| HealthCheckType |
string |
No |
The protocol used for health checks. Valid values:
|
TCP |
| HealthCheckConnectPort |
integer |
No |
The port of the backend server used for health checks. Valid values: 0 to 65535. A value of 0 indicates that the port of the backend server is used for health checks. |
0 |
| HealthyThreshold |
integer |
No |
The number of consecutive successful health checks that must occur before a backend server is declared healthy (from fail to success). Valid values: 2 to 10. |
3 |
| UnhealthyThreshold |
integer |
No |
The number of consecutive failed health checks that must occur before a backend server is declared unhealthy (from success to fail). Valid values: 2 to 10. |
3 |
| HealthCheckConnectTimeout |
integer |
No |
The maximum timeout period for a health check response. Unit: seconds. Valid values: 1 to 300. Default value: 5. |
100 |
| HealthCheckInterval |
integer |
No |
The interval between two consecutive health checks. Unit: seconds. Default value: 5.
|
5 |
| HealthCheckDomain |
string |
No |
The domain name used for health checks. Valid values:
Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
$SERVER_IP |
| HealthCheckUrl |
string |
No |
The health check path. The path must be 1 to 80 characters in length, and can contain only letters, digits, and the characters Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
/test/index.html |
| HealthCheckHttpCode |
array |
No |
The HTTP status codes returned for a healthy backend server. Separate multiple status codes with commas (,). Valid values: http_2xx (default), http_3xx, http_4xx, and http_5xx. Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
|
|
string |
No |
The HTTP status codes returned for a healthy backend server. Separate multiple status codes with commas (,). Valid values: http_2xx (default), http_3xx, http_4xx, and http_5xx. Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
http_2xx |
|
| HttpCheckMethod |
string |
No |
The health check method. Valid values: GET or HEAD. Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
GET |
| HealthCheckReq |
string |
No |
The request string for UDP listener health checks. The string can contain only letters and digits, with a maximum length of 512 characters. |
hello |
| HealthCheckExp |
string |
No |
The response string for UDP listener health checks. The string can contain only letters and digits, with a maximum length of 512 characters. |
ok |
| HealthCheckHttpVersion |
string |
No |
The HTTP version for health checks. Valid values: HTTP1.0 or HTTP1.1. Note
This parameter takes effect only when HealthCheckType is set to HTTP. |
HTTP1.0 |
| RegionId |
string |
No |
The region ID of the Network Load Balancer (NLB) instance. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
|
false |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The client token can contain only ASCII characters. Note
If you do not set this parameter, the system uses RequestId as ClientToken. The value of RequestId may be different for each API request. |
123e4567-e89b-12d3-a456-426655440000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response for updating server group configuration. |
||
| RequestId |
string |
The request ID. |
54B48E3D-DF70-471B-AA93-08E683A1B45 |
| ServerGroupId |
string |
The server group ID. |
sgp-atstuj3rtoptyui**** |
| JobId |
string |
The asynchronous task ID. |
72dcd26b-f12d-4c27-b3af-18f6aed5**** |
Examples
Success response
JSON format
{
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
"ServerGroupId": "sgp-atstuj3rtoptyui****",
"JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalParam.%s | The param of %s is illegal. | |
| 400 | SystemBusy | System is busy, please try again later. | |
| 400 | IllegalParam.healthCheckDomain | The parameter of healthCheckConfig.healthCheckDomain is illegal. | The healthCheckDomain in the health check configuration is invalid. Check the input parameters. |
| 400 | IlleagalParam.healthCheckUrl | The parameter of healthCheckUrl in healthCheckConfig is illegal. | The URL of the health check used in the health check setting is invalid. |
| 400 | OperationDenied.UidNotAllowQuic29 | The operation is not allowed because of uid not allow quic29 version. | |
| 400 | IllegalParam | The param of %s is illegal. | |
| 400 | DryRunOperation | Request validation has been passed with DryRun flag set. | Request validation has been passed with DryRun flag set. |
| 400 | IllegalParam.ServerGroupName | The param of ServerGroupName is illegal. | |
| 400 | IllegalParam.PreserveClientIpSwitch | The server group associated with the tcpssl listener does not support enabling PreserveClientIp. | The server group associated with the tcpssl listener does not support enabling PreserveClientIp. |
| 403 | Forbidden.NoPermission | Authentication is failed for NoPermission. | Authentication is failed for NoPermission. |
| 404 | ResourceNotFound.serverGroup | The specified resource of serverGroup is not found. | The specified resource of serverGroup is not found. Please check the input parameters. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.