<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
now we have support network get/create/delete/activate/deactivate<br>
<br>
Now we need to support the <a
href="https://github.com/kimchi-project/kimchi/wiki/customize-VM#organization-of-sub-resources-and-rest-api-exposition">attach/detach/</a>
a Network to a guest. <br>
And get the info of Network attached to a guest.<br>
<br>
<br>
libvirt supports several types of network interfaces:<br>
'bridge','network','user','ethernet','direct','hostdev','mcast',
'server', 'client'<br>
<br>
but there is not a unique "name" attribute for "interface" element.(<a
href="http://libvirt.org/formatdomain.html#elementsNICS">more
libvirt network interfaces info</a>)<br>
<br>
That is not good to define our REST API.<br>
<br>
But for "network" type resource, there is a "network" attribute of
"source" resource. <br>
And the value of "network" attribute is the name of network that we
defined by /networks POST method.<br>
<br>
the "network" type + "network" attribute is unique.<br>
<br>
We can define the Network Interfaces like this to support "network"
type Interfaces:<br>
GET /vms/*name*/Interfaces?type=network&network="default"<br>
But this is not RESTFUL.<br>
<br>
<br>
Maybe We can also name a Network Interface by the Interface mac. <br>
The mac is unique.<br>
GET /vms/*name*/Interfaces/mac<br>
<br>
<br>
The best way for user is get the NICS name in guest. such as eth0,
eth1....<br>
GET /vms/*name*/Interfaces/eth0 <br>
GET /vms/*name*/Interfaces/eth1 <br>
<br>
But there is a problem, we need get the nic name and mac from guest.
<br>
and Make a map in kimchi DB. <br>
also the nic name may change, we need make the map consistence with
guest nic name. <br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Sheldon Feng(冯少合)<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
</body>
</html>