All Products
Search
Document Center

Server Load Balancer:ListListeners

Last Updated:Oct 14, 2026

Queries the listeners in a specified region.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

alb:ListListeners

get

*LoadBalancer

acs:alb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}

None None

Request parameters

Parameter

Type

Required

Description

Example

NextToken

string

No

The token that indicates whether a subsequent query is available. Valid values:

  • Leave this parameter empty for the first query or when no subsequent query is required.

  • For a subsequent query, set this parameter to the NextToken value returned by the previous API call.

FFmyTO70tTpLG6I4FmYAXGKPd****

MaxResults

integer

No

The maximum number of entries to return in a single call. This parameter is optional. Valid values: 1 to 100. Default value: 20.

50

ListenerIds

array

No

The listener instance IDs. You can specify up to 20 listener instance IDs.

string

No

The listener instance ID.

lsn-o4u54y73wq7b******

LoadBalancerIds

array

No

The Application Load Balancing instance IDs. You can specify up to 20 instance IDs.

string

No

The Application Load Balancing instance ID.

alb-bd6oylbckp6k9x****

ListenerProtocol

string

No

The listener protocol used for filtering. Valid values:

  • HTTP: The protocol type is HTTP.

  • HTTPS: The protocol type is HTTPS.

  • QUIC: The protocol type is QUIC.

HTTP

Tag

array<object>

No

The tags.

object

No

The tag structure.

Key

string

No

The tag key. The key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

env

Value

string

No

The tag value. The value can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

product

Response elements

Element

Type

Description

Example

object

The application load balancing listener information.

Listeners

array<object>

The list of application load balancing listeners.

array<object>

The application load balancing listener structure.

DefaultActions

array<object>

The list of default rule actions.

array<object>

The default rule action structure.

ForwardGroupConfig

object

The configuration for the forwarding rule action. This parameter takes effect only when the action type is ForwardGroup.

ServerGroupTuples

array<object>

The destination server groups for forwarding.

object

The destination server groups for forwarding.

ServerGroupId

string

The ID of the destination server group.

sgp-i5qt20******

Type

string

The action type. Valid value: ForwardGroup, which indicates forwarding requests to multiple server groups.

ForwardGroup

GzipEnabled

boolean

Specifies whether to enable Gzip compression to compress specific file types. Valid values:

  • true: yes.

  • false: no.

false

Http2Enabled

boolean

Specifies whether to enable the HTTP/2 feature. Valid values:

  • true: yes.

  • false: no.

Note

This parameter is supported only by HTTPS listeners.

false

IdleTimeout

integer

Specifies the idle connection timeout period. Unit: seconds. Valid values: 1 to 60.

If no access request is accepted within the timeout period, load balancing temporarily breaks the current connection and establishes a new connection when the next request is accepted.

3

ListenerDescription

string

The custom listener name.

HTTP_80

ListenerId

string

The listener ID.

lsn-o4u34y73wq7b******

ListenerPort

integer

The frontend port used by the application load balancing instance. Valid values: 1 to 65535.

80

ListenerProtocol

string

The listener protocol. Valid values:

  • HTTP: The Protocol Type is HTTP.

  • HTTPS: The Protocol Type is HTTPS.

  • QUIC: The Protocol Type is QUIC.

HTTP

ListenerStatus

string

The current status of the listener. Valid values:

  • Provisioning: The listener is being created.

  • Running: The listener is running.

  • Configuring: The listener is being configured.

  • Stopped: The listener is stopped.

Running

LoadBalancerId

string

The instance ID of the application load balancing.

alb-bd6oylbckp6k9x****

LogConfig

object

The log configuration.

AccessLogRecordCustomizedHeadersEnabled

boolean

Specifies whether to include custom headers in access logs. Valid values:

  • true: yes.

  • false: no.

true

AccessLogTracingConfig

object

The Xtrace configuration for access logs.

TracingEnabled

boolean

Specifies whether to enable the Xtrace feature. Valid values:

  • true: yes.

  • false: no.

Note

You can set this parameter to true only when the instance access log switch AccessLogEnabled is turned on.

true

TracingSample

integer

The Xtrace sampling rate. Valid values: 1 to 10000.

Note

This value takes effect only when TracingEnabled is set to true.

100

TracingType

string

The Xtrace type. Valid value: Zipkin.

Note

This value takes effect only when TracingEnabled is set to true.

Zipkin

QuicConfig

object

The configuration for associating a QUIC listener.

QuicListenerId

string

The ID of the QUIC listener to be associated. This parameter is required when QuicUpgradeEnabled is set to true. This parameter takes effect only for HTTPS listeners.

Note

The original listener and the associated QUIC listener must belong to the same ALB instance, and the QUIC listener must not have been associated before.

lsn-o4u54y73wq7b******

