All Products
Search
Document Center

Server Load Balancer:DescribeLoadBalancerTCPListenerAttribute

Last Updated:Mar 14, 2024

Queries the configuration 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.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
slb:DescribeLoadBalancerTCPListenerAttributeREAD
  • loadbalancer
    acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}
  • slb:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The region ID of the CLB instance.

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

cn-hangzhou
LoadBalancerIdstringYes

The ID of the CLB instance.

lb-bp1ygod3yctvg1y****
ListenerPortintegerYes

The frontend port used by the CLB instance.

Valid values: 1 to 65535.

80

Response parameters

ParameterTypeDescriptionExample
object
VServerGroupIdstring

The ID of the associated server group.

rsp-cige6******8
Statusstring

The status of the listener. Valid values:

  • running
  • stopped
stopped
AclTypestring

The type of the 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 you enable a whitelist but do not add an IP address to the ACL, the listener forwards all requests.

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

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

Note If AclStatus is set to on, this parameter is returned.
white
ConnectionDrainTimeoutinteger

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

Valid values: 10 to 900. Unit: seconds.

300
RequestIdstring

The ID of the request.

365F4154-92F6-4AE4-92F8-7FF34B540710
HealthCheckConnectPortinteger

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.

8080
Descriptionstring

The description of the listener.

TCP listener
Bandwidthinteger

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.
-1
HealthCheckTypestring

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

Valid values: tcp and http.

tcp
MasterSlaveServerGroupIdstring

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

rsp-0bfucw****
BackendServerPortinteger

The backend port used by the CLB instance.

Note If the listener is associated with a vServer group, this parameter is not returned.
443
AclStatusstring

Indicates whether access control is enabled. Valid values:

  • on: yes
  • off: no
off
HealthCheckDomainstring

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 (-).
www.domain.com
UnhealthyThresholdinteger

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.

4
HealthCheckHttpCodestring

The HTTP status code for a successful health check.

http_2xx
ProxyProtocolV2Enabledboolean

Indicates whether the Proxy protocol is used to pass client IP addresses to backend servers. Valid values:

  • true: yes
  • false: no
false
PersistenceTimeoutinteger

The timeout period of session persistence.

Valid values: 0 to 3600. Unit: seconds. Default value: 0. If the default value is used, the system disables session persistence.

0
ListenerPortinteger

The frontend port used by the CLB instance.

110
HealthCheckIntervalinteger

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

5
HealthCheckURIstring

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 is not a single forward slash (/) but it starts with a forward slash (/).

/test/index.html
AclIdstring

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

If AclStatus is set to on, this parameter is returned.

12
SynProxystring

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
enable
Schedulerstring

The scheduling algorithm.

  • 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.
wrr
EstablishedTimeoutinteger

The timeout period of a connection.

500
HealthCheckConnectTimeoutinteger

The timeout period.

100
HealthyThresholdinteger

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.

4
ConnectionDrainstring

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

  • on: yes
  • off: no
off
HealthCheckMethodstring

The health check method.

tcp
HealthCheckstring

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

  • on: yes
  • off: no
on
LoadBalancerIdstring

The ID of the CLB instance.

lb-bp1ygod3yctvg1y****
Tagsobject []

The tags.

TagKeystring

The tags.

TestKey
TagValuestring

The tag value.

TestValue

Examples

Sample success responses

JSONformat

{
  "VServerGroupId": "rsp-cige6******8",
  "Status": "stopped",
  "AclType": "white",
  "ConnectionDrainTimeout": 300,
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "HealthCheckConnectPort": 8080,
  "Description": "TCP listener",
  "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": "12",
  "SynProxy": "enable",
  "Scheduler": "wrr",
  "EstablishedTimeout": 500,
  "HealthCheckConnectTimeout": 100,
  "HealthyThreshold": 4,
  "ConnectionDrain": "off",
  "HealthCheckMethod": "tcp",
  "HealthCheck": "on",
  "LoadBalancerId": "lb-bp1ygod3yctvg1y****",
  "Tags": {
    "Tag": [
      {
        "TagKey": "TestKey",
        "TagValue": "TestValue"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError message
400LocationServiceTimeoutLocation service connection timeout. Please try again later.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-08The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Added Error Codes: 400