Modifies the configurations of a vServer group.

This operation allows you to modify only the name of a vServer group and the weights of the backend servers in the vServer group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SetVServerGroupAttribute

The operation that you want to perform.

Set the value to SetVServerGroupAttribute.

RegionId String Yes cn-hangzhou

The ID of the region where the Classic Load Balancer (CLB) instance is deployed. This parameter cannot be modified.

VServerGroupId String Yes rsp-cige6****

The ID of the vServer group. This parameter cannot be modified.

VServerGroupName String No Group1

The name of the vServer group. You can specify a custom name for the vServer group.

BackendServers String No [{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.XX.XX.6", "Port":"80","Description":"test-112" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.XX.XX.6", "Port":"80","Description":"test-113" }]

The list of backend servers in the vServer group. You can specify at most 20 backend servers for a vServer group in each call.

  • ServerId: required. The ID of the Elastic Compute Service (ECS) instance or elastic network interface (ENI) that serves as a backend server. This parameter must be of the STRING type.
  • Port: required. The port that is used by the backend server. This parameter must be of the INTEGER type. Valid values: 1 to 65535.
  • Weight: required. The weight of the backend server. This parameter must be of the INTEGER type. You can modify this parameter. Valid values: 0 to 100.
  • Description: optional. The description of the backend server. This parameter must be of the STRING type. You can modify this parameter. The description must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.),and underscores (_).
  • Type: the type of backend server. This parameter must be of the STRING type. Valid values:
    • ecs: an ECS instance. This is the default value.
    • eni: an ENI.
  • ServerIp: the IP address of the ECS instance or ENI.

Examples:

  • An ECS instance: [{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","Description":"test-112" }]
  • An ENI: [{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-112" }]
  • An ENI with multiple IP addresses: [{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-112" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.166.**.**", "Port":"80","Description":"test-113" }]

Response parameters

Parameter Type Example Description
VServerGroupId String rsp-cige6****

The ID of the vServer group.

VServerGroupName String Group1

The name of the vServer group.

BackendServers Array of BackendServer N/A

The list of backend servers.

BackendServer N/A N/A N/A
ServerId String i-bp1ek6yd7jvkx****

The ID of the ECS instance or ENI.

Port Integer 70

The port that is used by the backend server.

Weight Integer 100

The weight of the backend server.

Description String vServerGroupDescription

The description of the vServer group.

Type String ecs

The type of backend server. Valid values:

  • ecs: an ECS instance
  • eni: an ENI
RequestId String 9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=SetVServerGroupAttribute
&RegionId=cn-hangzhou
&VServerGroupId=rsp-cige6****
&<Common request parameters>

Sample success responses

XML format

<CreateLoadBalancerTCPListener>
  <VServerGroupId>rsp-cige6****</VServerGroupId>
  <RequestId>9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C</RequestId>
  <VServerGroupName>Group1</VServerGroupName>
  <BackendServers>
        <BackendServer>
              <Type>ecs</Type>
              <Description>vServerGroupDescription </Description>
              <ServerId>i-bp1ek6yd7jvkx****</ServerId>
              <Port>70</Port>
              <Weight>100</Weight>
        </BackendServer>
  </BackendServers>
</CreateLoadBalancerTCPListener>

JSON format

{
    "VServerGroupId": "rsp-cige6****",
    "RequestId": "9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
    "VServerGroupName": "Group1",
    "BackendServers": {
        "BackendServer": {
            "Type": "ecs",
            "Description": "vServerGroupDescription",
            "ServerId": "i-bp1ek6yd7jvkx****",
            "Port": 70,
            "Weight": 100
        }
    }
}

Error codes

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