Adds backend servers to a listener.

Note If two or more same ECS instances are added in a request, only the first ECS instance is added.

Debug

Use OpenAPI Explorer to perform debug operations and generate SDK code examples.

Request parameters

Parameter Type Required? Example value Description
Action String Yes AddBackendServers

The name of this action.

Value: AddBackendServers

BackendServers String Yes [{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.11.1", "Description":"test-112" }, { "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.11.2", "Description":"test-112" }]

The list of backend servers to be added.

The list must contain the following parameters:

  • ServerId: the ID of the ECS instance.
  • Weight: the weight of the backend server. Value range: 0 to 100. Default value: 100. If the weight value of a backend server is 0, no request is distributed to this server.
  • Description: the description of the backend server. This parameter is optional and of the string type. The description must be 1 to 80 characters in length and can contain letters, numbers, hyphens (-), forward slashes (/), periods (.), and underscores (_).
  • Type: the type of the backend server. Valid values:
    • ecs: ECS instance (default)
    • eni: Elastic Network Interface (ENI)
Note
  • Only backend servers (ECS instances) in the running state can be added. You can add up to 20 backend servers at a time.
  • ENI-type backend servers are supported only by guaranteed-performance instances.
LoadBalancerId String Yes lb-2ze7o5h52g02kkzz******

The ID of the SLB instance.

RegionId String Yes cn-beijing

The ID of the region to which the SLB instance belongs.

To query the region ID, call DescribeRegions.

Response parameters

Parameter Type Example value Description
LoadBalancerId String lb-2ze7o5h52g02kkzz****

The ID of the SLB instance.

BackendServers

The list of backend servers.

BackendServer

The details of the backend server.

ServerId String i-2zej4lxhjoq1icu*****

The ECS instance ID or ENI instance ID.

Weight String 100

The weight of the backend server.

Value range: 0 to 100

Default value: 100. If the value is set to 0, no requests are forwarded to the backend server.

Description String Backend server

The description of the backend server.

Type String ecs

The type of the backend server.

  • ecs: ECS instance (Default)
  • eni: Elastic Network Interface (ENI)
RequestId String 34B82C81-F13B-4EEB-99F6-A048C67CC830

The ID of the request.

Examples

Request example


http(s)://[Endpoint]/? Action=AddBackendServers
&LoadBalancerId=lb-2ze7o5h52g02kkzz******
&<CommonParameters>

Response example

XML format

<AddBackendServersResponse>
    <BackendServers>
        <BackendServer>
            <ServerId>i-2zej4lxhjoq1icu*****</ServerId>
            <Weight>100</Weight>
            <Type>ecs</Type>
        </BackendServer>
        <BackendServer>
            <ServerId>i-2ze1u9ywulp5pbv*****</ServerId>
            <Weight>100</Weight>
            <Type>ecs</Type>
        </BackendServer>
    </BackendServers>
    <RequestId>34B82C81-F13B-4EEB-99F6-A048C67CC830</RequestId>
    <LoadBalancerId>lb-2ze7o5h52g02kkzz*****</LoadBalancerId>
</AddBackendServersResponse>

JSON format

{
	"BackendServers":{
		"BackendServer":[
			{
				"ServerId":"i-2zej4lxhjoq1icue****",
				"Weight":100,
				"Type":"ecs"
			},
			{
				"ServerId":"i-2ze1u9ywulp5pbvv****",
				"Weight":100,
				"Type":"ecs"
			}
		]
	},
	"RequestId":"34B82C81-F13B-4EEB-99F6-A048C67CC830",
	"LoadBalancerId":"lb-2ze7o5h52g02kkzze****"
}

Errors

HTTP status code Error code Error message Description
400 InvalidParameter The specified load balancer does not support the network type of the ECS instance. SLB instances do not support ECS instances of the specified network type. Please change the ECS network type and try again.

For a list of error codes, visit the API Error Center.