Project

General

Profile

Bug #12353

API GET hostgroup does not return content_view_id and lifecycle_environment_id

Added by Brad Buckingham over 5 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Category:
API
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1267629
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

  1. 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:

Associated revisions

Revision 06ae7fd5 (diff)
Added by Brad Buckingham over 5 years ago

fixes #12353 - api - get hostgroup - extend response to include katello attributes

This commit will extend the api for GET api/v2/hostgroups/:id to
include the attributes that are added by katello. The following
is an example:

"content_source_id": 1,
"content_source_name": "fortello.devel",
"content_view_id": 2,
"content_view_name": "app view 1",
"lifecycle_environment_id": 1,
"lifecycle_environment_name": "Library",

Revision 55383b17
Added by Brad Buckingham over 5 years ago

Merge pull request #5559 from bbuckingham/issue-12353

fixes #12353 - api - get hostgroup - extend response to include katello attributes

History

#1 Updated by The Foreman Bot over 5 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Brad Buckingham
  • Pull request https://github.com/Katello/katello/pull/5559 added
  • Pull request deleted ()

#2 Updated by Eric Helms over 5 years ago

  • Legacy Backlogs Release (now unused) set to 70
  • Triaged changed from No to Yes

#3 Updated by Justin Sherrill over 5 years ago

  • Legacy Backlogs Release (now unused) changed from 70 to 86

#4 Updated by Brad Buckingham over 5 years ago

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

Also available in: Atom PDF