Bug #36281
openParent parameters of hostgroups not accessable via API
Description
When querying /api/hostgroups/:id/parameters on a child hostgroup, which has a parameter on its parent hostgroup, that parameter is not returned. Searching hostgroups via /api/hostgroups?params.PARAMETERNAME=PARAMETERVALUE returns only the parent hostgroup. Using the foreman webui, putting a host in the child hostgroup and searching for params.PARAMETERNAME=PARAMETERVALUE in the hosts tab the host is returned (so it works for hosts), but the same query on the hostgroups site only returns the parent.
Parent hostgroup, parameter name "TenantID"
/api/hostgroups/5/parameters
{
"total": 1,
"subtotal": 1,
"page": 1,
"per_page": 20,
"search": null,
"sort": {
"by": null,
"order": null
},
"results": [{"priority":60,"created_at":"2023-04-01 09:29:09 UTC","updated_at":"2023-04-02 08:30:40 UTC","id":5,"name":"TenantID","parameter_type":"string","value":"1"}]
}
Child hostgroup
/api/hostgroups/6/parameters
{
"total": 0,
"subtotal": 0,
"page": 1,
"per_page": 20,
"search": null,
"sort": {
"by": null,
"order": null
},
"results": []
}
I think it should be possible to query a hostgroup via the api and get the inherited parameters as well, in one form or another.
No data to display