[Kimchi-devel] [RFC][PATCH] VM supports interfaces

Hongliang Wang hlwang at linux.vnet.ibm.com
Tue Dec 31 05:44:35 UTC 2013


On 12/30/2013 08:41 PM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> now kimchi support supports network get/create/delete/activate/deactivate
> REST API.
>
> Now we need to support the attach/detach/ a Network to a VM.
> https://github.com/kimchi-project/kimchi/wiki/customize-VM#organization-of-sub-resources-and-rest-api-exposition
> And get the info of Network attached to a VM.
>
> more libvirt network interfaces info:
> http://libvirt.org/formatdomain.html#elementsNICS
>
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> ---
>   docs/API.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 49 insertions(+)
>
> diff --git a/docs/API.md b/docs/API.md
> index 9edc551..2d3ce11 100644
> --- a/docs/API.md
> +++ b/docs/API.md
> @@ -127,6 +127,55 @@ Represents a snapshot of the Virtual Machine's primary monitor.
>           * volume: A volume name that contains the initial disk contents
>
>
> +### Sub-Collection: Virtual Machine Network Interfaces
> +
> +**URI:** /vms/*:name*/interfaces
> +
> +Represents all network interfaces attached to a Virtual Machine.
> +
> +**Methods:**
> +
> +* **GET**: Retrieve a summarized list of all network interfaces attached to a Virtual Machine.
> +
> +* **POST**: attach a network interface to VM
> +    * type: The type of VM network interface that libvirt supports.
> +            It can be one of these types: 'network', 'bridge', 'user','ethernet',
> +            'direct', 'hostdev', 'mcast', 'server' and 'client'.
> +            Now kimchi just supports 'network' type.

-            It can be one of these types: 'network', 'bridge', 'user','ethernet',
-            'direct', 'hostdev', 'mcast', 'server' and 'client'.
-            Now kimchi just supports 'network' type.
+            Currently Kimchi only supports type 'network'.

> +    * network *(optional)*: the name of resource network, it is required when the
> +              interface type is network.
> +    * model *(optional)*: model of emulated network interface card. It can be one of these models:
> +            ne2k_pci, i82551, i82557b, i82559er, rtl8139, e1000, pcnet and virtio.
> +            when model is missing, but already some interfaces is attached to VM, then will choose
> +            one of model of the exist interfaces.
> +            if on interface is attached to VM, then 'virtio' is default.
> +
> +### Sub-Resource: Virtual Machine Network Interface
> +
> +**URI:** /vms/*:name*/interfaces/*:name*
> +
> +A interface represents available network interface on VM.
> +
> +**Methods:**
> +
> +* **GET**: Retrieve the full description of the VM network interface
> +    * name: The identifier of the network interface.
> +    * type: The type of VM network interface that libvirt supports.
> +            It will be one of these types: 'network', 'bridge', 'user','ethernet',
> +            'direct', 'hostdev', 'mcast', 'server' and 'client'.
> +    * network *(optional)*: the name of resource network, only be available when the
> +              interface type is network.
> +    * bridge *(optional)*: the name of resource bridge, only be available when the
> +              interface type is bridge.
> +    * mac: Media Access Control Address of the VM interface.
> +
> +* **DELETE**: detach the network interface from VM
> +
> +**Actions (POST):**
> +
> +*No actions defined*
> +
> +
>   ### Resource: Template
>
>   **URI:** /templates/*:name*




More information about the Kimchi-devel mailing list