All Products
Search
Document Center

Server Load Balancer:GetListenerAttribute

Last Updated:Jan 15, 2026

Queries the details about a listener.

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:GetListenerAttribute

get

*LoadBalancer

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

  • acs:ResourceTag
None

Request parameters

Parameter

Type

Required

Description

Example

ListenerId

string

Yes

The listener ID.

lsn-o4u54y73wq7b******

Response elements

Element

Type

Description

Example

object

The details about the listener.

AclConfig

object

The configurations of the access control lists (ACLs).

AclRelations

array<object>

The IDs of the ACLs that are associated with the listener.

object

The structure of the ACL that is associated with the listener.

AclId

string

The ID of the ACL that is associated with the listener.

acl-doc****

Status

string

Indicates whether the ACL is associated with the listener. Valid values:

  • Associating

  • Associated

  • Dissociating

Associating

AclType

string

The type of the ACL. Valid values:

  • White: a whitelist. Only requests from the IP addresses or CIDR blocks in the network ACL are forwarded. Whitelists are applicable to scenarios in which you want to allow only specific IP addresses to access an application. Your service may be adversely affected if the whitelist is not properly configured. If a whitelist is configured for a listener, only requests from IP addresses that are on the whitelist are forwarded by the listener.

    If you enable a whitelist but do not add an IP address to the whitelist, the listener forwards all requests.

  • Black: a blacklist. Requests from the IP addresses or CIDR blocks in the network ACL are denied. Blacklists are suitable for scenarios in which you want to deny access from specific IP addresses or CIDR blocks to an application.

    If a blacklist is configured for a listener but no IP addresses are added to the blacklist, the listener forwards all requests.

White

Certificates

array<object>

A list of certificates.

object

The configurations of the certificate.

CertificateId

string

The ID of the certificate. Only server certificates are supported.

123157*******

CaCertificates

array<object>

A list of default CA certificates.

object

CertificateId

string

The ID of the default CA certificate.

139a00*****

Status

string

The status of the certificate.

Associated

IsDefault

boolean

Indicates whether the certificate is a default certificate: Valid values:

  • true

  • false

true

CaEnabled

boolean

Indicates whether mutual authentication is enabled. Valid values:

  • true

  • false

false

DefaultActions

array<object>

The actions of the default forwarding rule.

array<object>

The configurations of the default forwarding rule.

ForwardGroupConfig

object

The configuration of the ForwardGroup action. This parameter is returned and takes effect when Type is set to ForwardGroup.

ServerGroupTuples

array<object>

The server group to which requests are forwarded.

object

The server groups to which requests are forwarded.

ServerGroupId

string

The ID of the server group to which requests are forwarded.

sgp-i5qt20******

Type

string

The type of the action.

If ForwardGroup is returned, requests are forwarded to multiple vServer groups.

ForwardGroup

GzipEnabled

boolean

Indicates whether GZIP compression is enabled to compress specific types of files. Valid values:

  • true

  • false

true

Http2Enabled

boolean

Indicates whether HTTP/2 is enabled. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTPS listener.

true

IdleTimeout

integer

The timeout period of an idle connection. Unit: seconds.

If no requests are received within the specified timeout period, Application Load Balancer (ALB) closes the current connection. When a request is received, ALB establishes a new connection.

2

ListenerDescription

string

The name of the listener.

HTTP_80

ListenerId

string

The ID of the listener.

lsn-o4u54y73wq7b******

ListenerPort

integer

The frontend port that is used by the ALB instance.

80

ListenerProtocol

string

The listener protocol. Valid values: HTTP, HTTPS, and QUIC.

HTTP

ListenerStatus

string

The status of the listener. Valid values:

  • Provisioning

  • Running

  • Configuring

  • Stopped

Running

LoadBalancerId

string

The ALB instance ID.

alb-bd6oylbckp6k9x****

LogConfig

object

The logging configuration.

AccessLogRecordCustomizedHeadersEnabled

boolean

Indicates whether custom headers are recorded in the access log. Valid values:

  • true

  • false

true

AccessLogTracingConfig

object

The configuration of Xtrace. Xtrace is used to record requests sent to ALB.

