You can call the SetBackendServers API to set the weights of backend severs.


Click here to perform a debug operation in OpenAPI Explorer and automatically generate an SDK code example.

Request parameters

Name Type Required? Example value Description
Action String Yes SetBackendServers

The action to perform. Valid value: SetBackendServers

BackendServers String Yes [{"ServerId":"vm-233","Weight":"0"},{"ServerId":"vm-234","Weight":"0"}]

The list of backend servers to be added.

Note Only backend servers (ECS instances) in running status can be added. You can add up to 20 backend servers at a time.
LoadBalancerId String Yes lb-bp1qjwo61pqz3ahltv0mw

The ID of the SLB instance

RegionId String Yes cn-hangzhou

The ID of the region to which the SLB instance belongs

Response parameters

Name Type Example value Description
LoadBalancerId String 139a00604ad-cn-east-hangzhou-01

The ID of the SLB instance


A list of backend servers

  └ServerId String vm-234

The ID of the ECS instance

  └Weight String 100

The weight of the backend server

  └Description String Backend server

A description of the backend server

  └Type String ecs

The backend server type. Valid values:

  • ecs: ECS instance (default)
  • eni: Elastic Network Interface (ENI)
RequestId String 365F4154-92F6-4AE4-92F8-7FF34B540710

The ID of the request


Request example

/? Action=SetBackendServers

Normal response examples

XML format


JSON format


Error response example

JSON format

	"Message":"The specified parameter is not valid.",

Error codes

Click here to view the error codes.