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

Querying Load Balancers

Function

This API is used to query all load balancers.

Constraints

This API has the following 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.

Calling Method

For details, see Calling APIs.

URI

GET /v3/{project_id}/elb/loadbalancers

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

This parameter has the same meaning as eips.

Minimum: 1

Maximum: 255

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

marker

No

String

Specifies the ID of the last record on the previous page.

Note:

  • This parameter must be used together with limit.

  • If this parameter is not specified, the first page will be queried.

  • This parameter cannot be left blank or set to an invalid ID.

limit

No

Integer

Specifies the number of records on each page.

Minimum: 0

Maximum: 2000

Default: 2000

page_reverse

No

Boolean

Specifies whether to use reverse query. Values:

  • true: Query the previous page.

  • false (default): Query the next page.

Note:

  • This parameter must be used together with limit.

  • If page_reverse is set to true and you want to query the previous page, set the value of marker to the value of previous_marker.

id

No

Array

Specifies the load balancer ID.

Multiple IDs can be queried in the format of id=xxx&id=xxx.

name

No

Array

Specifies the load balancer name.

Multiple names can be queried in the format of name=xxx&name=xxx.

description

No

Array

Provides supplementary information about the load balancer.

Multiple descriptions can be queried in the format of description=xxx&description=xxx.

admin_state_up

No

Boolean

Specifies the administrative status of the load balancer.

This parameter is unsupported. Please do not use it.

provisioning_status

No

Array

Specifies the provisioning status of the load balancer.

  • ACTIVE: The load balancer is successfully provisioned.

  • PENDING_DELETE: The load balancer is being deleted.

Multiple provisioning statuses can be queried in the format of provisioning_status=xxx&provisioning_status=xxx.

operating_status

No

Array

Specifies the operating status of the load balancer.

  • ONLINE: The load balancer is working normally.

  • FROZEN: The load balancer has been frozen.

Multiple operating statuses can be queried in the format of operating_status=xxx&operating_status=xxx.

guaranteed

No

Boolean

Specifies whether the load balancer is a dedicated load balancer.

  • false: The load balancer is a shared load balancer.

  • true: The load balancer is a dedicated load balancer.

vpc_id

No

Array

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

Multiple IDs can be queried in the format of vpc_id=xxx&vpc_id=xxx.

vip_port_id

No

Array

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

Multiple IDs can be queried in the format of vip_port_id=xxx&vip_port_id=xxx.

vip_address

No

Array

Specifies the virtual IP address bound to the load balancer.

Multiple virtual IP addresses can be queried in the format of vip_address=xxx&vip_address=xxx.

vip_subnet_cidr_id

No

Array

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

Multiple IDs can be queried in the format of vip_subnet_cidr_id=xxx&vip_subnet_cidr_id=xxx.

ipv6_vip_port_id

No

Array

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

Multiple ports can be queried in the format of ipv6_vip_port_id=xxx&ipv6_vip_port_id=xxx.

ipv6_vip_address

No

Array

Specifies the IPv6 address bound to the load balancer.

Multiple IPv6 addresses can be queried in the format of ipv6_vip_address=xxx&ipv6_vip_address=xxx.

ipv6_vip_virsubnet_id

No

Array

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

Multiple IDs can be queried in the format of ipv6_vip_virsubnet_id=xxx&ipv6_vip_virsubnet_id=xxx.

eips

No

Array

Specifies the IPv4 EIP bound to the load balancer. The following is an example: "eips": [ { "eip_id": "e9b72a9d-4275-455e-a724-853504e4d9c6", "eip_address": "88.88.14.122", "ip_version": 4 } ]

Multiple EIPs can be queried.

  • If eip_id is used as the query condition, the format is eips=eip_id=xxx&eips=eip_id=xxx.

  • If eip_address is used as the query condition, the format is eips=eip_address=xxx&eips=eip_address=xxx.

  • If ip_version is used as the query condition, the format is eips=ip_version=xxx&eips=ip_version=xxx.

Note that this parameter has the same meaning as publicips.

publicips

No

Array

Specifies the IPv4 EIP bound to the load balancer. The following is an example: "publicips": [ { "publicip_id": "e9b72a9d-4275-455e-a724-853504e4d9c6", "publicip_address": "88.88.14.122", "ip_version": 4 } ]

Multiple EIPs can be queried.

  • If publicip_id is used as the query condition, the format is publicips=publicip_id=xxx&publicips=publicip_id=xxx.

  • If publicip_address is used as the query condition, the format is *publicips=publicip_address=xxx&publicips=publicip_address=xxx.

  • If publicip_address is used as the query condition, the format is publicips=ip_version=xxx&publicips=ip_version=xxx.

