From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
This patch depends on "[PATCH V1 0/6] VM supports interfaces"
1. get all vms:
$ curl -u <user> -H 'Accept: application/json' -H 'Content-type:
application/json'
http://localhost:8000/vms
2. get all networks:
$ curl -u <user> -H 'Accept: application/json' -H 'Content-type:
application/json'
http://localhost:8000/networks
3. get all ifaces of a vm
$ curl -u <user> -H 'Accept: application/json' -H 'Content-type:
application/json'
http://localhost:8000/vms/test-vm-0/ifaces/
[
{
"mac":"52:54:00:00:00:01",
"model":"virtio",
"type":"network",
"network":"default"
}
]
4. attach a new iface to vm
$ curl -u <user> -H 'Accept: application/json' -H 'Content-type:
application/json'
http://localhost:8000/vms/test-vm-8/ifaces -X POST -d '
{
"type":"network",
"network":"test-network-0"
}
'
{
"mac":"52:54:00:00:00:0d",
"model":"virtio",
"type":"network",
"network":"test-network-0"
}
5. detach a iface from vm
$ curl -u <user> -H 'Accept: application/json' -H 'Content-type:
application/json'
http://localhost:8000/vms/test-vm-8/ifaces/52:54:00:00:00:0d -X
DELETE
ShaoHe Feng (4):
support create/delete VMIface: update model
support create/delete VMIface: update mockmodel
support create/delete VMIface: update API.json
support create/delete VMIface: update testcase
src/kimchi/API.json | 21 ++++++++++++++++++++
src/kimchi/mockmodel.py | 21 ++++++++++++++++++++
src/kimchi/model.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++++-
tests/test_model.py | 22 +++++++++++++++++++++
tests/test_rest.py | 27 ++++++++++++++++++++++++++
5 files changed, 141 insertions(+), 1 deletion(-)
--
1.8.4.2