Document navigation

AttachVipToLoadBalancer

API Request

URLs

POST zstack/v1/load-balancers/{loadBalancerUuid}/vip/{vipUuid}

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {},
  "systemTags": [],
  "userTags": []
}

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 855586410b7b4c0cba21bfd5ed2df4fb" \
-X POST -d '{"params":{}}' \
http://localhost:8080/zstack/v1/load-balancers/a627a001122d397481460b388659a06b/vip/aa9d600755023b0084ec54593a54c1db

Request Parameters

Name Type Location Description Optional Value Starting Version
loadBalancerUuid String url The load balancer uuid. 5.0.0
vipUuid String url The VIP UUID. 5.0.0
systemTags List body Optional. The system tags. 5.0.0
userTags List body Optional. The user tags. 5.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

AttachVipToLoadBalancerAction action = new AttachVipToLoadBalancerAction();
action.loadBalancerUuid = "a627a001122d397481460b388659a06b";
action.vipUuid = "aa9d600755023b0084ec54593a54c1db";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachVipToLoadBalancerAction.Result res = action.call();

Python SDK

action = AttachVipToLoadBalancerAction()
action.loadBalancerUuid = "a627a001122d397481460b388659a06b"
action.vipUuid = "aa9d600755023b0084ec54593a54c1db"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()