Resource Center/Resource Pool/VM Instance Operations
POSTVM Instance OperationsSince 0.6SynchronousAuth Required
AttachL3NetworkToVm
AttachL3NetworkToVm
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Path Parameters
Request Inputs
Path Parameters
vmInstanceUuidStringRequiredThe VM instance UUID.
l3NetworkUuidStringRequiredThe L3 network UUID.
Body Fields
paramsObjectRequiredRequest body parameter object.
staticIpStringOptional. Specifies the IP address to be allocated to the VM instance.
driverTypeStringRequiredThe NIC driver type.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
POST/zstack/v1/vm-instances/{vmInstanceUuid}/l3-networks/{l3NetworkUuid}
/zstack/v1/vm-instances/{vmInstanceUuid}/l3-networks/{l3NetworkUuid}
Request Example
curl -X POST 'http://{host}/zstack/v1/vm-instances/{vmInstanceUuid}/l3-networks/{l3NetworkUuid}' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"staticIp":"<staticIp>"},"driverType":"<driverType>","systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "e300c6dbbaa1326ebca205a7b2a0e7ea", "name": "Test-VM", "description": "web server VM", "zoneUuid": "c9b73cde21d23866802e8a5178f29f0d", "clusterUuid": "24a72428e400344b88f8c2faa4c292bd", "imageUuid": "5484ed82cdfc366c9657c695577bee37", "hostUuid": "5eb00f0897603309904b418c821b1acb", "lastHostUuid": "b2cfad47a7923346a735008c32ef0d0b", "instanceOfferingUuid": "bbea469feb78345591cc9ac6c0ce0c5c", "rootVolumeUuid": "fc8a81afd11136ac8a48cf458ac2945b", "platform": "Linux", "defaultL3NetworkUuid": "aa3e9117d9793eff81a614b0e18bade7", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 8.589934592E9, "cpuNum": 1.0, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM", "state": "Running", "vmNics": [ { "uuid": "458704a1654637209667e69847ee3a97", "vmInstanceUuid": "e300c6dbbaa1326ebca205a7b2a0e7ea", "usedIpUuid": "b6edb8e1ccc533b98cb9cc1c14baf38b", "l3NetworkUuid": "aa3e9117d9793eff81a614b0e18bade7", "ip": "192.168.1.10", "mac": "00:0c:29:bd:99:fc", "hypervisorType": "KVM", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "deviceId": 0.0, "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ], "allVolumes": [ { "uuid": "fc8a81afd11136ac8a48cf458ac2945b", "name": "Root-Volume-For-VM-e300c6dbbaa1326ebca205a7b2a0e7ea", "primaryStorageUuid": "91dc7f8732243262933100a509ab808a", "vmInstanceUuid": "e300c6dbbaa1326ebca205a7b2a0e7ea", "diskOfferingUuid": "26483e8eca413d809f4f8c6afba75ae2", "rootImageUuid": "5484ed82cdfc366c9657c695577bee37", "installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-fc8a81afd11136ac8a48cf458ac2945b/fc8a81afd11136ac8a48cf458ac2945b.qcow2", "type": "Root", "format": "qcow2", "size": 1.073741824E11, "actualSize": 2.147483648E10, "deviceId": 0.0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ] } }Change History
This API has no change history records yet.
