ChangeEipState
API Request
URLs
PUT zstack/v1/eips/{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.
{
"changeEipState": {
"stateEvent": "enable"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth ba708ad93aa54eb696ea994d412d539a" \
-X PUT -d '{"changeEipState":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/eips/e6c715aaa65c39aa948d88e548a5f044/actions
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The EIP UUID. | 0.6 | |
stateEvent | String | body (contained in the changeEipState 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": {
"name": "Test-EIP",
"vmNicUuid": "8384e17c064a4b3f819421beb695891d",
"vipUuid": "4ab30bbbf55f4bcda38acd573335d6d7",
"state": "Enabled"
}
}
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 | EipInventory | 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 |
vmNicUuid | String | The VM NIC UUID. | 0.6 |
vipUuid | String | The VIP UUID. | 0.6 |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
state | String | 0.6 | |
vipIp | String | 0.6 | |
guestIp | String | 0.6 |
SDK Sample
Java
SDK
ChangeEipStateAction action = new ChangeEipStateAction();
action.uuid = "ae4f106e8e884788bf73ee2e863a2ad3";
action.stateEvent = "enable";
action.sessionId = "c35fc61e1a784c41a17cb9a0fe9cd2a5";
ChangeEipStateAction.Result res = action.call();
Python
SDK
ChangeEipStateAction action = ChangeEipStateAction()
action.uuid = "b5b5cd464d2d48cca37352fb904e5226"
action.stateEvent = "enable"
action.sessionId = "17f673d897dc47fb845c48fba7af7942"
ChangeEipStateAction.Result res = action.call()