Anyone already have a Satellite API script to download packages?
I figured I'd post to ask before anyone goes off to reinvent the wheel here.
Does anyone already have a script in use that uses the Satellite API (namely packages.search and getPackage) to pull down rpms matching an expression?
I have a user agitating for the ability to pull some 3rd party (Puppet) rpms from the satellite en-mass so that he can dump to ISO for offline hosts.
Thanks!
Responses
I'm not sure whether it contains what you're looking for, Kodiak, but this might be a good time to bump the Satellite API solutions thread we had going a while back: https://access.redhat.com/site/discussions/683433
Ah... I misunderstood what you were asking for. And your goal sounds completely reasonable and actually a good idea. For an entire stack, like Puppet, I could see this being possible. However, to pull a subset of packages out of an existing tree, that would seem a lot more challenging. I have a better idea of what you are trying to accomplish now.
I wonder how yum handles a request like
yum list includepkgs=puppet* exclude=all
Even though I cannot really help you (I'm not very good with API-type stuff ;-) I wonder if you could look at the following (and figure out what spacecmd actually does behind the scenes).
[root@rhnsat01 ~]# spacecmd "package_search puppet"
INFO: Connected to https://localhost/rpc/api as satadmin
puppet-2.6.18-3.el5.noarch
puppet-2.7.23-1.el6.noarch
puppet-server-2.6.18-3.el5.noarch
puppet-server-2.7.23-1.el6.noarch
rubygem-puppet-lint-0.3.2-1.el6.noarch
rubygem-puppet-lint-doc-0.3.2-1.el6.noarch
Hello Kodiak,
Do not have ready script to achieve your goal but as you want to search packages based on strings like - 'puppet' or 'nagios-plugins*' , instead of package.findByNvrea API other API " packages.search.name " might help you to list packages as per your search string. Because for package.findByNvrea API you need to pass exact package version details which may not be posible for you every time.
You can get package ID of specific package from output of packages.search.name API and pass it to " package.getPackage " API.
Regards,
Ashish
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
