ChangeVipState
API Request
URLs
PUT zstack/v1/vips/{uuid}/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.
{
"changeVipState": {
"stateEvent": "enable"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeVipState":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/vips/5dae8db6e42831a1a219768d1f16abb5/actions
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The resource UUID. | 0.6 | |
stateEvent | String | body (contained in the changeVipState structure) | The state event. |
|
0.6 |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventory": {
"uuid": "50be5da2ebcc41b1aa0413b611f2a723",
"name": "vip1",
"ipRangeUuid": "6c8c280a596846a3967c1202cc049770",
"l3NetworkUuid": "df62c1dedde04fffbd591dc737a10772",
"ip": "192.168.0.1",
"state": "Enabled",
"gateway": "127.0.0.1",
"netmask": "255.255.0.0",
"peerL3NetworkUuid": [
"bdb49f66946143538608b8feb6b3c35a"
]
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
inventory | VipInventory | 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. | 0.6 |
description | String | The brief description of the error. | 0.6 |
details | String | The details about the error. | 0.6 |
elaboration | String | The reserved field. Default value: null. | 0.6 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
#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 |
l3NetworkUuid | String | The L3 network UUID. | 0.6 |
ip | String | The IP address of the IPv4 type. | 0.6 |
state | String | The state of the VIP, including Enabled and Enabled. | 0.6 |
gateway | String | The gateway. | 0.6 |
netmask | String | The netmask. | 0.6 |
prefixLen | String | The prefix length. | 3.1.0 |
serviceProvider | String | The service provider that provides the VIP service. | 0.6 |
peerL3NetworkUuid | String | The L3 private network UUID or the VPC L3 network UUID. | 0.6 |
useFor | String | The usage, such as port forwarding. | 0.6 |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
ChangeVipStateAction action = new ChangeVipStateAction();
action.uuid = "2165a4d5e45441088244ff4fa3614412";
action.stateEvent = "enable";
action.sessionId = "2e1079fe6f4f45dab2f97f86d5a0fbc8";
ChangeVipStateAction.Result res = action.call();
Python
SDK
ChangeVipStateAction action = ChangeVipStateAction()
action.uuid = "0191aa0014ae4b24ac7a87886a6d5527"
action.stateEvent = "enable"
action.sessionId = "1549fc2b0547482fb562020512ad89b6"
ChangeVipStateAction.Result res = action.call()