TracingEnabled

boolean

Indicates whether Xtrace is enabled. Valid values:

  • true

  • false

Note

You can set this parameter to true only if the AccessLogEnabled parameter is set to true.

true

TracingSample

integer

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

Note

If TracingEnabled is set to true, this parameter is valid.

100

TracingType

string

The Xtrace type. Supported Xtrace type: Zipkin.

Note

If TracingEnabled is set to true, this parameter is valid.

Zipkin

QuicConfig

object

The configuration information when the listener is associated with a QUIC listener.

QuicListenerId

string

The ID of the QUIC listener. This parameter is returned when QuicUpgradeEnabled is set to true. Only HTTPS listeners support this parameter.

Note

You must associate the HTTPS listener and the QUIC listener with the same ALB instance. In addition, make sure that the QUIC listener has never been associated with another listener.

lsn-ek6ad66t****

QuicUpgradeEnabled

boolean

Indicates whether QUIC upgrade is enabled. Valid values:

  • true

  • false

Note

Only HTTPS listeners support this parameter.

true

RequestId

string

The request ID.

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

RequestTimeout

integer

The timeout period of a request. Unit: seconds.

If no responses are received from the backend server within the specified timeout period, ALB returns an HTTP 504 error code to the client.

34

SecurityPolicyId

string

The security policy.

Note

This parameter is available only when you create an HTTPS listener.

tls_cipher_policy_1_1

XForwardedForConfig

object

The configuration of the XForward headers.

XForwardedForClientCertClientVerifyAlias

string

The name of the custom header. This parameter takes effect only when XForwardedForClientCertClientVerifyEnabled is set to true.

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

Note

This parameter is available only when you create an HTTPS listener.

test_client-verify-alias_123456

XForwardedForClientCertClientVerifyEnabled

boolean

Indicates whether the X-Forwarded-Clientcert-clientverify header is used to retrieve the verification result of the client certificate. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTPS listener.

true

XForwardedForClientCertFingerprintAlias

string

The name of the custom header. This parameter takes effect only when XForwardedForClientCertFingerprintEnabled is set to true.

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

Note

This parameter is available only when you create an HTTPS listener.

test_finger-print-alias_123456

XForwardedForClientCertFingerprintEnabled

boolean

Indicates whether the X-Forwarded-Clientcert-fingerprint header is used to retrieve the fingerprint of the client certificate. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTPS listener.

true

XForwardedForClientCertIssuerDNAlias

string

The name of the custom header. This parameter takes effect only when XForwardedForClientCertIssuerDNEnabled is set to true.

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

Note

This parameter is available only when you create an HTTPS listener.

test_issue-dn-alias_123456

XForwardedForClientCertIssuerDNEnabled

boolean

Indicates whether the X-Forwarded-Clientcert-issuerdn header is used to retrieve information about the authority that issues the client certificate. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTPS listener.

true

XForwardedForClientCertSubjectDNAlias

string

The name of the custom header. This parameter takes effect only when XForwardedForClientCertSubjectDNEnabled is set to true.

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

Note

This parameter is available only when you create an HTTPS listener.

test_subject-dn-alias_123456

XForwardedForClientCertSubjectDNEnabled

boolean

Indicates whether the X-Forwarded-Clientcert-subjectdn header is used to retrieve information about the owner of the client certificate. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTPS listener.

true

XForwardedForClientSrcPortEnabled

boolean

Indicates whether the X-Forwarded-Client-Port header is used to retrieve the client port. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTP or HTTPS listener.

true

XForwardedForEnabled

boolean

Indicates whether the X-Forwarded-For header is used to retrieve the client IP address. Valid values:

  • true (default)

  • false

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

  • If this parameter is set to false, the X-Forwarded-For header in the request is not modified in any way before the request is sent to backend servers.

  • This parameter is only available for HTTP and HTTPS listeners.

true

XForwardedForProcessingMode

string

Specifies how the X-Forwarded-For header is processed. This parameter takes effect only when XForwardedForEnabled is set to true. Valid values:

  • append (default)

  • remove

