Satellite API with Perl

Latest response

I have been working the last couple of weeks on building a way to do a full enterprise wide patch script.  The script will do many things, but key to its success is that I must be able to update a channel with packages, and then errata from the main RedHat channels automatically.  I have written the code to do it in Perl. 

I am able to successfuly update the channels with new packages merged from the RedHat channels.  I print out a nice list of the channels along with what packages were added. 

I need to do the same with errata.  When I do this, the errata prints out as though it has merged, but it does not.  It just lists the data. 

I found a couple of interesting things with 'channel.software.mergeErrata'.  First is that the dates are listed YYYY/MM/DD.  The documentation does not specifiy, but that seems to work.  Second is that when I run the following line, I get a list of the errata, but the merge does not actually happen.  I think there must be an additional step, or something, but I have not been able to find it. 

Code:  my $updatedErrata = $satClient->call('channel.software.mergeErrata', $satSession, $sourceChannel, $destChannel, $startDate, $endDate);

I can provide more code, but that is the important line.  I use the $satClient, and $satSession in other calls (to update the packages) with no problems.  Has anyone done this before?  Any ideas?

Responses

Hey Jonathan! I bet someone here will be able to help you out with this. Also, if you haven't seen it already, you might like to check out this thread of API solutions. 

You might also find this discussion relevant

Jan/David, I think I found the 'missing link' for the above URL here

nuts. apologies. I wish I could delete any of my posts.

Thanks David.  I had seen both of thoes, but they didn't provide clues to my problem.  

After leaving this for a couple of hours until I got home last night, I found that the issue isn't in the process.  It is on the Satellite server.  All of the errata DID merge.  It just took a very long time for it to show up in the console.  It took about 3 hours, and then suddenly all of the errata showed up.  I am not sure what the delay was, but it was a big delay.  

At this point, I don't know if it was just the horrors I put the DB through yesterday with massive adds, and deletes as I created, deleted, and then recreated the channels, or if there is some other underlying issue.  

Jon

Hey Jon - although I have not experienced delays quite as lengthy as what you describe, I have definitely noticed delays.

What I have found helpful is to monitoring top (I know how crazy that may seem).  Whenever I execute some serious updates or pushes from Satellite, I notice that there is a java (Jboss/Tomcat) process that will run a decent CPU load and even though the portal indicates things are moving along, I know that Satellite is still crunching something in the background.

Hi David,

What happened to the links you provided?
I was looking for API script examples, but both linked articles seem to have been moved or removed.

Kind regards,

Jan Gerrit Kootstra

I was wondering this as well.
I made one example at: https://access.redhat.com/site/discussions/723333. I used Perl though.

David's link updated above...

I'll link more examples if I find them here...

Thanks Remmele. Both links should be updated now. They were broken when we migrated this discussion from the old community platform.

Hi Jonathan,

I understand your concern about missing details in API documentation about parameter to mergeErrata API in DATE format as a parameter.

I have created internal bugzilla to documentation team to add syntax with example for API where we need Date as input. Will keep you posted here when API guide is updated.

Regards,
Ashish

Close

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