Bug 1448511
| Summary: | event.id type is inconsistent | ||
|---|---|---|---|
| Product: | [oVirt] ovirt-engine | Reporter: | Fabrice Bacchella <fabrice.bacchella> |
| Component: | RestAPI | Assignee: | Juan Hernández <juan.hernandez> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Radim Hrazdil <rhrazdil> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | --- | CC: | bugs, juan.hernandez, lsvaty, mperina, oourfali, stirabos |
| Target Milestone: | ovirt-4.1.3 | Flags: | rule-engine:
ovirt-4.1+
lsvaty: testing_ack+ |
| Target Release: | 4.1.3.3 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-07-06 13:25:15 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Infra | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Fabrice Bacchella
2017-05-05 15:44:27 UTC
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. |