Bug 872147

Summary: [RESTAPI] User API for search query don't filter result by specified parameter
Product: Red Hat Enterprise Virtualization Manager Reporter: Ondra Machacek <omachace>
Component: ovirt-engine-restapiAssignee: Michael Pasternak <mpastern>
Status: CLOSED NOTABUG QA Contact: Oded Ramraz <oramraz>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: bazulay, dyasny, ecohen, iheim, mpastern, Rhev-m-bugs, ykaul
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-04 07:31:38 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 Ondra Machacek 2012-11-01 11:41:41 UTC
Description of problem:


Version-Release number of selected component (if applicable):
si23

How reproducible:
always

Steps to Reproduce:
1. In webadmin. Create vm 'a' and vm 'b'
2. Add UserVmManager permissions on vm 'a' and vm 'b' for some user.
3. In API search one of vm.
  
Actual results:
All vms are return, doesnt matter what users search query look like.

Expected results:
Only filtered result by query should be returned.

Additional info:
curl https://url/api/vms?search=id%3Dabc
  <vms>
   <vm href="/api/vms/id" id="id">...</vm>
   <vm href="/api/vms/id" id="id">...</vm>
  </vms>

List instead of search is return for every object.

Comment 1 Michael Pasternak 2012-11-01 11:49:56 UTC
/id is not a part of engine search language (?search=id%3Dabc),
please recheck using /name or similar.

Comment 2 Ondra Machacek 2012-11-01 12:04:12 UTC
same issue for /name

Comment 3 Ondra Machacek 2012-11-01 12:41:49 UTC
Also doesn't work

https://10.34.63.30/api/templates/id/nics?search=name%3Dnic5
https://10.34.63.30/api/vms/id/disks?search=name%3Dnic5

Much more could be affected. This doesn't work even for admin users.

Comment 4 Itamar Heim 2012-11-01 18:13:30 UTC
this is "not a bug".
search is not supported for user level api today.

michael - is there a way to get a specific vm by its name via user api somehow?

Comment 5 Michael Pasternak 2012-11-04 07:31:38 UTC
(In reply to comment #4)
> this is "not a bug".
> search is not supported for user level api today.
> 
> michael - is there a way to get a specific vm by its name via user api
> somehow?

rnori already working fixing this at Bug 869334.

*** This bug has been marked as a duplicate of bug 869334 ***

Comment 6 Michael Pasternak 2012-11-04 07:32:43 UTC
(In reply to comment #4)
> this is "not a bug".
> search is not supported for user level api today.
> 
> michael - is there a way to get a specific vm by its name via user api
> somehow?

only in sdk (using client side filtering).

Comment 7 Michael Pasternak 2013-01-24 15:15:23 UTC
based on Comment 4.