Updated on 2025-09-22 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

Definition: Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID.

Constraints: N/A

Range: The value can contain a maximum of 32 characters, including digits and lowercase letters.

Default value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

marker

No

String

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

Constraints:

  • This parameter must be used together with limit.

  • If the parameter is not specified, only resources on the first page are queried.

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

Range: N/A

Default value: N/A

limit

No

Integer

Definition: Specifies the number of records returned on each page.

Constraints: N/A

Range: 0 to 2000

Default value: 2000

page_reverse

No

Boolean

Definition: Specifies whether to use reverse query.

Constraints:

  • This parameter must be used together with limit.

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

Range:

  • true: Query resources on the previous page.

  • false: Query resources on the next page.

Default value: false

id

No

Array of strings

Definition: Specifies the load balancer ID.

Multiple values can be used for query in the format of:

id=xxx&id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

name

No

Array of strings

Definition: Specifies the load balancer name.

Multiple values can be used for query in the format of:

name=xxx&name=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

description

No

Array of strings

Definition: Provides supplementary information about the load balancer.

Multiple values can be used for query in the format of:

description=xxx&description=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

admin_state_up

No

Boolean

Definition: Specifies whether the load balancer is enabled.

Constraints: N/A

Range:

  • true: enabled

  • false: disabled

Default value: N/A

include_recycle_bin

No

Boolean

Definition: Specifies whether to query the load balancers in the recycle bin.

Constraints: N/A

Range:

  • true: Load balancers in the recycle bin will be returned.

  • false: Load balancers in the recycle bin will not be returned.

Default value: N/A

provisioning_status

No

Array of strings

Definition: Specifies the provisioning status of the load balancer.

Multiple values can be used for query in the format of:

provisioning_status=xxx&provisioning_status=xxx.

Constraints: N/A

Range:

  • ACTIVE: in use

  • PENDING_DELETE: deleting

Default value: N/A

operating_status

No

Array of strings

Definition: Specifies the operating status of the load balancer.

Multiple values can be used for query in the format of:

operating_status=xxx&operating_status=xxx.

Constraints: N/A

Range:

  • ONLINE: running

  • FROZEN: frozen

Default value: N/A

guaranteed

No

Boolean

Definition: Specifies whether the load balancer is a dedicated load balancer.

Constraints: N/A

Range:

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

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

Default value: N/A

vpc_id

No

Array of strings

Definition: Specifies the ID of the VPC where the load balancer is located.

Multiple values can be used for query in the format of:

vpc_id=xxx&vpc_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

vip_port_id

No

Array of strings

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

Multiple values can be used for query in the format of:

vip_port_id=xxx&vip_port_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

vip_address

No

Array of strings

Definition: Specifies the private IPv4 address of the load balancer.

Multiple values can be used for query in the format of:

vip_address=xxx&vip_address=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

vip_subnet_cidr_id

No

Array of strings

Definition: Specifies the ID of the IPv4 subnet where the load balancer is located. This subnet is also called the frontend subnet.

Multiple values can be used for query in the format of:

vip_subnet_cidr_id=xxx&vip_subnet_cidr_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

ipv6_vip_port_id

No

Array of strings

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

Multiple values can be used for query in the format of:

ipv6_vip_port_id=xxx&ipv6_vip_port_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

ipv6_vip_address

No

Array of strings

Definition: Specifies the IPv6 address of the load balancer.

Multiple values can be used for query in the format of:

ipv6_vip_address=xxx&ipv6_vip_address=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

ipv6_vip_virsubnet_id

No

Array of strings

Definition: Specifies the ID of the IPv6 subnet where the load balancer is located. This subnet is also called the frontend subnet.

Multiple values can be used for query in the format of:

ipv6_vip_virsubnet_id=xxx&ipv6_vip_virsubnet_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

eips

No

Array of strings

Definition: Specifies the 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

}

]

If you want to query the load balancers that have the above EIP bound, you can use the following format:

eips=ip_version%3D4&eips=eip_address%3D88.88.14.122&eips=eip_id%3De9b72a9d-4275-455e-a724-853504e4d9c6

Multiple values can be used for query.

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

Constraints: N/A

Range: N/A

Default value: N/A

Note that this parameter has the same meaning as publicips.

publicips

No

Array of strings

Definition: Specifies the EIP bound to the load balancer. The following is an example:

"publicips=": [

{

"public_id": "e9b72a9d-4275-455e-a724-853504e4d9c6",

"public_address": "88.88.14.122",

"ip_version": 4

}

]

