AFS-Command
view release on metacpan or search on metacpan
lib/AFS/Command/FS.pod view on Meta::CPAN
Methods Returns
------- -------
getCellNames() list of cell names
getCells() list of AFS::Object::Cell objects
getCell($cell) the AFS::Object::Cell object for cell $cell
B<AFS::Object::Cell>
Attributes Values
---------- ------
cell AFS cell name
status Boolean, true indicating setuid/gid bits are allowed,
false indicating they are not
=back
=head2 getclientaddrs
=over
=item Arguments
The fs help string is:
fs getclientaddrs: get client network interface addresses
Usage: fs getclientaddrs
The corresponding method invocation looks like:
my $result = $fs->getclientaddrs();
=item Return Values
This method returns an AFS::Object::CacheManager object with one attribute.
my $result = $fs->getclientaddrs() || die $fs->errors();
print "This client has the following addressed configured for AFS:\n";
foreach my $address ( @{$result->addresses()} ) {
print "\t$address\n";
}
The object has the following attribute:
B<AFS::Object::CacheManager>
Attributes Values
---------- ------
addresses ARRAY reference of IP addresses
=back
=head2 getcrypt
=over
=item Arguments
The fs help string is:
fs getcrypt: set cache manager encryption flag
Usage: fs getcrypt
The corresponding method invocation looks like:
my $result = $fs->getcrypt();
=item Return Values
This method returns an AFS::Object::CacheManager object with one attribute.
my $result = $fs->getcrypt() || die $fs->errors();
print "This client has encryption turned " . ( $result->crypt() ? "on" : "off" ) . "\n";
The object has the following attribute:
B<AFS::Object::CacheManager>
Attributes Values
---------- ------
crypt Boolean, indicating whether or not encryption is enabled
=back
=head2 getserverprefs
=over
=item Arguments
The fs help string is:
fs getserverprefs: get server ranks
Usage: fs getserverprefs [-file <output to named file>] [-numeric] [-vlservers]
Where: -numeric addresses only
-vlservers VL servers
The corresponding method invocation looks like:
my $result = $fs->getserverprefs
(
# Optional arguments
file => $file,
numeric => 1,
vlservers => 1,
);
=item Return Values
This method returns an AFS::Object::CacheManager object which contains
one or more AFS::Object::Server objects.
my $result = $fs->getserverprefs() || die $fs->errors();
foreach my $serverobj ( $result->getServers() ) {
my $server = $serverobj->server();
my $pref = $serverobj->preference();
print "Server '$server' has preference '$preference'\n";
}
The objects have the following attributes and methods:
lib/AFS/Command/FS.pod view on Meta::CPAN
The corresponding method invocation looks like:
my $result = $fs->rxstatpeer
(
# Optional arguments
enable => 1,
disable => 1,
clear => 1,
);
=head2 rxstatproc
The fs help string is:
fs rxstatproc: Manage per process RX statistics
Usage: fs rxstatproc [-enable] [-disable] [-clear]
Where: -enable Enable RX stats
-disable Disable RX stats
-clear Clear RX stats
The corresponding method invocation looks like:
my $result = $fs->rxstatproc
(
# Optional arguments
enable => 1,
disable => 1,
clear => 1,
);
=head2 setacl
The fs help string is:
fs setacl: set access control list
Usage: fs setacl -dir <directory>+ -acl <access list entries>+
[-clear] [-negative] [-id] [-if]
Where: -clear clear access list
-negative apply to negative rights
-id initial directory acl (DFS only)
-if initial file acl (DFS only)
The corresponding method invocation looks like:
my $result = $fs->setacl
(
# Required arguments
dir => $dir, # OR [ $dir1, $dir2, ... ]
acl => [ <<see below>> ],
# Optional arguments
clear => 1,
negative => 1,
id => 1,
if => 1,
);
NOTE: The values passed to the 'acl' argument has to be constructed
with care. Unlike many of the other arguments, this has to be a seen
by the 'fs' command as an even number of additional command line
arguments immediately after the -acl flag.
If you construct a single string, such as "user read group write",
then the method will fail. There is no shell involved in exec'ing fs,
so there will be no splitting of this string on whitespace before we
construct the arguments to fs, so it will look like a single argument,
not four distinct arguments.
Therefore, there are two ways to construct an ACL to pass to setacl():
my @acl = ( $user, 'read', $group, 'write' );
my $result = $fs->setacl
(
dir => $dir,
acl => \@acl,
);
my %acl =
(
$user => 'read',
$group => 'write',
);
my $result = $fs->setacl
(
dir => $dir,
acl => \%acl,
);
In a future release of the API, maybe even 1.1, it will be possible to
pass AFS::Object::ACL objects as arguments to these API
calls, but not yet...
=head2 setcachesize
The fs help string is:
fs setcachesize: set cache size
Usage: fs setcachesize [-blocks <size in 1K byte blocks (0 => reset)>] [-reset]
Where: -reset reset size back to boot value
The corresponding method invocation looks like:
my $result = $fs->setcachesize
(
# Optional arguments
blocks => $blocks,
reset => 1,
);
=head2 setcell
The fs help string is:
fs setcell: set cell status
Usage: fs setcell -cell <cell name>+ [-suid] [-nosuid]
Where: -suid allow setuid programs
-nosuid disallow setuid programs
The corresponding method invocation looks like:
my $result = $fs->setcell
(
# Required arguments
cell => $cell, # OR [ $cell1, $cell2, ... ]
# Optional arguments
suid => 1,
nosuid => 1,
);
=head2 setclientaddrs
The fs help string is:
fs setclientaddrs: set client network interface addresses
Usage: fs setclientaddrs [-address <client network interfaces>+]
The corresponding method invocation looks like:
my $result = $fs->setclientaddrs
(
# Required arguments
address => $address, # OR [ $address1, $address2, ... ]
);
=head2 setcrypt
The fs help string is:
fs setcrypt: set cache manager encryption flag
Usage: fs setcrypt -crypt <on or off>
The corresponding method invocation looks like:
my $result = $fs->setcrypt
(
# Required arguments
crypt => 1,
);
=head2 setquota
The fs help string is:
fs setquota: set volume quota
Usage: fs setquota [-path <dir/file path>] -max <max quota in kbytes>
The corresponding method invocation looks like:
my $result = $fs->setquota
(
# Required arguments
max => $max,
# Optional arguments
path => $path, # OR [ $path1, $path2, ... ]
);
=head2 setserverprefs
The fs help string is:
fs setserverprefs: set server ranks
Usage: fs setserverprefs [-servers <fileserver names and ranks>+]
[-vlservers <VL server names and ranks>+]
[-file <input from named file>] [-stdin]
Where: -stdin input from stdin
The corresponding method invocation looks like:
my $result = $fs->setserverprefs
(
# Optional arguments
servers => $server, # OR [ $server1, $server2, ... ]
vlservers => $vlserver, # OR [ $vlserver1, $vlserver2, ... ]
file => $file,
stdin => 1,
);
=head2 setvol
The fs help string is:
fs setvol: set volume status
Usage: fs setvol [-path <dir/file path>+] [-max <disk space quota in 1K units>]
[-offlinemsg <offline message>]
The corresponding method invocation looks like:
my $result = $fs->setvol
(
( run in 2.046 seconds using v1.01-cache-2.11-cpan-ecdf5575e8d )