Hi Giulio,
I tried to reproduce your same steps and it returns an non-empty list
for me.
In [1]: vms_serv = sys_serv.vms_service()
In [2]: vm = vms_serv.list(search='name=bleh')[0]
In [3]: vmsv = vms_serv.vm_service(vm.id)
In [4]: vmsess = vmsv.sessions_service()
In [5]: vmsess.list()
Out[5]:
[<ovirtsdk4.types.Session at 0x4701e10>,
<ovirtsdk4.types.Session at 0x4701e90>]
Are you sure a session is initiated on vmname in the moment you run the
vms_service.list(...)[0] statement?
El 2017-03-30 12:01, Giulio Casella escribió:
Hi,
I'm trying to obtain a list of users connected to a VM, using python
SDK v4.
Here's what I'm doing:
vm = vms_service.list(search="name=vmname")[0]
vm_service = vms_service.vm_service(vm.id)
sessions = vm_service.sessions_service().list()
But "sessions" is None.
Same result using:
s = connection.follow_link(vm.sessions)
"s" is None.
I tried also using curl, and if I connect to:
https://my.ovirt.host/ovirt-engine/api/v4/vms/<vmid>/sessions
I get a beautiful 404.
Also using v3 of python SDK I obtain the same behaviour.
So I suspect that retrieving user sessions via API is not implemented,
is it? If not, what I'm doing wrong?
I'm using RHV 4.0.6.3-0.1.el7ev
Thanks in advance,
Giulio
_______________________________________________
Users mailing list
Users(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/users