[Kimchi-devel] [PATCH 1/4] vmiface update support: update API.md

Aline Manera alinefm at linux.vnet.ibm.com
Tue Apr 22 16:01:03 UTC 2014


On 04/18/2014 09:46 AM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> update API.md and API.json
>
> Test this patch by:
>
> $ curl -u <user>:<password> -H "Content-Type: application/json" \
>> -H "Accept: application/json"
>> http://localhost:8000/vms/<vmname>/ifaces/<mac> \
>> -X PUT -d '
>> {
>>    "model":"virtio",
>>    "network":"default"
>> }'
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> ---
>   docs/API.md         |  8 ++++++++
>   src/kimchi/API.json | 17 +++++++++++++++++
>   src/kimchi/i18n.py  |  1 +
>   3 files changed, 26 insertions(+)
>
> diff --git a/docs/API.md b/docs/API.md
> index 716c983..26a4937 100644
> --- a/docs/API.md
> +++ b/docs/API.md
> @@ -220,6 +220,14 @@ A interface represents available network interface on VM.
>
>   * **DELETE**: detach the network interface from VM
>
> +* **PUT**: update the parameters of existed VM interface.

typo: s/existed/existing

I can fix it before applying

> +    * model *(optional)*: model of emulated network interface card. It will be one of these models:
> +             ne2k_pci, i82551, i82557b, i82559er, rtl8139, e1000, pcnet and virtio.
> +             This change is only on the persisted VM configuration.
> +    * network *(optional)*: the name of resource network, only be available when the
> +              interface type is network.
> +              This change is on the active VM instance and persisted VM configuration.
> +
>   **Actions (POST):**
>
>   *No actions defined*
> diff --git a/src/kimchi/API.json b/src/kimchi/API.json
> index 3360a9c..9ad8e9d 100644
> --- a/src/kimchi/API.json
> +++ b/src/kimchi/API.json
> @@ -288,6 +288,23 @@
>                   }
>               }
>           },
> +        "vmiface_update": {
> +            "type": "object",
> +            "error": "KCHVMIF0008E",
> +            "properties": {
> +                "network": {
> +                    "description": "the name of one available network",
> +                    "minLength": 1,
> +                    "type": "string",
> +                    "error": "KCHVMIF0005E"
> +                },
> +                "model": {
> +                    "description": "model of emulated network interface card",
> +                    "enum": ["ne2k_pci", "i82551", "i82557b", "i82559er", "rtl8139", "e1000", "pcnet", "virtio", "spapr-vlan"],
> +                    "error": "KCHVMIF0006E"
> +                }
> +            }
> +        },
>           "templates_create": {
>               "type": "object",
>               "error": "KCHTMPL0016E",
> diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
> index 3fc3013..1a57bfd 100644
> --- a/src/kimchi/i18n.py
> +++ b/src/kimchi/i18n.py
> @@ -94,6 +94,7 @@ messages = {
>       "KCHVMIF0005E": _("Network name for virtual machine interface must be a string"),
>       "KCHVMIF0006E": _("Invalid network model card specified for virtual machine interface"),
>       "KCHVMIF0007E": _("Specify type and network to add a new virtual machine interface"),
> +    "KCHVMIF0008E": _("Specify type and network to update a virtual machine interface"),
>
>       "KCHTMPL0001E": _("Template %(name)s already exists"),
>       "KCHTMPL0002E": _("Template %(name)s does not exist"),




More information about the Kimchi-devel mailing list