perfSONAR_PS::Client::Status::MA - A module that provides methods for


perfSONAR_PS-Client-Status-MA documentation  | view source Contained in the perfSONAR_PS-Client-Status-MA distribution.

Index


NAME

Top

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

DESCRIPTION

Top

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

Top

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

Top

API

Top

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.

SEE ALSO

Top

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

Top

$Id$

AUTHOR

Top

Aaron Brown, aaron@internet2.edu

LICENSE

Top

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

Top


perfSONAR_PS-Client-Status-MA documentation  | view source Contained in the perfSONAR_PS-Client-Status-MA distribution.