AFS-Command
view release on metacpan or search on metacpan
lib/AFS/Command/FS.pod view on Meta::CPAN
(
path => [ $afspath, $ufspath, $boguspath ],
) || die $fs->errors();
foreach my $pathobj ( $result->getPaths() ) {
my $path = $pathobj->path();
if ( $pathobj->hasAttribute('error') ) {
print "Path '$path' has errors '" . $pathobj->error() . "'\n";
} else {
foreach my $attr ( qw( id volname quota used avail total ) ) {
print "Path '$path' has '$attr' of '" . $pathobj->$attr() . "'\n";
}
}
}
Each of these objects has the following attributes and methods:
B<AFS::Object::CacheManager>
Methods Returns
------- -------
getPathNames() list of strings, each of which is a single pathname
getPaths() list of AFS::Object::Path objects, one for each path
getPath($pathname) a single AFS::Object::Path object, for the pathname $pathname
B<AFS::Object::Path>
If errors were encountered for any given path, then its object will
have the following attributes:
Attributes Values
---------- ------
path The pathname
error The error string for that path
If no errors were encountered, then the following attributes will be present:
Attributes Values
---------- ------
path The pathname
volname The AFS volume name that contains the pathname
id The numerical volume ID of the above volume
total The size (in KB) of the partition that contains 'volname'
used The amount of space (in KB) used on that partition
avail The amount of space (in KB) available on that partition
quota The quota of the volume (in KB), or 0 if set to "unlimited"
=back
=head2 exportafs
=over
=item Arguments
The fs help string is:
fs exportafs: enable/disable translators to AFS
Usage: fs exportafs -type <exporter name> [-start <start/stop translator (on | off)>]
[-convert <convert from afs to unix mode (on | off)>]
[-uidcheck <run on strict 'uid check' mode (on | off)>]
[-submounts <allow nfs mounts to subdirs of /afs/.. (on | off)>]
The corresponding method invocation looks like:
my $result = $fs->exportafs
(
# Required arguments
type => $type, # 'nfs' is the only supported value
# Optional arguments
start => $start, # 'on' or 'off'
convert => $convert, # 'on' or 'off'
uidcheck => $uidcheck, # 'on' or 'off'
submounts => $submounts, # 'on' or 'off'
);
NOTE: In a future release, the 4 optional arguments will probably take
boolean values, with "off" being a special case that means false, in
order to simply the interface (and be backwards compatible).
=item Return Values
This method returns an AFS::Object::CacheManager object with one or
more attributes.
my $result = $fs->exportafs
(
type => 'nfs',
start => 'on',
) || die $fs->errors();
foreach my $attr ( qw( convert uidcheck submounts ) ) {
print "Translator has '$attr' set to '" . $result->$attr() . "'\n";
}
The object has the following attribute:
B<AFS::Object::CacheManager>
Attributes Values
---------- ------
enabled Boolean, true means the translator is on, false means off
convert Boolean, true means mode bits are converted from AFS to UNIX, false means off
uidcheck Boolean, true means strict uid checking mode is on, false means off
submounts Boolean, true means mounts of subdirs are allowed, false means disallowed
=back
=head2 getcacheparms
=over
=item Arguments
The fs help string is:
fs getcacheparms: get cache usage info
Usage: fs getcacheparms
The corresponding method invocation looks like:
my $result = $fs->getcacheparms();
=item Return Values
This method returns an AFS::Object::CacheManager object with one or
more attributes.
my $result = $fs->getcacheparms() || die $fs->errors();
my $used = $result->used();
my $avail = $result->avail();
print "Cache is using $used KB of $availa KB available\n";
The object has the following attributes:
B<AFS::Object::CacheManager>
Attributes Values
---------- ------
used Number of KB of the AFS cache in use
avail Size of the AFS cache, in KB
=back
=head2 getcellstatus
=over
=item Arguments
The fs help string is:
fs getcellstatus: get cell status
Usage: fs getcellstatus -cell <cell name>+
The corresponding method invocation looks like:
my $result = $fs->getcellstatus
(
# Required arguments
cell -> $cell, # OR [ $cell1, $cell2, ... ]
);
=item Return Values
( run in 1.105 second using v1.01-cache-2.11-cpan-13bb782fe5a )