Note that this parameter has the same meaning as eips.

availability_zone_list

No

Array

Specifies the list of AZs where the load balancer is created.

Multiple AZs can be queried in the format of availability_zone_list=xxx&availability_zone_list=xxx.

l4_flavor_id

No

Array

Specifies the ID of a flavor at Layer 4.

Multiple IDs can be queried in the format of l4_flavor_id=xxx&l4_flavor_id=xxx.

This parameter is unsupported. Please do not use it.

l4_scale_flavor_id

No

Array

Specifies the ID of the elastic flavor at Layer 4, which is reserved for now.

Multiple flavors can be queried in the format of l4_scale_flavor_id=xxx&l4_scale_flavor_id=xxx.

This parameter is unsupported. Please do not use it.

l7_flavor_id

No

Array

Specifies the ID of a flavor at Layer 7.

Multiple flavors can be queried in the format of l7_flavor_id=xxx&l7_flavor_id=xxx.

This parameter is unsupported. Please do not use it.

l7_scale_flavor_id

No

Array

Specifies the ID of the elastic flavor at Layer 7. Multiple flavors can be queried in the format of l7_scale_flavor_id=xxx&l7_scale_flavor_id=xxx. This parameter is unsupported. Please do not use it.

member_device_id

No

Array

Specifies the ID of the cloud server that is associated with the load balancer as a backend server. This is a query parameter and will not be included in the response.

Multiple IDs can be queried in the format of member_device_id=xxx&member_device_id=xxx.

member_address

No

Array

Specifies the private IP address of the cloud server that is associated with the load balancer as a backend server. This is a query parameter and will not be included in the response.

Multiple private IP addresses can be queried in the format of member_address=xxx&member_address=xxx.

enterprise_project_id

No

Array

Specifies the enterprise project ID.

  • If this parameter is not passed, resources in the default enterprise project are queried, and authentication is performed based on the default enterprise project.

  • If this parameter is passed, its value can be the ID of an existing enterprise project (resources in the specific enterprise project are required) or all_granted_eps (resources in all enterprise projects are queried).

Multiple IDs can be queried in the format of enterprise_project_id=xxx&enterprise_project_id=xxx.

ip_version

No

Array

Specifies the IP version. The value can be 4 (IPv4) or 6 (IPv6).

Multiple versions can be queried in the format of ip_version=xxx&ip_version=xxx.

deletion_protection_enable

No

Boolean

Specifies whether to enable deletion protection.

  • true: Enable deletion protection.

  • false: Disable deletion protection.

elb_virsubnet_type

No

Array

Specifies the type of the subnet on the downstream plane.

  • ipv4: IPv4 subnet

  • dualstack: subnet that supports IPv4/IPv6 dual stack

Multiple values query can be queried in the format of elb_virsubnet_type=ipv4&elb_virsubnet_type=dualstack.

autoscaling

No

Array

Specifies whether to enable elastic scaling. Example: "autoscaling": { "enable": "true" }

Multiple values query can be queried in the format of autoscaling=enable=true&autoscaling=enable=false.

This parameter is unsupported. Please do not use it.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

Specifies the token used for IAM authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

loadbalancers

Array of LoadBalancer objects

Lists the load balancers.

page_info

PageInfo object

Shows pagination information about load balancers.

request_id

String

Specifies the request ID. The value is automatically generated.

Table 5 LoadBalancer

Parameter

Type

Description

id

String

Specifies the load balancer ID.

description

String

Provides supplementary information about the load balancer.

Minimum: 1

Maximum: 255

provisioning_status

String

Specifies the provisioning status of the load balancer. The value can be one of the following:

  • ACTIVE: The load balancer is successfully provisioned.

  • PENDING_DELETE: The load balancer is being deleted.

admin_state_up

Boolean

Specifies the administrative status of the load balancer. The value can be true or false. true indicates the load balancer is enabled and false indicates the load balancer is disabled.

provider

String

Specifies the provider of the load balancer. The value can only be vlb.

pools

Array of PoolRef objects

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

listeners

Array of ListenerRef objects

Lists the IDs of listeners added to the load balancer.

operating_status

String

Specifies the operating status of the load balancer. The value can only be ONLINE, indicating that the load balancer is running normally.

name

String

Specifies the load balancer name.

project_id

String

Specifies the project ID of the load balancer.

vip_subnet_cidr_id

String

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

vip_address

String

Specifies the private IPv4 address bound to the load balancer.

