Bug 1267629 - API GET hostgroup does not return content_view_id and lifecycle_environment_id
Summary: API GET hostgroup does not return content_view_id and lifecycle_environment_id
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.1.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: Brad Buckingham
QA Contact: Roman Plevka
URL: http://projects.theforeman.org/issues...
Whiteboard: FAILEDQA in Upstream
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2015-09-30 14:22 UTC by Peter Vreman
Modified: 2019-09-26 16:25 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 08:56:40 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 12353 None None None 2016-04-22 16:08:45 UTC
Red Hat Product Errata RHBA-2016:1500 normal SHIPPED_LIVE Red Hat Satellite 6.2 Base Libraries 2016-07-27 12:24:38 UTC

Description Peter Vreman 2015-09-30 14:22:25 UTC
Description of problem:
You can set the content_view_id and lifecycle_environment_id using PUT:

PUT /api/hostgroups/:id 
...
hostgroup[content_view_id]
optional , nil allowed 	
Value: Must be a number.
hostgroup[lifecycle_environment_id]
optional , nil allowed 	
Value: Must be a number. 

But the GET /api/hostgroups/:id does not return those values. For scripts this makes it impossible to verify the current values

# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/api/v2/hostgroups/24 | jq . | egrep '(content_view|lifecycle_environment)'
#

In the WebUI those fields are visible as well as in object printed foreman-rake console.


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


How reproducible:


Steps to Reproduce:
1. See curl command
2.
3.

Actual results:
fields are not returned

Expected results:
All additional Katello fields, including content_view_id,content_view_name,lifecycle_environment_id,lifecycle_environment_name are returned

Additional info:

Comment 2 Brad Buckingham 2015-10-29 20:42:47 UTC
Created redmine issue http://projects.theforeman.org/issues/12353 from this bug

Comment 3 Brad Buckingham 2015-10-29 20:50:54 UTC
Upstream Katello PR: https://github.com/Katello/katello/pull/5559

Comment 4 Bryan Kearney 2015-12-16 19:02:46 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/12353 has been closed
-------------
Brad Buckingham
Applied in changeset commit:katello|06ae7fd5228c1187113f5b9719e0b0dce4294824.

Comment 5 Sachin Ghai 2015-12-18 09:46:01 UTC
Verified with following version:

katello-2.5.0-1.nightly.el7.noarch
foreman-1.11.0-0.develop.201512091815git0e9b35e.el7.noarch

API GET still doesn't return  content_view_id and lifecycle_environment_id

---|--------|--------|------------------|-------------|------
ID | NAME   | TITLE  | OPERATING SYSTEM | ENVIRONMENT | MODEL
---|--------|--------|------------------|-------------|------
1  | fgroup | fgroup | RHEL Server 7.2  | production  |      
2  | group1 | group1 | RHEL Server 7.2  |             |      
---|--------|--------|------------------|-------------|------


[root@cloud ~]# curl -k -u admin:changeme -H "Accept: application/json" -X GET https://localhost/api/v2/hostgroup/2{"subnet_id":2,"subnet_name":"primary_libvirt","operatingsystem_id":1,"operatingsystem_name":"RHEL Server 7.2","domain_id":1,"domain_name":"idmqe.lab.eng.bos.redhat.com","environment_id":null,"environment_name":null,"compute_profile_id":4,"compute_profile_name":"testp","ancestry":null,"puppet_proxy_id":1,"puppet_ca_proxy_id":1,"ptable_id":55,"ptable_name":"Kickstart default","medium_id":9,"medium_name":"Default_Organization/Library/RHEL7/RHEL7_x86_64","architecture_id":1,"architecture_name":"x86_64","realm_id":null,"realm_name":null,"created_at":"2015-12-17T11:25:34Z","updated_at":"2015-12-17T11:35:28Z","id":2,"name":"group1","title":"group1","parameters":[{"id":2,"name":"kt_activation_keys","value":"ak_rhel7"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[],"organizations":[{"id":1,"name":"Default Organization","title":"Default Organization","description":null}]}

Comment 7 Bryan Kearney 2015-12-18 11:02:59 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/12353 has been closed
-------------
Brad Buckingham
Applied in changeset commit:katello|06ae7fd5228c1187113f5b9719e0b0dce4294824.

Comment 8 Brad Buckingham 2016-02-29 20:01:01 UTC
The API does indeed return the additional fields for content source, content view and lifecycle environment; therefore, moving this BZ back to POST.

Comment #5 raises a separate issue and that is supporting those fields from hammer cli.  I agree that we should do that; however, let's track that with a separate bug.


Regarding the API, the following is an example of the new fields:

{
    "content_source_id": 1,
    "content_source_name": "katello-centos7-devel",
    "content_view_id": 1,
    "content_view_name": "Default Organization View",
    "lifecycle_environment_id": 1,
    "lifecycle_environment_name": "Library",
    ...
}

Comment 9 Brad Buckingham 2016-02-29 20:10:07 UTC
Sachin, I created bug 1313056 for the hammer CLI aspect.

Comment 11 Roman Plevka 2016-04-20 09:43:08 UTC
VERIFIED
in sat 6.2.0. snap 8.2

# curl -L -u admin:changeme sat6.com/api/hostgroups/1
{"content_source_id":1,
"content_source_name":"sat6.com",
"content_view_id":3,
"content_view_name":"rhel7_cv",
"lifecycle_environment_id":2,
"lifecycle_environment_name":"Dev",
...}

Comment 12 Peter Vreman 2016-06-29 15:19:14 UTC
Confirmed with Sat6.2.0 Beta2

[crash] 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/24 | jq . | egrep '(content_view|lifecycle_environment)'
  "content_view_id": 37,
  "content_view_name": "hg-crash::ILF::Gateway2",
  "lifecycle_environment_id": 2,
  "lifecycle_environment_name": "Library",

Comment 14 errata-xmlrpc 2016-07-27 08:56:40 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.

https://access.redhat.com/errata/RHBA-2016:1500


Note You need to log in before you can comment on or make changes to this bug.