• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. API Reference
  4. Native APIs (OpenStack Neutron)
  5. Load Balancer
  6. Creating a Load Balancer

Creating a Load Balancer

Function

This API is used to create a load balancer.

URI

POST /v2.0/lbaas/loadbalancers

Restrictions

  • The backend server and VIP associated with the same load balancer must be in the same router.
  • Creating a load balancer using specified flavors is not supported.
  • The value of admin_state_up must be true.
  • The value of provider must be vlb.
  • The value of vip_subnet_id must be one of an internal network.

Request

  • Request parameters
    Table 1 Parameter description

    Parameter

    Type

    Mandatory

    Description

    loadbalancer

    Dict

    Yes

    Specifies the load balancer.

    Table 2 loadbalancer field description

    Parameter

    Type

    Mandatory

    Description

    name

    String (255)

    No

    Specifies the load balancer name.

    description

    String (255)

    No

    Provides supplementary information about the load balancer.

    tenant_id

    String (255)

    No

    Specifies the project ID.

    vip_subnet_id

    uuid-str

    Yes

    • Specifies the ID of the subnet from which the virtual IP address is assigned.
    • Only IPv4 subnets are supported.

    provider

    String

    No

    • Specifies the provider.
    • The value can only be vlb.

    vip_address

    String (64)

    No

    Specifies the virtual IP address.

    admin_state_up

    Bool

    No

    • Specifies the administrative status.
    • This value can only be true.
  • Example request
    POST /v2.0/lbaas/loadbalancers
    {
        "loadbalancer": {
            "name": "loadbalancer1",
            "description": "simple lb",
            "tenant_id": "1867112d054b427e808cc6096d8193a1",
            "vip_subnet_id": "58077bdb-d470-424b-8c45-2e3c65060a5b",
            "vip_address": "10.0.0.4",
            "admin_state_up": true
        }
    }

Response

  • Response parameters
    Table 3 Parameter description

    Parameter

    Type

    Description

    loadbalancer

    Dict

    Specifies the load balancer.

    Table 4 loadbalancer field description

    Parameter

    Type

    Description

    id

    uuid-str

    Specifies the load balancer ID.

    tenant_id

    String (255)

    Specifies the project ID.

    name

    String (255)

    Specifies the load balancer name.

    description

    String (255)

    Provides supplementary information about the load balancer.

    vip_subnet_id

    uuid-str

    • Specifies the ID of the subnet from which the virtual IP address is assigned.
    • This parameter is valid only when the load balancer is a private network load balancer.

    vip_port_id

    uuid-str

    Specifies the ID of the port with which the virtual IP address is associated.

    provider

    String

    • Specifies the provider.
    • The value can only be vlb.

    vip_address

    String (64)

    Specifies the virtual IP address.

    listeners

    uuid-list

    Lists the associated listeners.

    pools

    uuid-list

    Lists the associated backend server groups.

    provisioning_status

    String (16)

    Specifies the provisioning status. The value can be ACTIVEPENDING_CREATE, or ERROR.

    operating_status

    String (16)

    Specifies the operating status. The value can be ONLINEOFFLINEDEGRADEDDISABLED, or NO_MONITOR.

    admin_state_up

    Bool

    • Specifies the administrative status.
    • This value can only be true.

    flavor_id

    String (255)

    • Specifies the flavor ID.
    • This parameter is unavailable now.
  • Example response
    {
        "loadbalancer": {
            "description": "",
            "admin_state_up": true,
            "tenant_id": "1867112d054b427e808cc6096d8193a1",
            "provisioning_status": "ACTIVE",
            "vip_subnet_id": "58077bdb-d470-424b-8c45-2e3c65060a5b",
            "listeners": [],
            "vip_address": "10.0.0.4",
            "vip_port_id": "519f6af5-74aa-4347-9dba-84c440192877",
            "provider": "vlb",
            "pools": [],
            "id": "b0657373-0c68-41d1-980f-1a44d9e3ff01",
            "operating_status": "ONLINE",
            "name": "loadbalancer1"
             
            
        }
    }

Return Codes

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