vip_port_id

String

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

tags

Array of Tag objects

Lists the tags added to the load balancer.

created_at

String

Specifies the time when the load balancer was created, in the format of yyyy-MM-dd''T''HH:mm:ss''Z''.

updated_at

String

Specifies the time when the load balancer was updated, in the format of yyyy-MM-dd''T''HH:mm:ss''Z''.

guaranteed

Boolean

Specifies whether the load balancer is a dedicated load balancer.

  • true (default): The load balancer is a dedicated load balancer.

  • false: The load balancer is a shared load balancer.

vpc_id

String

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

eips

Array of EipInfo objects

Specifies the EIP bound to the load balancer. Only one EIP can be bound to a load balancer.

This parameter has the same meaning as publicips.

ipv6_vip_address

String

Specifies the IPv6 address bound to the load balancer.

ipv6_vip_virsubnet_id

String

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

ipv6_vip_port_id

String

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

availability_zone_list

Array of strings

Specifies the list of AZs where the load balancer is created.

enterprise_project_id

String

Specifies the enterprise project ID.

If this parameter is not passed during resource creation, "0" will be returned, and the resource belongs to the default enterprise project.

"0" is not a valid enterprise project ID and cannot be used in the APIs for creating, updating the load balancer, or querying details of the load balancer.

billing_info

String

Provides resource billing information.

  • If the value is left blank, the resource is billed in pay-per-use mode.

  • If the value is not left blank, the resource is billed on a yearly/monthly basis. The value is in the format of order_id:product_id:region_id:project_id, for example, CS2107161019CDJZZ:OFFI569702121789763584:az1:057ef081eb00d2732fd1c01a9be75e6f. This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 1024

l4_flavor_id

String

Specifies the ID of a flavor at Layer 4. If autoscaling.enable is set to true, this parameter indicates the ID of the maximum flavor.

If l4 is specified, you will charged by the specifications you select.

If L4_elastic_max is specified, you will charged by how many LCUs you use. All load balancers share underlying resources. This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 255

l4_scale_flavor_id

String

Specifies the ID of the reserved flavor at Layer 4.

This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 255

l7_flavor_id

String

Specifies the ID of a flavor at Layer 7. If autoscaling.enable is set to true, this parameter indicates the ID of the maximum flavor.

If l7 is specified, you will charged by the specifications you select.

If L7_elastic_max is specified, you will charged by how many LCUs you use. All load balancers share underlying resources. This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 255

l7_scale_flavor_id

String

Specifies the ID of the reserved flavor at Layer 7.

This parameter is unsupported. Please do not use it.

Minimum: 1

Maximum: 255

publicips

Array of PublicIpInfo objects

Specifies the EIP bound to the load balancer. Only one EIP can be bound to a load balancer.

This parameter has the same meaning as eips.

global_eips

Array of GlobalEipInfo objects

Specifies the global EIP bound to the load balancer. Only the first global EIP specified under global_eips will be bound.

elb_virsubnet_ids

Array of strings

Lists the IDs of subnets on the downstream plane.

elb_virsubnet_type

String

Specifies the type of the subnet on the downstream plane.

  • ipv4: IPv4 subnet

  • dualstack: subnet that supports IPv4/IPv6 dual stack

ip_target_enable

Boolean

Specifies whether to enable IP as a backend. The value can be true (enable IP as a backend) or false (disable IP as a backend). This function cannot be disabled after it is enabled.

If you enable this function, you can add servers in a VPC connected through a VPC peering connection, in a VPC connected through a cloud connection, or in an on-premises data center at the other end of a Direct Connect or VPN connection, by using their IP addresses.

If you enable this function for a dedicated load balancer deployed in a shared VPC, ensure that a VPC peering connection has been created.

This function is available only for dedicated load balancers.

frozen_scene

String

Specifies the scenario where the load balancer is frozen. Multiple values are separated using commas (,).

This parameter is unsupported. Please do not use it.

ipv6_bandwidth

BandwidthRef object

Specifies the ID of the bandwidth used by an IPv6 address. This parameter is available only when you create or update a load balancer with a public IPv6 address. If you use a new IPv6 address and specify a shared bandwidth, the IPv6 address will be added to the shared bandwidth.

deletion_protection_enable

Boolean

Specifies whether to enable deletion protection for the load balancer.

  • true: Enable deletion protection.

  • false (default): Disable deletion protection.

NOTE:

Disable deletion protection for all your resources before deleting your account.

autoscaling

AutoscalingRef object

