Updated on 2024-04-09 GMT+08:00

Querying Load Balancers

Function

This API is used to query load balancers and display them in a list. Filter query and pagination query are supported. Unless otherwise specified, exact match is applied.

Constraints

Parameters marker, limit, and page_reverse are used for pagination query. Parameters marker and page_reverse take effect only when they are used together with parameter limit.

URI

GET /v2.0/lbaas/loadbalancers

Request

Table 1 Parameter description

Parameter

Mandatory

Type

Description

marker

No

String

Specifies the ID of the load balancer from which pagination query starts, that is, the ID of the last load balancer on the previous page.

This parameter must be used together with limit.

limit

No

Integer

Specifies the number of load balancers on each page.

page_reverse

No

Boolean

Specifies the page direction. The value can be true or false, and the default value is false. The last page in the list requested with page_reverse set to false will not contain the "next" link, and the last page in the list requested with page_reverse set to true will not contain the "previous" link.

This parameter must be used together with limit.

tenant_id

No

String

Specifies the ID of the project where the load balancer is used.

id

No

String

Specifies the load balancer ID.

description

No

String

Provides supplementary information about the load balancer.

The value contains a maximum of 255 characters.

name

No

String

Specifies the load balancer name.

The value contains a maximum of 255 characters.

operating_status

No

String

This parameter is reserved, and its value can be ONLINE or FROZEN.

It specifies the operating status of the load balancer.

provisioning_status

No

String

This parameter is reserved, and its value can only be ACTIVE.

It specifies the provisioning status of the load balancer.

admin_state_up

No

Boolean

This parameter is reserved, and its value can only be true.

It specifies the administrative status of the load balancer.

vip_address

No

String

Specifies the private IP address of the load balancer.

The value contains a maximum of 64 characters.

vip_port_id

No

String

Specifies the ID of the port bound to the private IP address of the load balancer.

vip_subnet_id

No

String

Specifies the ID of the IPv4 subnet where the load balancer works.

member_address

No

String

Specifies the IP address of the backend server associated with the load balancer.

member_device_id

No

String

Specifies the ID of the cloud server used as the backend server associated with the load balancer.

vpc_id

No

String

Specifies the ID of the VPC where the load balancer works.

Response

Table 2 Response parameters

Parameter

Type

Description

loadbalancers

Array

Lists the load balancers. For details, see Table 3.

loadbalancers_links

Array

Provides links to the previous or next page during pagination query, respectively. This parameter exists only in the response body of pagination query. For details, see Table 6.

Table 3 loadbalancer parameter description

Parameter

Mandatory

Type

Description

name

No

String

Specifies the load balancer name.

The value contains a maximum of 255 characters.

description

No

String

Provides supplementary information about the load balancer.

The value contains a maximum of 255 characters.

tenant_id

No

String

Specifies the ID of the project where the load balancer is used.

The value contains a maximum of 255 characters.

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

vip_subnet_id

Yes

String

Specifies the ID of the IPv4 subnet where the load balancer works. You can obtain the value by calling the API for querying subnets ({VPC endpoint}/v2.0/subnets) using the GET method.

The private IP address of the load balancer is in this subnet.

Only IPv4 subnets are supported. IPv6 subnets are not supported.

provider

No

String

Specifies the provider of the load balancer.

The value can only be vlb.

vip_address

No

String

Specifies the private IP address of the load balancer.

This IP address must be the one in the subnet specified by vip_subnet_id. If this parameter is not specified, an IP address is automatically assigned to the load balancer from the subnet specified by vip_subnet_id.

The value contains a maximum of 64 characters.

admin_state_up

No

Boolean

Specifies the administrative status of the load balancer.

This parameter is reserved. The default value is true.

Table 4 listeners parameter description

Parameter

Type

Description

id

String

Specifies the ID of the associated listener.

Table 5 pools parameter description

Parameter

Type

Description

id

String

Specifies the ID of the associated backend server group.

Table 6 loadbalancers_links parameter description

Parameter

Type

Description

href

String

Provides links to the previous or next page during pagination query, respectively.

rel

String

Specifies the prompt of the previous or next page.

The value can be next or previous. The value next indicates the Hypertext Reference (href) containing the URL of the next page, and previous indicates the href containing the URL of the previous page.

