AFS-Command

 view release on metacpan or  search on metacpan

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


=over

=item new

=item errors

=item supportsOperation

=item supportsArgument

=back

=head1 METHODS (dump, restore)

Both the 'dump' and 'restore' methods are special, since this API
supports compression to and from the filesystem when dumping or
restoring the volume.  Normally, "vos dump -file" will just wrote the
uncompressed volume dump to the file, but this API can compress it.
This is a huge cost savings in disk space, assuming you can afford the
CPU time to perform the compression (this is the 21st century -- you
probably can).

Both of these commands return simply boolean true/false values, but
they have some special case handling for the -file argument, and
support several special arguments that are extensions implemented in
this API only.

=head2 dump

The vos help string is:

    vos dump: dump a volume
    Usage: vos dump -id <volume name or ID> [-time <dump from time>] [-file <dump file>]
		    [-server <server>] [-partition <partition>] [-cell <cell name>]
		    [-noauth] [-localauth] [-verbose] [-encrypt]

The corresponding method invocation looks like:

    my $result = $vos->dump
      (
       # Required arguments
       id			=> $id,
       file			=> $file, # SPECIAL CASE!!! (see below)
       # Optional arguments
       time			=> $time,
       server			=> $server,
       partition		=> $partition,
       cell                     => $cell,
       noauth                   => 1,
       localauth                => 1,
       verbose                  => 1,
       encrypt                  => 1,
       # Enhanced arguments
       gzip			=> $gzip,
       bzip2			=> $bzip2,
       filterout		=> [ @command ], # OR [ [ @cmd1 ], [ @cmd2 ], ... ]
      );

The first thing to notice is that 'file' is optional to the vos dump
command itself, but required in this API.  The second thing to notice
is the addition of three new arguments: gzip, bzip2 and filterout.

=over

=item file

This argument specifies the file to which the vos dump output should
be written.  If this file ends in '.gz' or '.bz2', then gzip or bzip2
will be used to compress the output before it is written to the
filesystem.  This is accomplished using a pipe, so there is no
intermediate file written to disk first.

By default, 'vos dump' will write the volume dump to stdout, which is
not what you want in most applications.  If you really want the volume
to be written to stdout, then you have to explicitly say so:

   my $result = $vos->dump
     (
      ...
      file			=> 'stdout',
      ...
     );

=item gzip, bzip2

Both of these arguments will turn on compression explicitly, and if
the file specified doesn't end in the appropriate extension already
('.gz' for gzip, and '.bz2' for bzip2), then the extension is appended
to the filename.

The value of these arguments specifies the degree of compression used,
an should be a single numeric digit, from 0 to 9.  See the gzip and
bzip2 man pages for more information.

These arguments are also mutually exclusive.

=item filterout

This is an advanced feature, and one that allows the volume dump to be
filtered through any arbitrary number of commands before it is
compressed (optionally) and written to the filesystem.  The value of
this argument is either an ARRAY reference to a list of command line
arguments, suitable for passing to exec(), or an ARRAY or such ARRAYS,
when more than one filter command is being used.

For example, the author has a requirement to pass all volume dumps
through a simple filter called 'newversion', which reads a volume
dump, changes the directory version numbers to the current utime
value, and writes the volume dump to stdout.  Trust me, you really
don't want to know why.

    my $result = $vos->dump
      (
       ...
       filterout		=> [ 'newversion' ],
       ...
      );

If there were command line arguments for this command, then they must
be given as follows:

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

    type			"RO" | "RW" | "BK"
    size			Numeric size in KB
    server			Fileserver hostname
    partition			Fileserver /vice partition
    maxquota			Volume quota in KB
    creation			Volume creation date (ctime format, eg: Sat Oct  6 04:39:50 2001)
    copyTime			Volume copy date   (also in ctime format)
    backupTime			Volume backup date (also in ctime format)
    access      Volume Last Access date (also in ctime format)
    update			Volume update date (also in ctime format)
    accesses			Number of volume accesses since the last reset
    rwrite			Numeric Volume ID for the RW volume
    ronly			Numeric Volume ID for the RO volume
    backup			Numeric Volume ID for the BK volume
    rclone			Numeric Volume ID for the RClone volume, if present

Note that the 'rclone' attribute is only present if the volume was
actively being cloned while being examined.  This is true when a 'vos
release' command is actively updating the RO volumes.

The following attributes are only present if the 'extended' argument
was specified (see below for details on access the raw and author
stats):

    Attributes			Values
    ----------			------
    files			Number of files in the volume
    raw				Generic AFS::Object object
    author			Generic AFS::Object object

The 'raw' and 'author' stats are implemented as a hierarchy of simple,
generic AFS::Object objects, which have nothing but a couple
of attributes, and no special methods associated with them.

The 'raw' object has the following attributes:

    Attributes			Values
    ----------			------
    reads			Generic AFS::Object object
    writes			Generic AFS::Object object

Both of the 'reads' and 'writes' objects have the following
attributes:

    Attributes			Values
    ----------			------
    same			Generic AFS::Object object
    diff			Generic AFS::Object object

Both of the 'same' and 'diff' objects have the following attributes:

    Attributes			Values
    ----------			------
    total			Numeric value
    auth			Numeric value

The 'author' object has the following attributes:

    Attributes			Values
    ----------			------
    0sec			Generic AFS::Object object
    1min			Generic AFS::Object object
    10min			Generic AFS::Object object
    1hr				Generic AFS::Object object
    1day			Generic AFS::Object object
    1wk				Generic AFS::Object object

Each of the above interval value objects has the following attributes:

    Attributes			Values
    ----------			------
    file			Generic AFS::Object object
    dir				Generic AFS::Object object

