Example of hash values for post api call

Problem:
Require the api to work to get information for POST /api/hosts/bulk/installable_errata. I have searched online but not getting the information that is needed to get it working and don’t really understand how the hash value works and are there set values or do you need to create a hash for what you want to do

curl -X POST -k https://katello.tests.com/api/hosts/bulk/installable_errata -H ‘Content-Type: application/json’ -d ‘{“login”:“admin”,“password”:“password”,“organization_id”:“3”}’

I am just not sure what the value should be for “include” and for “excluded” that is a required value for the api call according the the api documentation

Expected outcome:
Get the information that is required when running /api/hosts/bulk/installable_errata

Foreman and Proxy versions:
3.1

Foreman and Proxy plugin versions:
Foreman-tasks = 5.2.0
foreman_remote_execution = 5.0.1
katello = 4.3.0.rc4

Distribution and version:
Rocky 8.5

Other relevant data:

Hey there @tvziem,

It looks like you either have to provide a valid search field, or a list of ids to include.

{
included: { ids: [1, 2, 3, 4] }
}

or

{
included: { search: “name ~ example.com” }
}

Try that and let us know how it goes!

Good luck.

@tvziem

Why can’t you use the UI or Hammer?

Hi Dewar,

Thanks for your reply. not sure if I understand correct. Should this be added under Global Parameters in the UI?

For a quick overview I current use the UI. We currently have multiple systems that needs to integrate and collect errata data but I will look into using hammer

@cintrix84, the following gives me the output of what errata’s needs to be applied but would be great if I can see on which hosts

hammer erratum list --errata-restrict-applicable yes

Hi @tvziem,

I’m not aware of any endpoint that would do what you are discussing, but the relevant documentation is here.

You may be able to use some combination of commands found there to get the desired result.

@cintrix84 may have more information.

Good luck!

Hi @tvziem

Take a look at this example and let me know if that would work for you:

If you can’t see it let me know and I can post it somewhere else.

@cintrix84 thanks for the above link! this is giving the results I needed