Project

General

Profile

Actions

Bug #20891

closed

API hosts/X/facts inconsistent and superfluous hostname hash in results response

Added by Daniel Lobato Garcia about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Facts
Target version:
Difficulty:
easy
Triaged:
Fixed in Releases:
Found in Releases:

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.


Related issues 2 (0 open2 closed)

Related to Hammer CLI - Bug #25167: Hammer error: Error: undefined method `collect’ forResolvedMartin BacovskyActions
Related to Foreman - Bug #25188: API hosts/X/facts still inconsistentClosedMartin BacovskyActions
Actions #1

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
Actions #2

Updated by Shira Maximov about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Shira Maximov
  • Target version set to 113
Actions #3

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
Actions #4

Updated by Tomer Brisker over 6 years ago

  • Translation missing: en.field_release set to 353
Actions #5

Updated by Shira Maximov over 6 years ago

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

Updated by Martin Bacovsky about 6 years ago

  • Related to Bug #25167: Hammer error: Error: undefined method `collect’ for added
Actions #7

Updated by Martin Bacovsky about 6 years ago

  • Related to Bug #25188: API hosts/X/facts still inconsistent added
Actions

Also available in: Atom PDF