[Kimchi-devel] [PATCH v5 1/5] CDROM Management: API.md and externalized error messages

Royce Lv lvroyce at linux.vnet.ibm.com
Fri Feb 14 07:58:49 UTC 2014


On 2014年02月14日 09:45, Daniel Barboza wrote:
> From: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
>
> This patch changes API.md with new storage sub-collection/sub-resource
> information.
>
> Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
> Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
>
> Excluding hard drive support from docs/API.md
> Adding externalized string to be used in the new exception
> model
>
> Signed-off-by: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
> ---
>   docs/API.md        | 21 +++++++++++++++++++++
>   src/kimchi/i18n.py | 11 +++++++++++
>   2 files changed, 32 insertions(+)
>
> diff --git a/docs/API.md b/docs/API.md
> index 89acd44..2b60d52 100644
> --- a/docs/API.md
> +++ b/docs/API.md
> @@ -117,6 +117,27 @@ Represents a snapshot of the Virtual Machine's primary monitor.
>
>   * **GET**: Redirect to the latest screenshot of a Virtual Machine in PNG format
>
> +
> +### Sub-collection: Virtual Machine storages
> +**URI:** /vms/*:name*/storages
> +* **GET**: Retrieve a summarized list of all storages of specified guest
> +* **POST**: Attach a new storage or virtual drive to specified virtual machine.
> +    * dev: The name of the storage in the vm.
> +    * type: The type of the storage (currently supports  'cdrom' only).
> +    * path: Path of cdrom iso.
> +
> +### Sub-resource: storage
> +**URI:** /vms/*:name*/storages/*:dev*
> +* **GET**: Retrieve storage information
> +    * dev: The name of the storage in the vm.
> +    * type: The type of the storage ('cdrom' only for now).
> +    * path: Path of cdrom iso.
> +* **PUT**: Update storage information
> +    * path: Path of cdrom iso. Can not be blank.
> +* **DELETE**: Remove the storage.
> +
> +
> +
>   ### Collection: Templates
>
>   **URI:** /templates
> diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
> index d3f9fcf..b9ee5ae 100644
> --- a/src/kimchi/i18n.py
> +++ b/src/kimchi/i18n.py
> @@ -185,4 +185,15 @@ messages = {
>       "KCHUTILS0001E": _("Invalid URI %(uri)s"),
>       "KCHUTILS0002E": _("Timeout while running command '%(cmd)s' after %(seconds)s seconds"),
>       "KCHUTILS0003E": _("Unable to choose a virutal machine name"),
> +    "KCHCDROM0001E": _("Invalid cd-rom device name"),
> +    "KCHCDROM0002E": _("Invalid storage type. Types supported: 'cdrom'"),
> +    "KCHCDROM0003E": _("CDROM path must be a valid filesystem, http or ftp path"),
> +    "KCHCDROM0004E": _("Device name %(dev_name)s already exists in vm %(vm_name)s"),
> +    "KCHCDROM0005E": _("%(path)s is not valid local/remote path for the device"),
What is difference with 3E and 5E?
> +    "KCHCDROM0006E": _("Can't specify a directory for a cd-rom device path"),
> +    "KCHCDROM0007E": _("The storage device %(dev_name)s does not exist in the guest %(vm_name)s"),
> +    "KCHCDROM0008E": _("Must specify a device name"),
> +    "KCHCDROM0009E": _("Error while updating storage device: %(error)s"),
> +    "KCHCDROM0010E": _("Error while removing storage device: %(error)s"),
> +    "KCHCDROM0011E": _("Error while creating new storage device: %(error)s"),
>   }




More information about the Kimchi-devel mailing list