Specifies information about elastic scaling. If elastic scaling is enabled, the load balancer specifications can be automatically adjusted based on incoming traffic.

Note:

  • This parameter is only available for users on the whitelist.

  • If elastic scaling is enabled, l4_flavor_id indicates the maximum Layer-4 flavor for elastic scaling. l7_flavor_id indicates the maximum Layer-7 flavor for elastic scaling.

This parameter is unsupported. Please do not use it.

public_border_group

String

Specifies the AZ group to which the load balancer belongs.

charge_mode

String

Specifies the billing mode. The value can be one of the following:

  • flavor: billed by the specifications you will select

  • lcu: billed by LCU usage

waf_failure_action

String

Specifies traffic distributing policies when the WAF is faulty.

  • discard: Traffic will not be distributed.

  • forward: Traffic will be distributed to the default backend servers.

Note: This parameter takes effect only when WAF is enabled for the load balancer.

This parameter is unsupported. Please do not use it.

log_group_id

String

Specifies the ID of the log group that is associated with the load balancer.

log_topic_id

String

Specifies the ID of the log topic that is associated with the load balancer.

Table 6 PoolRef

Parameter

Type

Description

id

String

Specifies the ID of the backend server group.

Table 7 ListenerRef

Parameter

Type

Description

id

String

Specifies the listener ID.

Table 8 Tag

Parameter

Type

Description

key

String

Specifies the tag key.

Minimum: 1

Maximum: 36

value

String

Specifies the tag value.

Minimum: 0

Maximum: 43

Table 9 EipInfo

Parameter

Type

Description

eip_id

String

eip_id

eip_address

String

eip_address

ip_version

Integer

Specifies the IP version. 4 indicates IPv4, and 6 indicates IPv6.

Table 10 PublicIpInfo

Parameter

Type

Description

publicip_id

String

Specifies the EIP ID.

publicip_address

String

Specifies the IP address.

ip_version

Integer

Specifies the IP version. The value can be 4 (IPv4) or 6 (IPv6).

Table 11 GlobalEipInfo

Parameter

Type

Description

global_eip_id

String

Specifies the ID of the global EIP.

global_eip_address

String

Specifies the global EIP.

ip_version

Integer

Specifies the IP version. The value can be 4 and 6. 4 indicates an IPv4 address, and 6 indicates an IPv6 address.

Table 12 BandwidthRef

Parameter

Type

Description

id

String

Specifies the shared bandwidth ID.

Table 13 AutoscalingRef

Parameter

Type

Description

enable

Boolean

Specifies whether to enable elastic scaling for the load balancer.

  • true: Enable elastic scaling.

  • false (default): Disable elastic scaling.

min_l7_flavor_id

String

Specifies the ID of the minimum Layer-7 flavor for elastic scaling. This parameter cannot be left blank if there are HTTP or HTTPS listeners.

This parameter has been discarded but still can be passed for compatibility reasons. If you specify this parameter, you will be charged for the minimum Layer-7 flavor

Minimum: 1

Maximum: 36

Table 14 PageInfo

Parameter

Type

Description

previous_marker

String

Specifies the ID of the first record in the pagination query result.

next_marker

String

Specifies the ID of the last record in the pagination query result.

current_count

Integer

Specifies the number of records.

Example Requests

  • Querying load balancers on each page

    GET https://{ELB_Endpoint}/v3/b2782e6708b8475c993e6064bc456bf8/elb/loadbalancers?limit=2&marker=87627cb6-9ff1-4580-984f-cc564fa9fc34
  • Querying load balancers using multiple IDs

    GET https://{ELB_Endpoint}/v3/b2782e6708b8475c993e6064bc456bf8/elb/loadbalancers?id=87627cb6-9ff1-4580-984f-cc564fa9fc34&id=09e86f09-03fc-440e-8132-03f3e149e979

Example Responses

Status code: 200

Successful request.

