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
Action String Yes DescribeLoadBalancerTCPListenerAttribute

The operation that you want to perform.

Set the value to DescribeLoadBalancerTCPListenerAttribute.

ListenerPort Integer Yes 80

The frontend port that is used by the Classic Load Balancer (CLB) instance.

Valid values: 1 to 65535.

LoadBalancerId String Yes lb-bp1ygod3yctvg1y****

The ID of the CLB instance.

RegionId String Yes cn-hangzhou

The region ID of the CLB instance.

You can query region IDs from the Regions and zones list or by calling the DescribeRegions operation.

Response parameters

Parameter Type Example Description
ListenerPort Integer 110

The frontend port that is used by the CLB instance.

BackendServerPort Integer 443

The backend port that is used by the CLB instance.

Note If the listener is associated with a vServer group, this parameter is not returned.
Bandwidth Integer -1

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

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

The status of the listener. Valid values:

  • running: The listener runs as expected.
  • stopped: The listener is stopped.
SynProxy String enable

Indicates whether the SynProxy feature of CLB is enabled for protection.

We recommend that you use the default value of this parameter. Valid values:

  • enable: yes
  • disable: no
Scheduler String wrr

The scheduling algorithm. Valid values:

  • wrr (default): Backend servers with higher weights receive more requests than backend servers with lower weights.
  • rr: Requests are distributed to backend servers in sequence.
PersistenceTimeout Integer 0

The timeout period of session persistence.

Valid values: 0~3600. Unit: seconds. The default value is 0, which indicates that session persistence is disabled.

HealthCheckType String tcp

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

Valid values: tcp and http.

HealthCheck String on

Indicates whether health checks are enabled.

Valid values: on and off. Default value: on.

HealthyThreshold Integer 4

The number of consecutive health check successes before a backend server is declared as healthy. The number of health checks that an unhealthy backend server must consecutively pass before it can be declared healthy. In this case, the health check state is changed from fail to success. Valid values: 2 to 10.

UnhealthyThreshold Integer 4

The number of consecutive health check failures before a backend server is declared unhealthy. The number of health checks that a healthy backend server must consecutively fail before it can be declared unhealthy. In this case, the health check state is changed from success to fail. Valid values: 2 to 10.

HealthCheckConnectPort Integer 8080

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

HealthCheckInterval Integer 5

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

HealthCheckDomain String www.domain.com

The domain name used for health checks. Valid values:

  • $_ip: the private IP addresses of backend servers. If you set this parameter to $_ip or do not set this parameter, the CLB instance uses the private IP address of each backend server for health checks.
  • domain: The domain name must be 1 to 80 characters in length, and can contain letters, digits, periods (.),and hyphens (-).
HealthCheckURI String /test/index.html

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

HealthCheckHttpCode String http_2xx

The HTTP status code that indicates a successful health check.

VServerGroupId String rsp-cige6******8

The ID of the associated server group.

AclId String 12

The ID of the access control list (ACL) to be associated with the listener.

This parameter is required if the AclStatus parameter is set to on.

AclStatus String off

Indicates whether the access control feature is enabled.

Valid values: on and off. Default value: off.

AclType String white

The type of ACL. Valid values:

  • white: a whitelist. Only requests from the IP addresses or CIDR blocks in the ACL are forwarded. Whitelists apply to scenarios where you want to allow only specific IP addresses to access an application.

    Risks may arise if the whitelist is improperly set. After a whitelist is configured, only IP addresses in the whitelist can access the CLB listener.

    If you enable a whitelist but the whitelist does not contain an IP address, the listener forwards all requests.

  • black: a blacklist. All requests from the IP addresses or CIDR blocks in the ACL are rejected. Blacklists apply to scenarios where you want to block access from specified IP addresses to an application.

    If you enable a blacklist but the blacklist does not contain an IP address, the CLB listener forwards all requests.

Note If AclStatus is set to on, this parameter is required.
ConnectionDrain String off

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

Valid values:

  • on: yes
  • off: no
ConnectionDrainTimeout Integer 300

The timeout period for the connection draining feature. If ConnectionDrain is set to on, the parameter is returned.

Valid values: 10 to 900.

Description String TCPListener

The description of the listener.

EstablishedTimeout Integer 500

The timeout period of connections.

HealthCheckConnectTimeout Integer 100

The timeout period of a health check.

HealthCheckMethod String tcp

The health check method.

MasterSlaveServerGroupId String rsp-0bfucw****

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

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

The ID of the request.

Examples

Sample requests

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

Sample success responses

XML format

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

JSON format

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

Error codes

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