If you want to query the load balancers that have the above EIP bound, you can use the following format:

publicips=ip_version%3D4&publicips=public_address%3D88.88.14.122&publicips=public_id%3De9b72a9d-4275-455e-a724-853504e4d9c6

Multiple values can be used for query.

  • 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 ip_version is used as the query condition, the format is publicips=ip_version=xxx&publicips=ip_version=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

Note: This parameter has the same meaning as eips.

availability_zone_list

No

Array of strings

Definition: Specifies the list of AZs where the load balancers are created.

Multiple values can be used for query in the format of:

availability_zone_list=xxx&availability_zone_list=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

l4_flavor_id

No

Array of strings

Definition: Specifies the ID of a flavor at Layer 4.

Multiple values can be used for query in the format of:

l4_flavor_id=xxx&l4_flavor_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

l4_scale_flavor_id

No

Array of strings

Definition: Specifies the ID of an elastic flavor at Layer 4.

Multiple values can be used for query in the format of:

l4_scale_flavor_id=xxx&l4_scale_flavor_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

This parameter is unsupported. Please do not use it.

l7_flavor_id

No

Array of strings

Definition: Specifies the ID of a flavor at Layer 7.

Multiple values can be used for query in the format of:

l7_flavor_id=xxx&l7_flavor_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

l7_scale_flavor_id

No

Array of strings

Definition: Specifies the ID of an elastic flavor at Layer 7.

Multiple values can be used for query in the format of:

l7_scale_flavor_id=xxx&l7_scale_flavor_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

This parameter is unsupported. Please do not use it.

billing_info

No

Array of strings

Definition: Provides resource billing information.

Multiple values can be used for query in the format of:

billing_info=xxx&billing_info=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

This parameter is unsupported. Please do not use it.

member_device_id

No

Array of strings

Definition: Specifies the ID of the ECS 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 values can be used for query in the format of:

member_device_id=xxx&member_device_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

member_address

No

Array of strings

Definition: Specifies the private IP address of the ECS 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 values can be used for query in the format of:

member_address=xxx&member_address=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

enterprise_project_id

No

Array of strings

Definition: Specifies the ID of the enterprise project where the load balancer is used.

Multiple values can be used for query in the format of:

enterprise_project_id=xxx&enterprise_project_id=xxx.

Constraints:

  • If enterprise_project_id is not specified, resources in all enterprise projects are queried by default. Fine-grained authorization is performed. The elb:loadbalancers:list permission must be assigned to the user group.

  • If enterprise_project_id is specified, 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 permission are queried.

Range: N/A

Default value: N/A

ip_version

No

Array of integers

Definition: Specifies the IP address version.

Multiple values can be used for query in the format of:

ip_version=xxx&ip_version=xxx.

Constraints: N/A

Range: 4 (IPv4 addresses) or 6 (IPv6 addresses)

Default value: N/A

deletion_protection_enable

No

Boolean

Definition: Specifies whether to enable deletion protection.

Constraints: N/A

Range: false (disable this option) or true (enable this option).

Default value: N/A

elb_virsubnet_type

No

Array of strings

Definition: Specifies the type of the subnet on the downstream plane.

Multiple values can be used for query in the format of:

elb_virsubnet_type=ipv4&elb_virsubnet_type=dualstack.

Constraints: N/A

Range:

  • ipv4: IPv4 subnets

  • dualstack: subnets that support IPv4/IPv6 dual stack

Default value: N/A

autoscaling

No

Array of strings

Definition: Specifies whether to enable elastic scaling. Example:

"autoscaling": {

"enable": "true"

}

Multiple values can be used for query in the format of:

autoscaling=enable=true&autoscaling=enable=false.

Constraints: N/A

Range: N/A

Default value: N/A

protection_status

No

Array of strings

Definition: Specifies the protection status.

Constraints: N/A

Range:

  • nonProtection: The resource is not protected.

  • consoleProtection: Modification is not allowed on the console.

Default value: nonProtection

global_eips

No

Array of strings

Definition: Specifies the EIP bound to the load balancer. The following shows an example:

{

"global_eips": [

{

"global_eip_id": "24000000-0000-0000-0000-100000000001",

"global_eip_address": "10.10.10.10",

"ip_version": 4

}

]

}

Multiple values can be used for query in the format of:

  • If global_eip_id is used as the query condition, the format is global_eips=global_eip_id=xxx&global_eips=global_eip_id=xxx.

  • If global_eip_address is used as the query condition, the format is global_eips=global_eip_address=xxx&global_eips=global_eip_address=xxx.

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

