Bug 1478849

Summary: [RFE] API Hosts GET returning also owner_name
Product: Red Hat Satellite 6 Reporter: Peter Vreman <peter.vreman>
Component: HostsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.10CC: inecas, jcallaha, tbrisker
Target Milestone: 6.4.0Keywords: FutureFeature, Triaged, VerifiedUpstream
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 15:28:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1122832    

Description Peter Vreman 2017-08-07 10:22:31 UTC
Description of problem:
Currently GET of hosts returns only owner_id and owner_type. As an API user i would like to have also the owner_name for presentation and easier verification. The missing owner_name is also inconsistent with almost all other fields that have a _name variant available

[crash/LI] root@li-lc-1578:~# time curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/api/v2/hosts/7 | jq . | grep owner_
  "owner_id": 1,
  "owner_type": "User",

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

How reproducible:

Steps to Reproduce:
1. API GET hosts/x

Actual results:
There is no owner_name field returned

Expected results:
An owner_name with the login name of the owner is returned-

Additional info:

Comment 1 Ivan Necas 2017-08-07 14:40:21 UTC
Created redmine issue http://projects.theforeman.org/issues/20516 from this bug

Comment 3 pm-sat@redhat.com 2017-09-07 10:10:57 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20516 has been resolved.

Comment 4 Peter Ondrejka 2018-03-27 08:42:07 UTC
Verified upstream manually +  by running test "should show host owner name" from test/controllers/api/v2/hosts_controller_test.rb

Comment 5 Peter Ondrejka 2018-07-02 11:13:47 UTC
Verified in Sat 6.4 snap 10, owner_name is now being included in the host outpu

Comment 7 errata-xmlrpc 2018-10-16 15:28:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.