All Products
Search
Document Center

Server Load Balancer:GetListenerAttribute

Last Updated:Feb 20, 2025

Queries the details about a listener.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
alb:GetListenerAttributeget
*LoadBalancer
acs:alb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}
  • acs:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
ListenerIdstringYes

The listener ID.

lsr-bp1bpn0kn908w4nbw****

Response parameters

ParameterTypeDescriptionExample
object

The details about the listener.

AclConfigobject

The configurations of the access control lists (ACLs).

AclRelationsarray<object>

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

aclRelationobject

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

AclIdstring

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

acl-doc****
Statusstring

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

  • Associating
  • Associated
  • Dissociating
Associating
AclTypestring

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
Certificatesarray<object>

A list of certificates.

Certificateobject

The configurations of the certificate.

CertificateIdstring

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

12315790212_166f8204689_1714763408_70998****
CaCertificatesarray<object>

A list of default CA certificates.

Certificateobject
CertificateIdstring

The ID of the default CA certificate.

139a00604bd-cn-east-hangzho****
Statusstring

The status of the certificate.

Associated
IsDefaultboolean

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

  • true
  • false
true
CaEnabledboolean

Indicates whether mutual authentication is enabled. Valid values:

  • true
  • false
false
DefaultActionsarray<object>

The actions of the default forwarding rule.

defaultActionobject

The configurations of the default forwarding rule.

ForwardGroupConfigobject

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

ServerGroupTuplesarray<object>

The server group to which requests are forwarded.

serverGroupTupleobject

The server groups to which requests are forwarded.

ServerGroupIdstring

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

rsp-cige6j****
Typestring

The type of the action.

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

ForwardGroup
GzipEnabledboolean

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

  • true
  • false
true
Http2Enabledboolean

Indicates whether HTTP/2 is enabled. Valid values:

  • true
  • false
Note This parameter is available only when you create an HTTPS listener.
true
IdleTimeoutinteger

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
ListenerDescriptionstring

The name of the listener.

test
ListenerIdstring

The ID of the listener.

lsr-bp1bpn0kn908w4nbw****
ListenerPortinteger

The frontend port that is used by the ALB instance.

80
ListenerProtocolstring

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

HTTP
ListenerStatusstring

The status of the listener. Valid values:

  • Provisioning
  • Running
  • Configuring
  • Stopped
Running
LoadBalancerIdstring

The ALB instance ID.

lb-bp1o94dp5i6ea****
LogConfigobject

The logging configuration.

AccessLogRecordCustomizedHeadersEnabledboolean

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

  • true
  • false
true
AccessLogTracingConfigobject

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

TracingEnabledboolean

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
TracingSampleinteger

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

Note If TracingEnabled is set to true, this parameter is valid.
100
TracingTypestring

The Xtrace type. Supported Xtrace type: Zipkin.

Note If TracingEnabled is set to true, this parameter is valid.
Zipkin
QuicConfigobject

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

QuicListenerIdstring

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-333
QuicUpgradeEnabledboolean

Indicates whether QUIC upgrade is enabled. Valid values:

  • true
  • false
Note Only HTTPS listeners support this parameter.
true
RequestIdstring

The request ID.

365F4154-92F6-4AE4-92F8-7FF34B540710
RequestTimeoutinteger

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
SecurityPolicyIdstring

The security policy.

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

The configuration of the XForward headers.

XForwardedForClientCertClientVerifyAliasstring

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
XForwardedForClientCertClientVerifyEnabledboolean

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
XForwardedForClientCertFingerprintAliasstring

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
XForwardedForClientCertFingerprintEnabledboolean

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
XForwardedForClientCertIssuerDNAliasstring

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
XForwardedForClientCertIssuerDNEnabledboolean

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
XForwardedForClientCertSubjectDNAliasstring

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
XForwardedForClientCertSubjectDNEnabledboolean

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
XForwardedForClientSrcPortEnabledboolean

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
XForwardedForEnabledboolean

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
    XForwardedForProcessingModestring

    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
    XForwardedForProtoEnabledboolean

    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
    XForwardedForSLBIdEnabledboolean

    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
    XForwardedForSLBPortEnabledboolean

    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
    XForwardedForClientSourceIpsEnabledboolean

    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
    XForwardedForClientSourceIpsTrustedstring

    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
    XForwardedForHostEnabledboolean

    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
    Tagsarray<object>

    The tags.

    Tagobject

    The tags.

    Keystring

    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
    Valuestring

    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

    Sample success responses

    JSONformat

    {
      "AclConfig": {
        "AclRelations": [
          {
            "AclId": "acl-doc****",
            "Status": "Associating"
          }
        ],
        "AclType": "White"
      },
      "Certificates": [
        {
          "CertificateId": "12315790212_166f8204689_1714763408_70998****"
        }
      ],
      "CaCertificates": [
        {
          "CertificateId": "139a00604bd-cn-east-hangzho****",
          "Status": "Associated",
          "IsDefault": true
        }
      ],
      "CaEnabled": false,
      "DefaultActions": [
        {
          "ForwardGroupConfig": {
            "ServerGroupTuples": [
              {
                "ServerGroupId": "rsp-cige6j****"
              }
            ]
          },
          "Type": "ForwardGroup"
        }
      ],
      "GzipEnabled": true,
      "Http2Enabled": true,
      "IdleTimeout": 2,
      "ListenerDescription": "test",
      "ListenerId": "lsr-bp1bpn0kn908w4nbw****",
      "ListenerPort": 80,
      "ListenerProtocol": "HTTP",
      "ListenerStatus": "Running",
      "LoadBalancerId": "lb-bp1o94dp5i6ea****",
      "LogConfig": {
        "AccessLogRecordCustomizedHeadersEnabled": true,
        "AccessLogTracingConfig": {
          "TracingEnabled": true,
          "TracingSample": 100,
          "TracingType": "Zipkin"
        }
      },
      "QuicConfig": {
        "QuicListenerId": "lsn-333",
        "QuicUpgradeEnabled": true
      },
      "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
      "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 codeError codeError messageDescription
    403Forbidden.LoadBalancerAuthentication is failed for %s.Authentication is failed for %s.
    404ResourceNotFound.ListenerThe specified resource %s is not found.-

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2024-12-20The Error code has changed. The response structure of the API has changedView Change Details
    2024-01-29The Error code has changedView Change Details
    2022-11-18The Error code has changed. The response structure of the API has changedView Change Details