Constraints: N/A

Range: N/A

Default value: N/A

log_topic_id

No

String

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

Multiple values can be used for query in the format of:

log_topic_id=xxx&log_topic_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

log_group_id

No

String

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

Multiple values can be used for query in the format of:

log_group_id=xxx&log_group_id=xxx.

Constraints: N/A

Range: N/A

Default value: N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

Definition: Specifies the token used for IAM authentication.

Constraints: N/A

Range: N/A

Default value: N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

loadbalancers

Array of LoadBalancer objects

Definition: Lists the load balancers.

page_info

PageInfo object

Definition: Specifies the pagination information.

request_id

String

Definition: Specifies the request ID.

Range: The value is automatically generated, and can contain characters including digits, lowercase letters, and hyphens (-).

Table 5 LoadBalancer

Parameter

Type

Description

id

String

Definition: Specifies the load balancer ID.

Range: N/A

description

String

Definition: Provides supplementary information about the load balancer.

Range: N/A

provisioning_status

String

Definition: Specifies the provisioning status of the load balancer.

Range:

  • ACTIVE: in use

  • PENDING_DELETE: deleting

admin_state_up

Boolean

Definition: Specifies whether the load balancer is enabled.

Range:

  • true: enabled

  • false: disabled

provider

String

Definition: Specifies the provider of the load balancer. The value is fixed to vlb.

Range: N/A

pools

Array of PoolRef objects

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

listeners

Array of ListenerRef objects

Definition: Lists the IDs of listeners associated with the load balancer.

operating_status

String

Definition: Specifies the operating status of the load balancer.

Range:

  • ONLINE: The load balancer is online.

  • FROZEN: The load balancer is frozen.

name

String

Definition: Specifies the load balancer name.

Range: N/A

project_id

String

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

Range: N/A

vip_subnet_cidr_id

String

Definition: Specifies the ID of the IPv4 subnet where the load balancer is located. This subnet is also called the frontend subnet.

Range: N/A

vip_address

String

Definition: Specifies the private IPv4 address of the load balancer.

Range: N/A

vip_port_id

String

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

Range: N/A

tags

Array of Tag objects

Definition: Specifies the tags added to the load balancer.

created_at

String

Definition: Specifies the time when the load balancer was created.

Range:

The value must be in the format of yyyy-MM-dd'T'HH:mm:ss'Z'.

updated_at

String

Definition: Specifies the time when the load balancer was updated.

Range:

The value must be in the format of yyyy-MM-dd'T'HH:mm:ss'Z'.

guaranteed

Boolean

Definition: Specifies whether the load balancer is a dedicated load balancer.

Range:

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

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

vpc_id

String

Definition: Specifies the ID of the VPC where the load balancer is located.

Range: N/A

eips

Array of EipInfo objects

Definition: Specifies the EIP bound to the load balancer.

NOTE:
This parameter has the same meaning as publicips.

ipv6_vip_address

String

Definition: Specifies the IPv6 address of the load balancer.

Range: N/A

ipv6_vip_virsubnet_id

String

Definition: Specifies the ID of the IPv6 subnet where the load balancer is located. This subnet is also called the frontend subnet.

Range: N/A

ipv6_vip_port_id

String

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

Range: N/A

availability_zone_list

Array of strings

Definition: Specifies the list of AZs where the load balancers are created.

Range: N/A

enterprise_project_id

String

Definition: Specifies the ID of the enterprise project.

Range:

  • 0: The resource belongs to the default enterprise project.

  • A string in UUID format indicates a non-default enterprise project.

billing_info

String

Definition: Provides resource billing information.

Range:

  • If the value is left blank, the resource is billed on a pay-per-use basis.

This parameter is unsupported. Please do not use it.

l4_flavor_id

String

Definition: Specifies the ID of a flavor at Layer 4.

If the current load balancer is an elastic flavor instance, this parameter defines the maximum elastic flavor at Layer 4.

Range: N/A

l4_scale_flavor_id

String

Definition: Specifies the ID of an elastic flavor at Layer 4.

Range: N/A

NOTE:
This parameter has been discarded. Do not use it.

l7_flavor_id

String

Definition: Specifies the ID of a flavor at Layer 7.

If the current load balancer is an elastic flavor instance, this parameter defines the maximum elastic flavor at Layer 7.

Range: N/A

