ANNOUNCE: new module: Ingres::Utility::Netutil

ANNOUNCE: new module: Ingres::Utility::Netutil

am 25.11.2006 15:59:57 von Joner Cyrre Worm

Ingres::Utility::Netutil (apdOp) API to Netutil Ingres RDBMS utility

This module has been accepted in CPAN's Official Module List and is the
third module of a framework to interact with and administrate local
services of Ingres RDBMS through an object-oriented API.

The API implements as similar as possible all commands accepted by each
of Ingres' utilities.

Together with Ingres::Utility::IINamu and IIMonitor
(http://search.cpan.org/~WORM), it provides the basis for most daily
sysadmin tasks for Ingres services.

The whole framework will provide the basis to develop powerful and
friendly tools, but each module can be easily employed by simple Perl
scripts to automate sysadmin daily tasks.

The project is hosted at Sourceforge.net:
http://www.sourceforge.net/projects/ingres-utility/

The module is hosted also on CPAN:
http://search.cpan.org/dist/Ingres-Utility-Netutil

Here is the POD (abriged):

NAME
Ingres::Utility::Netutil - API to "netutil" Ingres RDBMS utility

VERSION
Version 0.03

SYNOPSIS
use Ingres::Utility::Netutil;

# create a connection to NETUTIL utility

$netu = Ingres::Utility::Netutil->new();

# Attention: many arguments accept wildcard *

# showLogin($type,$vnode) - prepare to provide info on login
VNodes
# and return netutil ouput
print $netu->showLogin('global','*');

#
# getLogin() - return one-by-one all login VNodes previously
prepared
while ( ($type, $login, $vnode, $acct) = $netu->getLogin() ) {
print "Type: $type\tName: $vnode\tAccount: $acct\n";
}

# showConn($type, $conn, $vnode, $addr, $proto, $listen)
# - prepare to provide info on
connections of a VNode
# and return netutil ouput
print $netu->showConn('global','sample_vnode_name', '*', '*',
'*');

#
# getConn() - return one-by-one all connections of a VNodes
previously prepared
while ( @conn = $netu->getConn() ) {
($type, $conn, $vnode, $addr, $proto, $listen) = @conn;
print "Type: $type\tName: $vnode\tAddress: $addr\tProtocol:
$proto";
print "\tListen Address: $listenAddr\n";
}

# createLogin($type,$vnode,$acct, $passwd) - create a new VNode
$netu->createLogin('global', 'new_vnode_name',
'sample_login_account', 'secret_passwd');

# createConn($type,$vnode,$addr,$proto,$listenAddr) - create a
connection for a VNode
$netu->createConn('global', 'new_vnode_name', '192.168.0.1',
'tcp_ip', 'II');

# destroyConn($type,$vnode,$acct, $passwd) - destroy a
connection from a VNode
$netu->destroyConn('global', 'new_vnode_name', '192.168.0.1',
'tcp_ip', 'II');

# destroyLogin($type,$vnode) - destroy a VNode and all
connections
$netu->destroyLogin('global', 'new_vnode_name');

# quiesceServer($serverId) - stop IIGCC server after all
connections close (die gracefully)
# if no $serverId is given, then all IIGCC servers are affected
(carefull).
$netu->quiesceServer('sample_server_id');

# stopServer($serverId) - stop IIGCC server imediately (break
connections)
# if no $serverId is given, then all IIGCC servers are affected
(carefull).
$netu->stopServer('sample_server_id');

The server id can be obtained through Ingres::Utility::IINamu
module.

DESCRIPTION
This module provides an API to netutil utility for Ingres RDBMS,
which
provides local control of IIGCC servers for Ingres Net inbound and
outbound remote connections, and also manage logins and connections
to
remote servers, a.k.a. VNodes.

Notes:

Ordinary user can create/destroy on his own private logins and
connections.

SECURITY privilege should be granted to have access to other
user's
private entries.

GCA privilege NET_ADMIN (generally a system administrator)
needed to
manage global type login and connection entries.

GCA privilege SERVER_CONTROL (generally a system administrator)
needed to stop a communications server.

