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: 2019-08-14 14:36 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:


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.