Project

General

Profile

Bug #20891

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

Added by Daniel Lobato Garcia about 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Facts
Target version:
Difficulty:
easy
Triaged:
Bugzilla link:
Team Backlog:
Ivan
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

Related to Hammer CLI - Bug #25167: Hammer error: Error: undefined method `collect’ forResolved
Related to Foreman - Bug #25188: API hosts/X/facts still inconsistentClosed

Associated revisions

Revision 8ebbbecf (diff)
Added by Shira Maximov 5 months ago

Fixes #20891 - Remove hostname from /hosts/x/facts results

Revision d7c67746 (diff)
Added by Michael Moll 5 months ago

Fixes #19873 - Fix Style/MultilineIfModifier cop (#5705)

  • Refs #20891 - fix for new rubocop rules
  • Fixes #19873 - Fix Style/MultilineIfModifier cop

Revision 6ebba152 (diff)
Added by Michael Moll 5 months ago

Fixes #19858 - Configure Style/EmptyMethod cop (#5703)

  • Refs #20891 - fix for new rubocop rules
  • Fixes #19858 - Configure Style/EmptyMethod cop

Revision 1f15c21b (diff)
Added by Michael Moll 5 months ago

Refs #20891 - fix for new rubocop rules

History

#1 Updated by Marek Hulán about 1 year 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

#2 Updated by Shira Maximov about 1 year ago

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

#3 Updated by The Foreman Bot about 1 year ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5003 added

#4 Updated by Tomer Brisker 5 months ago

  • Legacy Backlogs Release (now unused) set to 353

#5 Updated by Shira Maximov 5 months ago

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

#6 Updated by Martin Bacovsky about 1 month ago

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

#7 Updated by Martin Bacovsky about 1 month ago

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

Also available in: Atom PDF