ChangeLoadBalancerBackendServer
API Request
URLs
PUT zstack/v1/load-balancers/servergroups/{serverGroupUuid}/backendserver/actions
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"changeLoadBalancerBackendServer": {
"vmNics": [
{
"c1409d7fc54333d5ad3163d406620c01": "10"
}
],
"servers": [
{
"192.168.1.1": "20"
}
]
},
"systemTags": [],
"userTags": []
}

Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeLoadBalancerBackendServer":{"vmNics":[{"c1409d7fc54333d5ad3163d406620c01":"10"}],"servers":[{"192.168.1.1":"20"}]}}' http://localhost:8080/zstack/v1/load-balancers/servergroups/892bcf49ff433372952a09db93f851e6/backendserver/actions
Request Parameters
Name | Type | Location | Description | Valid Value | Starting Version |
---|---|---|---|---|---|
serverGroupUuid | String | url | The UUID of the server group for load balancing. | 4.0.0 | |
vmNics | List | body(contained in the changeLoadBalancerBackendServer structure) | Optional. The VM NICs. | 4.0.0 | |
servers | List | body(contained in the changeLoadBalancerBackendServer structure) | Optional. The IP addresses of backend servers. | 4.0.0 | |
systemTags | List | body | Optional. The system tags. | 4.0.0 | |
userTags | List | body | Optional. The user tags. | 4.0.0 |
API Response
When the API succeeded, an empty JSON structure
{}
is returned. When
the API failed, the returned JSON structure includes an error field. For
example,{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}
SDK Sample
Java
SDK
ChangeLoadBalancerBackendServerAction action = new ChangeLoadBalancerBackendServerAction();
action.serverGroupUuid = "892bcf49ff433372952a09db93f851e6";
action.vmNics = asList([c1409d7fc54333d5ad3163d406620c01:10]);
action.servers = asList([192.168.1.1:20]);
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeLoadBalancerBackendServerAction.Result res = action.call();
Python
SDK
ChangeLoadBalancerBackendServerAction action = ChangeLoadBalancerBackendServerAction()
action.serverGroupUuid = "892bcf49ff433372952a09db93f851e6"
action.vmNics = [[c1409d7fc54333d5ad3163d406620c01:10]]
action.servers = [[192.168.1.1:20]]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeLoadBalancerBackendServerAction.Result res = action.call()