All Products
Search
Document Center

Server Load Balancer:GetListenerAttribute

Last Updated:Mar 01, 2024

Queries the details about a listener.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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:GetListenerAttributeRead
  • 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).

AclRelationsobject []

The IDs of the ACLs that are 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
Certificatesobject []

A list of certificates.

CertificateIdstring

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

12315790212_166f8204689_1714763408_70998****
CaCertificatesobject []

A list of default CA certificates.

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
DefaultActionsobject []

The actions 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.

ServerGroupTuplesobject []

The server group 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
  • false
Note This parameter is available only when you create an HTTP or HTTPS listener.
true
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
Tagsobject []

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,
    "XForwardedForProtoEnabled": true,
    "XForwardedForSLBIdEnabled": true,
    "XForwardedForSLBPortEnabled": true,
    "XForwardedForClientSourceIpsEnabled": false,
    "XForwardedForClientSourceIpsTrusted": "10.1.1.0/24"
  },
  "Tags": [
    {
      "Key": "env",
      "Value": "product"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
404ResourceNotFound.ListenerThe specified resource %s is not found.The specified resource %s is not found.

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

Change history

Change timeSummary of changesOperation
2024-01-29The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 404
    Added Error Codes: 403
2022-11-18The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 404
Output ParametersThe response structure of the API has changed.