• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. API Reference
  4. Enhanced Load Balancer APIs
  5. Pool (Backend Server Group)
  6. Querying Backend Server Groups

Querying Backend Server Groups

Function

This API is used to query all backend server groups and display them in a list. Filter query and pagination query are supported.

URI

GET /v2.0/lbaas/pools

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 backend server group from which pagination query starts, that is, the ID of the last backend server group on the previous page. If this parameter is not specified, the first page will be queried.

This parameter must be used together with limit.

limit

Int

No

Specifies the number of backend server groups 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.

id

Uuid

No

Specifies the backend server group ID.

tenant_id

String (255)

No

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

name

String (255)

No

Specifies the backend server group name.

description

String (255)

No

Provides supplementary information about the backend server group.

healthmonitor_id

Uuid

No

Specifies the ID of the health check configured for the backend server group.

loadbalancer_id

Uuid

No

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

protocol

String

No

Specifies the protocol that the backend server group uses to receive requests.

TCP, UDP, and HTTP are supported.

lb_algorithm

String

No

Specifies the load balancing algorithm of the backend server group.

The value can be one of the following:
  • ROUND_ROBIN: indicates the weighted round robin algorithm.
  • LEAST_CONNECTIONS: indicates the weighted least connection algorithm.
  • SOURCE_IP: indicates the source IP hash algorithm.

When the value is SOURCE_IP, the weights of backend servers in the server group are invalid.

member_address

Uuid

No

Lists the IDs of backend servers in the backend server group.

member_device_id

Uuid

No

Specifies the backend server ID.

Response

Table 2 Parameter description

Parameter

Type

Description

pools

List

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

Table 3 pools field description

Parameter

Type

Description

id

Uuid

Specifies the backend server group ID.

tenant_id

String (255)

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

name

String (255)

Specifies the backend server group name.

description

String (255)

Provides supplementary information about the backend server group.

protocol

String

Specifies the protocol that the backend server group uses to receive requests.

TCP, UDP, and HTTP are supported.

lb_algorithm

String

Specifies the load balancing algorithm of the backend server group.

The value can be one of the following:
  • ROUND_ROBIN: indicates the weighted round robin algorithm.
  • LEAST_CONNECTIONS: indicates the weighted least connection algorithm.
  • SOURCE_IP: indicates the source IP hash algorithm.

When the value is SOURCE_IP, the weights of backend servers in the server group are invalid.

members

List

Lists the IDs of backend servers in the backend server group.

healthmonitor_id

Uuid

Specifies the ID of the health check configured for the backend server group.

admin_state_up

Bool

Specifies the administrative status of the backend server group.

This parameter is reserved and has been not used. The default value is true.

listeners

List

Lists the IDs of listeners associated with the backend server group.

loadbalancers

Uuid

Lists the IDs of load balancers associated with the backend server group.

session_persistence

Dict

Specifies whether to enable the sticky session feature. For details, see Table 4.

Once the sticky session feature is enabled, requests from the same client are sent to the same backend server within the specified period.

When this feature is disabled, the parameter value is null.

pools_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 5.

Table 4 session_persistence field description

Parameter

Type

Description

type

String

Specifies the sticky session type.

The value can be one of the following:
  • SOURCE_IP: Requests are distributed based on the source IP address. Requests from the same IP address are sent to the same backend server.
  • HTTP_COOKIE: When the client sends a request for the first time, the load balancer automatically generates a cookie and inserts the cookie into the response message. Subsequent requests are sent to the backend server that processes the first request.
  • APP_COOKIE: When the client sends a request for the first time, the backend server generates a cookie and inserts the cookie into the response message. Subsequent requests are sent to the backend server that processes the first request.

When the protocol of the backend server group is TCP, only SOURCE_IP takes effect. When the protocol of the backend server group is HTTP, HTTP_COOKIE and APP_COOKIE take effect.

cookie_name

String

Specifies the cookie name.

This parameter is mandatory when the sticky session type is APP_COOKIE.

persistence_timeout

Int

Specifies the sticky session timeout duration.

This parameter is invalid when type is set to APP_COOKIE.

  • Optional value ranges are as follows:
    • When the protocol of the backend server is TCP or UDP, the value ranges from 1 to 60.
    • When the protocol of the backend server is HTTP, the value ranges from 1 to 1440.
Table 5 pools_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.

  • next: indicates the URL of the next page.
  • previous: indicates that the URL of the previous page.

Example

  • Example request: Querying all backend server groups
    GET  https://{Endpoint}/v2.0/lbaas/pools
  • Example response
    {
        "pools": [
            {
                "lb_algorithm": "SOURCE_IP",
                "protocol": "TCP",
                "description": "",
                "admin_state_up": true,
                "loadbalancers": [
                    {
                        "id": "07d28d4a-4899-40a3-a939-5d09d69019e1"
                    }
                ],
                "tenant_id": "1867112d054b427e808cc6096d8193a1",
                
                "session_persistence": null,
                "healthmonitor_id": null,
                "listeners": [
                    {
                        "id": "1b421c2d-7e78-4a78-9ee4-c8ccba41f15b"
                    }
                ],
                "members": [
                    {
                        "id": "88f9c079-29cb-435a-b98f-0c5c0b90c2bd"
                    },
                    {
                        "id": "2f4c9644-d5d2-4cf8-a3c0-944239a4f58c"
                    }
                ],
                "id": "3a9f50bb-f041-4eac-a117-82472d8a0007",
                "name": "my-pool"
            }
        ]
    }

Response Codes

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