Description of problem: * when performing action on an object there is an option to use both object name and id. * add storagedomain - host-id|name * add vm - template-id|name, cluster-id|name * add cluster - data_center-id|name * add network - data_center-id|name * add snapshot - data_center-id|name * add template - vm-id|name * add vmpool - cluster-id|name, template-id|name ** list reveals only ids for objects of higher level ** add host - cluster-id unknown error: not enough arguments for format string [RHEVM shell (connected)]# Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: to be able to use both name and id in all actions Additional info:
Barak, can you elaborate please, i've failed to understand your comment.
(In reply to comment #1) > Barak, can you elaborate please, i've failed to understand your comment. I'm trying to say that in some cases (*) one can use either id or name of higher level object, but in other cases (**) only the id is given or can be used, for example, when adding host - cluster name is not available as a parameter - only cluster id is, which is not as intuitive as the name. I'm sure that there are more examples, which I don't remember at the moment, but will add when I find them.
(In reply to comment #2) > (In reply to comment #1) > > Barak, can you elaborate please, i've failed to understand your comment. > > I'm trying to say that in some cases (*) one can use either id or name of > higher level object, but in other cases (**) only the id is given or can be > used, for example, when adding host - cluster name is not available as a > parameter - only cluster id is, which is not as intuitive as the name. I'm > sure that there are more examples, which I don't remember at the moment, but > will add when I find them. this is not related to cli, this is api gaps, you more then welcome file bugs against api on this.
link : http://gerrit.ovirt.org/#/c/10726/ change id : I6b8268b016d83f3a963774b097f78f980503e8dd I could not find other cases where we need to expose both name and id. Please lust them if you find any
(In reply to comment #5) > I could not find other cases where we need to expose both name and id. > Please lust them if you find any this is basic RESTapi principal that in params resource can be referenced by both id/name, if you see that this is not a case - this is gap.
Ravi, Does patch from the Comment 5 covers all mentioned gaps?
(In reply to comment #7) > Ravi, > > Does patch from the Comment 5 covers all mentioned gaps? Yes as far I can see this patch closes the mentioned gaps.
on sf6. Add host can use cluster name as well. * update host can use cluster id and not cluster name. * update vm can use placement_policy-host-id and not placement_policy-host-name
update vm can already use placement_policy host id or name
(In reply to comment #10) > update vm can already use placement_policy host id or name Right I missed it in the interface. So we are left with update host
Verified on SF9, in both RSDL and CLI: <link href="/api/hosts" rel="add"> <request> <http_method>POST</http_method> <headers>...</headers> <body> <type>Host</type> <parameters_set> ... <parameter required="true" type="xs:string"> <name>host.cluster.id|name</name> <link href="/api/hosts/{host:id}" rel="update"> <request> <http_method>PUT</http_method> <headers>...</headers> <url>...</url> <body> <type>Host</type> <parameters_set> ... <parameter required="false" type="xs:string"> <name>host.cluster.id|name</name> [RHEVM shell (connected)]# add host address name power_management-options-option reboot_after_installation cluster-id port power_management-password root_password cluster-name power_management-address power_management-pm_proxy storage_manager-priority correlation_id power_management-agents-agent power_management-type value expect power_management-enabled power_management-user_name [RHEVM shell (connected)]# update host address port power_management-options-option power_management-user_name cluster-id power_management-address power_management-password root_password correlation_id power_management-agents-agent power_management-pm_proxy storage_manager-priority name power_management-enabled power_management-type value [RHEVM shell (connected)]# update host
Verify SF 10.1 (CLI): [RHEVM shell (connected)]# add host address display-address power_management-address power_management-password reboot_after_installation cluster-id expect power_management-agents-agent power_management-pm_proxy root_password cluster-name name power_management-enabled power_management-type storage_manager-priority correlation_id port power_management-options-option power_management-user_name value [RHEVM shell (connected)]# update host address display-address power_management-agents-agent power_management-pm_proxy storage_manager-priority cluster-id name power_management-enabled power_management-type value cluster-name port power_management-options-option power_management-user_name correlation_id power_management-address power_management-password root_password
3.2 has been released