CreateListener
1. API Description
This API is used to create a load balance listener.
2. Input Parameters
The following request parameter list only provides API request parameters.
loadBalancerId
Yes
String
Load balance instance ID.
listenerName
Yes
String
Name of the listener to be created.
Only letters, numbers, hyphens (-), and periods (.) are supported, and the beginning and end must be letters or numbers.
healthCheck
No
Parameters related to health check.
If this parameter is not passed or healthCheck.enable
= false
, the health check will be disabled.
port
Yes
String
Listening port.
Multiple ports are separated by commas.
When the port is a range, connect with -
, for example: 10000-10005
.
The value range of the port is 1
to 65535
.
Please note that the port cannot overlap with other ports of the listener.
3. Output Parameters
requestId
String
The unique request ID, which is returned for each request. RequestId is required to locate a problem.
listenerId
String
The created listener ID.
4. Code Example
Create a TCP load balance listener to listen to ports 8080-9000
and 8000
without enabling health check.
5. Developer Resources
Zenlayer Cloud API 2.0 SDKs to make it easier for you to call APIs. More programming languages will be supported.
6. Error Codes
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
400
INVALID_LB_STATUS
The load balancer is not in a normal state.
400
INVALID_LISTENER_QUOTA_EXCEED
The number of listeners for the load balancer exceeds the limit.
400
INVALID_PORT_FORMAT_ERROR
Invalid port format.
400
INVALID_LISTENER_PORT_CONFLICT
The port conflicts with other ports of the listener.
400
INVALID_PORT_RANGE
Invalid port range. The port range should be between 1 and 65535.
400
INVALID_LISTENER_PORT_CONFLICT_SELF
The currently configured port is invalid and conflicts with another.
Last updated