Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1654655 - Unable to use Host classes API calls
Summary: Unable to use Host classes API calls
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.3.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Jan Hutař
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-29 11:00 UTC by Kenny Tordeurs
Modified: 2022-03-13 16:16 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-05 15:04:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Kenny Tordeurs 2018-11-29 11:00:21 UTC
Description of problem:
Cannot list/update/remove puppetclasses via API calls.


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

How reproducible:
100%

Steps to Reproduce:
satellite-6.3.3-2.el7sat.noarch
~~~
List puppet class ids for host 38:
~~~
# curl --user admin:pass -X GET https://$(hostname -f)/api/v2/hosts/38/puppetclass_ids 
{"results":[]}
~~~

A puppet class is present as can be seen:
# hammer host puppet-classes --host-id 38
~~~
---|-----------------------
ID | NAME                  
---|-----------------------
1  | access_insights_client
---|-----------------------

Try in a different way to list puppet classes for host 38:
# curl --user admin:pass -X GET https://$(hostname -f)/api/v2/hosts/38/puppetclasses
~~~
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": {"access_insights_client":[{"id":1,"name":"access_insights_client","created_at":"2018-02-08T09:45:40.550Z","updated_at":"2018-02-08T09:45:40.550Z"}]}
}
~~~

Try to delete a puppetclass for host 38
# curl --user admin:pass -X DELETE https://$(hostname -f)/api/v2/hosts/38/puppetclass_ids/1
~~~
[]
~~~

Conclusion: It did not delete the puppetclass from host 38


Same tests on satellite-6.4.0-15
~~~
List puppet class ids for host 528:
# curl --user admin:pass -X GET https://$(hostname -f)/api/v2/hosts/528/puppetclass_ids
{"results":[16,78]}

Remove puppet class id 16 from host 528:
# curl --user admin:pass -X DELETE https://$(hostname -f)/api/v2/hosts/528/puppetclass_ids/16
[]

List class ids for host 528:
# curl --user admin:pass -X GET https://$(hostname -f)/api/v2/hosts/528/puppetclass_ids
{"results":[78]}
~~~

Actual results:
API calls on Satellite 6.3.3 yield no results

Expected results:
API calls on Satellite 6.3.3 to do the same as in Satellite 6.4

Additional info:
As a workaround we created a new hostgroup that does not contain the puppetclass you want to remove and assigned it to the host. This inherits the puppet classes.


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