edit-icon download-icon

AddBackendServers

Last Updated: Apr 04, 2018

Description

Add the backend servers to a Server Load Balancer instance.

Note: If the ECS instances has already been added, the ECS instances are ignored.

Request parameter

Name Type Required Description
Action String Yes

The action to peform. Valid value:

AddBackendServers

LoadBalancerId String Yes

The ID of the Server Load Balancer instance.

BackendServers JSON String Yes

A list of backend servers to be added.

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 1-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 JSON String The list of the backend servers of the SLB instance, containing the following:
  • ServerId is the ID of the ECS instance.
  • Weight is the weight of the ECS instance in the range of 1-100, the default value is 100. The ECS instance with higher weight receives more requests.

Example

Request example

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

Response example

  • XML format

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <AddBackendServersResponse>
    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>100</Weight>
    9. </BackendServer>
    10. <BackendServer>
    11. <ServerId>vm-234</ServerId>
    12. <Weight>100</Weight>
    13. </BackendServer>
    14. </BackendServers>
    15. </AddBackendServersResponse>
  • 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",
    7. "Weight":100},
    8. {"ServerId":"vm-234",
    9. "Weight":100
    10. }
    11. ]
    12. }
    13. }
Thank you! We've received your feedback.