AttachEip
API Request
URLs
POST zstack/v1/eips/{eipUuid}/vm-instances/nics/{vmNicUuid}
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.
{
"params": {},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/eips/b7b3d87e803434f3b597638377830e68/vm-instances/nics/3fb731573096397c90dbe65781d5b616
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
eipUuid | String | url | The EIP UUID. | 0.6 | |
vmNicUuid | String | body | The VM NIC UUID. | 0.6 | |
usedIpUuid | String | body (contained in the params structure) | Optional. The IP UUID. | 3.1.0 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
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
AttachEipAction action = new AttachEipAction();
action.eipUuid = "dfee2872f32f4eab81cce8be02d564f7";
action.vmNicUuid = "77439a0f6c464053937fdfc12531647e";
action.sessionId = "80a49201196649f296e8b1c3b03d2284";
AttachEipAction.Result res = action.call();
Python
SDK
AttachEipAction action = AttachEipAction()
action.eipUuid = "080064a02ea9470a9364bdc255c1cfa6"
action.vmNicUuid = "e255a04227b94b5181eda063e1f8b17a"
action.sessionId = "beebaac6f3fe4ac99db525f8775b5a61"
AttachEipAction.Result res = action.call()