Red Hat Training

A Red Hat training course is available for Red Hat Satellite

2.3. Ruby Example

The following example demonstrates the channel.listAllChannels API call. The example prints a list of channel labels.
#!/usr/bin/env ruby
require "xmlrpc/client"

@SATELLITE_URL = "http://satellite.example.com/rpc/api"
@SATELLITE_LOGIN = "username"
@SATELLITE_PASSWORD = "password"

@client = XMLRPC::Client.new2(@SATELLITE_URL)

@key = @client.call('auth.login', @SATELLITE_LOGIN, @SATELLITE_PASSWORD)
channels = @client.call('channel.listAllChannels', @key)
for channel in channels do
   p channel["label"]
end

@client.call('auth.logout', @key)