<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 2:25 PM, Giulio Casella <span dir="ltr">&lt;<a href="mailto:giulio@di.unimi.it" target="_blank">giulio@di.unimi.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 30/03/2017 13:39, <a href="mailto:nicolas@devels.es" target="_blank">nicolas@devels.es</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi Giulio,<br>
<br>
I tried to reproduce your same steps and it returns an non-empty list<br>
for me.<br>
<br>
In [1]: vms_serv = sys_serv.vms_service()<br>
<br>
In [2]: vm = vms_serv.list(search=&#39;name=ble<wbr>h&#39;)[0]<br>
<br>
In [3]: vmsv = vms_serv.vm_service(<a href="http://vm.id" rel="noreferrer" target="_blank">vm.id</a>)<br>
<br>
In [4]: vmsess = vmsv.sessions_service()<br>
<br>
In [5]: vmsess.list()<br>
Out[5]:<br>
[&lt;ovirtsdk4.types.Session at 0x4701e10&gt;,<br>
 &lt;ovirtsdk4.types.Session at 0x4701e90&gt;]<br>
<br>
Are you sure a session is initiated on vmname in the moment you run the<br>
vms_service.list(...)[0] statement?<br>
</blockquote>
<br></span>
Yes, if I print vm I obtain:<br>
<br>
&lt;ovirtsdk4.types.Vm object at 0x15dcb10&gt;<br>
<br>
while if I print vm_service:<br>
<br>
VmService:/vms/&lt;vmid&gt;<br>
<br>
and it is a real service (e.g. I can call method start, shutdown, ...)<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
El 2017-03-30 12:01, Giulio Casella escribió:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi,<br>
I&#39;m trying to obtain a list of users connected to a VM, using python<br>
SDK v4.<br>
Here&#39;s what I&#39;m doing:<br>
<br>
vm = vms_service.list(search=&quot;name=<wbr>vmname&quot;)[0]<br>
vm_service = vms_service.vm_service(<a href="http://vm.id" rel="noreferrer" target="_blank">vm.id</a>)<br>
sessions = vm_service.sessions_service().<wbr>list()<br>
<br>
But &quot;sessions&quot; is None.<br>
<br>
Same result using:<br>
<br>
s = connection.follow_link(vm.sess<wbr>ions)<br>
<br>
&quot;s&quot; is None.<br>
<br>
I tried also using curl, and if I connect to:<br>
<br>
<a href="https://my.ovirt.host/ovirt-engine/api/v4/vms/" rel="noreferrer" target="_blank">https://my.ovirt.host/ovirt-en<wbr>gine/api/v4/vms/</a>&lt;vmid&gt;/session<wbr>s<br>
<br>
I get a beautiful 404.<br>
<br>
Also using v3 of python SDK I obtain the same behaviour.<br>
<br>
So I suspect that retrieving user sessions via API is not implemented,<br>
is it? If not, what I&#39;m doing wrong?<br></blockquote></blockquote></div></div></blockquote><div><br><br></div><div>Works OK for me:<br><br>In [12]: vm_service = vms_service.vm_service(&#39;55095f91-e8e3-4634-9d05-47e0cc91e66b&#39;)<br><br>In [13]: vm_service.sessions_service().list()<br>Out[13]: []<br><br>In [14]: sdk.version.VERSION<br>Out[14]: &#39;4.0.4&#39;<br><br><br></div><div>What is the version of the SDK you are using?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I&#39;m using RHV 4.0.6.3-0.1.el7ev<br>
<br>
Thanks in advance,<br>
Giulio<br>
<br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman<wbr>/listinfo/users</a><br>
</blockquote>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman<wbr>/listinfo/users</a><br>
</blockquote>
<br></div></div><span class="gmail-HOEnZb"><font color="#888888">
-- <br>
Giulio Casella                                    giulio at <a href="http://di.unimi.it" rel="noreferrer" target="_blank">di.unimi.it</a><br>
System and network manager<br>
Computer Science Dept. - University of Milano</font></span><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman<wbr>/listinfo/users</a><br>
</div></div></blockquote></div><br></div></div>