Satellite API get target host for a patch

Latest response

Does anyone know the API method to use to get the system a patch is targeted to be installed on?

Responses

Afraid I don't know the answer to this one Joseph, but have you checked out the Satellite API guide?

Yeah. I've read over that and have been unable to find a way to get the information I am looking for. Granted I am newb when it comes to using the API so I could just be overlooking something.

Hi Joseph, can you give more details about what you are trying to achieve?

Cheers
Fábio

Certainly.

My boss wants a report ran that is based off errata. The format he is looking for is:
Errata:Advisory Type:Package name:HOST Package will be installed on

What I am doing to get this information is using the channel to get the errata, then I use the errata to get the Advisory type and package. But I can't find a way to say which system a package will be installed on.

For instance lets say channel "A" has an errata which requires package "1". I know channel "A" has systems "A1" and "A2" assigned to it, but how do I know if both systems require that package?

Hi Joseph,

You can get required details in report format with the help of bellow API's

1) system.listSystems will return you list of systems with systemid which you need to pass to next API

Sample Output :

        {
          'last_checkin' => bless( do{\(my $o = '20131030T05:35:16')}, 'Frontier::RPC2::DateTime::ISO8601' ),
          'name' => 'server10.example.com',
          'id' => '1000010000'
        },

2) system.getRelevantErrata will return errata's applicable to system based on systemid

Sample Output :

        {
          'advisory_type' => 'Bug Fix Advisory',
          'date' => '11/21/13',
          'advisory_name' => 'RHBA-2013:1751',
          'update_date' => '11/21/13',
          'id' => '4440',
          'advisory_synopsis' => 'openssl bug fix update'
        },

Here you will get Errata type, Errata , Package name.

Hope this helps you.

Regards,
Ashish

Ashish,

Are you referring to the advisory synopsis? If so the format of this is more like a description than a package name. I would like only the package name.
What I tried was using "client.system.getRelevantErrata(key,systemId)"to get a list of errata for the system and then looping through each to get the advisoryName. I then used this API method to list the package "client.errata.listPackages(key,advisoryName)".
However this appears to return duplicate entries. So I figured I'd set the list to remove duplicate entries, but the number of packages I get do not match what is shown in the satellite app.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.