Looking for API call for retrieving upgradable packages per content host

Hello community!
I’m the developer of katprep, a patch automatation framework for Foreman and Katello. Currently I’m looking for a convenient way to retrieve a list of upgradable packages per content host.

I understand that this information can be seen in the web interface by clicking Hosts > Content Hosts. Anyhow, I found no way to retrieve this information via the API. I understand that there is an API call PUT /api/hosts/:host_id/packages/upgrade_all to install all available package updates. I want to implement a kind of exclude/blacklist feature so I need to retrieve the list of available package upgrades.

Thank you very much for any ideas in advance!

Problem:
No such API call available

Expected outcome:
API call for retrieving upgradable packages per content host available

Foreman and Proxy versions:
1.17.1

Foreman and Proxy plugin versions:
bastion 6.1.8
foreman-tasks 0.11.2
foreman_docker 4.0.0
foreman_remote_execution 1.4.5
katello 3.6.0

Other relevant data:

1 Like

Sorry for bumping this: do you think it is a good idea to create a bug/feature request for this? Really doesn’t look like there is such a call.

Best wishes,
Christian.

ping @katello team - is there some way to get this info from the api or should @stdevel open a feature request for it?

Does the following API endpoint work for you?

GET https://kate.llo/katello/api/packages?host_id=2&packages_restrict_upgradable=1

This should show upgradable packages for a given host.

1 Like

Hey @akofink,
awesome - that’s exactly, what I was looking for.

Do you know in which Katello version this call was introduced? I’d like to document this in my toolkit.

Thank you very much for sharing!

Best wishes,
Christian.

It’s this commit, which appears to have been included in Katello since 3.3.0.

1 Like

Thank you very much!