[Kimchi-devel] [PATCH V3 3/6] template supports networks: update controller and json schema
Rodrigo Trujillo
rodrigo.trujillo at linux.vnet.ibm.com
Tue Dec 31 02:43:29 UTC 2013
Reviewed-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
On 12/30/2013 02:04 PM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> for json schema, verify the 'networks' option when creating or
> updating template.
> for controller, add 'networks' attribute when GET template.
>
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> ---
> src/kimchi/API.json | 12 ++++++++++++
> src/kimchi/controller.py | 3 ++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/src/kimchi/API.json b/src/kimchi/API.json
> index 7b90826..527bb60 100644
> --- a/src/kimchi/API.json
> +++ b/src/kimchi/API.json
> @@ -125,6 +125,12 @@
> "type": "string",
> "pattern": "^/storagepools/[^/]+/?$"
> },
> + "networks": {
> + "description": "list of which networks will be assigned to the new VM.",
> + "type": "array",
> + "items": { "type": "string" },
> + "uniqueItems": true
> + },
> "folder": {
> "description": "Folder",
> "type": "array",
> @@ -198,6 +204,12 @@
> "type": "string",
> "pattern": "^/storagepools/[^/]+/?$"
> },
> + "networks": {
> + "description": "list of which networks will be assigned to the new VM.",
> + "type": "array",
> + "items": { "type": "string" },
> + "uniqueItems": true
> + },
> "folder": {
> "description": "Folder",
> "type": "array",
> diff --git a/src/kimchi/controller.py b/src/kimchi/controller.py
> index 2940278..4a88a2d 100644
> --- a/src/kimchi/controller.py
> +++ b/src/kimchi/controller.py
> @@ -406,7 +406,7 @@ class Template(Resource):
> super(Template, self).__init__(model, ident)
> self.update_params = ["name", "folder", "icon", "os_distro",
> "storagepool", "os_version", "cpus",
> - "memory", "cdrom", "disks"]
> + "memory", "cdrom", "disks", "networks"]
> self.uri_fmt = "/templates/%s"
>
> @property
> @@ -420,6 +420,7 @@ class Template(Resource):
> 'cdrom': self.info['cdrom'],
> 'disks': self.info['disks'],
> 'storagepool': self.info['storagepool'],
> + 'networks': self.info['networks'],
> 'folder': self.info.get('folder', [])}
>
>
More information about the Kimchi-devel
mailing list