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

FieldTypeRequiredDescription
LoadBalancerIdstringYesID of the CLB instance. You can call the DescribeLoadBalancers API to obtain the ID.
Portsstring[]YesPorts for creating listeners. Each port corresponds to a listener.
ProtocolstringYesListener protocol. Valid values: TCP, UDP, HTTP, HTTPS, TCP_SSL, and QUIC.
ListenerNamesstring[]NoList 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.
HealthCheckHealthCheckNoHealth check parameter. This parameter applies only to TCP, UDP, TCP_SSL, and QUIC listeners.
CertificateCertificateInputNoCertificate-related information. The parameter limitations are as follows:
SessionExpireTimeintegerNoSession 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.
SchedulerstringNoListener forwarding mode. valid values: WRR (weighted round-robin), LEAST_CONN (LEAST connections).
SniSwitchintegerNoWhether to enable the SNI feature. This parameter applies only to HTTPS listeners. 0: disable; 1: enable.
TargetTypestringNoReal 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.
SessionTypestringNoSession 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…
KeepaliveEnableintegerNoWhether 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.
EndPortintegerNoEnd 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.
DeregisterTargetRstbooleanNoReschedules when unbinding real servers. only supported for TCP/UDP listeners. toggle on to enable this feature.
MultiCertInfoMultiCertInfoNoCertificate information. You can import multiple server certificates with different algorithms at the same time. The parameter limitations are as follows:
MaxConnintegerNoMaximum 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.
MaxCpsintegerNoMaximum 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.
IdleConnectTimeoutintegerNoSpecifies 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.
ProxyProtocolbooleanNoSpecifies whether PP is supported for TCP_SSL and QUIC.
SnatEnablebooleanNoWhether 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.
FullEndPortsstring[]NoEnd port of a listener with a port range. Range of the port: 2–65535.
H2cSwitchbooleanNoEnable private network http listener h2c switch. valid values: True (enable), False (disable).
SslCloseSwitchbooleanNoWhether to disable SSL for TCP_SSL listeners. dual-stack binding is still supported after SSL is disabled. valid values: True (disable), False (enable).
DataCompressModestringNoData compression mode. Valid values: transparent (passthrough mode) and compatibility (compatibility mode).
RescheduleTargetZeroWeightbooleanNoReschedules when setting backend server weight to 0. only supported for TCP/UDP listeners. toggle on to enable this feature.
RescheduleUnhealthybooleanNoReschedules when health check exceptions occur on real servers. only supported for TCP/UDP listeners. toggle on to enable this feature.
RescheduleExpandTargetbooleanNoReschedules when adding or removing backend servers. only supported for TCP/UDP listeners. toggle on to enable this feature.
RescheduleStartTimeintegerNoSpecifies the trigger start time for rescheduling. value range: 0-3600s. supported only by TCP/UDP listeners.
RescheduleIntervalintegerNoRescheduling 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.

FieldTypeDescription
ListenerIdsstring[]Array of the unique IDs of created listeners.
RequestIdstringThe 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; "
    }
  }
}