clb — Cloud Load Balancer
clb · 2018-03-17
CreateListener
POST
Create a listener for a CLB instance.
Wire call
Converge Cloud is RPC over HTTP. There is one path — / — and the action travels in the X-TC-Action header. The /clb/CreateListener path used in the OpenAPI document is a documentation convenience so each action is addressable; it is not a route on the server.
curl
curl -sS https://clb.api3.convergecloud.com/ \
-H 'Authorization: TC3-HMAC-SHA256 Credential=<SecretId>/<YYYY-MM-DD>/clb/tc3_request, SignedHeaders=content-type;host;x-tc-action, Signature=<sig>' \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Host: clb.api3.convergecloud.com' \
-H 'X-TC-Action: CreateListener' \
-H 'X-TC-Version: 2018-03-17' \
-H 'X-TC-Timestamp: <unix-seconds>' \
-H 'X-TC-Region: luzon' \
-d '{"LoadBalancerId":"<LoadBalancerId>","Ports":"<Ports>","Protocol":"<Protocol>"}'Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| LoadBalancerId | string | Yes | ID of the CLB instance. You can call the DescribeLoadBalancers API to obtain the ID. |
| Ports | string[] | Yes | Ports for creating listeners. Each port corresponds to a listener. |
| Protocol | string | Yes | Listener protocol. Valid values: TCP, UDP, HTTP, HTTPS, TCP_SSL, and QUIC. |
| ListenerNames | string[] | No | List of names of listeners to be created. The names correspond to ports one by one. This parameter can be left blank if you do not want to name the listeners immediately. |
| HealthCheck | HealthCheck | No | Health check parameter. This parameter applies only to TCP, UDP, TCP_SSL, and QUIC listeners. |
| Certificate | CertificateInput | No | Certificate-related information. The parameter limitations are as follows: |
| SessionExpireTime | integer | No | Session persistence duration, in seconds. Value range: 30–3600. Default value: 0, indicating that session persistence is not enabled by default. This parameter applies only to TCP and UDP listeners. |
| Scheduler | string | No | Listener forwarding mode. valid values: WRR (weighted round-robin), LEAST_CONN (LEAST connections). |
| SniSwitch | integer | No | Whether to enable the SNI feature. This parameter applies only to HTTPS listeners. 0: disable; 1: enable. |
| TargetType | string | No | Real server type. NODE: ordinary node; TARGETGROUP: real server group. This parameter applies only to TCP and UDP listeners. For layer-7 listeners, set the type in forwarding rules. |
| SessionType | string | No | Session persistence type. If this parameter is not specified or the value is set to NORMAL, the default session persistence type is used. QUIC_CID: perform session persistence based on QUIC connection ID. If the value is set to QUIC_CID, only the UDP protocol is supported. This parameter applies only to TCP and UDP listeners. For layer-7 listeners, set the type in forwarding rules. (If the valu… |
| KeepaliveEnable | integer | No | Whether to enable the persistent connection feature. This parameter applies only to HTTP and HTTPS listeners. 0: disable; 1: enable. This feature is disabled by default. |
| EndPort | integer | No | End port. This parameter is required for creating a listener with a port range. In this case, the input parameter Ports allows only one value to indicate the start port. To experience the port range feature, submit a ticket for application. |
| DeregisterTargetRst | boolean | No | Reschedules when unbinding real servers. only supported for TCP/UDP listeners. toggle on to enable this feature. |
| MultiCertInfo | MultiCertInfo | No | Certificate information. You can import multiple server certificates with different algorithms at the same time. The parameter limitations are as follows: |
| MaxConn | integer | No | Maximum number of connections to a listener. Currently, this parameter applies only to TCP, UDP, TCP_SSL, and QUIC listeners of LCU-supported instances. If this parameter is not specified or the value is set to -1, the maximum number of connections is not limited. This parameter is not supported for classic network-based instances. |
| MaxCps | integer | No | Maximum number of new connections to a listener. Currently, this parameter applies only to TCP, UDP, TCP_SSL, and QUIC listeners of LCU-supported instances. If this parameter is not specified or the value is set to -1, the maximum number of new connections is not limited. This parameter is not supported for classic network-based instances. |
| IdleConnectTimeout | integer | No | Specifies the idle connection timeout in seconds. this parameter applies only to TCP/UDP listeners. default value: 900 for TCP listeners and 300 for UDP listeners. value range: 10–900 for shared instances and dedicated instances and 10–1980 for lcu-supported instances. to set a value exceeding the permissible range, submit a ticket for application. |
| ProxyProtocol | boolean | No | Specifies whether PP is supported for TCP_SSL and QUIC. |
| SnatEnable | boolean | No | Whether SNAT (source IP replacement) is enabled. valid values: True (enabled), False (disabled). disabled by default. note: when SnatEnable is enabled, the client source IP will be replaced, at this point the `pass through client source IP` option is disabled, and vice versa. |
| FullEndPorts | string[] | No | End port of a listener with a port range. Range of the port: 2–65535. |
| H2cSwitch | boolean | No | Enable private network http listener h2c switch. valid values: True (enable), False (disable). |
| SslCloseSwitch | boolean | No | Whether to disable SSL for TCP_SSL listeners. dual-stack binding is still supported after SSL is disabled. valid values: True (disable), False (enable). |
| DataCompressMode | string | No | Data compression mode. Valid values: transparent (passthrough mode) and compatibility (compatibility mode). |
| RescheduleTargetZeroWeight | boolean | No | Reschedules when setting backend server weight to 0. only supported for TCP/UDP listeners. toggle on to enable this feature. |
| RescheduleUnhealthy | boolean | No | Reschedules when health check exceptions occur on real servers. only supported for TCP/UDP listeners. toggle on to enable this feature. |
| RescheduleExpandTarget | boolean | No | Reschedules when adding or removing backend servers. only supported for TCP/UDP listeners. toggle on to enable this feature. |
| RescheduleStartTime | integer | No | Specifies the trigger start time for rescheduling. value range: 0-3600s. supported only by TCP/UDP listeners. |
| RescheduleInterval | integer | No | Rescheduling trigger duration. valid values: 0-3600s. only TCP/UDP listeners support this. |
Response
Fields are returned inside the Response envelope. Converge Cloud answers HTTP 200 for errors as well as successes, so read Response.Error rather than the status code — and test for the presence of that object, because Code is occasionally the empty string.
| Field | Type | Description |
|---|---|---|
| ListenerIds | string[] | Array of the unique IDs of created listeners. |
| RequestId | string | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Success
{
"Response": {
"ListenerIds": …,
"RequestId": "…"
}
}Error
{
"Response": {
"Error": { "Code": "…", "Message": "…" },
"RequestId": "…"
}
}Try it
CredentialThe key never leaves this tab — it signs the request here. The signed request goes to /api-relay/clb.
Request bodyvalid JSONPOST clb.api3.convergecloud.com · CreateListener
What failure looks like
Example error responses for this action. Match on Code.
Recorded error 1
{
"Response": {
"RequestId": "5bb01994-887a-c603-136d-c707ff7e961b",
"Error": {
"Code": "InvalidParameter",
"Message": "[Type 3002] Certificate: Additional property CertKeyName is not allowed; "
}
}
}