Queries the configurations of a TCP listener.

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
RegionId String No cn-hangzhou

The ID of the region where the Classic Load Balancer (CLB) instance is deployed.

You can call the DescribeRegions operation to query the most recent region list.

Action String Yes DescribeLoadBalancerTCPListenerAttribute

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

LoadBalancerId String Yes lb-bp1ygod3yctvg1y****

The ID of the CLB instance.

ListenerPort Integer Yes 80

The frontend port that is used by the CLB instance.

Valid values: 1 to 65535.

Response parameters

Parameter Type Example Description
VServerGroupId String rsp-cige6******8

The ID of the associated server group.

Status String running

The status of the listener. Valid values:

  • running
  • stopped
AclType String white

The type of the network access control list (ACL). Valid values:

  • white: a whitelist. Only requests from the IP addresses or CIDR blocks in the network ACL are forwarded. Whitelists apply 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. After a whitelist is configured, only requests from IP addresses that are added to the whitelist are forwarded by the listener.

    If a whitelist is configured but no IP address is added to the whitelist, the listener forwards all requests.

  • black: a blacklist. All requests from the IP addresses or CIDR blocks in the network ACL are denied. Blacklists apply to scenarios in which you want to deny access from specific IP addresses.

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

ConnectionDrainTimeout Integer 200

The timeout period of connection draining. If ConnectionDrain is set to on, the parameter is returned. Unit: seconds.

Valid values: 10 to 900.

RequestId String 365F4154-92F6-4AE4-92F8-7FF34B540710

The ID of the request.

HealthCheckConnectPort Integer 8080

The port that is used for health checks. Valid values: 1 to 65535. If this parameter is not set, the backend port specified by BackendServerPort is used for health checks.

Description String TCPListener

The description of the listener.

The description is 1 to 256 characters in length and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).

Bandwidth Integer -1

The maximum bandwidth of the listener. Unit: Mbit/s. Valid values:

  • -1: For a pay-by-data-transfer Internet-facing CLB instance, this parameter is set to -1. This indicates that the bandwidth of the listener is unlimited.
  • 1 to 5120: For a pay-by-bandwidth Internet-facing CLB instance, you can specify the maximum bandwidth of each listener. The sum of maximum bandwidth of all listeners cannot exceed the maximum bandwidth of the CLB instance.
HealthCheckType String tcp

The health check method that is used by the TCP listener.

Valid values: tcp and http.

MasterSlaveServerGroupId String rsp-0bfucw****

The ID of the primary/secondary server group that is associated with the listener.

BackendServerPort Integer 443

The backend port that is used by the CLB instance.

Note This parameter takes effect only when the VServerGroupId and MasterSlaveServerGroupId parameters are both empty.
AclStatus String off

Indicates whether access control is enabled. Valid values:

  • on
  • off
HealthCheckDomain String domain

The domain name that is used for health checks. Valid values:

  • $_ip: the private IP addresses of backend servers. If you do not set the HealthCheckDomain parameter or set the parameter to $_ip, the CLB instance uses the private IP address of each backend server for health checks.
  • domain: The domain name is 1 to 80 characters in length, and can contain letters, digits, periods (.), and hyphens (-).
UnhealthyThreshold Integer 4

The unhealthy threshold. The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status is changed from success to fail. Valid values: 2 to 10.

HealthCheckHttpCode String http_2xx

The HTTP status code for a successful health check.

Valid values: http_2xx, http_3xx, http_4xx, and http_5xx.

PersistenceTimeout Integer 0

The timeout period of session persistence. Unit: seconds.

Valid values: 0 to 3600. 0 indicates that session persistence is disabled.

ListenerPort Integer 110

The frontend port that is used by the CLB instance.

HealthCheckInterval Integer 5

The interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50.

HealthCheckURI String /test/index.html

The URI that is used for health checks. It is 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URI starts with a forward slash (/) but is not a single forward slash (/).

AclId String 12

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

SynProxy String enable

Indicates whether SYN Proxy is enabled. Valid values:

  • enable
  • disable
