Queries the list of listeners added to Network Load Balancer (NLB) instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListListeners

The operation that you want to perform. Set the value to ListListeners.

ListenerIds.N String No lsn-bp1bpn0kn908w4nbw****

The ID of the listener. You can specify at most 20 IDs.

LoadBalancerIds.N String No nlb-83ckzc8d4xlp8o****

The ID of the NLB instance. You can specify at most 20 IDs.

ListenerProtocol String No TCPSSL

The listening protocol. Valid values: TCP, UDP, and TCPSSL.

NextToken String No NextToken FFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If this is your first query or no next query is to be sent, ignore this parameter.
  • If a next query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
MaxResults Integer No 20

The number of entries to return on each page. Valid values: 1 to 100. Default value: 20.

RegionId String No cn-hangzhou

The ID of the region where the NLB instance is deployed.

You can call the DescribeRegions operation to query the most recent region list.

Response parameters

Parameter Type Example Description
RequestId String CEF72CEB-54B6-4AE8-B225-F876FF7BA984

The ID of the request.

Listeners Array of ListenerInfo

The list of listeners.

LoadBalancerId String nlb-83ckzc8d4xlp8o****

The ID of the NLB instance.

ListenerId String lsn-ga6sjjcll6ou34l1et****

The ID of the listener.

ListenerProtocol String TCPSSL

The listening protocol. Valid values: TCP, UDP, and TCPSSL.

ListenerPort Integer 443

The listening port.

StartPort String 233

The first port in the listening port range.

EndPort String 455

The last port in the listening port range.

ListenerDescription String tcpssl_443

The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

ServerGroupId String sgp-ppdpc14gdm3x4o****

The ID of the server group.

IdleTimeout Integer 900

The timeout period of an idle connection. Unit: seconds. Valid values: 1 to 900. Default value: 900.

SecurityPolicyId String tls_cipher_policy_1_1

The ID of the security policy.

Note This parameter takes effect only for listeners that use SSL over TCP.
CertificateIds Array of String 12315790212_166f8204689_1714763408_70998****

The list of server certificates.

Note This parameter takes effect only for listeners that use SSL over TCP.
CaCertificateIds Array of String 139a00604ad-cn-east-hangzh****

The list of CA certificates.

Note This parameter takes effect only for listeners that use SSL over TCP.
CaEnabled Boolean false

Indicates whether mutual authentication is enabled. Valid values:

  • true: yes
  • false: no
ListenerStatus String Running

The status of the listener. Valid values:

  • Provisioning
  • Running
  • Configuring
  • Stopping
  • Stopped
  • Starting
  • Deleting
  • Deleted
RegionId String cn-hangzhou

The ID of the region where the NLB instance is deployed.

AlpnEnabled String false

Indicates whether Application-Layer Protocol Negotiation (ALPN) is enabled. Valid values:

  • true: enabled
  • false: disabled
AlpnPolicy String HTTP1Only

The ALPN policy. Valid values:

  • HTTP1Only
  • HTTP2Only
  • HTTP2Preferred
  • HTTP2Optional
SecSensorEnabled String false

Indicates whether fine-grained monitoring is enabled. Valid values:

  • true: enabled
  • false: disabled
ProxyProtocolEnabled String false

Indicates whether the Proxy protocol is used to pass client IP addresses to backend servers. Valid values:

  • true: enabled
  • false: disabled
Cps Integer 1000

The maximum number of connections that can be created per second on the NLB instance. Valid values: 0 to 1000000. 0 indicates that the number of connections is unlimited.

Mss Integer 200

The maximum size of a TCP segment. Unit: bytes. Valid values: 0 to 1500. 0 indicates that the maximum segment size remains unchanged.

Note This parameter is supported only by listeners that use SSL over TCP.
TotalCount Integer 4

The number of entries returned.

NextToken String FFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If NextToken is empty, it indicates that no next query is to be sent.
  • If a value of NextToken is returned, the value is the token used for the next query.
MaxResults Integer 20

The number of entries returned per page.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListListeners
&ListenerIds=["lsn-bp1bpn0kn908w4nbw****"]
&LoadBalancerIds=["nlb-83ckzc8d4xlp8o****"]
&ListenerProtocol=TCPSSL
&NextToken=NextToken	FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=20
&RegionId=cn-hangzhou
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListListenersResponse>
    <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
    <Listeners>
        <LoadBalancerId>nlb-83ckzc8d4xlp8o****</LoadBalancerId>
        <ListenerId>lsn-ga6sjjcll6ou34l1et****</ListenerId>
        <ListenerProtocol>TCPSSL</ListenerProtocol>
        <ListenerPort>443</ListenerPort>
        <StartPort>233</StartPort>
        <EndPort>455</EndPort>
        <ListenerDescription>tcpssl_443</ListenerDescription>
        <ServerGroupId>sgp-ppdpc14gdm3x4o****</ServerGroupId>
        <IdleTimeout>900</IdleTimeout>
        <SecurityPolicyId>tls_cipher_policy_1_1</SecurityPolicyId>
        <CertificateIds>12315790212_166f8204689_1714763408_70998****</CertificateIds>
        <CaCertificateIds>139a00604ad-cn-east-hangzh****</CaCertificateIds>
        <CaEnabled>false</CaEnabled>
        <ListenerStatus>Running</ListenerStatus>
        <RegionId>cn-hangzhou</RegionId>
        <AlpnEnabled>false</AlpnEnabled>
        <AlpnPolicy>ALPN</AlpnPolicy>
        <SecSensorEnabled>false</SecSensorEnabled>
        <ProxyProtocolEnabled>false</ProxyProtocolEnabled>
        <Cps>1000</Cps>
        <Mss>200</Mss>
    </Listeners>
    <TotalCount>4</TotalCount>
    <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
    <MaxResults>20</MaxResults>
</ListListenersResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
  "Listeners" : [ {
    "LoadBalancerId" : "nlb-83ckzc8d4xlp8o****",
    "ListenerId" : "lsn-ga6sjjcll6ou34l1et****",
    "ListenerProtocol" : "TCPSSL",
    "ListenerPort" : 443,
    "StartPort" : "233",
    "EndPort" : "455",
    "ListenerDescription" : "tcpssl_443",
    "ServerGroupId" : "sgp-ppdpc14gdm3x4o****",
    "IdleTimeout" : 900,
    "SecurityPolicyId" : "tls_cipher_policy_1_1",
    "CertificateIds" : [ "12315790212_166f8204689_1714763408_70998****" ],
    "CaCertificateIds" : [ "139a00604ad-cn-east-hangzh****" ],
    "CaEnabled" : false,
    "ListenerStatus" : "Running",
    "RegionId" : "cn-hangzhou",
    "AlpnEnabled" : "false",
    "AlpnPolicy" : "ALPN",
    "SecSensorEnabled" : "false",
    "ProxyProtocolEnabled" : "false",
    "Cps" : 1000,
    "Mss" : 200
  } ],
  "TotalCount" : 4,
  "NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "MaxResults" : 20
}

Error codes

For a list of error codes, visit the API Error Center.