You can call the ModifyVServerGroupBackendServers API to modify the backend servers in a VServer group.

Debug

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 ModifyVServerGroupBackendServers

The action to perform. Valid value: ModifyVServerGroupBackendServers

RegionId String Yes cn-hangzhou

The ID of the region to which the SLB instance belongs

VServerGroupId String Yes rsp-cige6j5e7p

The ID of the VServer group

NewBackendServers String No [{'ServerId':'vm-235','Port':'8080','Weight':'100'},{'ServerId':'vm-236','Port':'70','Weight':'100'}]

The list of new backend servers to be added.

A VServer group can contain up to 20 backend servers.

Note Make sure the number of backend servers in NewBackendServers is the same as that in OldBackendServers.
OldBackendServers String No [{'ServerId':'vm-233','Port':'80'},{'ServerId':'vm-232','Port':'90'}]

The list of backend servers to be removed

Response parameters

Name Type Example value Description
VServerGroupId String rsp-cige6j5e7p

The ID of the VServer group

BackendServers

A list of backend servers

  └ServerId String vm-236

The ECS instance ID or ENI ID

  └Port Integer 70

The port used by the backend server

  └Weight Integer 100

The weight of the backend server

  └Description String A description of the 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 9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C

The ID of the request

Examples

Request example


http(s)://[Endpoint]/? Action=ModifyVServerGroupBackendServers
&RegionId=cn-hangzhou
&VServerGroupId=rsp-cige6j5e7p
&<CommonParameters>

Normal response examples

XML format

<ModifyVServerGroupBackendServers>
  <RequestId>9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C</RequestId>
  <VServerGroupId>rsp-cige6j5e7p</VServerGroupId>
  <BackendServers>
    <BackendServer>
      <ServerId>vm-400</ServerId>
      <Port>80</Port>
      <Weight>100</Weight>
    </BackendServer>
    <BackendServer>
      <ServerId>vm-401</ServerId>
      <Port>90</Port>
      <Weight>100</Weight>
    </BackendServer>
  </BackendServers>
</ModifyVServerGroupBackendServers>

JSON format

{
	"ModifyVServerGroupBackendServersResponse":{
		"BackendServers":{
			"BackendServer":[
				{
					"ServerId":"vm-400",
					"Port":"80",
					"Weight":"100"
				},
				{
					"ServerId":"vm-401",
					"Port":"90",
					"Weight":"100"
				}
			]
		},
		"RequestId":"9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
		"VServerGroupId":"rsp-cige6j5e7p"
	}
}

Error codes

HttpCode Error code Error message Description
400 InvalidParameter The specified BackendServers contain duplicated value of ServerId and Port. The parameter Bandwidth is invalid. Please check that the parameter is correct.

Click here to view the error codes.