Bug 830913 - Ovirt Rest API - 'from' in search is treated as parameter
Summary: Ovirt Rest API - 'from' in search is treated as parameter
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Michael Pasternak
QA Contact: Elena
URL:
Whiteboard: infra
Depends On:
Blocks: 847369
TreeView+ depends on / blocked
 
Reported: 2012-06-11 16:21 UTC by Elena
Modified: 2018-11-29 19:36 UTC (History)
13 users (show)

Fixed In Version: si7
Doc Type: Release Note
Doc Text:
A new syntax for performing event search using the REST API is now supported. The event search URI is now of the form <literal>/api/events;from=</literal><replaceable>&lt;event_id&gt;</replaceable>. The existing search syntax remains supported but is considered deprecated and will be removed in a future release.
Clone Of:
: 847369 (view as bug list)
Environment:
Last Closed: 2012-12-04 20:01:01 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Elena 2012-06-11 16:21:35 UTC
This query doesn't return correct results:
/api/events;from=<event_id>;?search=type%3D<type_num>

and this one does:
/api/events?search=type%3D<type_num>&from=<event_id>

from/ should be treated as REST matrix parameter and not ovirt-engine search parameter

Comment 1 Geert Jansen 2012-07-11 14:30:22 UTC
What's wrong with the format we currently have? The ";" style parameters have never caught up (and they are supposed to be apply to a path segment only by the way).

Comment 2 Michael Pasternak 2012-07-12 13:34:10 UTC
the decision to use matrix parameters was made due to:

1. we wanted to create clear differentiation between query (search) parameters 
   and parameters exposed in api only, i.e if user seeing 'max', 
   'case_sensitive', etc. parameters in api, he will not expect to find them 
   in UI search.
 
2. Matrix parameters apply to a particular path element while query parameters 
   apply to the request as a whole, so it will give us much more flexibility in 
   the future.

3. matrix parameters can have more than one value, i.e: 
   /matrix_param=value1,value2

Comment 3 Geert Jansen 2012-07-13 11:55:28 UTC
I think it's confusing to have two types of parameters. And i don't think #1-#3 above are enough justification for breaking compatibility.

But in any case, we cannot break compatibility before 4.0.

Comment 4 Michael Pasternak 2012-07-15 06:34:48 UTC
(In reply to comment #3)
> I think it's confusing to have two types of parameters. 

wouldn't be more confusing to have only one type of params, while a
part of them not available in UI?,

and people would confusing when concatenating them to search string doing
"... name=X... and case_sensitive = false" while correct format would be:
"... name=X..."&&case_sensitive = false as it not really search query param.

anyway, non query params documented in /api resource & RSDL & UG

> And i don't think
> #1-#3 above are enough justification for breaking compatibility.
> 
> But in any case, we cannot break compatibility before 4.0.

old style will be kept till 4.0

Comment 8 Stephen Gordon 2012-08-14 15:34:25 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
A new syntax for searching for events using the REST API is now supported. The event search URI is now of the form <literal>/api/events;from=</literal><replaceable>&lt;event_id&gt;</replaceable>. The existing search syntax remains supported but is considered deprecated and will be removed in Red Hat Enterprise Virtualization 4.0.

Comment 9 Stephen Gordon 2012-08-14 15:36:18 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-A new syntax for searching for events using the REST API is now supported. The event search URI is now of the form <literal>/api/events;from=</literal><replaceable>&lt;event_id&gt;</replaceable>. The existing search syntax remains supported but is considered deprecated and will be removed in Red Hat Enterprise Virtualization 4.0.+A new syntax for searching for events using the REST API is now supported. The event search URI is now of the form <literal>/api/events;from=</literal><replaceable>&lt;event_id&gt;</replaceable>. The existing search syntax remains supported but is considered deprecated and will be removed in a future release.

Comment 10 Stephen Gordon 2012-08-14 15:39:02 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-A new syntax for searching for events using the REST API is now supported. The event search URI is now of the form <literal>/api/events;from=</literal><replaceable>&lt;event_id&gt;</replaceable>. The existing search syntax remains supported but is considered deprecated and will be removed in a future release.+A new syntax for performing event search using the REST API is now supported. The event search URI is now of the form <literal>/api/events;from=</literal><replaceable>&lt;event_id&gt;</replaceable>. The existing search syntax remains supported but is considered deprecated and will be removed in a future release.


Note You need to log in before you can comment on or make changes to this bug.