You can call this operation to specify weights of backend servers.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | SetBackendServers |
The operation that you want to perform. Set the value to SetBackendServers. |
LoadBalancerId | String | Yes | lb-bp1qjwo61pqz3a****** |
The ID of the SLB instance that you want to query. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the SLB instance. |
BackendServers | String | Yes | [{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","Description":"test-112" }] |
The backend servers that you want to add to the SLB instance. The value of this parameter is a JSON string with a JSON List structure. You can specify up to 20 elements in a list at a request.
Examples:
Note
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
LoadBalancerId | String | lb-bp1qjwo61pqz3a****** |
The ID of the SLB instance that you want to query. |
BackendServers | Array |
The list of backend servers. |
|
BackendServer | |||
ServerId | String | i-xxxxxxxxx |
The ID of the ECS instance. |
Weight | String | 100 |
The weight of the backend server. |
Description | String | The backend server. |
The description of the backend server. |
Type | String | ecs |
The type of the backend server. Valid values:
|
RequestId | String | 365F4154-92F6-4AE4-92F8-7FF34B540710 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=SetBackendServers
&LoadBalancerId=lb-bp1qjwo61pqz3a******
&BackendServers=[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","Description":"test-112" }]
&<Common request parameters>
Sample success responses
XML
format
<SetBackendServersResponse>
<RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
<LoadBalancerId>lb-dhf13*******</LoadBalancerId>
<BackendServers>
<BackendServer>
<ServerId>eni-hg231**</ServerId>
<Weight>100</Weight>
<Type>eni</Type>
</BackendServer>
<BackendServer>
<ServerId>eni-hfhf***</ServerId>
<Weight>100</Weight>
<Type>eni</Type>
</BackendServer>
</BackendServers>
</SetBackendServersResponse>
JSON
format
{
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
"LoadBalancerId": "139a00604ad-cn-ea******",
"BackendServers": {
"BackendServer": [
{
"ServerId": "eni-hg231**",
"Weight": "100",
"Type": "eni"
},
{
"ServerId": "eni-hhshhs****",
"Weight": "100",
"Type": "eni"
}
]
}
}
Error codes
For a list of error codes, visit the API Error Center.