Queries the listeners of a Global Accelerator (GA) instance.

Description

This API operation is used to query information about the listeners of a GA instance, including the status of each listener, the timestamp that indicates when each listener was created, and the listener ports.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListListeners

The operation that you want to perform. Set the value to ListListeners.

RegionId String Yes cn-hangzhou

The ID of the region where the GA instance is deployed. Set the value to cn-hangzhou.

PageNumber Integer No 1

The number of the page to return. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page. Maximum value: 50. Default value: 10.

AcceleratorId String Yes ga-bp1odcab8tmno0hdq****

The ID of the GA instance.

Response parameters

Parameter Type Example Description
TotalCount Integer 1

The total number of entries returned.

Listeners Array of Listeners

The information about the listeners.

Certificates Array of Certificate

The information about the SSL certificates.

Type String Server

The type of the certificate.

Only Server can be returned, which indicates a server certificate.

Id String 44983xxxx-cn-hangzhou

The ID of the SSL certificate.

BackendPorts Array of BackendPort

The information about the ports of the backend server.

FromPort String 80

The starting port of the backend server.

ToPort String 80

The ending port of the backend server.

ListenerId String lsr-bp1bpn0kn908w4nbw****

The ID of the listener.

Description String Listener

The description of the listener.

State String active

The status of the listener. Valid values:

  • active: The listener is running as expected.
  • creating: The listener is being created.
  • configuring: The listener is being configured.
ClientAffinity String SOURCE_IP

Indicates whether client affinity is enabled for the listener.

  • If NONE is returned, client affinity is disabled. After client affinity is disabled, requests from a specific client IP address may be forwarded to different endpoints.
  • If SOURCE_IP is returned, client affinity is enabled. In this case, when a client accesses stateful applications, requests from the same client are forwarded to the same endpoint regardless of the source port or protocol.
Protocol String TCP

The network transmission protocol that is used by the listener. Valid values:

  • tcp: TCP
  • udp: UDP
  • http: HTTP
  • https: HTTPS
CreateTime Long 1577786252000

The timestamp that indicates when the listener was created.

PortRanges Array of PortRanges

The information about the listener ports.

FromPort Integer 20

The starting listener port that is used to receive and forward requests to endpoints.

Note You can configure only one listener port for an HTTP or HTTPS listener. In this case, the starting and ending listener ports are the same.
ToPort Integer 20

The ending listener port that is used to receive and forward requests to endpoints.

Name String Listener

The name of the listener.

ProxyProtocol Boolean true

Indicates whether client IP addresses are preserved. Valid values:

  • true: client IP addresses are preserved. After this feature is enabled, backend servers can retrieve client IP addresses.
  • false: client IP addresses are not preserved.
AcceleratorId String ga-bp1odcab8tmno0hdq****

The ID of the GA instance.

XForwardedForConfig Object

The configuration of the XForward field.

XForwardedForGaIdEnabled Boolean false

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

  • true: yes
  • false: no
Note Only HTTP and HTTPS listeners support this parameter.
XRealIpEnabled Boolean false

Indicates whether the X-Real-IP header is used to retrieve client IP addresses. Valid values:

  • true: yes
  • false: no
Note Only HTTP and HTTPS listeners support this parameter.
XForwardedForGaApEnabled Boolean false

Indicates whether the GA-AP header is used to retrieve the information about the acceleration area. Valid values:

  • true: yes
  • false: no
Note Only HTTP and HTTPS listeners support this parameter.
XForwardedForProtoEnabled Boolean false

Indicates whether the GA-X-Forward-Proto header is used to retrieve the listener protocol of the GA instance. Valid values:

  • true: yes
  • false: no
Note Only HTTP and HTTPS listeners support this parameter.
XForwardedForPortEnabled Boolean false

Indicates whether the GA-X-Forward-Port header is used to retrieve the listener ports of the GA instance. Valid values:

  • true: yes
  • false: no
Note Only HTTP and HTTPS listeners support this parameter.
SecurityPolicyId String tls_cipher_policy_1_0

