Open Fobhep opened 5 years ago
triage: research if that is even possible and how the UI does it, open foreman issue if needed
Maybe it can be handled similar to scc_account
The problem that @akofink mentioned during triage is that there is no api endpoint and the UI does some weird tricks to validate from the browser (not even the Rails backend).
So for the UI, there is a /compute_resources/test_connection
endpoint, that is defined in the controller:
https://github.com/theforeman/foreman/blob/528875da4d17efc83488a2017a4286f085a6eb92/app/controllers/compute_resources_controller.rb#L126-L136
That is what the UI talks to when you click the button. It should be possible to make it work via API too, but at the moment there is no such API method.
I have opened https://projects.theforeman.org/issues/28554 against Foreman and labeling this "waiting on other project".
The compute resource module is so far not able to test whether the connection to a new resource is wokring. The foreman gui has a functionality for this. so far it seems to me this is not fully backed by the foreman api. Maybe once could "build around it" by using the api functionality to list available sub-entities of a compute-resource (pools, zones, etc, ..)