NAME

perfSONAR_PS::Client::Status::MA - A module that provides methods for interacting with Status MA servers.

DESCRIPTION

This module allows one to interact with the Status MA via its Web Services interface. The API provided is identical to the API for interacting with the MA database directly. Thus, a client written to read from or update a Status MA can be easily modified to interact directly with its underlying database allowing more efficient interactions if required.

The module is to be treated as an object, where each instance of the object represents a connection to a single database. Each method may then be invoked on the object for the specific database.

SYNOPSIS

use perfSONAR_PS::Client::Status::MA;

my $status_client = new perfSONAR_PS::Client::Status::MA("http://localhost:4801/axis/services/status"); if (not defined $status_client) { print "Problem creating client for status MA\n"; exit(-1); }

my ($status, $res) = $status_client->open; if ($status != 0) { print "Problem opening status MA: $res\n"; exit(-1); }

($status, $res) = $status_client->getAll(); if ($status != 0) { print "Problem getting complete database: $res\n"; exit(-1); }

my @links = ();

foreach my $id (keys %{ $res }) { print "Link ID: $id\n";

foreach my $link ( @{ $res->{$id} }) {
    print "\t" . $link->getStartTime . " - " . $link->getEndTime . "\n";
    print "\t-Knowledge Level: " . $link->getKnowledge . "\n";
    print "\t-operStatus: " . $link->getOperStatus . "\n";
    print "\t-adminStatus: " . $link->getAdminStatus . "\n";
}

push @links, $id;
}

($status, $res) = $status_client->getLinkStatus(\@links, ""); if ($status != 0) { print "Problem obtaining most recent link status: $res\n"; exit(-1); }

foreach my $id (keys %{ $res }) { print "Link ID: $id\n";

foreach my $link ( @{ $res->{$id} }) {
    print "-operStatus: " . $link->getOperStatus . "\n";
    print "-adminStatus: " . $link->getAdminStatus . "\n";
}
}

($status, $res) = $status_client->getLinkHistory(\@links); if ($status != 0) { print "Problem obtaining link history: $res\n"; exit(-1); }

foreach my $id (keys %{ $res }) { print "Link ID: $id\n";

foreach my $link ( @{ $res->{$id} }) {
    print "-operStatus: " . $link->getOperStatus . "\n";
    print "-adminStatus: " . $link->getAdminStatus . "\n";
}
}

DETAILS

API

The API os perfSONAR_PS::Client::Status::MA is rather simple and greatly resembles the messages types received by the server. It is also identical to the perfSONAR_PS::Client::Status::SQL API allowing easy construction of programs that can interface via the MA server or directly with the database.

new($package, $uri_string)

The new function takes a URI connection string as its first argument. This
specifies which MA to interact with.

open($self)

The open function could be used to open a persistent connection to the MA.
However, currently, it is simply a stub function.

close($self)

The close function could close a persistent connection to the MA. However,
currently, it is simply a stub function.

setURIString($self, $uri_string)

The setURIString function changes the MA that the instance uses.

dbIsOpen($self)

This function is a stub function that always returns 1.

getURIString($)

The getURIString function returns the current URI string

getAll($self)

The getAll function gets the full contents of the MA. It returns the results as
a hash with the key being the link id. Each element of the hash is an array of
perfSONAR_PS::Status::Link structures containing a the status of the
specified link at a certain point in time.
The getLinkHistory function returns the complete history of a set of links. The
$link_ids parameter is a reference to an array of link ids. It returns the
results as a hash with the key being the link id. Each element of the hash is
an array of perfSONAR_PS::Status::Link structures containing a the status
of the specified link at a certain point in time.
The getLinkStatus function returns the link status at the specified time. The
$link_ids parameter is a reference to an array of link ids. $time is a
perfSONAR_PS::Time element describing the time at which you'd like to know
each link's status. If $time is undefined, it returns the most recent
information it has about each link. It returns the results as a hash with
the key being the link id. Each element of the hash is an array of
perfSONAR_PS::Status::Link structures containing a the status of the
specified link at a certain point in time.
The updateLinkStatus function adds a new data point for the specified link.
$time is a unix timestamp corresponding to when the measurement occured. $link_id is the link to
update. $knowledge_level says whether or not this measurement can tell us
everything about a given link ("full") or whether the information only
corresponds to one side of the link("partial"). $oper_value is the current
operational status and $admin_value is the current administrative status.
$do_update is currently unused in this context, meaning that all intervals
added have cover the second that the measurement occurred.

SEE ALSO

perfSONAR_PS::Status::Link, perfSONAR_PS::Client::Status::SQL, Log::Log4perl perfSONAR_PS::Common, perfSONAR_PS::Status::Common, perfSONAR_PS::Transport, perfSONAR_PS::Time

To join the 'perfSONAR-PS' mailing list, please visit:

https://mail.internet2.edu/wws/info/i2-perfsonar

The perfSONAR-PS subversion repository is located at:

https://svn.internet2.edu/svn/perfSONAR-PS

Questions and comments can be directed to the author, or the mailing list.

VERSION

$Id$

AUTHOR

Aaron Brown, aaron@internet2.edu

LICENSE

You should have received a copy of the Internet2 Intellectual Property Framework along with this software. If not, see <http://www.internet2.edu/membership/ip.html>

COPYRIGHT

Copyright (c) 2004-2007, Internet2 and the University of Delaware

All rights reserved.