Description of problem: Template name is returned as None in some cases, see steps to reproduce for exact description. Version-Release number of selected component (if applicable): ovirt-engine-sdk-1.3-1.el6.noarch RHEV-M server version: rhevm-3.0.3_0001-3.el6.x86_64 How reproducible: 100 % Steps to Reproduce: Run following Python code: from ovirtsdk.api import API as rhevm_api api = rhevm_api("uri", "username", "password") # replace 10 with randomly picked VM number print api.vms.list()[10].get_template().get_id() print api.vms.list()[10].get_template().get_name() It will print templace ID and None in place of template name: '1d9c2917-2bdc-4d83-8b64-26350343b703' None Actual results: None is returned as template name. Expected results: String with real template name is returned. Additional info: Template IDs and names seem to be correct if I list all templates via api.templates.list().
Petr, Mentioned above is a part of our RESTful api, i.e for api to be self descriptive, it has to describe relations between the resources, and relation between vm & template described by ID of the template vm was created from, this why you can see in vm.template.id only, to get template's name, you need to fetch it by the mention id first.
I'm not expert in REST APIs, but IMHO SDK/libraries should hide details of protocol implementation. IMHO library should do one of following: - fetch the required data - do not export methods where are inappropriate (and distinguish "full-featured" get_template() from "less featured" get_template_id()) - throw some exception like "unsupported blah blah blah" (please, don't do it :-)) Current behaviour makes impression of "fast-baked" API to me.
(In reply to comment #2) > I'm not expert in REST APIs, but IMHO SDK/libraries should hide details of > protocol implementation. it do hides it. > > IMHO library should do one of following: > - fetch the required data > - do not export methods where are inappropriate (and distinguish > "full-featured" get_template() from "less featured" get_template_id()) > - throw some exception like "unsupported blah blah blah" (please, don't do > it :-)) > > Current behaviour makes impression of "fast-baked" API to me. i disagree: 1. relation between vm and template described by parameters holder (which is template in this case), and name of the template is not a part of this relation. (you can't have template inside of vm) 2. in python is not common to throw exceptions in getters, rather than return None.