• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. API Reference
  4. Enhanced Load Balancer APIs
  5. Load Balancer
  6. Querying Load Balancers

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.

URI

GET /v2.0/lbaas/loadbalancers

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.

Request

Table 1 Parameter description

Parameter

Type

Mandatory

Description

marker

String

No

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

This parameter must be used together with limit.

limit

Int

No

Specifies the number of listeners on each page.

The value ranges from 0 to intmax.

page_reverse

Bool

No

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

String (255)

No

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

id

Uuid

No

Specifies the load balancer ID.

description

String (255)

No

Provides supplementary information about the load balancer.

name

String (255)

No

Specifies the load balancer name.

operating_status

String

No

Specifies the operating status of the load balancer.

The value can be ONLINE, OFFLINE, DEGRADED, DISABLED, or NO_MONITOR.
NOTE:

This parameter is reserved and has been not used.

provisioning_status

String

No

Specifies the provisioning status of the load balancer.

The value can be ACTIVE, PENDING_CREATE, or ERROR.
NOTE:

This parameter is reserved and has been not used.

vip_address

String (64)

No

Specifies the IP address of the load balancer.

vip_port_id

Uuid

No

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

vip_subnet_id

Uuid

No

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

member_address

Uuid

No

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

member_device_id

Uuid

No

Specifies the ID of the backend server associated with the load balancer.

vpc_id

Uuid

No

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

Response

Table 2 Parameter description

Parameter

Type

Description

loadbalancers

List

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

Table 3 loadbalancers field description

Parameter

Type

Description

id

Uuid

Specifies the load balancer ID.

tenant_id

String (255)

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

name

String (255)

Specifies the load balancer name.

description

String (255)

Provides supplementary information about the load balancer.

vip_subnet_id

Uuid

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

vip_port_id

Uuid

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

provider

String

Specifies the provider name for the load balancer.

vip_address

String (64)

Specifies the IP address of the load balancer.

listeners

List

Lists the IDs of listeners added to the load balancer.

pools

List

Lists the IDs of backend server groups associated with the load balancer.

operating_status

String (16)

  • Specifies the operating status of the load balancer.
  • The value can be ONLINE, OFFLINE, DEGRADED, DISABLED, or NO_MONITOR.
  • This parameter is reserved and has been not used. The default value is ONLINE.

provisioning_status

String (16)

  • Specifies the provisioning status of the load balancer.
  • The value can be ACTIVE, PENDING_CREATE, or ERROR.
  • This parameter is reserved and has been not used. The default value is ACTIVE.

admin_state_up

Bool

  • Specifies the administrative status of the load balancer.
  • This parameter is reserved and has been not used. The default value is true.

tags

List

Lists load balancer tags.

created_at

String (19)

Specifies the time when the load balancer was created.

The time is in YYYY-MM-DDTHH:MM:SS format.

updated_at

String (19)

Specifies the time when the load balancer was updated.

The time is in YYYY-MM-DDTHH:MM:SS format.

loadbalancers_links

List

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 4.

Table 4 loadbalancers_links field description

Parameter

Type

Description

href

String

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

rel

String (255)

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

  • Example request 1: Querying all load balancers
    GET https://{Endpoint}/v2.0/lbaas/loadbalancers
  • 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 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 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 request 3: Filtering 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.1918
  • 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"
    
            }
        ]
    }

Response Codes

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