perfSONAR_PS::Client::Status::SQL

A module that provides methods for interacting with a Status MA database directly
Download

perfSONAR_PS::Client::Status::SQL Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Other/Proprietary Li...
  • Price:
  • FREE
  • Publisher Name:
  • Aaron Brown
  • Publisher web site:
  • http://search.cpan.org/~perfsonar/

perfSONAR_PS::Client::Status::SQL Tags


perfSONAR_PS::Client::Status::SQL Description

A module that provides methods for interacting with a Status MA database directly perfSONAR_PS::Client::Status::SQL is a Perl module that allows one to interact with the Status MA SQL Backend directly using a standard set of methods. The API provided is identical to the API for interacting with the MAs via its Web Services interface. 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::SQL; my $status_client = new perfSONAR_PS::Client::Status::SQL("DBI:SQLite:dbname=status.db"); 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"; } } Requirements: · Perl


perfSONAR_PS::Client::Status::SQL Related Software