Scheduler String wrr

The scheduling algorithm. Valid values:

  • wrr: Backend servers with higher weights receive more requests than those with lower weights.
  • rr: Requests are distributed to backend servers in sequence.
EstablishedTimeout Integer 500

The timeout period of a connection. Unit: seconds.

HealthCheckConnectTimeout Integer 100

The timeout period. Unit: seconds.

HealthyThreshold Integer 4

The healthy threshold. The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status is changed from fail to success. Valid values: 2 to 10.

ConnectionDrain String off

Indicates whether connection draining is enabled. If ConnectionDrain is set to on, the parameter is returned. Valid values:

  • on
  • off
HealthCheckMethod String tcp

The health check method.

HealthCheck String on

Indicates whether the health check feature is enabled. Valid values:

  • on
  • off

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=cn-hangzhou
&Action=DescribeLoadBalancerTCPListenerAttribute
&LoadBalancerId=lb-bp1ygod3yctvg1y****
&ListenerPort=80
&Common request parameters

Sample success responses

XML format

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

<DescribeLoadBalancerTCPListenerAttributeResponse>
    <VServerGroupId>rsp-cige6******8</VServerGroupId>
    <Status>running</Status>
    <AclType>white</AclType>
    <ConnectionDrainTimeout>200</ConnectionDrainTimeout>
    <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
    <HealthCheckConnectPort>8080</HealthCheckConnectPort>
    <Description>TCPListener</Description>
    <Bandwidth>-1</Bandwidth>
    <HealthCheckType>tcp</HealthCheckType>
    <MasterSlaveServerGroupId>rsp-0bfucw****</MasterSlaveServerGroupId>
    <BackendServerPort>443</BackendServerPort>
    <AclStatus>off</AclStatus>
    <HealthCheckDomain>domain</HealthCheckDomain>
    <UnhealthyThreshold>4</UnhealthyThreshold>
    <HealthCheckHttpCode>http_2xx</HealthCheckHttpCode>
    <PersistenceTimeout>0</PersistenceTimeout>
    <ListenerPort>110</ListenerPort>
    <HealthCheckInterval>5</HealthCheckInterval>
    <HealthCheckURI>/test/index.html</HealthCheckURI>
    <AclId>12</AclId>
    <SynProxy>enable</SynProxy>
    <Scheduler>wrr</Scheduler>
    <EstablishedTimeout>500</EstablishedTimeout>
    <HealthCheckConnectTimeout>100</HealthCheckConnectTimeout>
    <HealthyThreshold>4</HealthyThreshold>
    <ConnectionDrain>off</ConnectionDrain>
    <HealthCheckMethod>tcp</HealthCheckMethod>
    <HealthCheck>on</HealthCheck>
</DescribeLoadBalancerTCPListenerAttributeResponse>

JSON format

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

{
  "VServerGroupId" : "rsp-cige6******8",
  "Status" : "running",
  "AclType" : "white",
  "ConnectionDrainTimeout" : 200,
  "RequestId" : "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "HealthCheckConnectPort" : 8080,
  "Description" : "TCPListener",
  "Bandwidth" : -1,
  "HealthCheckType" : "tcp",
  "MasterSlaveServerGroupId" : "rsp-0bfucw****",
  "BackendServerPort" : 443,
  "AclStatus" : "off",
  "HealthCheckDomain" : "domain",
  "UnhealthyThreshold" : 4,
  "HealthCheckHttpCode" : "http_2xx",
  "PersistenceTimeout" : 0,
  "ListenerPort" : 110,
  "HealthCheckInterval" : 5,
  "HealthCheckURI" : "/test/index.html",
  "AclId" : "12",
  "SynProxy" : "enable",
  "Scheduler" : "wrr",
  "EstablishedTimeout" : 500,
  "HealthCheckConnectTimeout" : 100,
  "HealthyThreshold" : 4,
  "ConnectionDrain" : "off",
  "HealthCheckMethod" : "tcp",
  "HealthCheck" : "on"
}

Error codes

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