-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmlapi_sat_list_systems.pl
48 lines (35 loc) · 1.64 KB
/
xmlapi_sat_list_systems.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/perl -w
use strict;
use Frontier::Client;
use Data::Dumper;
############################################################################
# Defining an XMLRPC session. #
############################################################################
# Define the host first. This will be the FQDN of your satellite system.
my $HOST = 'vicpsat01.reecenet.org';
# Now we create the client object that will be used throughout the session.
my $client = new Frontier::Client(url => "http://$HOST/rpc/api");
# Next, we execute a login call, which returns a session identifier that will
# be passed in all subsequent calls. The syntax of this call is described at:
#
# http://$HOST/rpc/api/auth/login/
my $session = $client->call('auth.login', 'apiuser', 'apiuser!');
############################################################################
# System calls. #
############################################################################
# This next call returns a list of systems available to the user. The
# syntax of this call is described at:
#
# http://$HOST/rpc/api/system/list_user_systems/
#
# In the code snippet below, we dump data about our systems, and we
# capture the ID of the first system we find for future operations.
### GROUP ID's
# 141 > REECE-DEVELOPMENT
# 145 > REECE-PRODUCTION
# 161 > REECE-NON-PRODUCTION
my $systems = $client->call('system.listSystems', $session);
foreach my $system (@$systems) {
print $system->{name} . "\n";
}
$client->call('auth.logout', $session);