ChangeLoadBalancerListener

API Response

URLs
PUT zstack/v1/load-balancers/listeners/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeLoadBalancerListener": {
    "connectionIdleTimeout": 300,
    "maxConnection": 5000,
    "balancerAlgorithm": "roundrobin",
    "healthCheckTarget": "default",
    "healthyThreshold": 2,
    "unhealthyThreshold": 3,
    "healthCheckInterval": 5,
    "nbprocess": 1,
    "httpMode": "http-keep-alive",
    "sessionPersistence": "insert",
    "sessionIdleTimeout": 60
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeLoadBalancerListener":{"connectionIdleTimeout":300,"maxConnection":5000,"balancerAlgorithm":"roundrobin","healthCheckTarget":"default","healthyThreshold":2,"unhealthyThreshold":3,"healthCheckInterval":5,"nbprocess":1,"httpMode":"http-keep-alive","sessionPersistence":"insert","sessionIdleTimeout":60}}'
http://localhost:8080/zstack/v1/load-balancers/listeners/ca4f7cea0c5a3a329742b127d7f80615/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.4.0
connectionIdleTimeout Integer body (contained in the changeLoadBalancerListener structure) Optional. The connection timeout. 4.6.0
maxConnection Integer body (contained in the changeLoadBalancerListener structure) Optional. The maximum number of concurrent connections. 4.6.0
balancerAlgorithm String body (contained in the changeLoadBalancerListener structure) Optional. The load balancing algorithm.
  • weightroundrobin
  • roundrobin
  • leastconn
  • source
4.6.0
healthCheckTarget String body (contained in the changeLoadBalancerListener structure) Optional. The health check port. 4.6.0
healthyThreshold Integer body (contained in the changeLoadBalancerListener structure) Optional. The threshold of the healthy state. 4.6.0
unhealthyThreshold Integer body (contained in the changeLoadBalancerListener structure) Optional. The threshold of the unhealthy state. 4.6.0
healthCheckInterval Integer body (contained in the changeLoadBalancerListener structure) Optional. The health check interval. 4.6.0
healthCheckProtocol String body (contained in the changeLoadBalancerListener structure) Optional. The health check protocol.
  • tcp
  • udp
  • http
3.9.0
healthCheckMethod String body (contained in the changeLoadBalancerListener structure) Optional. The health check method.
  • GET
  • HEAD
3.9.0
healthCheckURI String body (contained in the changeLoadBalancerListener structure) Optional. The health check URI. 3.9.0
healthCheckHttpCode String body (contained in the changeLoadBalancerListener structure) Optional. The expected response code of the health check. 3.9.0
aclStatus String body (contained in the changeLoadBalancerListener structure) The access control status.
  • enable
  • disable
3.9.0
securityPolicyType String body (contained in the changeLoadBalancerListener structure) The transport layer security policy.
  • tls_cipher_policy_default
  • tls_cipher_policy_1_0
  • tls_cipher_policy_1_1
  • tls_cipher_policy_1_2
  • tls_cipher_policy_1_2_strict
  • tls_cipher_policy_1_2_strict_with_1_3
4.1.0
nbprocess Integer body (contained in the changeLoadBalancerListener structure) The number of SLB processes. 4.1.0
httpMode String body (contained in the changeLoadBalancerListener structure) The HTTP mode of SLB.
  • http-keep-alive
  • http-server-close
  • http-tunnel
  • httpclose
  • forceclose
4.1.0
sessionPersistence String body (contained in the changeLoadBalancerListener structure) The session persistence mode.
  • disable
  • iphash
  • insert
  • rewrite
4.6.0
sessionIdleTimeout Integer body (contained in the changeLoadBalancerListener structure) The session persistence time. 4.6.0
cookieName String body (contained in the changeLoadBalancerListener structure) The Cookie name. 4.6.0
systemTags List body Optional. The system tags. 3.4.0
userTags List body Optional. The user tags. 3.4.0
httpRedirectHttps String body (contained in the changeLoadBalancerListener structure) Optional. The http redirects https.
  • disable
  • enable
4.7.21
redirectPort Integer body (contained in the changeLoadBalancerListener structure) Optional. The redirect port. 4.7.21
statusCode Integer body (contained in the changeLoadBalancerListener structure) Optional. The redirect status code.
  • 301
  • 302
  • 303
  • 307
  • 308
4.7.21
httpVersions List body (contained in the changeLoadBalancerListener structure) Optional. The Load Balancer frontend network HTTP protocol version.
  • h1
  • h2
