All Products
Search
Document Center

Server Load Balancer:ListListeners

Last Updated:Jul 15, 2024

Queries the listeners in a region.

Debugging

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

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • You do not need to specify this parameter for the first request.
  • If a value is returned for NextToken, you must specify the token that is obtained from the previous query as the value of NextToken.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultsintegerNo

The maximum number of entries to return. This parameter is optional. Valid values: 1 to 100. If you do not specify this parameter, the default value 20 is used.

50
ListenerIdsarrayNo

The listener IDs. You can specify at most 20 listener IDs.

stringNo

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

lsr-bp1bpn0kn908w4nbw****
LoadBalancerIdsarrayNo

The ID of the Application Load Balancer (ALB) instance. You can specify at most 20 IDs.

stringNo

The ALB instance ID. You can specify at most 20 IDs.

lb-bp1b6c719dfa08ex*****
ListenerProtocolstringNo

The listener protocol. Valid values:

  • HTTP
  • HTTPS
  • QUIC
HTTP
Tagarray<object>No

The tags.

objectNo

The tags.

KeystringNo

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
ValuestringNo

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

Response parameters

ParameterTypeDescriptionExample
object

The information about the listeners.

Listenersarray<object>

The listeners.

object

The listener.

DefaultActionsarray<object>

The default actions in the forwarding rules.

object

The action of the default forwarding rule.

ForwardGroupConfigobject

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

ServerGroupTuplesarray<object>

The server groups to which requests are forwarded.

object

The server group to which requests are forwarded.

ServerGroupIdstring

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

rsp-cige6j****
Typestring

The action. ForwardGroup: forwards requests to multiple server groups.

ForwardGroup
GzipEnabledboolean

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

  • true
  • false
false
Http2Enabledboolean

Indicates whether HTTP/2 is enabled. Valid values:

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

The timeout period of an idle connection. Unit: seconds. Valid values: 1 to 60.

If no request is received within the specified timeout period, ALB closes the connection. ALB establishes the connection again when a new connection request is received.

3
ListenerDescriptionstring

The name of the listener.

test
ListenerIdstring

The listener ID.

lsr-bp1bpn0kn908w4nbw****
ListenerPortinteger

The frontend port that is used by the ALB instance. Valid values: 1 to 65535.

80
ListenerProtocolstring

The listener protocol of the instance. Valid values:

  • HTTP
  • HTTPS
  • QUIC
HTTP
ListenerStatusstring

The 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 disabled.
Running
LoadBalancerIdstring

The ALB instance ID.

lb-bp1b6c719dfa08ex*****
LogConfigobject

The logging configurations.

AccessLogRecordCustomizedHeadersEnabledboolean

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

  • true
  • false
true
AccessLogTracingConfigobject

The configurations of xtrace.

TracingEnabledboolean

Indicates whether xtrace is enabled. Valid values:

  • true
  • false
Note This parameter can be set to true only when the access log feature of ALB is enabled by setting AccessLogEnabled to true.
true
TracingSampleinteger

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

Note This parameter takes effect when TracingEnabled is set to true.
100
TracingTypestring

The type of xtrace. The value is set to Zipkin.

Note This parameter takes effect when TracingEnabled is set to true.
Zipkin
QuicConfigobject

The configurations of the QUIC listener associated with the ALB instance.

QuicListenerIdstring

The ID of the QUIC listener associated with the ALB instance. This parameter is required if the QuicUpgradeEnabled parameter is set to true. Only HTTPS listeners support this parameter.

Note The existing listener and QUIC listener must be to the same ALB instance, and the QUIC listener has not been associated with an ALB instance.
lsr-bp1bpn908w4nbw****
QuicUpgradeEnabledboolean

Indicates whether QUIC upgrade is enabled. Valid values:

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

The timeout period of a request. Unit: seconds. Valid values: 1 to 180.

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 Only HTTPS listeners support this parameter.
tls_cipher_policy_1_1
XForwardedForConfigobject

The configuration of the XForward header.

