<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 02/12/2014 08:35 AM, Aline Manera
wrote:<br>
</div>
<blockquote cite="mid:52FAC1B4.2090705@linux.vnet.ibm.com"
type="cite">On 02/11/2014 10:32 PM, Aline Manera wrote:
<br>
<blockquote type="cite">On 02/11/2014 11:58 AM,
<a class="moz-txt-link-abbreviated" href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a> wrote:
<br>
<blockquote type="cite">From: ShaoHe Feng
<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
<br>
<br>
The user may clone a template from an existing template with
different
<br>
name.
<br>
He can update some attributes when he clone a template.
<br>
And he can also customize some parts of the template to save
the effort to
<br>
create a full new template later.
<br>
<br>
Signed-off-by: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
<br>
---
<br>
docs/API.md | 27 ++++++++++++++++++++++++++-
<br>
1 file changed, 26 insertions(+), 1 deletion(-)
<br>
<br>
diff --git a/docs/API.md b/docs/API.md
<br>
index 580728c..bf4dd78 100644
<br>
--- a/docs/API.md
<br>
+++ b/docs/API.md
<br>
@@ -257,7 +257,32 @@ A interface represents available network
interface on VM.
<br>
<br>
**Actions (POST):**
<br>
<br>
-* *No actions defined*
<br>
+* clone: clone a template from an existing template with
different name.
<br>
</blockquote>
<br>
To clone a template the user just need to pass the template name
to clone from.
<br>
<br>
So I expect:
<br>
POST /templates {template: /templates/my-template}
<br>
</blockquote>
</blockquote>
POST for collection is just for CREATE method. <br>
POST /templates {template: /templates/my-template}
can not tell the kimchi this is a "clone" action. <br>
<blockquote cite="mid:52FAC1B4.2090705@linux.vnet.ibm.com"
type="cite">
<br>
The API can be as you did:
<br>
<br>
POST /templates/my-template/clone to create a new template from
my-template
<br>
<br>
So in this case any parameter is needed
<br>
</blockquote>
None parameter is needed, all they are optional. <br>
In this way, user can clone and customize some parts of the template
one time.<br>
Of course, user still can customize some parts of the template by
"UPDATE" later.<br>
<br>
Here is the history of RFC.<code><br>
</code><code></code>
<blockquote cite="mid:52E918E8.8010907@linux.vnet.ibm.com"
type="cite"> Can we provide a reasonable default the name of the
clone?<br>
</blockquote>
How about we set the default name of the clone as follow?<br>
if the template name is "kimchi-template", then the default name is
"kimchi-template-clone1".<br>
and user will clone this template twice, then the default name is
"kimchi-template-clone2".
<blockquote cite="mid:52E918E8.8010907@linux.vnet.ibm.com"
type="cite"> With the full edit flow in place, its tempting to
just add <br>
a "duplicate template" action to template. The action default
everything in the new template.<br>
</blockquote>
Do you means we let the user pre-edit the template. <br>
for if user want to clone a template with name "template1", but he
just want a CPU numbers are different.<br>
He just modify the current template( "template1") , and press
"clone", then kimchi generate "template1-clone1" template. <br>
We will not save the "template1" what he modify. <br>
and all the attributes of new "template1-clone1" template are same
with "template1" except name and CPU number.<br>
of course, the user can modify the CPU number after he does clone.<br>
<blockquote cite="mid:52FAC1B4.2090705@linux.vnet.ibm.com"
type="cite">
<blockquote type="cite">
<br>
This will create a new template based on /templates/my-template
<br>
<br>
To change the parameters in new template user can use the edit
function.
<br>
<br>
<blockquote type="cite">+ * name *(optional)*: A name for the
new template.
<br>
+ * folder *(optional)*: A virtual path which can be used
to organize Templates
<br>
+ in a user interface. The format is an array of path
components.
<br>
+ * icon *(optional)*: A URI to a PNG image representing
this template
<br>
+ * os_distro *(optional)*: The operating system
distribution
<br>
+ * os_version *(optional)*: The version of the operating
system distribution
<br>
+ * cpus *(optional)*: The number of CPUs assigned to the
VM
<br>
+ * memory *(optional)*: The amount of memory assigned to
the VM
<br>
+ * cdrom *(optional)*: A volume name or URI to an ISO
image
<br>
+ * storagepool *(optional)*: URI of the storagepool where
template allocates
<br>
+ vm storage.
<br>
+ * networks *(optional)*: list of networks will be
assigned to the new VM.
<br>
+ * disks *(optional)*: An array of requested disks with
the following optional
<br>
+ fields (either *size* or *volume* must be specified):
<br>
+ * index: The device index
<br>
+ * size: The device size in GB
<br>
+ * volume: A volume name that contains the initial
disk contents
<br>
+ * graphcis *(optional)*: A dict of graphics paramenters
of this template
<br>
+ * type: The type of graphics. It can be VNC or spice
or None.
<br>
+ * vnc: Graphical display using the Virtual
Network
<br>
+ Computing protocol
<br>
+ * spice: Graphical display using the Simple
Protocol for
<br>
+ Independent Computing Environments
<br>
+ * null: Graphics is disabled or type not
supported
<br>
+ * listen: The network which the vnc/spice server
listens on.
<br>
<br>
### Collection: Storage Pools
<br>
<br>
</blockquote>
<br>
_______________________________________________
<br>
Kimchi-devel mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
<br>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Thanks and best regards!
Sheldon Feng(冯少合)<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
</body>
</html>