Both the 'file' and 'dir' objects have the following attributes:

    Attributes			Values
    ----------			------
    same			Numeric value
    diff			Numeric value

At this point, any sane individual is probably hopelessly confused how
to make sense of the statistics, so let's make this clear with an
example.

First of all, the 'raw' and 'author' statistics are parsed from this
noise, generated when -extended is given:

			  Raw Read/Write Stats
	      |-------------------------------------------|
	      |    Same Network     |    Diff Network     |
	      |----------|----------|----------|----------|
	      |  Total   |   Auth   |   Total  |   Auth   |
	      |----------|----------|----------|----------|
    Reads     |      162 |      162 |        6 |        6 |
    Writes    |     1815 |     1815 |        0 |        0 |
	      |-------------------------------------------|
		       Writes Affecting Authorship
	      |-------------------------------------------|
	      |   File Authorship   | Directory Authorship|
	      |----------|----------|----------|----------|
	      |   Same   |   Diff   |    Same  |   Diff   |
	      |----------|----------|----------|----------|
    0-60 sec  |      226 |        0 |      621 |        0 |
    1-10 min  |       87 |        0 |      105 |        0 |
    10min-1hr |       42 |        0 |       44 |        0 |
    1hr-1day  |       18 |        0 |        6 |        0 |
    1day-1wk  |        0 |        0 |        0 |        0 |
    > 1wk     |        1 |        0 |        0 |        0 |
	      |-------------------------------------------|

Since attributes can most easily be accessed by calling the method of
the same name, one can easily dig into the hierarchy as follows:

    my $result = $vos->examine
      (
       id			=> 'user.wpm',
       cell			=> 'q.ny.ms.com',
       extended			=> 1,
      );

    print $result->raw()->reads()->same()->total();  # 162, in the above output.
    print $result->author()->10min()->dir()->same(); # 44, in the above output.

See?  It's not as ugly as the pedantic description above implies.

=back

=head2 listaddrs

=over

=item Arguments

The vos help string is:

    vos listaddrs: list the IP address of all file servers registered in the VLDB
    Usage: vos listaddrs [-uuid <uuid of server>] [-host <address of host>]
			 [-noresolve] [-printuuid] [-cell <cell name>] [-noauth]
			 [-localauth] [-verbose] [-encrypt] 
    Where: -noresolve  don't resolve addresses
	   -printuuid  print uuid of hosts

The corresponding method invocation looks like:

    my $result = $vos->listaddrs
      (
       # Optional arguments
       uuid			=> $uuid,
       host			=> $host,
       noresolve		=> 1,
       printuuid		=> 1,
       cell			=> $cell,
       noauth			=> 1,
       localauth		=> 1,
       verbose			=> 1,
       encrypt			=> 1,
      );

=item Return Values

This method returns a list of AFS::Object::FileServer
objects, each of which has attributes that vary depending on the
arguments to the method call.

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

       verbose                  => 1,
       encrypt                  => 1,
      );

=head2 lock

The vos help string is:

    vos lock: lock VLDB entry for a volume
    Usage: vos lock -id <volume name or ID> [-cell <cell name>]
		    [-noauth] [-localauth] [-verbose] [-encrypt]

The corresponding method invocation looks like:

    my $result = $vos->lock
      (
       # Required arguments
       id			=> $id,
       # Optional arguments
       cell                     => $cell,
       noauth                   => 1,
       localauth                => 1,
       verbose                  => 1,
       encrypt                  => 1,
      );

=head2 move

The vos help string is:

    vos move: move a volume
    Usage: vos move -id <volume name or ID> -fromserver <machine name on source>
		    -frompartition <partition name on source>
		    -toserver <machine name on destination>
		    -topartition <partition name on destination> [-cell <cell name>]
		    [-noauth] [-localauth] [-verbose] [-encrypt]

The corresponding method invocation looks like:

    my $result = $vos->move
      (
       # Required arguments
       id			=> $id,
       fromserver		=> $fromserver,
       frompartition		=> $frompartition,
       toserver			=> $toserver,
       topartition		=> $topartition,
       # Optional arguments
       cell                     => $cell,
       noauth                   => 1,
       localauth                => 1,
       verbose                  => 1,
       encrypt                  => 1,
      );

=head2 offline

The vos help string is:

    Usage: vos offline -server <server name> -partition <partition name>
 		       -id <volume name or ID> [-sleep <seconds to sleep>]
                       [-busy] [-cell <cell name>]
 		       [-noauth] [-localauth] [-verbose] [-encrypt]

The corresponding method invocation looks like:

    my $result = $vos->offline
      (
       # Required arguments
       id			=> $id,
       server			=> $server,
       partition		=> $partition,
       # Optional arguments
       sleep			=> $sleep,
       busy			=> 1,
       cell                     => $cell,
       noauth                   => 1,
       localauth                => 1,
       verbose                  => 1,
       encrypt                  => 1,
      );

=head2 online

The vos help string is:

    Usage: vos online -server <server name> -partition <partition name>
		      -id <volume name or ID> [-cell <cell name>]
		      [-noauth] [-localauth] [-verbose] [-encrypt]

The corresponding method invocation looks like:

    my $result = $vos->online
      (
       # Required arguments
       id			=> $id,
       server			=> $server,
       partition		=> $partition,
       # Optional arguments
       cell                     => $cell,
       noauth                   => 1,
       localauth                => 1,
       verbose                  => 1,
       encrypt                  => 1,
      );

=head2 release

The vos help string is:

    vos release: release a volume
    Usage: vos release -id <volume name or ID> [-force] [-cell <cell name>]
		       [-noauth] [-localauth] [-verbose] [-encrypt]
    Where: -force      force a complete release

The corresponding method invocation looks like:

    my $result = $vos->release
      (
       # Required arguments
       id			=> $id,



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