{
  "request_id" : "46b7d911-cece-408c-a2cc-55c78ab025d8",
  "loadbalancers" : [ {
    "id" : "65672f7e-2024-4c39-9198-98249da479c5",
    "project_id" : "057ef081eb00d2732fd1c01a9be75e6f",
    "name" : "dxq_2021_07_26_11_12_37",
    "description" : "",
    "vip_port_id" : "b289f890-a6fa-4405-a9cc-fe62b8a3bed0",
    "vip_address" : "172.16.0.152",
    "admin_state_up" : true,
    "provisioning_status" : "ACTIVE",
    "operating_status" : "ONLINE",
    "listeners" : [ {
      "id" : "dc9572eb-a5b2-47b3-a982-44892d833892"
    } ],
    "pools" : [ {
      "id" : "dc6b01c4-f704-4427-a4c2-21cd5f58d177"
    } ],
    "tags" : [ ],
    "provider" : "vlb",
    "created_at" : "2021-07-26T03:12:37Z",
    "updated_at" : "2021-07-26T03:12:37Z",
    "vpc_id" : "6e0ee31f-7a46-4530-b32f-ce41f30959d4",
    "enterprise_project_id" : "0",
    "availability_zone_list" : [ "az1" ],
    "ipv6_vip_address" : "2001:db8:a583:4cb:d6b8:f8b4:4211:fe72",
    "ipv6_vip_virsubnet_id" : "0b9e3c5e-3ec8-46b3-bab9-80b1450e59ee",
    "ipv6_vip_port_id" : "5186bb47-24e5-4171-b795-62d22846db9b",
    "publicips" : [ ],
    "elb_virsubnet_ids" : [ "0b9e3c5e-3ec8-46b3-bab9-80b1450e59ee" ],
    "elb_virsubnet_type" : "dualstack",
    "ip_target_enable" : false,
    "autoscaling" : {
      "enable" : false,
      "min_l7_flavor_id" : ""
    },
    "frozen_scene" : null,
    "eips" : [ ],
    "guaranteed" : true,
    "billing_info" : null,
    "l4_flavor_id" : "aa06b26b-9ff9-43c6-92b9-41e0f746bca6",
    "l4_scale_flavor_id" : null,
    "l7_flavor_id" : "e2a5675c-a181-444e-b9a5-17b052dc7fb9",
    "l7_scale_flavor_id" : null,
    "vip_subnet_cidr_id" : "96e52038-7983-462f-8a96-415d8a280b13",
    "public_border_group" : "center",
    "log_topic_id" : null,
    "log_group_id" : null
  }, {
    "id" : "cce5318e-c79a-4f68-94a2-9fb285c6efbe",
    "project_id" : "057ef081eb00d2732fd1c01a9be75e6f",
    "name" : "elb-reset",
    "description" : "",
    "vip_port_id" : null,
    "vip_address" : null,
    "admin_state_up" : true,
    "provisioning_status" : "ACTIVE",
    "operating_status" : "ONLINE",
    "listeners" : [ {
      "id" : "0ae21c37-8b90-4e73-8a35-eedde6d2538c"
    } ],
    "pools" : [ {
      "id" : "904ecca6-8ebb-4974-9c5c-61d1d66fba17"
    } ],
    "tags" : [ ],
    "provider" : "vlb",
    "created_at" : "2021-07-26T02:46:31Z",
    "updated_at" : "2021-07-26T02:46:59Z",
    "vpc_id" : "59cb11ef-f185-49ba-92af-0539e8ff9734",
    "enterprise_project_id" : "0",
    "availability_zone_list" : [ "az1" ],
    "ipv6_vip_address" : null,
    "ipv6_vip_virsubnet_id" : null,
    "ipv6_vip_port_id" : null,
    "publicips" : [ {
      "publicip_id" : "0c07e04d-e2f9-41ad-b934-f58a65b6734d",
      "publicip_address" : "97.97.2.171",
      "ip_version" : 4
    } ],
    "elb_virsubnet_ids" : [ "7f817f9c-8731-4002-9e47-18cb8d431787" ],
    "elb_virsubnet_type" : "dualstack",
    "ip_target_enable" : false,
    "autoscaling" : {
      "enable" : false,
      "min_l7_flavor_id" : ""
    },
    "frozen_scene" : null,
    "eips" : [ {
      "eip_id" : "0c07e04d-e2f9-41ad-b934-f58a65b6734d",
      "eip_address" : "97.97.2.171",
      "ip_version" : 4
    } ],
    "guaranteed" : true,
    "billing_info" : null,
    "l4_flavor_id" : "636ba721-935a-4ca5-a685-8076ce0e4148",
    "l4_scale_flavor_id" : null,
    "l7_flavor_id" : null,
    "l7_scale_flavor_id" : null,
    "vip_subnet_cidr_id" : null,
    "public_border_group" : "center",
    "log_topic_id" : null,
    "log_group_id" : null
  } ],
  "page_info" : {
    "next_marker" : "cce5318e-c79a-4f68-94a2-9fb285c6efbe",
    "previous_marker" : "65672f7e-2024-4c39-9198-98249da479c5",
    "current_count" : 2
  }
}

Status Codes

Status Code

Description

200

Successful request.

Error Codes

See Error Codes.