lb.api.qcloud.com
Action
field for this API is CreateLoadBalancerListeners
.Parameter | Required | Type | Description |
loadBalancerId | Yes | String | |
listeners.n.loadBalancerPort | Yes | Int | Listening port of the CLB listener. Valid range: 1-65535. listeners is an array. You can create n listeners, and n is a subscript. |
listeners.n.instancePort | Yes | Int | Listening port of CLB listener’s real server. Value range: 1-65535. |
listeners.n.protocol | Yes | Int | Protocol type of the CLB listener. 1: HTTP; 2: TCP; 3: UDP; 4: HTTPS. Public network CLB listeners support HTTP, UDP, TCP and HTTPS protocols; Private network CLB listeners only support TCP and UDP protocols. |
listeners.n.listenerName | No | String | Name of the CLB listener. |
listeners.n.sessionExpire | No | Int | Session persistence duration of the CLB listener. Value range: 0 or 30-3600. Default value: 0. |
listeners.n.healthSwitch | No | Int | Whether to enable the health check for CLB listeners. 1: enable; 0: disable. Default value: 1. |
listeners.n.timeOut | No | Int | Response timeout of health check for the CLB listener, in seconds. Valid range: 2-60, default value: 2. This parameter should be less than the check interval. This parameter is currently unavailable to public network CLB listeners with HTTP or HTTPS protocol. |
listeners.n.intervalTime | No | Int | Health check interval for the CLB listener, in seconds. Value range: 5-300. Default value: 5. |
listeners.n.healthNum | No | Int | Healthy threshold of the CLB listener. Value range: 2-10. Default value: 3, indicating that if a forward is found healthy three consecutive times, it is considered to be normal. |
llisteners.n.unhealthNum | No | Int | Unhealthy threshold of the CLB listener. Value range: 2-10. Default value: 3, indicating that if a forward is found unhealthy three consecutive times, it is considered to be abnormal. |
listeners.n.httpHash | No | String | Forwarding method of the CLB listener. Only public CLB instances with HTTP or HTTPs listeners support this parameter. Valid values: wrr (weighted round robin), ip_hash (forwarding the hash of the source IP to the real server), least_conn (least connection). Default value: wrr. |
listeners.n.scheduler | No | String | Forwarding method of the CLB listener. Only public CLB instances with TCP or UDP listeners support this field. Valid values: wrr (weighted round robin), least_conn (least connection). Default value: wrr. |
listeners.n.httpCode | No | Int | Return code for health status of the HTTP or HTTPS listener of public network CLB instances. Valid range: 1-31. Default value: 31. 1 represents a return code of 1xx (healthy). 2 represents a return code of 2xx (healthy). 4 represents a return code of 3xx (healthy). 8 represents a return code of 4xx (healthy). 16 represents a return code of 5xx (healthy). If there are multiple codes that can show the healthy status, enter the accumulated value corresponding to such codes. |
listeners.n.httpCheckPath | No | String | Health check path for the HTTP or HTTPS listener of public network CLB instances. Default value: / . It must be started with / |
listeners.n.SSLMode | No | String | SSL authentication type of the HTTPS listener of public network CLB instances. unidirectional: one-way authentication; mutual: mutual authentication. This parameter is required to a HTTPS listener. |
listeners.n.certId | No | String | Server certificate ID. For HTTPS listeners, if this field is left empty, you must upload server certificate by specifying parameters including certContent, certKey, and certName. |
listeners.n.certCaId | No | String | Client certificate ID. For HTTPS listeners, if SSLMode=mutual and this field is left empty, you must upload client certificate by specifying the certCaContent and certCaName parameters. |
listeners.n.certCaContent | No | String | Content of the client certificate uploaded. For HTTPS listeners, if SSLMode=mutual and certCaId is left empty, this parameter must be passed in. |
listeners.n.certCaName | No | String | Name of the client CA certificate uploaded. For HTTPS listeners, if SSLMode=mutual and certCaId is left empty, this parameter must be passed in. |
listeners.n.certContent | No | String | Content of the server certificate uploaded. For HTTPS listeners, if certId is left empty, this parameter must be passed in. |
listeners.n.certKey | No | String | Key of the server certificate uploaded. For HTTPS listeners, if certId is left empty, this parameter must be passed in. |
listeners.n.certName | No | String | Name of the server certificate uploaded. For HTTPS listeners, if certId is left empty, this parameter must be passed in. |
Parameter Name | Type | Description |
code | Int | |
message | String | API-related module error message description. |
codeDesc | String | Error code. For a successful operation, "Success" is returned. For a failed operation, a message describing the failure is returned. |
requestId | Int | |
listenerIds | Array | Listener ID array. |
https://lb.api.qcloud.com/v2/index.php?Action=CreateLoadBalancerListeners&loadBalancerId=lb-abcdefgh&listeners.0.loadBalancerPort=443&listeners.0.instancePort=443&listeners.0.protocol=4&listeners.0.SSLMode=mutual&listeners.0.certName=myCertName&listeners.0.certContent=-----BEGIN CERTIFICATE-----MIIE0DCCA7igAwIBAgIQEgaTYAJIpw1PQ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mYteGouY29tggt5dC5mLXhqLmNvbYILZmIuZi14ai5jb22CC3R3LmYteGouY29tME8GA1UdIARIMEYwCAYGZ4EMAQIBMDoGCysGAQQBgptRAQECMCswKQYIKwYBBQUHAgEWHWh0dHA6Ly93d3cud29zaWduLmNvbS9wb2xpY3kvMA0GCSqGSIb3DQEBCwUAA4IBAQCJSd/1xmxwnT/TtKvvxTvDnkCpfsFYVmqiHB/ZrXiMdgobUOfF7C8kcBCTqSQAXZF3fjJ1KyhNulvKOffzGGYp+rMwoTAmfaNLUxD/X9gPLxZCiysDBQ1BLe16k4aKUHIOmqQNF1MD/8hOZBxjevctKaXc4Xqm2gxJLxDHRoY3HKZcdB6t/x7YJU640wvaFqDqIgR6Pc74YjtLrNjkXcf/IQU7c2yjZt9NIGeSOTku5DmFasRf04tmE7naB+wkUZOwAqGK8CESNS11BYZjO/M4G/ALS8zCpShUy89HhYiYAG5jdNI4vyWwaU4428nG3YvKzlTOpCaowqgbyCcqmtAT-----END CERTIFICATE-----&listeners.0.certKey=-----BEGIN RSA PRIVATE KEY-----your own key-----END RSA PRIVATE KEY-----&listeners.0.certCaContent=-----BEGIN CERTIFICATE-----MIIEPDCCAySgAwIBAgIJAJiHd00fZNxoMA0GCSqGSIb3DQEBBQUAMHExCzAJBgNVBAYTAkNOMQswCQYDVQQIEwJHUzELMAkGA1UEBxMCU1oxDTALBgNVBAoTBFhYWFgxDjAMBgNVBAsTBVhYWFhYMQ4wDAYDVQQDEwVBQUFBQTEZMBcGCSqGSIb3DQEJARYKd3d3QHFxLmNvbTAeFw0xNjA4MTExMTUyNTZaFw0xNzA4MDIxMTUyNTZaMHExCzAJBgNVBAYTAkNOMQswCQYDVQQIEwJHUzELMAkGA1UEBxMCU1oxDTALBgNVBAoTBFhYWFgxDjAMBgNVBAsTBVhYWFhYMQ4wDAYDVQQDEwVBQUFBQTEZMBcGCSqGSIb3DQEJARYKd3d3QHFxLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM29SL0TlZaqZb4jEjZ8mkwSeWGVhYaskYtDvxvZQSHZF2A1DtpGojsz+Z3KxgVo4edjY26lfxmFPwPhxoBRgCYDqEOLAOKWRxzXYyP2kr9FN4vs0hzizT4IVxJciOUwmIaQbjzzFQN5BeJ/UTekrs1/YwfJAakP7TvoKUlfBvkKFzRlgdxnGk+/C7+cg1P9F9J4rjm/Rn+0HhO0QshsAo1IT4jZF356yvk/g0upLhZexo39jKf4ypmtcHTusYcAoRGhbCk26taM4aeQxMnB715ZkQhqB1+dyM6SWRFysYpteEK+jEH8wWPQriqIlcRJxncy/8B4RmHIJxXRG8Tb8TUCAwEAAaOB1jCB0zAdBgNVHQ4EFgQUp/qOq6q7ezAVxEhXtrsPMa4aiq4wgaMGA1UdIwSBmzCBmIAUp/qOq6q7ezAVxEhXtrsPMa4aiq6hdaRzMHExCzAJBgNVBAYTAkNOMQswCQYDVQQIEwJHUzELMAkGA1UEBxMCU1oxDTALBgNVBAoTBFhYWFgxDjAMBgNVBAsTBVhYWFhYMQ4wDAYDVQQDEwVBQUFBQTEZMBcGCSqGSIb3DQEJARYKd3d3QHFxLmNvbYIJAJiHd00fZNxoMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAJ2XTOKyR2nFgaWcTG5d92tSij3lIoZCBo4dwrleYFuWcYUYSi65QskJpuDHr5KttmI4+0tt9OQOB/oHIEbkCqgEAC7PREJAgapcf5+ItMHNrNh151CkTyoK1Z09tw3OrX5GQVAHSpz0+BQTE+MPas5lyidwP1PqQFY9nZW4J3PGRAbiiSnQ1eN5g0aKzIZpbEbP7Y7BGT9b+rLt+VUbmQ30h96zHchSsUsQ32dchwLmN0ZL1PyCivQ+A1snbqA3uHZnoXBd8/yq0QNg0o15edx+GfbY5FJbgXf3FER+NgMBwPeJ62izpROBQvXYNb3e72gM1xCAlgD+MBpNeGlx56g=-----END CERTIFICATE-----&listeners.0.certCaName=myCertCaName
{"code": 0,"message": "","codeDesc": "Success","requestId": 28557,"listenerIds": ["lbl-hox8i4q0"]}
Was this page helpful?