The following code fails: event_service = connection.system_service().events_service() last_event = event_service.list(max=1)[0] print "%s %s" % (last_event.id, type(last_event.id)) new_event = event_service.list(from_=last_event.id) with: 50792 <type 'str'> ... TypeError: The 'from_' parameter should be of type 'int', but it is of type 'str'. Indeed event.id is a string but from expect a number. That's inconsistent. It might be to late to change event.id to a int, and for all other types it's a string, so changing it is probably not possible. But then from_ should allow string argument.
The 'id' is for all the entities a String, where usually it's 'uid'. In case of the event it's integer, so that's why the 'from_' takes integer as parameter. I know it's not nice, but still there is very easy workaround. We can change it in API version 5, due to backward compatibility. Or we can add another similar parameter with different type, but I don't really think we need it. So I would leave this bug for the oVirt 5. Juan what do you think?
The 'id' of the entity needs to be kept as an string, as it is handled in the same way for all entities, not just for events. And 'from' should be an integer, as there is an implicit concept of total order. What we can do is add a new attribute to the 'Event' type that has the same value but that is declared as integer in the specification of the API. Maybe 'sequence' or 'index': <event id="123" href="/ovirt-engine/api/events"> <index>123</index> ... </event> If it is declared as integer in the specification then it will be treated as integer in all the SDKs, so you will be able to do this: events_service = connection.system_service().events_service() last_event = events_service.list(max=1)[0] new_event = events_service.list(from_=last_event.index) We can add that attribute without breaking backwards compatibility, before version 5 of the API. But we can't retrofit it to older versions of the engine, so if you want to support those older versions you will need to use a workaround anyhow.
The change in the specification of the API has been merged and released with versions 4.2.12 and 4.1.37. Now the engine itself needs to be modified to handle correctly the new attribute.
Moving back to 4.1.3 as it's part of 4.1.3.2 build
INFO: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason: [Tag 'ovirt-engine-4.1.3.4' doesn't contain patch 'https://gerrit.ovirt.org/77594'] gitweb: https://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=shortlog;h=refs/tags/ovirt-engine-4.1.3.4 For more info please contact: infra
(In reply to rhev-integ from comment #5) > INFO: Bug status wasn't changed from MODIFIED to ON_QA due to the following > reason: > > [Tag 'ovirt-engine-4.1.3.4' doesn't contain patch > 'https://gerrit.ovirt.org/77594'] > gitweb: > https://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=shortlog;h=refs/tags/ > ovirt-engine-4.1.3.4 > > For more info please contact: infra Not true, https://gerrit.ovirt.org/77594 has been merged to ovirt-engine-4.1 on May 31st
Verified that engine api offers <index> tag with the same value as attribute id.