The ID of the security policy. Valid values:

  • tls_cipher_policy_1_0
    • Supported TLS versions: TLS 1.0, TLS 1.1, and TLS 1.2.
    • Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.
  • tls_cipher_policy_1_1
    • Supported TLS versions: TLS 1.1 and TLS 1.2.
    • Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.
  • tls_cipher_policy_1_2
    • Supported TLS version: TLS 1.2.
    • Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA256, AES256-SHA256, ECDHE-RSA-AES128-SHA, ECDHE-RSA-AES256-SHA, AES128-SHA, AES256-SHA, and DES-CBC3-SHA.
  • tls_cipher_policy_1_2_strict
    • Supported TLS version: TLS 1.2.
    • Supported cipher suites: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA.
  • tls_cipher_policy_1_2_strict_with_1_3
    • Supported TLS versions: TLS 1.2 and TLS 1.3.
    • Supported cipher suites: TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_128_CCM_8_SHA256, ECDHE-ECDSA-AES128-GCM-SHA256, ECDHE-ECDSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES128-SHA256, ECDHE-ECDSA-AES256-SHA384, ECDHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, ECDHE-ECDSA-AES128-SHA, ECDHE-ECDSA-AES256-SHA, ECDHE-RSA-AES128-SHA, and ECDHE-RSA-AES256-SHA.
Note Only HTTPS listeners support this parameter.
PageSize Integer 10

The number of entries returned per page.

RequestId String 6FEA0CF3-D3B9-43E5-A304-D217037876A8

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListListeners
&RegionId=cn-hangzhou
&PageNumber=1
&PageSize=10
&AcceleratorId=ga-bp1odcab8tmno0hdq****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListListenersResponse>
    <TotalCount>1</TotalCount>
    <Listeners>
        <Certificates>
            <Type>Server</Type>
            <Id>44983xxxx-cn-hangzhou</Id>
        </Certificates>
        <BackendPorts>
            <FromPort>80</FromPort>
            <ToPort>80</ToPort>
        </BackendPorts>
        <ListenerId>lsr-bp1bpn0kn908w4nbw****</ListenerId>
        <Description>Listener</Description>
        <State>active</State>
        <ClientAffinity>SOURCE_IP</ClientAffinity>
        <Protocol>TCP</Protocol>
        <CreateTime>1577786252000</CreateTime>
        <PortRanges>
            <FromPort>20</FromPort>
            <ToPort>20</ToPort>
        </PortRanges>
        <Name>Listener</Name>
        <ProxyProtocol>true</ProxyProtocol>
        <AcceleratorId>ga-bp1odcab8tmno0hdq****</AcceleratorId>
        <XForwardedForConfig>
            <XForwardedForGaIdEnabled>false</XForwardedForGaIdEnabled>
            <XRealIpEnabled>false</XRealIpEnabled>
            <XForwardedForGaApEnabled>false</XForwardedForGaApEnabled>
            <XForwardedForProtoEnabled>false</XForwardedForProtoEnabled>
            <XForwardedForPortEnabled>false</XForwardedForPortEnabled>
        </XForwardedForConfig>
        <SecurityPolicyId>tls_cipher_policy_1_0</SecurityPolicyId>
    </Listeners>
    <PageSize>10</PageSize>
    <RequestId>6FEA0CF3-D3B9-43E5-A304-D217037876A8</RequestId>
    <PageNumber>1</PageNumber>
</ListListenersResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalCount" : 1,
  "Listeners" : [ {
    "Certificates" : [ {
      "Type" : "Server",
      "Id" : "44983xxxx-cn-hangzhou"
    } ],
    "BackendPorts" : [ {
      "FromPort" : "80",
      "ToPort" : "80"
    } ],
    "ListenerId" : "lsr-bp1bpn0kn908w4nbw****",
    "Description" : "Listener",
    "State" : "active",
    "ClientAffinity" : "SOURCE_IP",
    "Protocol" : "TCP",
    "CreateTime" : 1577786252000,
    "PortRanges" : [ {
      "FromPort" : 20,
      "ToPort" : 20
    } ],
    "Name" : "Listener",
    "ProxyProtocol" : true,
    "AcceleratorId" : "ga-bp1odcab8tmno0hdq****",
    "XForwardedForConfig" : {
      "XForwardedForGaIdEnabled" : false,
      "XRealIpEnabled" : false,
      "XForwardedForGaApEnabled" : false,
      "XForwardedForProtoEnabled" : false,
      "XForwardedForPortEnabled" : false
    },
    "SecurityPolicyId" : "tls_cipher_policy_1_0"
  } ],
  "PageSize" : 10,
  "RequestId" : "6FEA0CF3-D3B9-43E5-A304-D217037876A8",
  "PageNumber" : 1
}

Error codes

For a list of error codes, visit the API Error Center.