Bug #3111
closedv2 API calls to /api/[class]/[object]/parameters/[parameter] don't work correctly
Description
If calling the v2 API with e.g.:
/api/hostgroups/myhostgroup/parameters/myparam
/api/hosts/myhost/parameters/myparam
I get the first parameter named myparam found. It doesn't care if its associated with the host, its hostgroup, etc.
I suggest returning just parameters associated with that object (or smart parameters).
What would be extremely useful for hosts, is a way to return a smart parameter, like if rendering kickstart templates or externalNodes:
/api/hosts/myhost/parameters/myparam would then return the host parameter myparam, if not set the hostgroup parameter myparam, if not set the operating system parameter myparam, if not set the common parameter myparam.
Steps to reproduce:
1. set a common parameter "myparam" value "1"
2. set a hostgroup parameter "myparam" value "2"
3. set a host parameter "myparam" value "3"
The api call for host and hostgroup is going to always return "1" as the parameter has been stored first.