Bug 859897
| Summary: | RHEVM-API: add /alias property to disk and deprecate name | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Ondra Machacek <omachace> |
| Component: | ovirt-engine-restapi | Assignee: | Michael Pasternak <mpastern> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Gadi Ickowicz <gickowic> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.1.0 | CC: | amureini, bazulay, dyasny, ecohen, gickowic, hateya, iheim, lpeer, mpastern, nlevinki, oramraz, Rhev-m-bugs, sgrinber, yeylon, ykaul |
| Target Milestone: | --- | ||
| Target Release: | 3.1.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | storage | ||
| Fixed In Version: | si20 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-12-04 20:02:24 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Ondra Machacek
2012-09-24 11:05:39 UTC
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 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 |