CreateListener
1. API Description
The API is used to create a TCP or UDP listener for a network load balancer instance.
2. Input Parameters
The following request parameter list only provides API request parameters.
loadBalancerId
Yes
String
Load balancer instance ID.
listenerName
Yes
String
Listener name.
This parameter can contain up to 64 characters. Only letters, numbers, - and periods (.) are supported.
portList
Yes
Array of Integer
Listening ports.
Valid range: 0 to 65535.
For example: 6569.
clientToken
Yes
String
This parameter is used to guarantee idempotence of the request.
protocol
Yes
String
Listening protocol.
Valid value:
TCPUDP
backendProtocol
Yes
String
Backend protocol.
Valid value:
TCPUDP
scheduler
No
String
Scheduling algorithm.
Valid value:
wrr(default): Weighted Round-Robin scheduling. Backend servers that have higher weights receive more requests than backend servers that have lower weights.rr: Round-Robin. Requests are forwarded to backend servers in sequence.
kind
No
String
Working mode.
Valid value:
DR
3. Output Parameters
requestId
String
The unique request ID, which is returned for each request. RequestId is required for locating a problem.
listenerId
String
Listener ID.
4. Code Example
Create a listener.
POST / HTTP/1.1
Host: console.harmonynetworks.net/api/v2/bmc
Content-Type: application/json
X-ZC-Action: CreateListener
<Common Request Params>
Request:
{
"loadBalancerId": "xxxx",
"name": "xxxx",
"portList": [80],
"clientToken": "xxxx",
"protocol": "TCP",
"backendProtocol": "TCP"
}
Response:
{
"requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
"response": {
"requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
"listenerId": "xxxx"
}
}5. Error Codes
No error codes related to the API business logic. For other error codes, see Common Error Codes.
Last updated