Perl Example

List users with Perl

This Perl example shows the system.listUserSystems call being used to get a list of systems a user has access to. In the example below, the name of each system will be printed.

#!/usr/bin/perl
use Frontier::Client;

my $HOST = 'manager.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);