Joner Cyrre Worm > Ingres-Utility-Netutil-0.03 > Ingres::Utility::Netutil

Download:
Ingres-Utility-Netutil-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

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).

DIAGNOSTICS ^

Ingres environment variable II_SYSTEM not set

Ingres environment variables should be set in the user session running this module. II_SYSTEM provides the root install dir (the one before 'ingres' dir). LD_LIBRARY_PATH too. See Ingres RDBMS docs.

Ingres utility cannot be executed: _COMMAND_FULL_PATH_

The Netutil command could not be found or does not permits execution for the current user.

invalid type: _VNODE_TYPE_

Call to a VNode related method should be given a valid VNode type (GLOBAL/PRIVATE), or a wildcard (*), when permitted.

showLogin() must be previously invoked

A method call should be preceded by a preparatory call to showLogin(). If any call is made to createXxx() or deleteXxx(), (whichever Login or Conn), then showLogin() should be called again.

showConn() must be previously invoked

A method call should be preceded by a preparatory call to showConn(). If any call is made to createXxx() or deleteXxx(), (whichever Login or Conn), then showConn() should be called again.

missing VNode name

VNode name identifying a Login is required for this method.

missing _PARAMETER_

The method requires the mentioned parameter to perform an action.

CONFIGURATION AND ENVIRONMENT ^

Requires Ingres environment variables, such as II_SYSTEM and LD_LIBRARY_PATH.

See Ingres RDBMS documentation.

DEPENDENCIES ^

Expect::Simple

INCOMPATIBILITIES ^

None reported.

BUGS AND LIMITATIONS ^

No bugs have been reported.

Please report any bugs or feature requests to bug-ingres-utility-Netutil at rt.cpan.org, or through the web interface at http://rt.cpan.org.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Ingres::Utility::Netutil

You can also look for information at:

ACKNOWLEDGEMENTS ^

Thanks to Computer Associates (CA) for licensing Ingres as open source, and let us hope for Ingres Corp to keep it that way.

AUTHOR ^

Joner Cyrre Worm <FAJCNLXLLXIH at spammotel.com>

LICENSE AND COPYRIGHT ^

Copyright (c) 2006, Joner Cyrre Worm <FAJCNLXLLXIH at 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.

DISCLAIMER OF WARRANTY ^

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

syntax highlighting: