计算管理/虚拟机相关接口
POSTVM Related Interfaces起始版本 4.0.0同步需要认证
加载网卡到虚拟机
加载网卡到虚拟机
调试可用性
在线调试
使用当前认证信息和示例参数提交 Mock 请求。
路径参数
请求参数
路径参数
vmNicUuidString必填虚拟机网卡UUID
vmInstanceUuidList必填虚拟机UUID
请求体字段
systemTagsList系统标签
userTagsList用户标签
响应状态
请求地址
POST/zstack/v1/vm-instances/{vmInstanceUuid}/nices/{vmNicUuid}
/zstack/v1/vm-instances/{vmInstanceUuid}/nices/{vmNicUuid}
请求示例
curl -X POST 'http://{host}/zstack/v1/vm-instances/{vmInstanceUuid}/nices/{vmNicUuid}' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
响应示例
200{ "inventory": { "uuid": "afbd67886d773a45af9a20071bcb09bb", "name": "Test-VM", "description": "web server VM", "zoneUuid": "4b9ddab3f5f738f1a0161f5cf5f33f5c", "clusterUuid": "d7061d85666a380cb3dda4cc7f9f16ee", "imageUuid": "179a3412da4a32faa927eae552348907", "hostUuid": "6ee062370eee3df58623fa99be0b2ce0", "lastHostUuid": "09fdbebbaea73df79b744ad0d4bd7088", "instanceOfferingUuid": "6dc0db981e68348e89ac79ed18fa4b24", "rootVolumeUuid": "a876397202ac3d1daf9f4ea67e75e13d", "platform": "Linux", "defaultL3NetworkUuid": "3baaf68d632f3e9aa12be139d58d968e", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 8589934592, "cpuNum": 1, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM", "state": "Running", "vmNics": [ { "uuid": "b9415d324b50301e923a990bf65352d0", "vmInstanceUuid": "afbd67886d773a45af9a20071bcb09bb", "usedIpUuid": "76a49549cb183d35865276187afb482b", "l3NetworkUuid": "3baaf68d632f3e9aa12be139d58d968e", "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, "state": "enable", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ], "allVolumes": [ { "uuid": "a876397202ac3d1daf9f4ea67e75e13d", "name": "Root-Volume-For-VM-afbd67886d773a45af9a20071bcb09bb", "primaryStorageUuid": "336625bac9e0326b9a9abc7801ef2c86", "vmInstanceUuid": "afbd67886d773a45af9a20071bcb09bb", "diskOfferingUuid": "475f8e09aae2389ea6945b46601aa683", "rootImageUuid": "179a3412da4a32faa927eae552348907", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-a876397202ac3d1daf9f4ea67e75e13d/a876397202ac3d1daf9f4ea67e75e13d.qcow2", "type": "Root", "format": "qcow2", "size": 107374182400, "actualSize": 21474836480, "deviceId": 0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ] } }变更历史
此 API 暂无变更历史记录。
