Red Hat Training

A Red Hat training course is available for Red Hat Satellite

2.2. Perl Example

This example uses the system.listUserSystems call to retrieve a list of systems a user can access. The example prints the name of each system. The Frontier::Client Perl module is found in the perl-Frontier-RPC RPM file.
use Frontier::Client;

my $HOST = '';
my $user = 'username';
my $pass = 'password';

my $client = new Frontier::Client(url => "http://$HOST/rpc/api");
my $session = $client->call('auth.login',$user, $pass);

my $systems = $client->call('system.listUserSystems', $session);
foreach my $system (@$systems) {
   print $system->{'name'}."\n";
$client->call('auth.logout', $session);