Queries the configuration of a TCP listener on a Classic Load Balancer (CLB) instance.
RAM authorization
To call this API, grant the RAM user or RAM role the following permission in a Resource Access Management (RAM) policy.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| slb:DescribeLoadBalancerTCPListenerAttribute | get | *loadbalancer acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId} | slb:tag | None |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| RegionId | string | No | The region ID of the CLB instance. To get a region ID, see Regions and zones or call DescribeRegions. | cn-hangzhou |
| LoadBalancerId | string | Yes | The ID of the CLB instance. | lb-bp1ygod3yctvg1y**** |
| ListenerPort | integer | Yes | The frontend port of the listener. Valid values: 1 to 65535. | 80 |
Response elements
| Element | Type | Description | Example |
|---|---|---|---|
| RequestId | string | The request ID. | 365F4154-92F6-4AE4-92F8-7FF34B540710 |
| LoadBalancerId | string | The ID of the CLB instance. | lb-bp1ygod3yctvg1y**** |
| ListenerPort | integer | The frontend port of the listener. | 110 |
| Description | string | The custom listener name. | TCP_80 |
| Status | string | The status of the listener. Valid values: running | stopped. | stopped |
| Bandwidth | integer | The peak bandwidth of the listener, in Mbps. Valid values: -1 (no limit, for pay-by-data-transfer Internet-facing instances) | 1 to 5120 (for pay-by-bandwidth Internet-facing instances; the sum of all listener bandwidths cannot exceed the instance peak bandwidth). | -1 |
| Scheduler | string | The scheduling algorithm. Valid values: wrr (default, weighted round robin) | rr (round robin) | sch (consistent hashing by source IP) | tch (consistent hashing by four-tuple: source IP, destination IP, source port, destination port). Only guaranteed-performance instances support sch and tch. | wrr |
| PersistenceTimeout | integer | The session persistence timeout, in seconds. Valid values: 0 to 3600. 0 means session persistence is disabled. | 0 |
| EstablishedTimeout | integer | The connection timeout for established TCP connections, in seconds. | 500 |
| BackendServerPort | integer | The backend port of the CLB instance. Not returned when the backend server group is a vServer group. | 443 |
| VServerGroupId | string | The ID of the attached vServer group. | rsp-cige6******8 |
| MasterSlaveServerGroupId | string | The ID of the attached primary/secondary server group. | rsp-0bfucw**** |
| SynProxy | string | Whether the SynProxy attack-prevention feature is enabled. Do not adjust this parameter under normal circumstances — CLB manages it automatically. Valid values: enable | disable. | disable |
| ProxyProtocolV2Enabled | boolean | Whether Proxy Protocol v2 is enabled to pass the client source IP address to backend servers. Valid values: true | false. | false |
| AclStatus | string | Whether access control is enabled. Valid values: on | off. | off |
| AclId | string | The ID of the access control policy group attached to the listener. Required when AclStatus is on. | acl-uf60jwfi****** |
| AclType | string | The access control mode. Required when AclStatus is on. Valid values: white | black. See the table below for details. | white |
| AclIds | object | The container for the list of access control policy group IDs. | — |
| AclIds.AclId | array | The list of access control policy group IDs. | — |
| ConnectionDrain | string | Whether connection draining is enabled. Valid values: on | off. | off |
| ConnectionDrainTimeout | integer | The connection draining timeout, in seconds. Returned only when ConnectionDrain is on. Valid values: 10 to 900. | 300 |
| HealthCheck | string | Whether health checks are enabled. Valid values: on | off. | on |
| HealthCheckType | string | The health check method for the TCP listener. Valid values: tcp | http. | tcp |
| HealthCheckConnectPort | integer | The port used for health checks. Valid values: 1 to 65535. Defaults to BackendServerPort if not set. | 8080 |
| HealthCheckConnectTimeout | integer | The health check connection timeout, in seconds. | 100 |
| HealthCheckInterval | integer | The interval between two consecutive health checks, in seconds. Valid values: 1 to 50. | 5 |
| HealthyThreshold | integer | The number of consecutive successful health checks required to mark a backend server as healthy. Valid values: 2 to 10. | 4 |
| UnhealthyThreshold | integer | The number of consecutive failed health checks required to mark a backend server as unhealthy. Valid values: 2 to 10. | 4 |
| HealthCheckDomain | string | The domain name used for health checks. Valid values: $_ip (the private IP address of the backend server) | a domain name of 1–80 characters (letters, digits, periods, and hyphens). | www.domain.com |
| HealthCheckURI | string | The URL used for health checks. Must be 1–80 characters, start with /, and cannot be a single /. Allowed characters: letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). | /test/index.html |
| HealthCheckHttpCode | string | The HTTP status codes that indicate a successful health check. | http_2xx |
| HealthCheckMethod | string | The health check method. | tcp |
| Tags | object | The container for the list of tags. | — |
| Tags.Tag | array | The list of tags attached to the listener. | — |
| Tags.Tag.TagKey | string | The tag key. N is an integer from 1 to 20. Cannot be an empty string. Up to 128 characters. Cannot start with aliyun or acs:, or contain http:// or https://. | TestKey |
| Tags.Tag.TagValue | string | The tag value. N is an integer from 1 to 20. Can be an empty string. Up to 128 characters. Cannot start with acs:, or contain http:// or https://. | TestValue |
AclType values
| Value | Behavior |
|---|---|
| white | Forwards requests only from IP addresses or CIDR blocks in the access control policy group. If the group is empty, all requests are forwarded. Use this mode when the application should be accessible only from specific IP addresses. |
| black | Blocks requests from IP addresses or CIDR blocks in the access control policy group. If the group is empty, all requests are forwarded. Use this mode when the application should block specific IP addresses. |
Examples
Sample success response in JSON format:
{
"VServerGroupId": "rsp-cige6******8",
"Status": "stopped",
"AclType": "white",
"ConnectionDrainTimeout": 300,
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
"HealthCheckConnectPort": 8080,
"Description": "TCP_80",
"Bandwidth": -1,
"HealthCheckType": "tcp",
"MasterSlaveServerGroupId": "rsp-0bfucw****",
"BackendServerPort": 443,
"AclStatus": "off",
"HealthCheckDomain": "www.domain.com",
"UnhealthyThreshold": 4,
"HealthCheckHttpCode": "http_2xx",
"ProxyProtocolV2Enabled": false,
"PersistenceTimeout": 0,
"ListenerPort": 110,
"HealthCheckInterval": 5,
"HealthCheckURI": "/test/index.html",
"AclId": "acl-uf60jwfi******",
"SynProxy": "disable",
"Scheduler": "wrr",
"EstablishedTimeout": 500,
"HealthCheckConnectTimeout": 100,
"HealthyThreshold": 4,
"ConnectionDrain": "off",
"HealthCheckMethod": "tcp",
"HealthCheck": "on",
"AclIds": {
"AclId": [
""
]
},
"LoadBalancerId": "lb-bp1ygod3yctvg1y****",
"Tags": {
"Tag": [
{
"TagKey": "TestKey",
"TagValue": "TestValue"
}
]
}
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | LocationServiceTimeout | Location service connection timeout. Please try again later. | — |
| 403 | UnauthorizedRegion | The specified region of is not authorized. | The specified region is not authorized. |
For a complete list, see Error codes.
Release notes
For a complete list, see Release notes.