QuicUpgradeEnabled

boolean

Specifies whether to enable QUIC upgrade. Valid values:

  • true: yes.

  • false: no.

Note

This parameter takes effect only for HTTPS listeners.

true

RequestTimeout

integer

Specifies the request timeout period. Unit: seconds. Valid values: 1 to 180.

If a backend server does not send a response within the timeout period, load balancing stops waiting and returns an HTTP 504 error code to the client.

34

SecurityPolicyId

string

The security policy.

Note

This parameter is supported only by HTTPS listeners.

tls_cipher_policy_1_1

Tags

array<object>

The tags.

object

The tag structure.

Key

string

The tag key. The key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

env

Value

string

The tag value. The value can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

product

XForwardedForConfig

object

The XForward header field configuration.

XForwardedForClientCertClientVerifyAlias

string

The custom header field name. This value takes effect only when XForwardedForClientCertClientVerifyEnabled is set to true.

The value must be 1 to 40 characters in length and can contain lowercase letters, digits, hyphens (-), and underscores (_).

Note

This parameter is supported only by HTTPS listeners.

test_client-verify-alias_123456

XForwardedForClientCertClientVerifyEnabled

boolean

Specifies whether to use the X-Forwarded-Clientcert-clientverify header field to obtain the verification result of the client certificate that accesses the load balancing instance. Valid values:

  • true: yes.

  • false: no.

Note

This parameter is supported only by HTTPS listeners.

true

XForwardedForClientCertFingerprintAlias

string

The custom header name. This value takes effect only when XForwardedForClientCertFingerprintEnabled is set to true.

The value must be 1 to 40 characters in length and can contain lowercase letters, digits, hyphens (-), and underscores (_).

Note

This parameter is supported only by HTTPS listeners.

test_finger-print-alias_123456

XForwardedForClientCertFingerprintEnabled

boolean

Specifies whether to use the X-Forwarded-Clientcert-fingerprint header field to obtain the fingerprint of the client certificate that accesses the load balancing instance. Valid values:

  • true: yes.

  • false: no.

Note

This parameter is supported only by HTTPS listeners.

true

XForwardedForClientCertIssuerDNAlias

string

The custom header name. This value takes effect only when XForwardedForClientCertIssuerDNEnabled is set to true.

The value must be 1 to 40 characters in length and can contain lowercase letters, digits, hyphens (-), and underscores (_).

Note

This parameter is supported only by HTTPS listeners.

test_issue-dn-alias_123456

XForwardedForClientCertIssuerDNEnabled

boolean

Specifies whether to use the X-Forwarded-Clientcert-issuerdn header field to obtain the issuer information of the client certificate that accesses the load balancing instance. Valid values:

  • true: yes.

  • false: no.

Note

This parameter is supported only by HTTPS listeners.

true

XForwardedForClientCertSubjectDNAlias

string

The custom header name. This value takes effect only when XForwardedForClientCertSubjectDNEnabled is set to true.

The value must be 1 to 40 characters in length and can contain lowercase letters, digits, hyphens (-), and underscores (_).

Note

This parameter is supported only by HTTPS listeners.

test_subject-dn-alias_123456

XForwardedForClientCertSubjectDNEnabled

boolean

Specifies whether to use the X-Forwarded-Clientcert-subjectdn header field to obtain the subject information of the client certificate that accesses the load balancing instance. Valid values:

  • true: yes.

  • false: no.

Note

This parameter is supported only by HTTPS listeners.

true

XForwardedForClientSourceIpsEnabled

boolean

Specifies whether to allow ALB to retrieve the actual client IP address from the X-Forwarded-For header field. Valid values:

  • true: yes.

  • false: no.

Note

This parameter is supported by HTTP and HTTPS listeners.

false

XForwardedForClientSourceIpsTrusted

string

Specifies the trusted proxy IP addresses.

Application load balancing ALB traverses the X-Forwarded-For header field from back to front and selects the first IP address that is not in the trusted IP address list as the actual client IP address. This IP address is used for source IP address-based rate limiting.

10.1.1.0/24

XForwardedForClientSrcPortEnabled

boolean

Specifies whether to use the X-Forwarded-Client-Port header to obtain the port of the client that accesses the load balancing instance. Valid values:

  • true: Yes.

  • false: No.

Note

HTTP and HTTPS listeners support this parameter.

true

XForwardedForEnabled

boolean

Specifies whether to use the X-Forwarded-For header to obtain the real IP address of the client. Valid values:

  • true (default): Yes.

  • false: No.

Note
  1. If you set this parameter to true, the default value of XForwardedForProcessingMode is append, and you can change it to remove.

  2. If you set this parameter to false, the X-Forwarded-For header is retained without additional processing before the request is sent to the backend server.

  3. HTTP and HTTPS listeners support this parameter.

true

