AFS-Command
view release on metacpan or search on metacpan
lib/AFS/Command/FS.pod view on Meta::CPAN
=head1 NAME
AFS::Command::FS - OO API to the AFS fs command
=head1 SYNOPSIS
use AFS::Command::FS;
my $fs = AFS::Command::FS->new();
my $fs = AFS::Command::FS->new
(
command => $path_to_your_fs_binary,
);
=head1 DESCRIPTION
This module implements an OO API wrapper around the AFS 'fs' command.
The supported methods depend on the version of the fs binary used,
and are determined automagically.
=head1 METHODS -- Inherited
All of the following methods are inherited from the AFS::Command::Base
class. See that documentation for details.
=over
=item new
=item errors
=item supportsOperation
=item supportsArgument
=back
=head1 METHODS (with complex return values)
=head2 NOTE: Error checking for commands that accept a list of paths
A number of these methods accept a list of paths, and will return
information for each path, individually. If you specify a
non-existent path, or one which is not in AFS, then the fs command
returns a non-zero exist status, which normally would mean the command
failed.
If you specify a list of paths to this API, and one or more of them
result in errors, the API call is still considered to succeed, as long
as we can determine the error for each path specified. The API will
still return an AFS::Object::CacheManager object, which contains a set
of AFS::Object::Path object, for each path specified in the arguments,
as long as we saw some kind of output from the fs commands for each
path.
Each AFS::Object::Path object must be examined to determine the
success of failure for that individual path. When errors were
encountered for any given path, then the objects will have an "error"
attribute, and nothing else (no other data attributes, except the path
itself).
This holds true for the following API methods: diskfree, examine,
listquota, quota, storebehind, whereis, whichcell, and listacl.
=head2 checkservers
=over
=item Arguments
The fs help string is:
fs checkservers: check local cell's servers
Usage: fs checkservers [-cell <cell to check>] [-all] [-fast]
[-interval <seconds between probes>]
Where: -all check all cells
-fast just list, don't check
The corresponding method invocation looks like:
my $result = $fs->checkservers
(
# Optional arguments
cell => $cell,
interval => $interval,
all => 1,
fast => 1,
);
=item Return Values
This method returns an AFS::Object::CacheManager object, which
contains one or more attributes.
my $result = $fs->checkservers() || die $fs->errors();
my @servers = $result->servers();
foreach my $server ( @servers ) {
print "Server $server appears to be down\n";
}
The object has the following attributes:
Attributes Values
---------- ------
servers ARRAY reference of strings, each of which is
the hostname of a server which is down
interval The value of the probe interval, in seconds
Note that the interval attribute is only present of the internal
argument was specified, and the servers list will be empty if nothing
was down.
=back
=head2 diskfree
=over
=item Arguments
lib/AFS/Command/FS.pod view on Meta::CPAN
=head2 copyacl
The fs help string is:
fs copyacl: copy access control list
Usage: fs copyacl -fromdir <source directory (or DFS file)>
-todir <destination directory (or DFS file)>+
[-clear] [-id] [-if]
Where: -clear first clear dest access list
-id initial directory acl
-if initial file acl
The corresponding method invocation looks like:
my $result = $fs->copyacl
(
# Required arguments
fromdir => $fromdir,
todir => $todir, # OR [ $todir1, $todir2, ... ]
# Optional arguments
clear => 1,
id => 1,
if => 1,
);
=head2 flush
The fs help string is:
fs flush: flush file from cache
Usage: fs flush [-path <dir/file path>+]
The corresponding method invocation looks like:
my $result = $fs->flush
(
# Optional arguments
path => $path, # OR [ $path1, $path2, ... ]
);
=head2 flushmount
The fs help string is:
fs flushmount: flush mount symlink from cache
Usage: fs flushmount [-path <dir/file path>+]
The corresponding method invocation looks like:
my $result = $fs->flushmount
(
# Optional arguments
path => $path, # OR [ $path1, $path2, ... ]
);
=head2 flushvolume
The fs help string is:
fs flushvolume: flush all data in volume
Usage: fs flushvolume [-path <dir/file path>+]
The corresponding method invocation looks like:
my $result = $fs->flushvolume
(
# Optional arguments
path => $path, # OR [ $path1, $path2, ... ]
);
=head2 messages
The fs help string is:
fs messages: control Cache Manager messages
Usage: fs messages [-show <[user|console|all|none]>]
The corresponding method invocation looks like:
my $result = $fs->messages
(
# Optional arguments
show => $show,
);
=head2 mkmount
The fs help string is:
fs mkmount: make mount point
Usage: fs mkmount -dir <directory> -vol <volume name> [-cell <cell name>] [-rw] [-fast]
Where: -rw force r/w volume
-fast don't check name with VLDB
The corresponding method invocation looks like:
my $result = $fs->mkmount
(
# Required arguments
dir => $dir,
vol => $vol,
# Optional arguments
cell => $cell,
rw => 1,
fast => 1,
);
=head2 newalias
The fs help string is:
fs newalias: configure new cell alias
Usage: fs newalias -alias <alias name> -name <real name of cell>
The corresponding method invocation looks like:
my $result = $fs->newalias
(
# Required arguments
alias => $alias,
( run in 0.862 second using v1.01-cache-2.11-cpan-c966e8aa7e8 )