l7_scale_flavor_id

String

Definition: Specifies the ID of an elastic flavor at Layer 7.

Range: N/A

NOTE:
This parameter has been discarded. Do not use it.

gw_flavor_id

String

Definition: Specifies the flavor ID of the gateway load balancer.

Range: N/A

This parameter is unsupported. Please do not use it.

loadbalancer_type

String

Definition: Specifies the load balancer type.

Range:

  • gateway: gateway load balancers

  • null: other types of load balancers

This parameter is unsupported. Please do not use it.

publicips

Array of PublicIpInfo objects

Definition: Specifies the EIP bound to the load balancer.

NOTE:
This parameter has the same meaning as eips.

global_eips

Array of GlobalEipInfo objects

Definition: Specifies the global EIP bound to the load balancer.

elb_virsubnet_ids

Array of strings

Definition: Specifies the network IDs of subnets on the downstream plane.

Range: N/A

elb_virsubnet_type

String

Definition: Specifies the type of the subnet on the downstream plane.

Range:

  • ipv4: IPv4 subnets

  • dualstack: subnets that support IPv4/IPv6 dual stack

ip_target_enable

Boolean

Definition: Specifies whether to add backend servers that are not in the load balancer's VPC.

If you set it to true, you can associate 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 server IP addresses.

Range:

  • true: This option will be enabled.

  • false: This option will be disabled.

frozen_scene

String

Definition: Specifies the scenario where the load balancer is frozen.

If there are multiple scenarios, separate them with commas (,).

Range:

  • POLICE: The load balancer is frozen due to security reasons.

  • ILLEGAL: The load balancer is frozen due to violation of laws and regulations.

  • VERIFY: Your account has not completed real-name authentication.

  • PARTNER: The load balancer is frozen by the partner.

  • AREAR: The load balancer is frozen due to arrears.

deletion_protection_enable

Boolean

Definition: Specifies whether to enable deletion protection. This parameter is returned only when the deletion protection is enabled in the current region.

Range:

  • false: This option will be disabled.

  • true: This option will be enabled.

autoscaling

AutoscalingRef object

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

NOTE:
This parameter has been deprecated, but is retained for compatibility purposes. Using this parameter is not recommended. If this parameter is specified, the load balancer with minimum flavors will be created and you will be billed for the minimum flavors.

public_border_group

String

Definition: Specifies the public border group.

Range:

  • center: public border group of the central site

  • Edge site name: public border group of an edge site

charge_mode

String

Definition: Specifies the charge mode of the load balancer.

Range:

  • flavor: billed by the fixed flavor you select.

  • lcu: billed by how many LCUs you have used.

  • Null: If it is a shared load balancer, it is free. If it is a dedicated load balancer, it will be billed by the fixed flavor you select.

This parameter is unsupported. Please do not use it.

service_lb_mode

String

Definition: Specifies load balancer mode.

Range:

  • lb: Cross-tenant access is not supported.

  • ep: Cross-tenant access is supported.

This parameter is unsupported. Please do not use it.

instance_type

String

Definition: Specifies the internal service to which the load balancer belongs.

Range: N/A

This parameter is unsupported. Please do not use it.

instance_id

String

Definition: Specifies the ID of the instance with which the load balancer is associated.

Range: N/A

This parameter is unsupported. Please do not use it.

proxy_protocol_extensions

Array of ProxyProtocolExtension objects

Definition: Specifies the proxy protocol extension.

This parameter is unsupported. Please do not use it.

waf_failure_action

String

Definition: Specifies traffic distributing policies when the WAF is faulty.

Range: discard indicates traffic will not be distributed. forward indicates traffic will be distributed to the default backend servers.

protection_status

String

Definition: Specifies the protection status.

Range:

  • nonProtection: The resource is not protected.

  • consoleProtection: Modification is not allowed on the console.

protection_reason

String

Definition: Specifies why modification protection is enabled.

Range: The value can contain a maximum of 255 Unicode characters, excluding angle brackets (<>).

log_group_id

String

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

Range: N/A

log_topic_id

String

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

Range: N/A

custom_qos_limit

CustomQosLimit object

Definition: Specifies the rate limit information of the ELB flavors.

Range: N/A

This parameter is unsupported. Please do not use it.

Table 6 PoolRef

Parameter

Type

Description

id

String

Definition: Specifies the backend server group ID.

Range: N/A

Table 7 ListenerRef

Parameter

Type

Description

id

String

Definition: Specifies the listener ID.

Range: N/A

