Creates a TCP listener.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateLoadBalancerTCPListener |
The operation that you want to perform. Set the value to CreateLoadBalancerTCPListener. |
Bandwidth | Integer | Yes | -1 |
The maximum bandwidth of the listener. Unit: Mbit/s. Valid values:
|
ListenerPort | Integer | Yes | 80 |
The frontend port that is used by the CLB instance. Valid values: 1 to 65535. |
LoadBalancerId | String | Yes | lb-bp1b6c719dfa08ex**** |
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. |
BackendServerPort | Integer | No | 80 |
The backend port that is used by the CLB instance. Valid values: 1 to 65535. If the VServerGroupId parameter is not set, this parameter is required. |
Scheduler | String | No | wrr |
The scheduling algorithm. Valid values:
Note Only high-performance CLB instances support sch and tch.
|
PersistenceTimeout | Integer | No | 0 |
The timeout period of session persistence. Unit: seconds. Valid values: 0 to 3600. Default value: 0. If you set the value to 0, session persistence is disabled. |
EstablishedTimeout | Integer | No | 500 |
The timeout period of connections. Unit: seconds. Value values: 10 to 900. |
HealthyThreshold | Integer | No | 4 |
The number of consecutive health check successes before a backend server is declared healthy (from fail to success). Valid values: 2 to 10. |
UnhealthyThreshold | Integer | No | 4 |
The number of consecutive health check failures before a backend server is declared unhealthy (from success to fail). Valid values: 2 to 10. |
HealthCheckConnectTimeout | Integer | No | 100 |
The timeout period of a health check response. Unit: seconds. Valid values: 1 to 300. Default value: 5. |
HealthCheckConnectPort | Integer | No | 80 |
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 | No | 3 |
The time interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50. |
HealthCheckDomain | String | No | 172.XX.XX.6 |
The domain name used for health checks. Valid values:
|
HealthCheckURI | String | No | /test/index.html |
The uniform resource identifier (URI) that is used for health checks. The URI must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), number signs (#), and ampersands (&). The URI must start with a forward slash (/) but cannot be a single forward slash (/). You can set this parameter when the TCP listener requires HTTP health checks. If you do not set this parameter, TCP health checks are performed. |
HealthCheckHttpCode | String | No | http_2xx,http_3xx |
The HTTP status code that indicates a successful health check. Separate multiple HTTP status codes with commas (,). Valid values:
|
HealthCheckType | String | No | tcp |
The type of health check. Valid values:
|
VServerGroupId | String | No | rsp-cige6j**** |
The ID of the vServer group. |
MasterSlaveServerGroupId | String | No | rsp-0bfucw**** |
The ID of the primary/secondary server group. Note You cannot specify the vServer group ID and primary/secondary server group ID at the
same time.
|
AclId | String | No | 1323 |
The ID of the access control list (ACL) to be associated with the listener. Note If AclStatus is set to on, this parameter is required.
|
AclType | String | No | black |
The type of ACL.
Note If AclStatus is set to on, this parameter is required.
|
AclStatus | String | No | off |
Specifies whether to enable the ACL feature. Default value: off. Valid values:
|
Description | String | No | CreateListeners |
The description of the listener. |
ConnectionDrain | String | No | off |
Specifies whether to enable connection draining. Valid values:
|
ConnectionDrainTimeout | Integer | No | 300 |
The timeout period for connection draining. Unit: seconds. Valid values: 10 to 900. Note If ConnectionDrain is set to on, this parameter is required.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CreateLoadBalancerTCPListener
&Bandwidth=-1
&ListenerPort=80
&LoadBalancerId=lb-bp1b6c719dfa08ex****
&<Common request parameters>
Sample success responses
XML
format
<CreateLoadBalancerTCPListenerResponse>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
</CreateLoadBalancerTCPListenerResponse>
JSON
format
null
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | Abs.VServerGroupIdAndMasterSlaveServerGroupId.MissMatch | The parameters VServerGroupId or MasterSlaveServerGroupId miss match. | The error message returned because the VServerGroupId parameter or the MasterSlaveServerGroupId parameter does not match. |
400 | LbNotSupportTcpssl | You cannot create a TCP SSL type listener for the specified load balancer. | The error message returned because the specified instance does not allow you to create TCP listeners. |
400 | LbSupportTcpsslOnly | The specified load balancer supports TCP SSL type listener only. | The error message returned because the specified instance allows you to create only TCP listeners. |
400 | ListenerNotSupportRule | You cannot create a rule for the specified listener. | The error message returned because the specified listener does not allow you to create forwarding rules. |
400 | Mismatch.SlbSpecTypeAndListenerProtocol | The SlbSpecType and ListenerProtocol are mismatched. | The error message returned because the specified instance type and listener type do not match. |
400 | OperationDenied.FullNatModeNotAllowed | The operation is not allowed because of FullNatModeNotAllowed. | The error message returned because the full NAT mode is not supported. |
400 | OperationDenied.OnlyIpv4SlbSupport | The operation is not allowed because of OnlyIpv4SlbSupport. | The error message returned because only IPv4 instances support the full NAT mode. |
400 | SpecNotSupportParameter | The instance with share spec does not support FullNatEnabled parameter. | The error message returned because resource-shared instances do not support the FullNatEnabled parameter. |
For a list of error codes, visit the API Error Center.