Project

General

Profile

Bug #3111

v2 API calls to /api/[class]/[object]/parameters/[parameter] don't work correctly

Added by Martin Matuška about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

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.


Related issues

Related to Foreman - Feature #3220: API for "rendered" view of host parameters, taking into account inheritanceNew2013-10-08

Associated revisions

Revision 9d743410 (diff)
Added by Joseph Magen about 9 years ago

fixes #3111 - v2 API calls to /api/[class]/[object]/parameters/[parameter] return wrong object

Revision 392240fb (diff)
Added by Joseph Magen about 9 years ago

fixes #3111 - v2 API calls to /api/[class]/[object]/parameters/[parameter] return wrong object

(cherry picked from commit 9d743410afc311dc96ba6653ae5787181d197dcf)

History

#1 Updated by Joseph Magen about 9 years ago

  • Assignee set to Joseph Magen

#3 Updated by Joseph Magen about 9 years ago

  • Status changed from New to Ready For Testing

#4 Updated by Dominic Cleal about 9 years ago

  • Related to Feature #3220: API for "rendered" view of host parameters, taking into account inheritance added

#5 Updated by Dominic Cleal about 9 years ago

Filed the render type API view as #3220, I think it's a good idea.

#6 Updated by Dominic Cleal about 9 years ago

  • Target version set to 1.3.0

#7 Updated by Dominic Cleal about 9 years ago

  • Related to Tracker #3112: [TRACKER] Issues to be released in 1.3 RC or final added

#8 Updated by Anonymous about 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#9 Updated by Lukas Zapletal about 9 years ago

  • Related to deleted (Tracker #3112: [TRACKER] Issues to be released in 1.3 RC or final)

Also available in: Atom PDF