Updated on 2022-08-15 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.

URI

GET /v2/{project_id}/elb/loadbalancers

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

marker

No

String

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

No

Integer

Specifies the number of listeners on each page. If this parameter is not set, all load balancers are queried by default.

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.

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

Specifies the administrative status of the load balancer.

This parameter is reserved, and the default value is true.

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 subnet where the load balancer resides.

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

enterprise_project_id

No

String

Specifies the enterprise project ID.

  • If enterprise_project_id is not passed, resources in all enterprise projects are queried by default. Fine-grained authorization is performed. The elb:loadbalancers:list permissions must be assigned to the user group.
  • If enterprise_project_id is passed, the value can be a specific enterprise project ID or all_granted_eps. If the value is a specific enterprise project ID, only resources in the enterprise project are queried. If the value is all_granted_eps, resources in the enterprise projects with the elb:loadbalancers:list permissions are queried.

Request

None

Response

Table 3 Response parameters

Parameter

Type

Description

loadbalancers

Array of Loadbalancers objects

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

Table 4 loadbalancer parameter description

Parameter

Type

Description

id

String

Specifies the load balancer ID.

tenant_id

String

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

The value contains a maximum of 255 characters.

name

String

Specifies the load balancer name.

The value contains a maximum of 255 characters.

description

String

Provides supplementary information about the load balancer.

The value contains a maximum of 255 characters.

vip_subnet_id

String

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

vip_port_id

String

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

provider

String

Specifies the provider of the load balancer.

vip_address

String

Specifies the private IP address of the load balancer.

The value contains a maximum of 64 characters.

listeners

Array of Listeners objects

Lists the IDs of listeners added to the load balancer. For details, see Table 6.

pools

Array of Pools objects

Lists the IDs of backend server groups associated with the load balancer. For details, see Table 7.

operating_status

String

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

It specifies the operating status of the load balancer.

provisioning_status

String

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

It specifies the provisioning status of the load balancer.

admin_state_up

Boolean

Specifies the administrative status of the load balancer.

This parameter is reserved. The value can be true or false.

  • true: Enabled
  • false: Disabled

tags

Array

Lists load balancer tags.

created_at

String

Specifies the time when the load balancer was created.

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

The value contains a maximum of 19 characters.

updated_at

String

Specifies the time when the load balancer was updated.

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

The value contains a maximum of 19 characters.

enterprise_project_id

String

Specifies the enterprise project ID. When creating a load balancer, you can assign an enterprise project to the load balancer.

The value is character string 0 or a UUID with hyphens (-). Value 0 indicates the default enterprise project.

Table 5 listeners parameter description

Parameter

Type

Description

id

String

Specifies the ID of the associated listener.

Table 6 pools parameter description

Parameter

Type

Description

id

String

Specifies the ID of the associated backend server group.

Example Request

  • Example request 1
    GET https://{Endpoint}/v2/1a3e005cf9ce40308c900bcb08e5320c/elb/loadbalancers
  • Example request 2
    GET https://{Endpoint}/v2/1a3e005cf9ce40308c900bcb08e5320c/elb/loadbalancers?limit=10&marker=165b6a38-5278-4569-b747-b2ee65ea84a4
  • Example request 3
    GET https://{Endpoint}/v2/601240b9c5c94059b63d484c92cfe308/elb/loadbalancers?member_address=192.168.0.198

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",
                "enterprise_project_id ": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2" 
            }
    ]
    }
  • 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",
                "enterprise_project_id ": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2" 
            }
        ]
    
    }
  • Example response 3
    {
        "loadbalancers": [
            {
                "description": "",
                "provisioning_status": "ACTIVE",
                "tenant_id": "601240b9c5c94059b63d484c92cfe308",
      
                "admin_state_up": true,
                "provider": "vlb",
                "pools": [
                    {
                        "id": "ed75f16e-fcc6-403e-a3fb-4eae82005eab"
                    },
                    {
                        "id": "f15f2723-4135-4bf8-9259-047d92684197"
                    }
                ],
                "listeners": [
                    {
                        "id": "75045172-70e9-480d-9443-b8b6459948f7"
                    },
                    {
                        "id": "b9a99cbb-d0a1-4269-bc5f-752ec37a10c3"
                    }
                ],
                "vip_port_id": "fb3f10f0-9417-4cf2-a82e-8f1da1687484",
                "operating_status": "ONLINE",
                "vip_address": "192.168.0.16",
                "vip_subnet_id": "3a450aa4-f642-4da8-b70d-cafd4a633b51",
                "id": "bc7ba445-035a-4464-a1a3-a62cf4a14116",
                "tags": [],
                "name": "elb-hm-test",
                "created_at": "2018-07-25T01:54:13", 
                "updated_at": "2018-07-25T01:54:14",  
                "enterprise_project_id ": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2"                
            }
        ]
    }

Status Code

For details, see Status Codes.