Document navigation

ChangeLoadBalancerListenerBackendServerState

API Request

URLs
PUT zstack/v1/load-balancers/listeners/{listenerUuid}/servergroups/{serverGroupUuid}/backendservers/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeLoadBalancerListenerBackendServerState": {
    "vmNicUuids": [
      "acd56cea809e3403b709cf8530575add"
    ],
    "state": "Disabled"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding example, the systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeLoadBalancerListenerBackendServerState":{"vmNicUuids":["acd56cea809e3403b709cf8530575add"],"state":"Disabled"}}' \
http://localhost:8080/zstack/v1/load-balancers/listeners/c4400f26d55c37dcbb4b538cb1e8b5ef/servergroups/4b3f55b00c153a7f8ab3c86daf45ed1a/backendservers/actions
Request Parameters
NameTypeLocationDescriptionOptional ValuesStarting Version
listenerUuidStringurlThe SLB listener UUID.5.5.38
serverGroupUuidStringurlThe backend server group UUID.5.5.38
vmNicUuidsListbody (contained in the changeLoadBalancerListenerBackendServerState structure)Optional. The list of VM NIC UUIDs to enable or disable in the current backend server group.5.5.38
serverIpsListbody (contained in the changeLoadBalancerListenerBackendServerState structure)Optional. The list of IP addresses to enable or disable in the current backend server group. Only supported by performance dedicated SLBs, and at least one of this parameter and vmNicUuids must be specified.5.5.38
stateStringbody (contained in the changeLoadBalancerListenerBackendServerState structure)The target administrative state of this operation.
  • Enabled
  • Disabled
5.5.38
systemTagsListbodyOptional. The system tags.5.5.38
userTagsListbodyOptional. The user tags.5.5.38
Note: This API only supports SLB provided by openEuler VPC routers and openEuler performance dedicated SLB (standalone SLB). VyOS is not supported.

API Response

Sample Response
{
  "results": [
    {
      "backendType": "VmNic",
      "vmNicUuid": "926709422db736adb32b9d208afb6648",
      "targetState": "Disabled",
      "effectiveState": "Disabled"
    }
  ]
}
NameTypeDescriptionStarting Version
successbooleanWhether the operation succeeds.5.5.38
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. See error.5.5.38
resultsListSee results.5.5.38
#results
NameTypeDescriptionStarting Version
backendTypeStringThe backend server type. Valid values: VmNic and ServerIp.5.5.38
vmNicUuidStringThe VM NIC UUID.5.5.38
serverIpStringThe IP address of the backend server.5.5.38
targetStateStringThe target administrative state of the request.5.5.38
effectiveStateStringThe administrative state that actually takes effect.5.5.38
#error
NameTypeDescriptionStarting Version
codeStringThe error code, which is a globally unique identifier of the error, for example, SYS.1000 or HOST.1001.5.3.20
descriptionStringThe brief description of the error.5.3.20
detailsStringThe details about the error.5.3.20
elaborationStringThe reserved field. Default: null.5.3.20
opaqueLinkedHashMapThe reserved field. Default: null.5.3.20
causeErrorCodeThe root error, which is the source error that causes the current error. If there is no source error, this field is null.5.3.20

SDK Sample

Java SDK
ChangeLoadBalancerListenerBackendServerStateAction action = new ChangeLoadBalancerListenerBackendServerStateAction();
action.listenerUuid = "c4400f26d55c37dcbb4b538cb1e8b5ef";
action.serverGroupUuid = "4b3f55b00c153a7f8ab3c86daf45ed1a";
action.vmNicUuids = asList("acd56cea809e3403b709cf8530575add");
action.state = "Disabled";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeLoadBalancerListenerBackendServerStateAction.Result res = action.call();
Python SDK
action = ChangeLoadBalancerListenerBackendServerStateAction()
action.listenerUuid = "c4400f26d55c37dcbb4b538cb1e8b5ef"
action.serverGroupUuid = "4b3f55b00c153a7f8ab3c86daf45ed1a"
action.vmNicUuids = ["acd56cea809e3403b709cf8530575add"]
action.state = "Disabled"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
API Reference | 5.5.38 | ZStack Cloud · ZCF | ZStack Resource Center