Querying Listeners
Function
This API is used to query listeners.
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/listeners
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 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
limit |
No |
Integer |
Definition: Specifies the number of records returned on each page. Constraints: N/A Range: 0 to 2000 Default value: 2000 |
marker |
No |
String |
Definition: Specifies the ID of the last record on the previous page. Constraints:
Range: N/A Default value: N/A |
page_reverse |
No |
Boolean |
Definition: Specifies whether to use reverse query. Constraints:
Range:
Default value: false |
protocol_port |
No |
Array of strings |
Definition: Specifies the port used by the listener. Multiple ports can be used for query in the format of protocol_port=xxx&protocol_port=xxx. Constraints: N/A Range: N/A Default value: N/A |
protocol |
No |
Array of strings |
Definition: Specifies the protocol used by the listener. Multiple protocols can be used for query in the format of protocol=xxx&protocol=xxx. Constraints: N/A The value can be TCP, UDP, HTTP, HTTPS, or IP. IP is only available for listeners that will be added to gateway load balancers. Default value: N/A QUIC is not supported. |
description |
No |
Array of strings |
Definition: Provides supplementary information about the listener. Multiple descriptions can be used for query in the format of description=xxx&description=xxx. Constraints: N/A Range: N/A Default value: N/A |
default_tls_container_ref |
No |
Array of strings |
Definition: Specifies the ID of the server certificate used by the listener. Multiple IDs can be used for query in the format of default_tls_container_ref=xxx&default_tls_container_ref=xxx. Constraints: N/A Range: N/A Default value: N/A |
client_ca_tls_container_ref |
No |
Array of strings |
Definition: Specifies the ID of the CA certificate used by the listener. Multiple IDs can be used for query in the format of client_ca_tls_container_ref=xxx&client_ca_tls_container_ref=xxx. Constraints: N/A Range: N/A Default value: N/A |
admin_state_up |
No |
Boolean |
Definition: Specifies the administrative status of the listener. Constraints: N/A Range: N/A Default value: N/A |
include_recycle_bin |
No |
Boolean |
Definition: Specifies whether to query the listeners associated with the load balancers in the recycle bin. Constraints: N/A Range:
Default value: N/A |
connection_limit |
No |
Array of integers |
Definition: Specifies the maximum number of connections that the load balancer can establish with backend servers. Multiple values can be used for query in the format of connection_limit=xxx&connection_limit=xxx. Constraints: N/A Range: N/A Default value: N/A |
default_pool_id |
No |
Array of strings |
Definition: Specifies the ID of the default backend server group. If there is no matched forwarding policy, requests will be routed to the default backend server group. Multiple IDs can be used for query in the format of default_pool_id=xxx&default_pool_id=xxx. Constraints: N/A Range: N/A Default value: N/A |
id |
No |
Array of strings |
Definition: Specifies the listener ID. Multiple IDs 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 name of the listener added to the load balancer. Multiple names can be used for query in the format of name=xxx&name=xxx. Constraints: N/A Range: N/A Default value: N/A |
http2_enable |
No |
Boolean |
Definition: Specifies whether to use HTTP/2 if you want the clients to use HTTP/2 to communicate with the load balancer. Request forwarding using HTTP/2 improves the access performance between your application and the load balancer. However, the load balancer still uses HTTP/1.x to forward requests to the backend server. Constraints: N/A Range: The value can be true (enable this option) or false (disable this option). Default value: N/A QUIC is not supported. |
loadbalancer_id |
No |
Array of strings |
Definition: Specifies the ID of the load balancer that the listener is added to. Multiple IDs can be used for query in the format of loadbalancer_id=xxx&loadbalancer_id=xxx. Constraints: N/A Range: N/A Default value: N/A |
tls_ciphers_policy |
No |
Array of strings |
Definition: Specifies the security policy used by the listener. Multiple security policies can be used for query in the format of tls_ciphers_policy=xxx&tls_ciphers_policy=xxx. Constraints: N/A Range: N/A Default value: N/A |
member_address |
No |
Array of strings |
Definition: Specifies the IP address of the backend server. This is a query parameter and will not be included in the response. Multiple IP addresses 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 |
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 IDs 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 |
enterprise_project_id |
No |
Array of strings |
Definition: Specifies the ID of the enterprise project. Multiple values can be used for query in the format of: enterprise_project_id=xxx&enterprise_project_id=xxx. Constraints:
Range: N/A Default value: N/A |
enable_member_retry |
No |
Boolean |
Definition: Specifies whether to enable health check retries for backend servers. Constraints: N/A Range: The value can be true (enable health check retries) or false (disable health check retries). Default value: N/A |
member_timeout |
No |
Array of integers |
Definition: Specifies the timeout duration for waiting for a response from a backend server, in seconds. If the backend server fails to respond after the timeout duration elapses, the load balancer will stop waiting and return HTTP 504 Gateway Timeout to the client. Multiple durations can be used for query in the format of member_timeout=xxx&member_timeout=xxx. Constraints: N/A Range: N/A Default value: N/A |
client_timeout |
No |
Array of integers |
Definition: Specifies the timeout duration for waiting for a response from a client, in seconds. There are two situations:
Multiple durations can be used for query in the format of client_timeout=xxx&client_timeout=xxx. Constraints: N/A Range: N/A Default value: N/A |
keepalive_timeout |
No |
Array of integers |
Definition: Specifies the idle timeout duration, in seconds. If the load balancer receives no requests within the idle timeout duration, it will disconnect the connection with the client and establish a new connection when there is a new request. Multiple durations can be used for query in the format of keepalive_timeout=xxx&keepalive_timeout=xxx. Constraints: N/A Range: N/A Default value: N/A |
transparent_client_ip_enable |
No |
Boolean |
Definition: Specifies whether to pass source IP addresses of the clients to backend servers. Constraints: N/A Range: The value can be true (enable this option) or false (disable this option). Default value: N/A |
proxy_protocol_enable |
No |
Boolean |
Definition: Specifies whether to enable the ProxyProtocol option to pass the source IP addresses of the clients to backend servers. Constraints: N/A Range: The value can be true (enable this option) or false (disable this option). Default value: N/A |
enhance_l7policy_enable |
No |
Boolean |
Definition: Specifies whether to enable advanced forwarding. If you enable this function, you can configure more flexible forwarding policies and rules. Constraints: N/A Range: The value can be true (enable this option) or false (disable this option). Default value: N/A |
member_instance_id |
No |
Array of strings |
Definition: Specifies the backend server ID. This is a query parameter and will not be included in the response. Multiple IDs can be used for query in the format of member_instance_id=xxx&member_instance_id=xxx. Constraints: N/A Range: N/A Default value: N/A |
ssl_early_data_enable |
No |
Boolean |
Definition: Specifies whether to enable zero round trip time resumption (0-RTT) for listeners. Constraints: N/A Range: The value can be true (enable this option) or false (disable this option). Default value: N/A |
nat64_enable |
No |
Boolean |
Definition: Specifies whether to set nat64_enable to true. Constraints: N/A Range: The value can be true (enable this option) or false (disable this option). Default value: N/A |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition: Specifies the token used for IAM authentication. Constraints: N/A Range: N/A Default value: N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
Definition: Specifies the request ID. Range: The value is automatically generated, and can contain characters including digits, lowercase letters, and hyphens (-). |
page_info |
PageInfo object |
Definition: Specifies the pagination information. |
listeners |
Array of Listener objects |
Definition: Lists the listeners. |
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 |
Parameter |
Type |
Description |
---|---|---|
admin_state_up |
Boolean |
Definition: Specifies the administrative status of the listener. Default value: true |
client_ca_tls_container_ref |
String |
Definition: Specifies the ID of the CA certificate used by the listener. This parameter is available only when type is set to client. Default value: N/A |
connection_limit |
Integer |
Definition: Specifies the maximum number of connections that the listener can establish with backend servers. Range: an integer greater than or equal to -1 |
created_at |
String |
Definition: Specifies the time when the listener was created. Range: N/A The value must be in the format of yyyy-MM-dd''T''HH:mm:ss''Z'', for example, 2021-07-30T12:03:44Z. |
default_pool_id |
String |
Definition: Specifies the ID of the default backend server group of the listener. If there is no matched forwarding policy, requests will be routed to the default backend server group. Range: N/A |
default_tls_container_ref |
String |
Definition: Specifies the ID of the server certificate used by the listener. Default value: N/A |
description |
String |
Definition: Provides supplementary information about the listener. Range: N/A |
http2_enable |
Boolean |
Definition: Specifies whether to allow clients to use HTTP/2 to communicate with the load balancer for higher access performance. However, the load balancer still uses HTTP/1.x to forward requests to the backend server. Range: N/A |
id |
String |
Definition: Specifies the listener ID. Range: N/A |
insert_headers |
ListenerInsertHeaders object |
Definition: Specifies the HTTP headers that can transmit required information to backend servers. For example, you can use the X-Forwarded-ELB-IP header to transmit the load balancer EIP to backend servers. |
loadbalancers |
Array of LoadBalancerRef objects |
Definition: Specifies the ID of the load balancer that the listener is added to. A listener can be associated with only one load balancer. |
name |
String |
Definition: Specifies the name of the listener. If you leave the listener name empty, you cannot locate it in the listener list and view its details. Range: N/A |
project_id |
String |
Definition: Specifies the ID of the project that the listener belongs to. Range: N/A |
enterprise_project_id |
String |
Definition: Specifies the enterprise project ID. Range: N/A |
protocol |
String |
Definition: Specifies the protocol of the listener. Range: The value can be TCP, UDP, HTTP, HTTPS, or IP. IP is only available for listeners that will be added to gateway load balancers. |
protocol_port |
Integer |
Definition: Specifies the port used by the listener. Default value: N/A |
sni_container_refs |
Array of strings |
Definition: Specifies the IDs of SNI certificates (server certificates with domain names) used by the listener. Range: N/A |
sni_match_algo |
String |
Definition: Specifies how wildcard domain name matches with the SNI certificates used by the listener. Range: longest_suffix indicates longest suffix match. wildcard indicates wildcard match. |
tags |
Array of Tag objects |
Definition: Lists the tags. |
updated_at |
String |
Definition: Specifies the time when the listener was updated. Range: The value must be in the format of yyyy-MM-dd''T''HH:mm:ss''Z'', for example, 2021-07-30T12:03:44Z. |
tls_ciphers_policy |
String |
Definition: Specifies the security policy used by the listener. Range: tls-1-0, tls-1-1, tls-1-2, or tls-1-2-strict. The default value is tls-1-2. TLS 1.3 is not supported. |
security_policy_id |
String |
Definition: Specifies the ID of the custom security policy. Range: N/A |
enable_member_retry |
Boolean |
Definition: Specifies whether to enable health check retries for backend servers. Range: true indicates health check retries will be enabled. false indicates health check retries will be disabled. |
keepalive_timeout |
Integer |
Definition: Specifies the idle timeout duration, in seconds. If the load balancer receives no requests within the idle timeout duration, it will disconnect the connection with the client and establish a new connection when there is a new request. Range:
|
client_timeout |
Integer |
Definition: Specifies the timeout duration for waiting for a response from a client, in seconds. There are two situations:
Range: 1-300s |
member_timeout |
Integer |
Definition: Specifies the timeout duration for waiting for a response from a backend server, in seconds. If the backend server fails to respond after the timeout duration elapses, the load balancer will stop waiting and return HTTP 504 Gateway Timeout to the client. Range: 1-300s |
ipgroup |
ListenerIpGroup object |
Specifies the IP address group associated with the listener. |
transparent_client_ip_enable |
Boolean |
Definition: Specifies whether to pass source IP addresses of the clients to backend servers. If it is enabled, the source IP addresses of the clients will be passed to the backend server. Range:
|
proxy_protocol_enable |
Boolean |
Definition: Specifies whether to enable ProxyProtocol to pass the source IP addresses of the clients to backend servers. This parameter is available only for TLS listeners and does not take effect for other types of listeners. Range: The value can be true (enable this option) or false (disable this option). |
enhance_l7policy_enable |
Boolean |
Definition: Specifies whether to enable advanced forwarding. If advanced forwarding is enabled, more flexible forwarding policies and rules are supported. The following scenarios are supported:
Range: The value can be true (enable this option) or false (disable this option). |
quic_config |
ListenerQuicConfig object |
Definition: Specifies the QUIC configuration for the current listener. Constraints: This parameter is valid only when protocol is set to HTTPS. For a TCP, UDP, HTTP, or QUIC listener, if this parameter is not left blank, an error will be reported.
NOTE:
Suppose the client sends an HTTP request to the server and carries information indicating that the QUIC protocol is supported.
If enable_quic_upgrade is set to true, the QUIC port and version information supported by the server will be included in the response header. When the client sends both HTTPS and QUIC requests, if the QUIC request is sent and responded, the client will use the QUIC protocol to communicate with the backend servers. QUIC is not supported. |
gzip_enable |
Boolean |
Definition: Specifies whether to enable gzip_enable for a load balancer. Range: The value can be true (enable this option) or false (disable this option). |
port_ranges |
Array of PortRange objects |
Definition: Specifies one or more port ranges, including the start and end ports. |
cps |
Integer |
Definition: Specifies the maximum number of new connections that a listener can handle per second. If the value is greater than the number defined in the load balancer flavors, the latter is used as the limit. Range: 0 to 1000000 |
connection |
Integer |
Definition: Specifies the maximum number of concurrent connections that a listener can handle per second. If the value is greater than the number defined in the load balancer flavors, the latter is used as the limit. Range: 0 to 1000000 |
nat64_enable |
Boolean |
Definition: Specifies whether to translate between IPv4 and IPv6 addresses. This option allows a client to access IPv4 or IPv6 backend servers by accessing the IPv4 or IPv6 address of a load balancer. Range: true: Enable nat64_enable. false: Disable nat64_enable. |
Parameter |
Type |
Description |
---|---|---|
X-Forwarded-ELB-IP |
Boolean |
Definition: If X-Forwarded-ELB-IP is set to true, the load balancer EIP will be stored in the X-Forwarded-ELB-IP header and passed to backend servers. Constraints: N/A Range: N/A Default value: N/A |
X-Forwarded-Port |
Boolean |
Definition: If X-Forwarded-Port is set to true, the listening port of the load balancer will be stored in the X-Forwarded-Port header and passed to backend servers. Constraints: N/A Range: N/A Default value: N/A |
X-Forwarded-For-Port |
Boolean |
Definition: If X-Forwarded-For-Port is set to true, the source port of the client will be stored in the HTTP header and passed to backend servers. Constraints: N/A Range: N/A Default value: N/A |
X-Forwarded-Host |
Boolean |
Definition: If X-Forwarded-Host is set to true, the client host can be stored in the X-Forwarded-Host header and passed to backend servers. |
X-Forwarded-Proto |
Boolean |
Definition: If X-Forwarded-Proto is set to true, the listener protocol of the load balancer can be stored in the X-Forwarded-Proto header and passed to backend servers. Constraints: N/A Range: N/A Default value: N/A |
X-Real-IP |
Boolean |
Definition: If X-Real-IP is set to true, the client IP address can be stored in the X-Real-IP header and passed to backend servers. Constraints: N/A Range: N/A Default value: N/A |
X-Forwarded-ELB-ID |
Boolean |
Definition: If X-Forwarded-ELB-ID is set to true, the load balancer ID can be transferred to backend servers through the X-Forwarded-ELB-ID header. Constraints: N/A Range: N/A Default value: N/A |
X-Forwarded-TLS-Certificate-ID |
Boolean |
Definition: If X-Forwarded-TLS-Certificate-ID is set to true, the certificate ID of the load balancer can be transferred to backend servers through the X-Forwarded-TLS-Certificate-ID header. Constraints: N/A Range: N/A Default value: N/A |
X-Forwarded-TLS-Protocol |
Boolean |
Definition: If X-Forwarded-TLS-Protocol is set to true, the algorithm protocol of the load balancer can be transferred to backend servers through the X-Forwarded-TLS-Protocol header. Constraints: N/A Range: N/A Default value: N/A |
X-Forwarded-TLS-Cipher |
Boolean |
Definition: If X-Forwarded-TLS-Cipher is set to true, the algorithm suite of the load balancer can be transferred to backend servers through the X-Forwarded-TLS-Cipher header. Constraints: N/A Range: N/A Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Definition: Specifies the load balancer ID. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Definition: Specifies the tag key. Range: N/A |
value |
String |
Definition: Specifies the tag value. Range: N/A |
Parameter |
Type |
Description |
---|---|---|
ipgroup_id |
String |
Definition: Specifies the ID of the IP address group associated with the listener. This parameter is mandatory during creation and is optional during update. Constraints: The specified IP address group must exist, and the value cannot be null. Otherwise, the IP address group conflicts with enable_ipgroup. |
enable_ipgroup |
Boolean |
Definition: Specifies whether access control is enabled. A listener with access control enabled can be directly deleted. Range:
|
type |
String |
Definition: Specifies how access to the listener is controlled. Range:
|
Parameter |
Type |
Description |
---|---|---|
quic_listener_id |
String |
Definition: Specifies the ID of the QUIC listener. Constraints: The listener specified by quic_listener_id must exist. The listener protocol must be QUIC and cannot be set to null. Otherwise, it will conflict with enable_quic_upgrade. QUIC is not supported. |
enable_quic_upgrade |
Boolean |
Definition: Specifies whether to enable QUIC upgrade. If this option is enabled, HTTPS listeners will be upgraded to QUIC listeners. Range:
QUIC is not supported. |
Example Requests
Querying the listeners on each page
GET https://{ELB_Endpoint}/v3/99a3fff0d03c428eac3678da6a7d0f24/elb/listeners?limit=2&marker=0r31747a-b139-492f-2749-2df0b1c87193
Example Responses
Status code: 200
Successful request.
{ "listeners" : [ { "id" : "0b11747a-b139-492f-9692-2df0b1c87193", "name" : "My listener", "protocol_port" : 80, "protocol" : "TCP", "ipgroup" : null, "description" : "My listener update.", "default_tls_container_ref" : null, "admin_state_up" : true, "loadbalancers" : [ { "id" : "098b2f68-af1c-41a9-8efd-69958722af62" } ], "member_timeout" : null, "client_timeout" : null, "keepalive_timeout" : 300, "client_ca_tls_container_ref" : null, "project_id" : "99a3fff0d03c428eac3678da6a7d0f24", "sni_container_refs" : [ ], "connection_limit" : -1, "default_pool_id" : null, "tls_ciphers_policy" : "tls-1-2", "tags" : [ ], "created_at" : "2019-04-02T00:12:32Z", "updated_at" : "2019-04-02T17:43:46Z", "http2_enable" : true, "insert_headers" : { "X-Forwarded-ELB-IP" : true }, "transparent_client_ip_enable" : false, "quic_config" : null, "nat64_enable" : false }, { "id" : "0b455839-3ea7-4bac-ad26-35bf22f96ea4", "name" : "listener-test", "protocol_port" : 86, "protocol" : "TERMINATED_HTTPS", "description" : null, "default_tls_container_ref" : "ad9b123e858d4652b80e89b9941e49a4", "admin_state_up" : true, "loadbalancers" : [ { "id" : "309a0f61-0b62-45f2-97d1-742f3434338e" } ], "member_timeout" : 60, "client_timeout" : 60, "keepalive_timeout" : 15, "client_ca_tls_container_ref" : "7875ccb4c6b44cdb90ab2ab89892ab71", "project_id" : "99a3fff0d03c428eac3678da6a7d0f24", "sni_container_refs" : [ "7f41c96223d34ebaa3c8e836b6625ec0" ], "connection_limit" : -1, "default_pool_id" : "5e7e0175-d5d5-4f37-bfba-88a9524ad20b", "tls_ciphers_policy" : "tls-1-2", "tags" : [ ], "created_at" : "2019-03-22T23:37:14Z", "updated_at" : "2019-03-22T23:37:14Z", "http2_enable" : false, "ipgroup" : null, "insert_headers" : { "X-Forwarded-ELB-IP" : true }, "transparent_client_ip_enable" : false, "quic_config" : null, "nat64_enable" : false } ], "page_info" : { "next_marker" : "0b455839-3ea7-4bac-ad26-35bf22f96ea4", "previous_marker" : "0b11747a-b139-492f-9692-2df0b1c87193", "current_count" : 2 }, "request_id" : "774640ee-6863-4de3-8156-aff16f51a087" }
Status Codes
Status Code |
Description |
---|---|
200 |
Successful request. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.