The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

perfSONAR_PS::Services::MA::Status - A module that provides methods for the Status MA.

DESCRIPTION

This module aims to offer simple methods for dealing with requests for information, and the related tasks of interacting with backend storage.

SYNOPSIS

use perfSONAR_PS::Services::MA::Status;

my %conf = readConfiguration();

my %ns = ( nmwg => "http://ggf.org/ns/nmwg/base/2.0/", ifevt => "http://ggf.org/ns/nmwg/event/status/base/2.0/", nmtopo => "http://ogf.org/schema/network/topology/base/20070707/", );

my $ma = perfSONAR_PS::Services::MA::Status->new(\%conf, \%ns);

# or # $ma = perfSONAR_PS::Services::MA::Status->new; # $ma->setConf(\%conf); # $ma->setNamespaces(\%ns);

if ($ma->init != 0) { print "Error: couldn't initialize measurement archive\n"; exit(-1); }

$ma->registerLS;

while(1) { my $request = $ma->receive; $ma->handleRequest($request); }

API

The offered API is simple, but offers the key functions we need in a measurement archive.

init

       Initializes the MA and validates or fills in entries in the
	configuration file. Returns 0 on success and -1 on failure.

registerLS($self)

Reads the information contained in the database and registers it with
the specified LS.

receive($self)

Grabs an incoming message from transport object to begin processing. It
completes the processing if the message was handled by a lower layer.
If not, it returns the Request structure.

handleRequest($self, $request)

Handles the specified request returned from receive()

__handleRequest($self)

Validates that the message is one that we can handle, calls the
appropriate function for the message type and builds the response
message. 

parseStoreRequest($self, $request)

Goes through each metadata/data pair, extracting the eventType and
calling the function associated with that eventType.
Stores the new link information into the database. If an update is to
be performed, the function reads in the most recent data for the
specified link and updates it.

parseQueryRequest($self, $request)

Goes through each metadata/data pair, extracting the eventType and
any other relevant information calling the function associated with
that eventType.

lookupAllRequest($self, $metadata, $data)

Reads all link information from the database and constructs the
metadata/data pairs for the response.
Looks up the requested link information from the database and
returns the results.

writeoutLinkState_range($self, $link)

Writes out the requested link in a format slightly different than the
normal ifevt. The ifevt schema has only the concept of events at a
single point in time. This output is compatible with applications
expecting the normal ifevt output, but also contains a start time and
an end time during which the status was the same.

writeoutLinkState($self, $link, $time)

Writes out the requested link according to the ifevt schema. If time is
empty, it simply uses the end time of the given range as the time for
the event.

SEE ALSO

perfSONAR_PS::Services::Base, perfSONAR_PS::Services::MA::General, perfSONAR_PS::Common, perfSONAR_PS::Messages, perfSONAR_PS::Client::LS::Remote, perfSONAR_PS::Client::Status::SQL

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.