<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 2014年07月17日 12:24, Sheldon wrote:<br>
</div>
<blockquote cite="mid:53C7500A.7080609@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">On 07/17/2014 08:54 AM, Aline Manera
wrote:<br>
</div>
<blockquote cite="mid:53C71EB7.70707@linux.vnet.ibm.com"
type="cite"> <br>
On 07/16/2014 09:35 PM, Aline Manera wrote: <br>
<blockquote type="cite"> <br>
On 07/15/2014 12:45 PM, <a moz-do-not-send="true"
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
moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
<br>
<br>
V1 -> V2: <br>
make ticket as sub-resource of a VM <br>
</blockquote>
<br>
Do we need a new sub-resource? <br>
Why not use PUT /vms/<my-vm> {passwd:...} ? <br>
</blockquote>
</blockquote>
How do we get the passwd?<br>
GET /vms/<my-vm><br>
{<br>
<blockquote>"name": my-vm,<br>
"cpu": 1,<br>
"memory": 512,<br>
"passwd": "abcd"<br>
</blockquote>
}<br>
</blockquote>
I think this make some sense to me when considering this from 2
perspectives:<br>
1. if we put passwd in vm info, we need to parse passwd every time
list_vms. If make it a subresource, we just manipulate it when
connect vnc.<br>
2. If we are controlled API level, we need to control vm_edit API
for passwd set. But we may want to control set passwd for special
user.<br>
<br>
What do you think?<br>
<blockquote cite="mid:53C7500A.7080609@linux.vnet.ibm.com"
type="cite">
<blockquote cite="mid:53C71EB7.70707@linux.vnet.ibm.com"
type="cite"> <br>
Using the PUT /vms/<my-vm> also can make the UI logic
simpler as the console password will be changed on VM Edit
dialog <br>
</blockquote>
at VM Edit dialog, the disks and ifaces are all sub-collection. <br>
PUT /vms/<my-vm>/ifaces/iface1<br>
<blockquote cite="mid:53C71EB7.70707@linux.vnet.ibm.com"
type="cite">(which already uses this PUT method) <br>
<br>
<blockquote type="cite"> <br>
<blockquote type="cite"> <br>
A ticket is the credential to access VM. <br>
Only who get the ticket can access a VM. <br>
<br>
test this patch set: <br>
set the ticket <br>
$sudo curl -k -u <user>:<password> -H
"Content-Type: application/json" -H \ <br>
"Accept: application/json" <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="https://localhost:8001/vms/test-vm-8/ticket/">https://localhost:8001/vms/test-vm-8/ticket/</a>
\ <br>
-X PUT -d '{"passwd": "abcd"}' <br>
<br>
get the ticket <br>
$sudo curl -k -u <user>:<password> -H
"Content-Type: application/json" -H \ <br>
"Accept: application/json" <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="https://localhost:8001/vms/test-vm-8/ticket/">https://localhost:8001/vms/test-vm-8/ticket/</a>
<br>
<br>
<br>
ShaoHe Feng (5): <br>
vm ticket in backend: update API.md <br>
vm ticket in backend: update controller and API.json <br>
vm ticket in backend: update model <br>
vm ticket in backend: update mockmodel <br>
vm ticket in backend: update test case <br>
<br>
docs/API.md | 20 +++++++++++++++ <br>
src/kimchi/API.json | 14 ++++++++++ <br>
src/kimchi/control/vms.py | 13 ++++++++++ <br>
src/kimchi/i18n.py | 1 + <br>
src/kimchi/mockmodel.py | 18 +++++++++++++ <br>
src/kimchi/model/vms.py | 65
+++++++++++++++++++++++++++++++++++++++++++++++ <br>
tests/test_model.py | 31 ++++++++++++++++++++++ <br>
tests/test_rest.py | 36 ++++++++++++++++++++++++++
<br>
8 files changed, 198 insertions(+) <br>
<br>
</blockquote>
<br>
_______________________________________________ <br>
Kimchi-devel mailing list <br>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<br>
<a moz-do-not-send="true" 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 moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>