5.0.0
tcpProxyProtocol String body (contained in the changeLoadBalancerListener structure) Optional. The TCP Proxy Protocol agreement.
  • v1
  • v2
  • disable
5.0.0
httpCompressAlgos List body (contained in the changeLoadBalancerListener structure) Optional. The HTTP compression algorithm.
  • deflate
  • raw-deflate
  • gzip
  • diasble
5.0.0
Note:
  • When you change a parameter of a load balancer listener in ZStack Cloud, you can set the weight of the backend server by adding the balancerWeight option to SystemTags.
    • Format of the balancerWeight option: balancerWeight::{nicUuid}::{weight} . Here, weight is the weight of the backend server. Weight range: 0-100, integer. Default value: 100.
    • Example: balancerWeight::{"c44007641c9040c6b2587e19b1b3e2b0"}::{100}

API Response

Sample Response
{
  "inventory": {
    "uuid": "6356c8f8ae7534bab9a2175144dbc997",
    "name": "Test-Listener",
    "description": "desc info",
    "loadBalancerUuid": "4b32d1a27d8e3d77a606e5014caddd86",
    "instancePort": 80,
    "loadBalancerPort": 80,
    "protocol": "http"
  }
}
Name Type Description Starting Version
success boolean 4.6.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.4.0
inventory LoadBalancerListenerInventory See inventory. 3.4.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.4.0
description String The brief description of the error. 3.4.0
details String The details about the error. 3.4.0
elaboration String The reserved field. Default value: null. 3.4.0
opaque LinkedHashMap The reserved field. Default value: null. 3.4.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.4.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.4.0
name String The resource name. 3.4.0
description String The detailed description of the resource. 3.4.0
loadBalancerUuid String The load balancer UUID. 3.4.0
instancePort Integer 3.4.0
loadBalancerPort Integer 3.4.0
protocol String 3.4.0
createDate Timestamp The creation date. 3.4.0
lastOpDate Timestamp The last operation date. 3.4.0
vmNicRefs List See vmNicRefs. 3.4.0
aclRefs List See aclRefs. 3.9.0
certificateRefs List See certificateRefs. 3.4.0
#vmNicRefs
Name Type Description Starting Version
id Long 3.4.0
listenerUuid String 3.4.0
vmNicUuid String The VM NIC UUID. 3.4.0
status String 3.4.0
createDate Timestamp The creation date. 3.4.0
lastOpDate Timestamp The last operation date. 3.4.0
#aclRefs
Name Type Description Starting Version
id Long The resource UUID. 3.9.0
listenerUuid String The listener UUID. 3.9.0
aclUuid String The UUID of the access control list. 3.9.0
type String The access control type. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
#certificateRefs
Name Type Description Starting Version
id Long 3.4.0
listenerUuid String 3.4.0
certificateUuid String 3.4.0
createDate Timestamp The creation date. 3.4.0
lastOpDate Timestamp The last operation date. 3.4.0

SDK Sample

Java SDK
ChangeLoadBalancerListenerAction action = new ChangeLoadBalancerListenerAction();
action.uuid = "ca4f7cea0c5a3a329742b127d7f80615";
action.connectionIdleTimeout = 300;
action.maxConnection = 5000;
action.balancerAlgorithm = "roundrobin";
action.healthCheckTarget = "default";
action.healthyThreshold = 2;
action.unhealthyThreshold = 3;
action.healthCheckInterval = 5;
action.nbprocess = 1;
action.httpMode = "http-keep-alive";
action.sessionPersistence = "insert";
action.sessionIdleTimeout = 60;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeLoadBalancerListenerAction.Result res = action.call();
Python SDK
ChangeLoadBalancerListenerAction action = ChangeLoadBalancerListenerAction()
action.uuid = "ca4f7cea0c5a3a329742b127d7f80615"
action.connectionIdleTimeout = 300
action.maxConnection = 5000
action.balancerAlgorithm = "roundrobin"
action.healthCheckTarget = "default"
action.healthyThreshold = 2
action.unhealthyThreshold = 3
action.healthCheckInterval = 5
action.nbprocess = 1
action.httpMode = "http-keep-alive"
action.sessionPersistence = "insert"
action.sessionIdleTimeout = 60
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeLoadBalancerListenerAction.Result res = action.call()
API Reference | 5.4.12 | ZStack Cloud · ZCF | ZStack Resource Center