Project

General

Profile

Bug #24121

API hostgroups/X/hosts listing all hosts instead of hostgroup

Added by Amit Karsale 11 months ago. Updated 5 months ago.

Status:
Closed
Priority:
High
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Description of problem:
The hostgroups/X/hosts filter is not working. As long as X is a valid hostgroup all hosts are returned:

[Unknown Hilti Tier] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/api/v2/hostgroups/66/hosts | jq . | grep hostgroup_id
"hostgroup_id": 49,
"hostgroup_id": 47,
[Unknown Hilti Tier] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/api/v2/hostgroups/1/hosts | jq . | grep hostgroup_id
"hostgroup_id": 49,
"hostgroup_id": 47,

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. See API call in description
2.
3.

Actual results:
All hosts returned

Expected results:
Only Hosts belonging to hostgroup X returned

History

#1 Updated by Amit Karsale 5 months ago

  • Status changed from New to Closed

not able to reproduce in foreman 1.20+ hence closing.

Also available in: Atom PDF