Example Request

  • Example request 1: Querying all load balancers
    GET https://{Endpoint}/v2.0/lbaas/loadbalancers
  • Example request 2: Querying load balancers by page (Each page contains one load balancer. The ID of the start load balancer is 165b6a38-5278-4569-b747-b2ee65ea84a4. The load balancer after 165b6a38-5278-4569-b747-b2ee65ea84a4 is the queried load balancer.)
    GET https://{Endpoint}/v2.0/lbaas/loadbalancers?limit=1&marker=165b6a38-5278-4569-b747-b2ee65ea84a4
  • Example request 3: Querying the load balancer using the IP address of a backend server (192.168.0.191)
    GET https://{Endpoint}/v2.0/lbaas/loadbalancers?member_address=192.168.0.181

Example Response

  • Example response 1
    {
        "loadbalancers": [
            {
                "description": "simple lb",
                "admin_state_up": true,
                "tenant_id": "1a3e005cf9ce40308c900bcb08e5320c",
     
                "provisioning_status": "ACTIVE",
                "vip_subnet_id": "5328f1e6-ce29-44f1-9493-b128a5653350",
                "listeners": [
                    {
                        "id": "45196943-2907-4369-87b1-c009b1d7ac35"
                    }
                ],
                "vip_address": "10.0.0.2",
                "vip_port_id": "cbced4fe-6f6f-4fd6-9348-0c3d1219d6ca",
                "provider": "vlb",
                "pools": [
                    {
                        "id": "21d49cf7-4fd3-4cb6-8c48-b7fc6c259aab"
                }
                ],
                "id": "a9729389-6147-41a3-ab22-a24aed8692b2",
                "operating_status": "ONLINE",
                "tags": [],
                "name": "loadbalancer1",
                "created_at": "2018-07-25T01:54:13", 
                "updated_at": "2018-07-25T01:54:14"
            }
        ]
    }
  • Example response 2
    {
        "loadbalancers": [
            {
                "description": "",
                "provisioning_status": "ACTIVE",
                "tenant_id": "601240b9c5c94059b63d484c92cfe308",
      
                "admin_state_up": true,
                "provider": "vlb",
                "pools": [
                    {
                        "id": "b13dba4c-a44c-4c40-8f6e-ce7a162b9f22"
                    },
                    {
                        "id": "4b9e765f-82ee-4128-911b-0a2d9ebc74c7"
                    }
                ],
                "listeners": [
                    {
                        "id": "21c41336-d0d3-4349-8641-6e82b4a4d097"
                    }
                ],
                "vip_port_id": "44ac5d9b-b0c0-4810-9a9d-c4dbf541e47e",
                "operating_status": "ONLINE",
                "vip_address": "192.168.0.234",
                "vip_subnet_id": "9d60827e-0e5c-490a-8183-0b6ebf9084ca",
                "id": "e79a7dd6-3a38-429a-95f9-c7f78b346cbe",
                "tags": [],
                "name": "elb-robot",
                "created_at": "2018-07-25T01:54:13", 
                "updated_at": "2018-07-25T01:54:14"
            }
        ],
        "loadbalancers_links": [
            {
                "href": "https://network.Region.dc1.domainname.com/v2.0/lbaas/loadbalancers?limit=10&marker=e79a7dd6-3a38-429a-95f9-c7f78b346cbe&page_reverse=True",
                  "rel": "previous"
            }
        ]
    }
  • Example response 3
    {
        "loadbalancers": [
            {
                "description": "",
                "provisioning_status": "ACTIVE",
                "tenant_id": "601240b9c5c94059b63d484c92cfe308",
     
                "created_at": "2018-11-29T13:55:20",
                "admin_state_up": true,
                "update_at": "2018-11-29T13:55:21",
                "id": "c1127125-64a9-4394-a08a-ef3be8f7ef9c",
                "pools": [
                    {
                        "id": "2f6895be-019b-4c82-9b53-c4a2ac009e20"
                    }
                ],
                "listeners": [
                    {
                        "id": "5c63d176-444f-4c75-9cfe-bcb8a05a845c"
                    }
                ],
                "vip_port_id": "434ac600-b779-4428-b7a7-830e047511f1",
                "operating_status": "ONLINE",
                "vip_address": "192.168.0.181",
                "vip_subnet_id": "9a303536-417c-45dc-a6db-1234b9e1c2b2",
                "provider": "vlb",
                "tags": [],
                "name": "elb-ftci"
    
            }
        ]
    }

Status Code

For details, see Status Codes.