Tuxedo::Admin::Group
use Tuxedo::Admin; $admin = new Tuxedo::Admin; $group = $admin->group('GW_GRP_3'); $group->grpno('50'); $group->lmid('master'); $group->update(); ... unless ($group->exists()) { $rc = $group->add($group); $admin->print_status(); } foreach $group ($admin->group_list()) { print "Group name: ", $group->srvgrp(); print "Group number: ", $group->grpno(); }
Provides methods to query, add, remove and update a Tuxedo group.
Tuxedo::Admin::Group objects are not instantiated directly. Instead they are created via the group() method of a Tuxedo::Admin object.
Example:
$group = $admin->group('GW_GRP_1');
This applies both for existing groups and for new groups that are being created.
Used to determine whether or not the group exists.
if ($group->exists()) { ... }
Returns true if the group exists.
Adds the group to the current Tuxedo application.
$rc = $group->add();
Croaks if the group already exists or if the required srvgrp, grpno and lmid parameters are not set. $rc is non-negative on success.
$group = $admin->group('GW_GRP_1); die "group already exists\n" if $group->exists(); $group->grpno('50'); $group->lmid('yoda'); $rc = $group->add($group); print "Welcome!" unless ($rc < 0); $admin->print_status();
Removes the group from the current Tuxedo application.
$rc = $group->remove();
Croaks if the group is booted or if the required srvgrp parameter is not set. $rc is non-negative on success.
$group = $admin->group('GW_GRP_1'); warn "Can't remove a group while it is booted.\n" unless ($group->state() eq 'INACTIVE'); $rc = $group->remove() if ($group->exists() and ($group->state() eq 'INACTIVE')); print "hasta la vista baby!" unless ($rc < 0); $admin->print_status();
Updates the group configuration with the values of the current object.
$ok = $group->update();
Croaks if the group does not exist or the required srvgrp parameter is not set. $rc is non-negative on success.
Starts all servers in this group.
$rc = $group->boot();
Croaks if the group is already booted. $rc is non-negative on success.
$group = $admin->group('GW_GRP_1'); $rc = $group->boot() if ($group->exists() and ($group->state() ne 'ACTIVE'));
Stops all servers in this group.
$rc = $group->shutdown();
Croaks if the group is not running. $rc is non-negative on success.
$group = $admin->group('GW_GRP_1'); $rc = $group->shutdown() if ($group->exists() and ($group->state() ne 'INACTIVE'));
Suspends all services advertised by servers in this group.
$rc = $group->suspend();
Croaks if the group is not active. $rc is non-negative on success.
$group = $admin->group('GW_GRP_1'); $rc = $group->suspend() if ($group->exists() and ($group->state() eq 'ACTIVE'));
Unsuspends all services advertised by servers in this group.
$rc = $group->resume();
$group = $admin->group('GW_GRP_1'); $rc = $group->resume() if ($group->exists() and ($group->state() eq 'ACTIVE'));
Returns the list of servers in this group.
@servers = $group->servers();
where @servers is an array of references to Tuxedo::Admin::Server objects.
foreach $server ($group->servers()) { print $server->servername(), "\t", $server->srvid(), "\n"; }
The following methods are available to get and set the group parameters. If an argument is provided then the parameter value is set to be the argument value. The value of the parameter is returned.
# Get the group number print $group->grpno(), "\n"; # Set the group number $group->grpno('50');
To install Tuxedo::Admin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tuxedo::Admin
CPAN shell
perl -MCPAN -e shell install Tuxedo::Admin
For more information on module installation, please visit the detailed CPAN module installation guide.