AFS-Command

 view release on metacpan or  search on metacpan

lib/AFS/Command/BOS.pod  view on Meta::CPAN

       server			=> $server,
       # Optional arguments
       instance			=> $instance, # OR [ $inst1, $inst2, ... ],
       cell			=> $cell,
       long			=> 1,
       noauth			=> 1,
       localauth		=> 1,
      );

=item Return Values

This method returns an AFS::Object::BosServer object, which
contains one optional attribute, and one or more
AFS::Object::Instance objects, each of which represents a
single instance of a bosserver managed process on the server.

    my $result = $bos->status
      (
       server			=> $server,
       long				=> 1,
      ) || die $bos->errors();
    foreach my $instanceobj ( $result->getInstances() ) {
	my $instance		= $instanceobj->instance();
	my $status			= $instanceobj->status();
	print "Instance $instance has status $status\n";
	foreach my $commandobj ( $instance->getCommands() ) {
	    my $index		= $commandobj->index();
	    my $command		= $commandobj->command();
	    print "\tCmd $index is '$command'\n";
	}
    }

The objects have the following attributes and methods:

B<AFS::Object::BosServer>

The following attribute is only present when "bos status" reports
inappropriate access on directories:

    Attributes			Values
    ----------			------
    access			Boolean, true indicating a potential security problem

The following methods can be used to extract the instance objects:

    Methods			Returns
    -------			-------
    getInstanceNames()		list of instance names
    getInstances()		list of AFS::Object::Instance objects
    getInstance($name)		one AFS::Object::Instance object for the instance $name

B<AFS::Object::Instance>

The following attributes are always present:

    Attributes			Values
    ----------			------
    instance			Name of the instance
    status			Status string (running normally, shutdown, etc.)

The following attribute is always present is the instance is of type
'cron':

    Attributes			Values
    ----------			------
    auxiliary			Auxiliary status (date the next execution)

The following attributes are always available when the 'long' argument
is specified:

    Attributes			Values
    ----------			------
    type			"cron", "simple", or "fs"
    startdate			Date when the process was last started
    startcount			Number of times the process has started,
				since the bosserver was started
    exitdate			Date when the process last exited

The following attributes are optionally available, depending on the
state of the instance, when the 'long' argument is specified:

    Attributes			Values
    ----------			------
    notifier			Path to the notifier application for this instance
    state			"temporarily disabled", or "disabled", or "temporarily enabled"
    errorstop			Boolean, indicating the process was
				"stopped for too many errors"
    core			Boolean, indicating the instance has a core file
    errorexitdate		Date when the process last exited with an error
    errorexitdue		"shutdown", or "signal", or "code" (present only when
				"errorexitdate" attribute is present)
    errorexitsignal		Signal that cause the error exit (present only when
				"errorexitdue" eq "signal")
    errorexitcode		Exit code from last error exit (present only when
				"errorexitdue" eq "code")

The following methods can be used to extract the command objects,
which are also only present when the 'long' argument is specified.

    Methods			Returns
    -------			-------
    getCommandIndexes()		list of numeric indexes for the commands
    getCommands()		list of AFS::Object objects for all commands
    getCommand($index)		the AFS::Object object for the command with index $index

B<AFS::Object> (Commands)

The following pair of attributes are always present:

    Attributes			Values
    ----------			------
    index			Numerical index of the command
    command			Command string

=back

=head1 METHODS (with simple return values)

All of the following commands return a simple Boolean (true/false)
value, if they succeed or fail.

=head2 addhost

The bos help string is:

    bos addhost: add host to cell dbase
    Usage: bos addhost -server <machine name> -host <host name>+
		       [-clone] [-cell <cell name>] [-noauth] [-localauth]
    Where: -clone      vote doesn't count

The corresponding method invocation looks like:

    my $result = $bos->addhost

lib/AFS/Command/BOS.pod  view on Meta::CPAN


    my $result = $bos->addkey
      (
       # Required arguments
       server			=> $server,
       kvno			=> $kvno,
       # Optional arguments
       key			=> $key,
       cell			=> $cell,
       noauth			=> 1,
       localauth		=> 1,
      );

=head2 adduser

The bos help string is:

    bos adduser: add users to super-user list
    Usage: bos adduser -server <machine name> -user <user names>+
		       [-cell <cell name>] [-noauth] [-localauth]

The corresponding method invocation looks like:

    my $result = $bos->adduser
      (
       # Required arguments
       server			=> $server,
       user			=> $user, # OR [ $user1, $user2, ... ]
       # Optional arguments
       cell			=> $cell,
       noauth			=> 1,
       localauth		=> 1,
      );

=head2 blockscanner

The bos help string is:

    bos blockscanner: block scanner daemon from making migration requests
    Usage: bos blockscanner -server <machine name> [-cell <cell name>]
			    [-noauth] [-localauth]

The corresponding method invocation looks like:

    my $result = $bos->blockscanner
      (
       # Required arguments
       server			=> $server,
       # Optional arguments
       cell			=> $cell,
       noauth			=> 1,
       localauth		=> 1,
      );

=head2 create

The bos help string is:

    bos create: create a new server instance
    Usage: bos create -server <machine name> -instance <server process name>
		      -type <server type> -cmd <command lines>+ [-notifier <Notifier program>]
		      [-cell <cell name>] [-noauth] [-localauth]

The corresponding method invocation looks like:

    my $result = $bos->create
      (
       # Required arguments
       server			=> $server,
       instance			=> $instance,
       type			=> $type,
       cmd			=> $cmd, # OR [ $cmd1, $cmd2, ... ]
       # Optional arguments
       notifier			=> $notifier,
       cell			=> $cell,
       noauth			=> 1,
       localauth		=> 1,
      );

=head2 delete

The bos help string is:

    bos delete: delete a server instance
    Usage: bos delete -server <machine name> -instance <server process name>+
		      [-cell <cell name>] [-noauth] [-localauth]

The corresponding method invocation looks like:

    my $result = $bos->delete
      (
       # Required arguments
       server			=> $server,
       instance			=> $instance, # OR [ $inst1, $inst2, ... ]
       # Optional arguments
       cell			=> $cell,
       noauth			=> 1,
       localauth		=> 1,
      );

=head2 exec

The bos help string is:

    bos exec: execute shell command on server
    Usage: bos exec -server <machine name> -cmd <command to execute>
		    [-cell <cell name>] [-noauth] [-localauth]

The corresponding method invocation looks like:

    my $result = $bos->exec
      (
       # Required arguments
       server			=> $server,
       cmd			=> $cmd,
       # Optional arguments
       cell			=> $cell,
       noauth			=> 1,
       localauth		=> 1,
      );

=head2 install

The bos help string is:

    bos install: install program
    Usage: bos install -server <machine name> -file <files to install>+
		       [-dir <destination dir>] [-cell <cell name>] [-noauth] [-localauth]

The corresponding method invocation looks like:



( run in 0.436 second using v1.01-cache-2.11-cpan-39bf76dae61 )