edit-icon download-icon

SetBackendServers

Last Updated: Mar 12, 2018

Description

Modify the weight of the backend servers.

Request parameter

Name Type Required Description
Action String Yes

The action to perform. Valid value:

SetBackendServers

RegionId String Yes The ID of the region where the SLB instance is located.
LoadBalancerId String Yes The ID of the SLB instance.
BackendServers JSON String Yes

The list of backend servers of the SLB instance.

Up to 20 backend servers can be added at one time. The backend servers must be added in the following format:

[{"ServerId":"XXX","Weight":"XXX"},{"ServerId":"XXX","Weight":"XXX"}]

  • ServerId is the ID of the ECS instance to be added.
  • Weight is the weight of the ECS instance in the range of 0-100, the default value is 100. The ECS instance with higher weight receives more requests.

Response parameter

Name Type Description
RequestId String The ID of the request.
LoadBalancerId String

The ID of the Server Load Balancer instance.

BackendServers List The list of the backend servers.

Example

Request example

  1. https://slb.aliyuncs.com/?Action=SetBackendServers
  2. &LoadBalancerId=139a00604ad-cn-east-hangzhou-01
  3. &BackendServers=[{"ServerId":"vm-233","Weight":"0"},{"ServerId":"vm-234","Weight":"0"}]
  4. &<CommonParameters>

Response example

  • XML format

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <SetBackendServers>
    3. <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
    4. <LoadBalancerId>139a00604ad-cn-east-hangzhou-01</LoadBalancerId>
    5. <BackendServers>
    6. <BackendServer>
    7. <ServerId>vm-233</ServerId>
    8. <Weight>0</Weight>
    9. </BackendServer>
    10. <BackendServer>
    11. <ServerId>vm-234</ServerId>
    12. <Weight>0</Weight>
    13. </BackendServer>
    14. </BackendServers>
    15. </SetBackendServers>
  • JSON format

    1. {
    2. "RequestId":"365F4154-92F6-4AE4-92F8-7FF34B540710",
    3. "LoadBalancerId":"139a00604ad-cn-east-hangzhou-01",
    4. "BackendServers":{
    5. BackendServer”: [
    6. {"ServerId":"vm-233","Weight":0},
    7. {"ServerId":"vm-234","Weight":0}
    8. ]
    9. }
    10. }
Thank you! We've received your feedback.