• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. API Reference
  4. Enhanced Load Balancer APIs
  5. Member (Backend Server)
  6. Adding a Backend Server

Adding a Backend Server

Function

This API is used to add a backend server to a specific backend server group. After a backend server group is added to a listener, traffic is distributed to backend servers in this server group using the specified load balancing algorithm.

URI

POST /v2.0/lbaas/pools/{pool_id}/members

Table 1 Parameter description

Parameter

Type

Mandatory

Description

pool_id

Uuid

Yes

Specifies the backend server group ID.

Constraints

Two backend servers in the same backend server group cannot have the same private IP address and port number.

The subnet specified during server creation must be in the same VPC as the subnet from which the load balancer IP address is assigned.

Request

  • Request parameters
    Table 2 Parameter description

    Parameter

    Type

    Mandatory

    Description

    member

    Dict

    Yes

    Specifies the backend server. For details, see Table 3.

    Table 3 members field description

    Parameter

    Type

    Mandatory

    Description

    tenant_id

    String (255)

    No

    Specifies the ID of the project where the backend server is used.

    The value must be the same as the value of project_id in the token.

    name

    String (255)

    No

    Specifies the backend server name. The value is an empty character string by default.

    address

    String (64)

    Yes

    Specifies the private IP address of the backend server. This IP address must be in the subnet specified by subnet_id.

    This parameter can be set only to the IP address of the primary NIC, for example, 192.168.3.11.

    protocol_port

    Int

    Yes

    Specifies the protocol and port number of the backend server. The port number ranges from 1 to 65535.

    subnet_id

    Uuid

    Yes

    Specifies the ID of the subnet where the backend server works. The private IP address of the backend server is in this subnet.

    IPv6 subnets are not supported.

    admin_state_up

    Bool

    No

    Specifies the administrative status of the backend server. The value can be true or false.

    Currently, the value can only be true.

    NOTE:

    This field can be used during creation and update and its actual value depends on whether the backend server exists. If the backend server exists, the value is true. Otherwise, the value is false.

    weight

    Int

    No

    Specifies the weight of the backend server. The value ranges from 0 to 100.

    If the value is 0, the backend server will not accept new requests. The default value is 1.

  • Example request
    POST https://{Endpoint}/v2.0/lbaas/pools/5a9a3e9e-d1aa-448e-af37-a70171f2a332/members
    
    {
        "member": {
            "subnet_id": "33d8b01a-bbe6-41f4-bc45-78a1d284d503",
            "protocol_port": 88,
            "name": "member-jy-tt-1",
            "address": "192.168.44.11"
        }
    }

Response

  • Response parameters
    Table 4 Parameter description

    Parameter

    Type

    Description

    member

    Dict

    Backend server parameters For details, see Table 5.

    Table 5 members field description

    Parameter

    Type

    Description

    id

    Uuid

    Specifies the backend server ID.

    tenant_id

    String (255)

    Specifies the ID of the project where the backend server is used.

    name

    String (255)

    Specifies the backend server name.

    address

    String (64)

    Specifies the private IP address of the backend server. This IP address must be in the subnet specified by subnet_id.

    This parameter can be set only to the IP address of the primary NIC, for example, 192.168.3.11.

    protocol_port

    Int

    Specifies the port number of the backend server. The port number ranges from 1 to 65535.

    subnet_id

    Uuid

    Specifies the ID of the subnet where the backend server works. The private IP address of the backend server is in this subnet.

    IPv6 subnets are not supported.

    admin_state_up

    Bool

    Specifies the administrative status of the backend server. The value can be true or false.

    Currently, the value can only be true.

    NOTE:

    This field can be used during creation and update and its actual value depends on whether the backend server exists. If the backend server exists, the value is true. Otherwise, the value is false.

    weight

    Int

    Specifies the weight of the backend server. The value ranges from 0 to 100.

    If the value is 0, the backend server will not accept new requests. The default value is 1.

    operating_status

    String (16)

    Specifies the health check result of the backend server. The value can be one of the following:

    • ONLINE: The health check is successfully conducted and the backend server is running properly.
    • OFFLINE: The health check is abnormal and the backend server is running improperly. The load balancer stops distributing traffic to this server until it recovers.
    • NO_MONITOR: No health check is conducted. No health checks are configured, or the value of admin_state_up is false.
  • Example response
    {
        "member": {
            "name": "member-jy-tt-1",
            "weight": 1,
            "admin_state_up": true,
            "subnet_id": "33d8b01a-bbe6-41f4-bc45-78a1d284d503",
            "tenant_id": "145483a5107745e9b3d80f956713e6a3",
            
            "address": "192.168.44.11",
            "protocol_port": 88,
            "id": "c0042496-e220-44f6-914b-e6ca33bab503"
        }
    }

Response Codes

For details, see HTTP Status Codes for Enhanced Load Balancers.