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 Server Load Balancer (SLB) instance.

Valid values: 1 to 65535.

LoadBalancerId String Yes lb-bp1ygod3yctvg1y******

The ID of the SLB instance.

RegionId String Yes cn-hangzhou

The ID of the region where the Server Load Balancer (SLB) instance is deployed.

You can retrieve the region ID 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 SLB instance.

BackendServerPort Integer 443

The backend port that is used by the SLB instance.

Note If the SLB instance uses a vServer group, this parameter is not displayed.
Bandwidth Integer -1

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

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

The state of the listener. Valid values:

  • running: indicates that the listener runs as expected.
  • stopped: indicates that the listener is stopped.
SynProxy String enable

Indicates whether the protection feature SynProxy of SLB is enabled.

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

  • Enable: SynProxy is enabled.
  • Disable: SynProxy is disabled.
Scheduler String wrr

The scheduling algorithm. Valid values:

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

The timeout period of session persistence.

Valid values: 0 to 3600. Unit: seconds. Default value: 0. This 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.

HealthyThreshold Integer 4

The healthy threshold. Indicates the number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy (from fail to success). Valid values: 2 to 10.

UnhealthyThreshold Integer 4

The unhealthy threshold. Indicates the number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy (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 time interval between two consecutive health checks. Valid values: 1 to 50. Unit: seconds.

HealthCheckDomain String www.domain.com

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

  • $_ip: The private IP address of the backend server. If the $_ip parameter is set or the HealthCheckDomain parameter is not set, SLB uses the private IP addresses of backend servers as the domain names for health checks.
  • domain: The domain name must be 1 to 80 characters in length. It can contain only letters, digits, periods (.),and hyphens (-).
HealthCheckURI String /test/index.html

The URL that is used for health checks. The value 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 must not be a single forward slash (/) but it must start with a forward slash (/).

HealthCheckHttpCode String http_2xx

The HTTP status code that indicates the health check is successful.

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

The ID of the associated server group.

AclId String 12

The ID of the access control list (ACL) to which the listener is bound.

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

AclStatus String off

Indicates whether access control is enabled for the listener.

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

AclType String white

The type of the ACL. Valid values:

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

    Risks may occur if the whitelist is improperly set. After you set a whitelist for an SLB listener, only requests from IP addresses that are added to the whitelist are distributed by the listener.

    After a whitelist is enabled for a listener, if no IP address is added to the whitelist, the listener does not distribute requests.

  • black: All requests from the IP addresses or CIDR blocks in the ACL are denied. The blacklist is used to prevent specified IP addresses from accessing an application.

    If the blacklist is enabled but the corresponding ACL does not contain IP addresses, the SLB listener forwards all requests.

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

ConnectionDrain String off

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

Valid values:

  • on: enabled
  • off: disabled
ConnectionDrainTimeout Integer 300

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

Value values: 10 to 900. Unit: seconds.

Description String TCP listeners

The description of the listener.

EstablishedTimeout Integer 500

The timeout period of connections.

HealthCheckConnectTimeout Integer 100

The timeout period.

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>TCP listeners</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":"TCP listeners",
"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.