METHODS
new(;('USER' => $user, 'VNODE' => $vnode})
Start interaction with netutil utility.

Takes an optional hash with the user id and remote vnode
arguments
to identify which user's private VNodes to control and which
remote's machine Net configuration to manage. The VNode must be
previously created.

debug($debug_level)
Activate Expect Module debuging.

showLogin(;$type, $vnode)
Prepare to return VNode login info.

Returns output from netutil.

Takes the VNode type to filter and name

$type - VNode type: GLOBAL/PRIVATE (no wildcard)
$vnode - VNode/*

getLogin()
Returns sequentially (call-after-call) each VNode info reported
by
showLogin() as an array of 4 elements: @login = getlogin(); #
$login[0] = VNode type (GLOBAL/PRIVATE) # $login[1] = 'LOGIN' #
$login[2] = VNode # $login[3] = User/*

Password is not returned.

showConn($type; $vnode, $addr, $proto, $listen)
Prepare to return VNode connection info.

Returns output from netutil.

Takes the following parameters: $type - VNode type:
GLOBAL/PRIVATE
(no wildcard) $vnode - VNode/* $addr - IP, hostname of the
server/*
$proto - protocol name (tcp_ip, win_tcp, ipx, etc.)/* $listen -
remote server's listen address (generaly 'II')/*

getConn()
Returns sequentially (call-after-call) each VNode connection
info
reported by showConn() as an array of 6 elements: @conn =
getConn();
# $conn[0] = VNode type (GLOBAL/PRIVATE) # $conn[1] =
'CONNECTION' #
$conn[2] = VNode # $conn[3] = Network address # $conn[4] =
Protocol
# $conn[5] = Listen address

createLogin($type, $vnode, $user, $passwd)
Create a Login VNode.

Returns output from netutil.

Takes the following parameters: $type - VNode type:
GLOBAL/PRIVATE
$vnode - VNode name $user - User account/* $passwd -
User/installation password

The Installation Password can be created invoking this method
as
follows:

$netu = Ingres::Utility::Netutil->new();

my $local_vnode = 'myhost.mydomain'; # See note below about
$local_vnode

$netu->createLogin('GLOBAL', $local_vnode, '*',
$installation_passwd);

Note: The virtual node name must be identical to the name that
has
been configured as LOCAL_VNODE on the Configure Name Server
screen
of the cbf utility. No connection needed

createConn($type, $vnode, $add, $proto, $listen)
Create a connection for a Login VNode previously created.

Returns output from netutil.

Takes the following parameters: $type - VNode type:
GLOBAL/PRIVATE
$vnode - VNode name $addr - IP, hostname of the server $proto -
protocol name (tcp_ip, win_tcp, ipx, etc.) $listen - remote
server's
listen address (generaly 'II')

destroyLogin($type, $vnode)
Delete a Login VNode and all its connections.

Returns output from netutil.

Takes the following parameters: $type - VNode type:
GLOBAL/PRIVATE
$vnode - VNode name/*

destroyConn($type, $vnode, $addr, $proto, $listen)
Destroy (delete) a connection for a Login VNode.

Returns output from netutil.

Takes the following parameters: $type - VNode type:
GLOBAL/PRIVATE
$vnode - VNode name/* $addr - IP, hostname of the server, or
'*'
$proto - protocol name (tcp_ip, win_tcp, ipx, etc.), or '*'
$listen
- remote server's listen address (generaly 'II'), or '*'

quiesceServer(;$serverId)
Stops IIGCC server gracefully, i.e. after all connections are
closed
by clients. No more connections are stablished.

Takes optional parameter serverId, to specify which server, or
'*'
for all servers. Default '*' (all).

stopServer($)
Stops IIGCC server immediatly, breaking all connections.

Takes optional parameter serverId, to specify which server, or
'*'
for all servers. Default '*' (all).

AUTHOR
Joner Cyrre Worm ""

LICENSE AND COPYRIGHT
Copyright (c) 2006, Joner Cyrre Worm " spammotel.com>".
All rights reserved.

This module is free software; you can redistribute it and/or modify
it
under the same terms as Perl itself. See perlartistic.

Ingres is a registered brand of Ingres Corporation.