Description of problem: Searching disks via RESTAPI should be supported, it is not. Version-Release number of selected component (if applicable): How reproducible: always Steps to Reproduce: 1. Create disk with name 'a'. 2. Try to search disk via RESTAPI.(https://url/api/disks?search=name%3Da) Actual results: Return empty <disks/> tag. Expected results: Should return <disk> tag with all information about disk with alias 'a'. Additional info:
basically this is inconsistency issue between the api and backend, backend does not have disk.name property but disk.alias, we preserve it for the backward compatibility, correct syntax is: /api/disks?search=alias%3DXXX
http://gerrit.ovirt.org/8326
Doesnt miss you rewrite part that generates function get? This line: result = self._getProxy().get(url=SearchHelper.appendQuery(url, {'search':'name='+name}), should be result = self._getProxy().get(url=SearchHelper.appendQuery(url, {'search':'alias='+name}),
making {'search':'alias='+name}) in sdk will break generic name=X search dialect concept, 'name='+name will be preserved in SDK, user can fetch the disk by alias using **kwargs
using **kwargs doesnt work for me: API = getApi() a = API.disks.list()[0].get_alias() d = API.disks.get(name=a, alias=a) print d.get_alias() >>> Traceback (most recent call last): File "./test.py", line 197, in <module> print d.get_alias() AttributeError: 'NoneType' object has no attribute 'get_alias
(In reply to comment #8) > using **kwargs doesnt work for me: > > API = getApi() > a = API.disks.list()[0].get_alias() > d = API.disks.get(name=a, alias=a) > print d.get_alias() > > >>> > Traceback (most recent call last): > File "./test.py", line 197, in <module> > print d.get_alias() > AttributeError: 'NoneType' object has no attribute 'get_alias do not use name=x in 3,1, just: d = API.disks.get(alias=a)
Verified in SI20 - rhevm-3.1.0-20.el6ev.noarch. able to search with REST as stated in comment#1