Note
  • If this parameter is set to append, ALB appends the IP address of the last hop to the existing X-Forwarded-For header in the request before the request is sent to backend servers.

  • If this parameter is set to remove, ALB removes the X-Forwarded-For header in the request before the request is sent to backend servers, no matter whether the request carries the X-Forwarded-For header.

  • This parameter is only available for HTTP and HTTPS listeners.

append

XForwardedForProtoEnabled

boolean

Indicates whether the X-Forwarded-Proto header is used to retrieve the listening protocol. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTP, HTTPS, or QUIC listener.

true

XForwardedForSLBIdEnabled

boolean

Indicates whether the SLB-ID header is used to retrieve the ID of the CLB instance. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTP, HTTPS, or QUIC listener.

true

XForwardedForSLBPortEnabled

boolean

Indicates whether the X-Forwarded-Port header is used to retrieve the listening port of the ALB instance. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTP, HTTPS, or QUIC listener.

true

XForwardedForClientSourceIpsEnabled

boolean

Indicates whether the X-Forwarded-Client-Ip header is used to retrieve the source port of the ALB instance. Valid values:

  • true

  • false

Note

This parameter is available only when you create an HTTP, HTTPS, or QUIC listener.

false

XForwardedForClientSourceIpsTrusted

string

The trusted proxy IP address.

ALB traverses X-Forwarded-For backward and selects the first IP address that is not on the trusted IP address list as the real IP address of the client. The IP address is used in source IP address throttling.

10.1.1.0/24

XForwardedForHostEnabled

boolean

Specifies whether to use the X-Forwarded-Host header to retrieve the client domain name. Valid values:

  • true

  • false (default)

Note

This parameter is available for HTTP, HTTPS, and QUIC listeners.

false

Tags

array<object>

The tags.

object

The tags.

Key

string

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

env

Value

string

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

product

Examples

Success response

JSON format

{
  "AclConfig": {
    "AclRelations": [
      {
        "AclId": "acl-doc****",
        "Status": "Associating"
      }
    ],
    "AclType": "White"
  },
  "Certificates": [
    {
      "CertificateId": "123157*******"
    }
  ],
  "CaCertificates": [
    {
      "CertificateId": "139a00*****",
      "Status": "Associated",
      "IsDefault": true
    }
  ],
  "CaEnabled": false,
  "DefaultActions": [
    {
      "ForwardGroupConfig": {
        "ServerGroupTuples": [
          {
            "ServerGroupId": "sgp-i5qt20******"
          }
        ]
      },
      "Type": "ForwardGroup"
    }
  ],
  "GzipEnabled": true,
  "Http2Enabled": true,
  "IdleTimeout": 2,
  "ListenerDescription": "HTTP_80",
  "ListenerId": "lsn-o4u54y73wq7b******",
  "ListenerPort": 80,
  "ListenerProtocol": "HTTP",
  "ListenerStatus": "Running",
  "LoadBalancerId": "alb-bd6oylbckp6k9x****",
  "LogConfig": {
    "AccessLogRecordCustomizedHeadersEnabled": true,
    "AccessLogTracingConfig": {
      "TracingEnabled": true,
      "TracingSample": 100,
      "TracingType": "Zipkin"
    }
  },
  "QuicConfig": {
    "QuicListenerId": "lsn-ek6ad66t****",
    "QuicUpgradeEnabled": true
  },
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF******",
  "RequestTimeout": 34,
  "SecurityPolicyId": "tls_cipher_policy_1_1",
  "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,
    "XForwardedForClientSrcPortEnabled": true,
    "XForwardedForEnabled": true,
    "XForwardedForProcessingMode": "append",
    "XForwardedForProtoEnabled": true,
    "XForwardedForSLBIdEnabled": true,
    "XForwardedForSLBPortEnabled": true,
    "XForwardedForClientSourceIpsEnabled": false,
    "XForwardedForClientSourceIpsTrusted": "10.1.1.0/24",
    "XForwardedForHostEnabled": false
  },
  "Tags": [
    {
      "Key": "env",
      "Value": "product"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

403 Forbidden.LoadBalancer Authentication is failed for %s. Authentication is failed for %s.
404 ResourceNotFound.Listener The specified resource %s is not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.