XForwardedForHostEnabled

boolean

Specifies whether to use the X-Forwarded-Host header to obtain the domain name of the client that accesses the load balancing instance. Valid values:

  • true: Yes.

  • false (default): No.

Note

HTTP, HTTPS, and QUIC listeners support this parameter.

false

XForwardedForProcessingMode

string

The processing mode for the X-Forwarded-For header. This parameter takes effect only when XForwardedForEnabled is set to true. Valid values:

  • append (default): Append.

  • remove: Remove.

Note
  1. If you set this parameter to append, the IP address of the last hop is added to the X-Forwarded-For header before the request is sent to the backend server.

  2. If you set this parameter to remove, the X-Forwarded-For header is deleted before the request is sent to the backend server, regardless of whether the request contains the X-Forwarded-For header.

  3. HTTP and HTTPS listeners support this parameter.

append

XForwardedForProtoEnabled

boolean

Specifies whether to use the X-Forwarded-Proto header to obtain the listener protocol of the load balancing instance. Valid values:

  • true: Yes.

  • false: No.

Note

HTTP, HTTPS, and QUIC listeners support this parameter.

true

XForwardedForSLBIdEnabled

boolean

Specifies whether to use the SLB-ID header to obtain the load balancing instance ID. Valid values:

  • true: Yes.

  • false: No.

Note

HTTP, HTTPS, and QUIC listeners support this parameter.

true

XForwardedForSLBPortEnabled

boolean

Specifies whether to use the X-Forwarded-Port header to obtain the listener port of the load balancing instance. Valid values:

  • true: Yes.

  • false: No.

Note

HTTP, HTTPS, and QUIC listeners support this parameter.

true

MaxResults

integer

The maximum number of records returned for the request.

50

NextToken

string

The token that indicates the position where the current call starts to read data. An empty value indicates that all data has been read.

FFmyTO70tTpLG6I3FmYAXGKPd****

RequestId

string

The request ID.

365F4154-92F6-4AE4-92F8-7FF3******

TotalCount

integer

The total number of records that meet the request conditions.

1000

Examples

Success response

JSON format

{
  "Listeners": [
    {
      "DefaultActions": [
        {
          "ForwardGroupConfig": {
            "ServerGroupTuples": [
              {
                "ServerGroupId": "sgp-i5qt20******"
              }
            ]
          },
          "Type": "ForwardGroup"
        }
      ],
      "GzipEnabled": false,
      "Http2Enabled": false,
      "IdleTimeout": 3,
      "ListenerDescription": "HTTP_80",
      "ListenerId": "lsn-o4u34y73wq7b******",
      "ListenerPort": 80,
      "ListenerProtocol": "HTTP",
      "ListenerStatus": "Running",
      "LoadBalancerId": "alb-bd6oylbckp6k9x****",
      "LogConfig": {
        "AccessLogRecordCustomizedHeadersEnabled": true,
        "AccessLogTracingConfig": {
          "TracingEnabled": true,
          "TracingSample": 100,
          "TracingType": "Zipkin"
        }
      },
      "QuicConfig": {
        "QuicListenerId": "lsn-o4u54y73wq7b******",
        "QuicUpgradeEnabled": true
      },
      "RequestTimeout": 34,
      "SecurityPolicyId": "tls_cipher_policy_1_1",
      "Tags": [
        {
          "Key": "env",
          "Value": "product"
        }
      ],
      "XForwardedForConfig": {
        "XForwardedForClientCertClientVerifyAlias": "test_client-verify-alias_123456",
        "XForwardedForClientCertClientVerifyEnabled": true,
        "XForwardedForClientCertFingerprintAlias": "test_finger-print-alias_123456",
        "XForwardedForClientCertFingerprintEnabled": true,
        "XForwardedForClientCertIssuerDNAlias": "test_issue-dn-alias_123456",
        "XForwardedForClientCertIssuerDNEnabled": true,
        "XForwardedForClientCertSubjectDNAlias": "test_subject-dn-alias_123456",
        "XForwardedForClientCertSubjectDNEnabled": true,
        "XForwardedForClientSourceIpsEnabled": false,
        "XForwardedForClientSourceIpsTrusted": "10.1.1.0/24",
        "XForwardedForClientSrcPortEnabled": true,
        "XForwardedForEnabled": true,
        "XForwardedForHostEnabled": false,
        "XForwardedForProcessingMode": "append",
        "XForwardedForProtoEnabled": true,
        "XForwardedForSLBIdEnabled": true,
        "XForwardedForSLBPortEnabled": true
      }
    }
  ],
  "MaxResults": 50,
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF3******",
  "TotalCount": 1000
}

Error codes

HTTP status code

Error code

Error message

Description

403 Forbidden.LoadBalancer Authentication is failed for %s. Authentication is failed for %s.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.