XForwardedForClientCertClientVerifyAliasstring

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

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

Note Only HTTPS listeners support this parameter.
test_client-verify-alias_123456
XForwardedForClientCertClientVerifyEnabledboolean

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

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

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

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

Note Only HTTPS listeners support this parameter.
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 Only HTTPS listeners support this parameter.
true
XForwardedForClientCertIssuerDNAliasstring

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

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

Note Only HTTPS listeners support this parameter.
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 Only HTTPS listeners support this parameter.
true
XForwardedForClientCertSubjectDNAliasstring

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

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

Note Only HTTPS listeners support this parameter.
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 Only HTTPS listeners support this parameter.
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 returned only for HTTP and HTTPS listeners.
true
XForwardedForEnabledboolean

Specifies whether to use the X-Forwarded-For header to retrieve client IP addresses. Valid values:

  • true
  • false
Note This parameter is returned only for HTTP and HTTPS listeners.
true
XForwardedForProtoEnabledboolean

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

  • true
  • false
Note This parameter is supported by HTTP, HTTPS, and QUIC listeners.
true
XForwardedForSLBIdEnabledboolean

Specifies whether to use the SLB-ID header to retrieve the ID of the ALB instance. Valid values:

  • true
  • false
Note This parameter is supported by HTTP, HTTPS, and QUIC listeners.
true
XForwardedForSLBPortEnabledboolean

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

  • true
  • false
Note This parameter is supported by HTTP, HTTPS, and QUIC listeners.
true
XForwardedForClientSourceIpsEnabledboolean

Indicates whether the X-Forwarded-For header is used to preserver client IP addresses for the ALB instance. Valid values:

  • true
  • false
Note This parameter is returned only for HTTP and HTTPS listeners.
false
XForwardedForClientSourceIpsTrustedstring

The trusted proxy IP address.

ALB instances traverse the IP addresses in the X-Forwarded-For header from the rightmost IP address to the leftmost IP address. The first IP address that is not on the trusted IP address list is considered the client IP address. Requests from the client IP address are throttled.

10.1.1.0/24
Tagsarray<object>

The tags.

object

The tags.

Keystring

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

env
Valuestring

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

product
MaxResultsinteger

The maximum number of entries returned.

50
NextTokenstring

The position where the query stopped. If this parameter is not returned, all data is queried.

FFmyTO70tTpLG6I3FmYAXGKPd****
RequestIdstring

The request ID.

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

The total number of entries returned.

1000

Examples

Sample success responses

JSONformat

{
  "Listeners": [
    {
      "DefaultActions": [
        {
          "ForwardGroupConfig": {
            "ServerGroupTuples": [
              {
                "ServerGroupId": "rsp-cige6j****"
              }
            ]
          },
          "Type": "ForwardGroup"
        }
      ],
      "GzipEnabled": false,
      "Http2Enabled": false,
      "IdleTimeout": 3,
      "ListenerDescription": "test",
      "ListenerId": "lsr-bp1bpn0kn908w4nbw****",
      "ListenerPort": 80,
      "ListenerProtocol": "HTTP",
      "ListenerStatus": "Running",
      "LoadBalancerId": "lb-bp1b6c719dfa08ex*****",
      "LogConfig": {
        "AccessLogRecordCustomizedHeadersEnabled": true,
        "AccessLogTracingConfig": {
          "TracingEnabled": true,
          "TracingSample": 100,
          "TracingType": "Zipkin"
        }
      },
      "QuicConfig": {
        "QuicListenerId": "lsr-bp1bpn908w4nbw****",
        "QuicUpgradeEnabled": true
      },
      "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"
        }
      ]
    }
  ],
  "MaxResults": 50,
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "TotalCount": 1000
}

Error codes

HTTP status codeError codeError messageDescription
403Forbidden.LoadBalancerAuthentication is failed for %s.Authentication is failed for %s.

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

Change history

Change timeSummary of changesOperation
2024-01-29The Error code has changedView Change Details