Project

General

Profile

Actions

Bug #37523

open

Changing the association of a host to hostgroups via UI and API differs extemely

Added by Bernhard Suttner 4 months ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Several host <-> hostgroup associations need to be restructured.

The first hosts were changed via GUI and everything was fine.
Then the change was scripted for the remaining hosts with a python script calling the host-api to change the hostgroupid.

In the end all hosts have wrong content views, lifecycles and most of them can’t even install anything anymore since also the content source was changed.

If you look at the production.log the GUI seems to use a different API, which is not documented (or available?)

Started POST "/hosts/update_multiple_hostgroup?host_ids%5B%5D=4" for 10.10.20.20 at 2024-05-20 09:03:36 +0000  
Processing by HostsController#update_multiple_hostgroup as HTML  
Parameters: {"utf8"=>"", "authenticity_token"=>"ajhasdlfzuwenbalsdufabflasdzfbasklfuzasdbf==", "hostgroup"=>{"id"=>"10"}, "host_ids"=>["4"]}

Steps to reproduce the issue:

- Open a host in the web UI and make note of the current CV / Livecycle / Repo Sets
- Get the Host / Hostgroup IDs with hammer

  hammer host list
  hammer hostgroup list

- Update the host with hammer
  hammer host update --id ${HOST_ID} --hostgroup-id ${HOSTGROUP_ID}

Reload the host in the web UI, note that CV / Lifecycle / Repo Sets have changed to match the new Hostgroup

Expected results:
Same behaviour between API and GUI

Additional info:
In fact the GUI seems to use a different API which does not exist in the APIDOC and is not documented. In fact, the API call is not exposed to the outside and is only used within the application.

Actions #1

Updated by Bernhard Suttner 4 months ago

  • Description updated (diff)
Actions #2

Updated by Bernhard Suttner 4 months ago

  • Description updated (diff)
Actions #3

Updated by Shimon Shtein 4 months ago

As a side note: The UI does not use the API endpoints, we have two different sets of endpoints - one for the UI and the other for the API. We do not document the UI endpoints, since they are not intended to be used directly bu users.

Actions

Also available in: Atom PDF