This API is used to add a listener to a load balancer.
POST /v1.0/{project_id}/elbaas/listeners
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the project ID. |
name |
Yes |
String |
|
description |
No |
String |
|
loadbalancer_id |
Yes |
String |
Specifies the load balancer ID. |
protocol |
Yes |
String |
|
port |
Yes |
Integer |
|
backend_protocol |
Yes |
String |
|
backend_port |
Yes |
Integer |
|
lb_algorithm |
Yes |
String |
|
session_sticky |
No |
Boolean |
|
sticky_session_type |
No |
String |
Specifies where the cookie is from. The only value is insert, indicating that the cookie is inserted by the load balancer.
|
cookie_timeout |
No |
Integer |
|
tcp_timeout |
No |
Integer |
|
tcp_draining |
No |
Boolean |
|
tcp_draining_timeout |
No |
Integer |
|
certificate_id |
No |
String |
|
certificates |
No |
String |
|
udp_timeout |
No |
Integer |
|
ssl_protocols |
No |
String |
|
ssl_ciphers |
No |
String |
|
{ "name": "listener1", "description": "", "loadbalancer_id": "0b07acf06d243925bc24a0ac7445267a", "protocol": "HTTP", "port": 88, "backend_protocol": "HTTP", "backend_port": 80, "lb_algorithm": "roundrobin", "session_sticky": true, "sticky_session_type": "insert", "cookie_timeout": 100, "tcp_draining": true, "tcp_draining_timeout": 5 }
Parameter |
Type |
Description |
---|---|---|
update_time |
String |
Specifies the time when the listener was updated. |
backend_port |
Integer |
Specifies the port used by backend ECSs. |
id |
String |
Specifies the listener ID. |
backend_protocol |
String |
Specifies the protocol used by backend ECSs. |
sticky_session_type |
String |
Specifies where the cookie is from. The only value is insert, indicating that the cookie is inserted by the load balancer. This parameter is valid when protocol is set to HTTP and session_sticky to true. |
description |
String |
Provides supplementary information about the listener. |
loadbalancer_id |
String |
Specifies the load balancer ID. |
create_time |
String |
Specifies the time when the listener was created. |
status |
String |
Specifies the listener status. The value can be ACTIVE, PENDING_CREATE, or ERROR. |
protocol |
String |
Specifies the protocol used for load balancing at Layer 4 or Layer 7. |
port |
Integer |
Specifies the port used by the listener. |
cookie_timeout |
Integer |
|
admin_state_up |
Boolean |
|
session_sticky |
Boolean |
Specifies whether to enable the sticky session feature. The feature is enabled when the value is true. |
lb_algorithm |
String |
Specifies the load balancing algorithm. |
name |
String |
Specifies the listener name. |
tcp_draining |
Boolean |
|
tcp_draining_timeout |
Integer |
|
ssl_protocols |
String |
|
ssl_ciphers |
String |
|
certificate_id |
String |
|
certificates |
String |
|
{ "update_time": "2015-09-15 07:41:17", "backend_port": 80, "tcp_draining": true, "id": "248425d7b97dc26920eb23720115e068", "backend_protocol": "HTTP", "sticky_session_type": "insert", "description": "", "loadbalancer_id": "0b07acf06d243925bc24a0ac7445267a", "create_time": "2015-09-15 07:41:17", "status": "ACTIVE", "protocol": "TCP", "port": 88, "cookie_timeout": 100, "admin_state_up": true, "session_sticky": true, "lb_algorithm": "roundrobin", "name": "listener1", "tcp_draining": true, "tcp_draining_timeout": 5 }
Status Code |
Message |
Description |
---|---|---|
400 |
badRequest |
Request error. |
401 |
unauthorized |
Authentication failed. |
403 |
userDisabled |
You do not have the permission to perform the operation. |
404 |
Not Found |
The requested page does not exist. |
500 |
authFault |
System error. |
503 |
serviceUnavailable |
The service is unavailable. |