<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 07/17/2014 01:24 AM, 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>
<br>
data = GET /vms/<my-vm><br>
data.passwd<br>
<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>
<br>
You are correct, but disks and ifaces have their own tab on VM Edit<br>
I was thinking in add the password in the VM configuration tab,
which means use the PUT method<br>
<br>
<blockquote cite="mid:53C7500A.7080609@linux.vnet.ibm.com"
type="cite">
<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>
</blockquote>
<br>
</body>
</html>