Show Table of Contents
Chapter 3. Examples
The following sections demostrate Red Hat Satellite API usage using different programming languages and their respective XML-RPC requests.
3.1. Perl Example
This Perl example shows the
system.listUserSystems call being used to get a list of systems a user has access. The example prints the name of each system. The Frontier::Client Perl module is found in the perl-Frontier-RPC RPM.
#!/usr/bin/perl
use Frontier::Client;
my $HOST = 'satellite.example.com';
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);

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.