Bug #20891
closedAPI hosts/X/facts inconsistent and superfluous hostname hash in results response
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1489515
Description of problem:
When querying the facts of a host the returned results are encapsulated in an additional hash of the hostname. This is inconsistent with all other API responses on a per host level, e.g. the interfaces
[crash/LI] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999999}" -XGET https://localhost:443/api/v2/hosts/23/facts
{
"total": 217,
"subtotal": 1,
"page": 1,
"per_page": 9999999,
"search": " host = 23",
"sort": {
"by": null,
"order": null
},
"results": {"li-lc-1441.hag.hilti.com":{"hardwaremodel":"x86_64","architecture":"x86_64",...."rubyplatform":"x86_64-linux","package_provider":"yum"}}
}
[crash/LI] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999999}" -XGET https://localhost:443/api/v2/hosts/23/interfaces
{
"total": 3,
"subtotal": 3,
"page": 1,
"per_page": 9999999,
"search": null,
"sort": {
"by": null,
"order": null
},
"results": [{"subnet_id":null,"subnet_name":null,"domain_id":1,...virtual":false}]
}
Steps to Reproduce:
1. Query hosts/X/facts
2. Query hosts/X/interfaces
Actual results:
Inconsistent return of results, the facst are inside results{"hostname":{}}
The interfaces are in the expected results:[]
Expected results:
Facts per hosts are directly underneath results returned like all other API calls.
Updated by Marek Hulán about 7 years ago
- Subject changed from API hosts/X/facts inconsistent and superfluous hostname hash in results response to API hosts/X/facts inconsistent and superfluous hostname hash in results response
- Category changed from 19 to Facts
- Difficulty set to easy
Updated by Shira Maximov about 7 years ago
- Status changed from New to Assigned
- Assignee set to Shira Maximov
- Target version set to 113
Updated by The Foreman Bot about 7 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/5003 added
Updated by Tomer Brisker over 6 years ago
- Translation missing: en.field_release set to 353
Updated by Shira Maximov over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 8ebbbecf36922c7a1f1c27610ddb1d14fe0467fa.
Updated by Martin Bacovsky about 6 years ago
- Related to Bug #25167: Hammer error: Error: undefined method `collect’ for added
Updated by Martin Bacovsky about 6 years ago
- Related to Bug #25188: API hosts/X/facts still inconsistent added