Document navigation

ChangeLoadBalancerListener

API Request

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
connectionIdleTimeout Integer body (contained in the changeLoadBalancerListener structure) Optional. The connection timeout. 3.4
instancePort Integer body (contained in the changeLoadBalancerListener structure) Optional. The backend server port. 5.5.38
maxConnection Integer body (contained in the changeLoadBalancerListener structure) Optional. The maximum number of concurrent connections. 3.4
balancerAlgorithm String body (contained in the changeLoadBalancerListener structure) Optional. The load balancing algorithm.
  • weightroundrobin
  • roundrobin
  • leastconn
  • source
3.4
healthCheckTarget String body (contained in the changeLoadBalancerListener structure) Optional. The health check port. 3.4
healthyThreshold Integer body (contained in the changeLoadBalancerListener structure) Optional. The threshold of the healthy state. 3.4
unhealthyThreshold Integer body (contained in the changeLoadBalancerListener structure) Optional. The threshold of the unhealthy state. 3.4
healthCheckInterval Integer body (contained in the changeLoadBalancerListener structure) Optional. The health check interval. 3.4
healthCheckProtocol String body (contained in the changeLoadBalancerListener structure) Optional. The health check protocol.
  • tcp
  • udp
  • http
  • https
  • none
3.9
healthCheckTimeout Integer body (contained in the changeLoadBalancerListener structure) Optional. The health check timeout. 5.5.38
healthCheckMethod String body (contained in the changeLoadBalancerListener structure) Optional. The health check method.
  • GET
  • HEAD
3.9
healthCheckURI String body (contained in the changeLoadBalancerListener structure) Optional. The health check URI. 3.9
healthCheckHttpCode String body (contained in the changeLoadBalancerListener structure) Optional. The expected response code of the health check. 3.9
aclStatus String body (contained in the changeLoadBalancerListener structure) The access control status.
  • enable
  • disable
3.9
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
nbprocess Integer body (contained in the changeLoadBalancerListener structure) The number of SLB processes. 4.1
httpMode String body (contained in the changeLoadBalancerListener structure) The HTTP mode of SLB.
  • http-keep-alive
  • http-server-close
  • httpclose
4.1
sessionPersistence String body (contained in the changeLoadBalancerListener structure) The session persistence mode.
  • disable
  • iphash
  • insert
  • rewrite
4.6
sessionIdleTimeout Integer body (contained in the changeLoadBalancerListener structure) The session persistence time. 4.6
cookieName String body (contained in the changeLoadBalancerListener structure) The Cookie name. 4.6
httpVersions List body (contained in the changeLoadBalancerListener structure) Optional. The Load Balancer frontend network HTTP protocol version. 5.0.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
tcpProxyProtocol String body (contained in the changeLoadBalancerListener structure) Optional. The TCP Proxy Protocol agreement. 5.0.0
httpCompressAlgos List body (contained in the changeLoadBalancerListener structure) Optional. The HTTP compression algorithm. 5.0.0
forwardMode String body (contained in the changeLoadBalancerListener structure) Optional. The forwarding mode when the listener uses the IPVS data plane. This parameter can only be specified when creating the listener and cannot be modified afterwards.
  • full_nat
  • nat
  • dr
5.5.28
systemTags List body Optional. The system tags. 3.4
userTags List body Optional. The user tags. 3.4
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 Whether the operation succeeded. 0.6
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory LoadBalancerListenerInventory See inventory. 0.6
#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. 5.3.20
description String The brief description of the error. 5.3.20
details String The details about the error. 5.3.20
elaboration String The reserved field. Default value: null. 5.3.20
opaque LinkedHashMap The reserved field. Default value: null. 5.3.20
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.3.20
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 0.6
name String The resource name. 0.6
description String The detailed description of the resource. 0.6
loadBalancerUuid String The load balancer UUID. 0.6
instancePort Integer The instance port. 0.6
loadBalancerPort Integer The load balancer port. 0.6
protocol String The protocol. 0.6
serverGroupUuid String 4.0
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
vmNicRefs List See vmNicRefs. 0.6
aclRefs List See aclRefs. 3.9
certificateRefs List See certificateRefs. 0.6
serverGroupRefs List See serverGroupRefs. 4.0
#vmNicRefs
Name Type Description Starting Version
id Long The resource ID. 0.6
listenerUuid String The listener UUID. 0.6
vmNicUuid String The VM NIC UUID. 0.6
status String The resource status. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
#aclRefs
Name Type Description Starting Version
id Long The resource UUID. 3.9
listenerUuid String The listener UUID. 3.9
aclUuid String The UUID of the access control list. 3.9
type String The access control type. 3.9
createDate Timestamp The creation date. 3.9
lastOpDate Timestamp The last operation date. 3.9
#certificateRefs
Name Type Description Starting Version
id Long The resource ID. 2.3
listenerUuid String The listener UUID. 2.3
certificateUuid String The certificate UUID. 2.3
createDate Timestamp The creation date. 2.3
lastOpDate Timestamp The last operation date. 2.3
#serverGroupRefs
Name Type Description Starting Version
id long 0.6
listenerUuid String 0.6
serverGroupUuid String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

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
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"
res = action.call()
API Reference | 5.5.38 | ZStack Cloud · ZCF | ZStack Resource Center