Table 8 Tag

Parameter

Type

Description

key

String

Definition: Specifies the tag key.

Range: N/A

value

String

Definition: Specifies the tag value.

Range: N/A

Table 9 EipInfo

Parameter

Type

Description

eip_id

String

Definition: Specifies the EIP ID.

Range: N/A

eip_address

String

Definition: Specifies the EIP.

Range: N/A

ip_version

Integer

Definition: Specifies the IP address version.

Range:

  • 4: IPv4 addresses

  • 6: IPv6 addresses

Table 10 PublicIpInfo

Parameter

Type

Description

publicip_id

String

Definition: Specifies the EIP ID.

Range: N/A

publicip_address

String

Definition: Specifies the EIP.

Range: N/A

ip_version

Integer

Definition: Specifies the IP address version.

Range:

  • 4: IPv4 address

  • 6: IPv6 address

Table 11 GlobalEipInfo

Parameter

Type

Description

global_eip_id

String

Definition: Specifies the ID of the global EIP.

Range: N/A

global_eip_address

String

Definition: Specifies the global EIP.

Range: N/A

ip_version

Integer

Definition: Specifies the IP address version.

Range:

  • 4: IPv4 addresses

  • 6: IPv6 addresses

Table 12 AutoscalingRef

Parameter

Type

Description

enable

Boolean

Definition: Specifies whether to enable elastic scaling for the load balancer.

Range:

  • true: This option will be enabled.

  • false: This option will be disabled.

min_l7_flavor_id

String

Definition: Specifies the ID of the minimum elastic flavor at Layer 7.

Range: N/A

Table 13 ProxyProtocolExtension

Parameter

Type

Description

vip_address

String

Definition: Specifies the IPv4 address.

Constraints: N/A

Range: N/A

Default value: N/A

ipv6_vip_address

String

Definition: Specifies the IPv6 address.

Constraints: N/A

Range: N/A

Default value: N/A

extension

Extension object

Definition: Specifies the proxy protocol extension.

Constraints: N/A

Table 14 Extension

Parameter

Type

Description

ep_id

String

Definition: Specifies the VPC endpoint ID.

Constraints: N/A

Range: N/A

Default value: N/A

ep_service_id

String

Definition: Specifies the VPC endpoint service ID.

Constraints: N/A

Range: N/A

Default value: N/A

Table 15 CustomQosLimit

Parameter

Type

Description

l4

L4Limit object

Definition: Specifies the rate limit information of the ELB flavors at Layer 4.

l7

L7Limit object

Definition: Specifies the rate limit information of the ELB flavors at Layer 7.

Table 16 L4Limit

Parameter

Type

Description

connection

Integer

Definition: Specifies the maximum number of concurrent connections at Layer 4.

Range: N/A

cps

Integer

Definition: Specifies the maximum number of new connections at Layer 4.

Range: N/A

Table 17 L7Limit

Parameter

Type

Description

connection

Integer

Definition: Specifies the maximum number of concurrent connections at Layer 7.

Range: N/A

cps

Integer

Definition: Specifies the maximum number of new connections at Layer 7.

Range: N/A

Table 18 PageInfo

Parameter

Type

Description

previous_marker

String

Definition: Specifies the ID of the first record in the pagination query result. If page_reverse is set to true, this parameter is used together to query resources on the previous page.

Range: N/A

next_marker

String

Definition: Specifies the ID of the last record in the pagination query result. It is usually used to query resources on the next page.

Range: N/A

current_count

Integer

Definition: Specifies the number of records returned on the current page.

Range: N/A

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
  }
}

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.elb.v3.region.ElbRegion;
import com.huaweicloud.sdk.elb.v3.*;
import com.huaweicloud.sdk.elb.v3.model.*;


public class ListLoadBalancersSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        ElbClient client = ElbClient.newBuilder()
                .withCredential(auth)
                .withRegion(ElbRegion.valueOf("<YOUR REGION>"))
                .build();
        ListLoadBalancersRequest request = new ListLoadBalancersRequest();
        try {
            ListLoadBalancersResponse response = client.listLoadBalancers(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkelb.v3.region.elb_region import ElbRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkelb.v3 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = ElbClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(ElbRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListLoadBalancersRequest()
        response = client.list_load_balancers(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    elb "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := elb.NewElbClient(
        elb.ElbClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ListLoadBalancersRequest{}
	response, err := client.ListLoadBalancers(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

Successful request.

Error Codes

See Error Codes.