On 02/11/2014 11:58 AM, shaohef(a)linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
The user may clone a template from an existing template with different
name.
He can update some attributes when he clone a template.
And he can also customize some parts of the template to save the effort to
create a full new template later.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
docs/API.md | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/docs/API.md b/docs/API.md
index 580728c..bf4dd78 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -257,7 +257,32 @@ A interface represents available network interface on VM.
**Actions (POST):**
-* *No actions defined*
+* clone: clone a template from an existing template with different name.
To clone a template the user just need to pass the template name to
clone from.
So I expect:
POST /templates {template: /templates/my-template}
This will create a new template based on /templates/my-template
To change the parameters in new template user can use the edit function.
+ * name *(optional)*: A name for the new template.
+ * folder *(optional)*: A virtual path which can be used to organize Templates
+ in a user interface. The format is an array of path components.
+ * icon *(optional)*: A URI to a PNG image representing this template
+ * os_distro *(optional)*: The operating system distribution
+ * os_version *(optional)*: The version of the operating system distribution
+ * cpus *(optional)*: The number of CPUs assigned to the VM
+ * memory *(optional)*: The amount of memory assigned to the VM
+ * cdrom *(optional)*: A volume name or URI to an ISO image
+ * storagepool *(optional)*: URI of the storagepool where template allocates
+ vm storage.
+ * networks *(optional)*: list of networks will be assigned to the new VM.
+ * disks *(optional)*: An array of requested disks with the following optional
+ fields (either *size* or *volume* must be specified):
+ * index: The device index
+ * size: The device size in GB
+ * volume: A volume name that contains the initial disk contents
+ * graphcis *(optional)*: A dict of graphics paramenters of this template
+ * type: The type of graphics. It can be VNC or spice or None.
+ * vnc: Graphical display using the Virtual Network
+ Computing protocol
+ * spice: Graphical display using the Simple Protocol for
+ Independent Computing Environments
+ * null: Graphics is disabled or type not supported
+ * listen: The network which the vnc/spice server listens on.
### Collection: Storage Pools