Bug 1131030

Summary: [REST API] using from filter in an event search doesn't work
Product: [Retired] oVirt Reporter: sefi litmanovich <slitmano>
Component: ovirt-engine-coreAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: sefi litmanovich <slitmano>
Severity: medium Docs Contact:
Priority: low    
Version: 3.5CC: bazulay, bugs, ecohen, emesika, gklein, iheim, juan.hernandez, rbalakri, scohen, s.kieske, yeylon
Target Milestone: ---Keywords: Regression
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: ovirt-3.5.0_rc2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:43:43 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:
Bug Depends On:    
Bug Blocks: 1073943    

Description sefi litmanovich 2014-08-18 12:11:21 UTC
Description of problem:

a query for an event using rest api didn't filter the results accordingly.


e.g. using the example found on the technical guide:

GET

https://{engine_address}/api/events;from=2795?search=type%3D30

HTTP/1.1
Accept: application/xml

also tried the old format:

https://{engine_address}/api/events?search=type%3D30&from=2795

playing with the value of the from key, it seems that this parameter is ignored.


Actual results:

I get all the events of type 30, as well as events with id < 2795

Expected results:

I should get all the events of type 30 with id > 2795

Comment 1 Juan Hernández 2014-08-20 10:13:42 UTC
As far as I can tell this "from" parameter has never been implemented, so we can remove it from the documentation or implement it as an enhancement for 3.6. What do we want to do?

Comment 2 Juan Hernández 2014-08-27 14:38:31 UTC
This is a side effect of the following change:

  http://gerrit.ovirt.org/28135

Now the "from" parameter of search queries is effectively ignored, no piece of code in the engine calls the SearchContainer.getSearchForm() method.

Comment 3 Juan Hernández 2014-08-27 14:42:03 UTC
Eli, can you take a look? I think it is a serious issue, as it breaks backwards compatibility for users of the RESTAPI.

Comment 4 Eli Mesika 2014-09-04 01:54:01 UTC
(In reply to Juan Hernández from comment #3)
> Eli, can you take a look? I think it is a serious issue, as it breaks
> backwards compatibility for users of the RESTAPI.

Yes, I agree , this is a real regression!
We should restore the 'from' support on top of that patch ...

Comment 5 Sven Kieske 2014-09-05 08:49:15 UTC
When was this regression introduced?
Should this get backported to 3.4.4 ? Should this block 3.4.4 release
when it is present in this version?

Comment 6 Juan Hernández 2014-09-05 08:59:11 UTC
This regression was introduced in ovirt-engine-3.5.0_beta1, it doesn't affect 3.4.

Comment 7 sefi litmanovich 2014-09-16 10:33:10 UTC
Verified with rhevm-3.5.0-0.12.beta.el6ev.noarch.

the format: 
https://{engine_address}/api/events;from=415?search=type%3D30

returns the expected result.

Comment 8 Sandro Bonazzola 2014-10-17 12:43:43 UTC
oVirt 3.5 has been released and should include the fix for this issue.