AFS-Command
view release on metacpan or search on metacpan
lib/AFS/Command/VOS.pod view on Meta::CPAN
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 methods are available:
Methods Returns
------- -------
getVLDBSites() list of AFS::Object::VLDBSite objects
B<AFS::Object::VLDBSite>
This object is created by parsing the individual VLDB sites in the
VLDB entry, namely the lines such as:
server pasafq5 partition /vicepg RO Site
The following attributes are always available:
Attributes Values
---------- ------
server Fileserver hostname
partition Fileserver /vice partition name
type "RO" | "RW" | "BK"
status Site status.
Note that the status is the field indicating the state of the volume
during a 'vos release' command, and this will be an empty string for
VLDB entries which are completely in sync.
B<AFS::Object::VolumeHeader>
This object is created by parsing the volume header stanza, such as:
root.afs 536908042 RW 23 K Off-line
npiafa3 /viceph
RWrite 536908042 ROnly 536908046 Backup 0
MaxQuota 0 K
Creation Sat Sep 23 03:41:50 2006
Copy Fri Aug 31 01:12:21 2007
Backup Fri Oct 17 20:59:02 2003
Last Update Sat Nov 7 15:12:40 1998
0 accesses in the past day (i.e., vnode references)
Note that there may very well be more than one of these, if a
.readonly is examined, since the volume headers for all of the RO
volumes will be queried.
The attributes available in this object depend on the method
arguments, as well as the state of the volume (less information can be
obtained when a volume is busy, for example).
The following attributes should always be present.
Attributes Values
---------- ------
id Numeric Volume ID
status online | offline | busy
attached Boolean
The 'attached' attribute is a Boolean that indicates whether or not
the volume is attached by the volserver. A volume which can not be
brought online due to volume header problems will be offline, and
unattached (attached == 0), but a volume can be offline for other
reasons, (eg. vos offline, or more than one volume with the same ID on
the same server), and still be attached (attached == 1).
The following attributes are present only if the volume's status is
'online':
Attributes Values
---------- ------
name Volume Name
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
---------- ------
lib/AFS/Command/VOS.pod view on Meta::CPAN
noauth => 1,
localauth => 1,
verbose => 1,
encrypt => 1,
);
=item Return Values
This method returns an AFS::Object::FileServer object, which
contains one or more AFS::Object::Partition objects. Because
'listpart' returns nothing other than the partition names, the
underlying Partition objects have only one attribute ('partition'), so
the API for access this data is trivial:
my $result = $vos->listpart
(
server => 'fs1.ms.com',
) || die $vos->errors();
foreach my $partition ( $result->getPartitionNames() ) {
print "Server '$server' has partition '$partition'\n";
}
The FileServer object has no attributes at all, it merely contains the
Partition objects. Since the Partition objects are indexed by name,
there's no need to extract the partition objects and query their
attributes, since once you have the names, you have all the information
already.
Compare this with 'vos partinfo', which provides a lot more
information. For pedantic completeness (the author is kinda
anal-retentive in that way), here's the description of the complete
interface.
B<AFS::Object::FileServer>
This object has no attributes, and is merely a container for the
AFS::Object::Partition objects. It has the following methods
for extracting the objects is contains.
Methods Returns
------- -------
getPartitionNames() list of strings (partition names)
getPartitions() list of AFS::Object::Partition objects
getPartition($partname) a single AFS::Object::Partition object,
for the partition named $partname
B<AFS::Object::Partition>
This object has one boring attribute:
Attributes Values
---------- ------
partition Fileserver /vice partition name
When used to encapsulate 'vos listpart' output, this object has no
relevant methods. Note, however, that this version of the API reuses
this object to represent other partition-related data (see 'vos
listvol' method documentation, for example), but they are not relevant
in this usage of the object. This multiple personality of the objects
may be changed in a future release, so don't get too attached to the
specific class names.
See the AFS::Object documentation for a discussion of the
planned evolution of the API.
=back
=head2 listvldb
=over
=item Arguments
The vos help string is:
vos listvldb: list volumes in the VLDB
Usage: vos listvldb [-name <volume name or ID>] [-server <machine name>]
[-partition <partition name>] [-locked] [-quiet] [-nosort]
[-cell <cell name>] [-noauth] [-localauth] [-verbose] [-encrypt]
Where: -locked locked volumes only
-quiet generate minimal information
-nosort do not alphabetically sort the volume names
The corresponding method invocation looks like:
my $result = $vos->listvldb
(
# Optional arguments
name => $name,
server => $server,
partition => $partition,
locked => 1,
quiet => 1,
nosort => 1,
cell => $cell,
noauth => 1,
localauth => 1,
verbose => 1,
encrypt => 1,
);
=item Return Values
This method returns an AFS::Object::VLDB object, which has a
few attributes, and contains one or more
AFS::Object::VLDBEntry objects, which in turn contain
AFS::Object::VLDBSite objects, as well as their own
attributes.
NOTE: the VLDBEntry and VLDBSite objects are the same as those used by
the 'examine' method, since that command also queries the VLDB for
part of its return values. See that discussion above for some
relevant details on the parsing of those objects, which will no be
repeated here.
my $result = $vos->listvldb
(
cell => $cell,
) || die $vos->errors();
lib/AFS/Command/VOS.pod view on Meta::CPAN
foreach my $id ( $partition->getVolumeIds() ) {
my $header = $partition->getVolumeHeader( id => $id );
# Do something interesting with $header.
}
Each of these objects has the following attributes and methods:
B<AFS::Object::VolServer>
This object has no attributes, and has several methods for extracting
the partition objects.
Methods Returns
------- -------
getPartitionNames() list of partition names
getPartitions() list of AFS::Object::Partition objects
getPartition($name) the AFS::Object::Partition for partition $name
B<AFS::Object::Partition>
This objects has several attributes, and several methods for
extracting the VolumeHeader objects.
Attributes Values
---------- ------
partition Partition name
total Total number of volumes on the partition
online Total number of online volumes
offline Total number of offline volumes
busy Total number of busy volumes
Methods Returns
------- -------
getVolumeIds() List of volume ids
getVolumeNames() List of volume names
getVolumeHeaderById($id) the AFS::Object::VolumeHeader object for $id
getVolumeHeaderByName($name) the AFS::Object::VolumeHeader object for $name
getVolumeHeaders() list of AFS::Object::VolumeHeader objects
getVolumeHeader( id => $id ) the AFS::Object::VolumeHeader object for $id
getVolumeHeader( name => $name ) the AFS::Object::VolumeHeader object for $name
Note that both of the following are equivalent, but merely differ in style:
getVolumeHeaderById($id)
getVolumeHeader( id => $id )
And it should be obvious, but these are also equivalent we well:
getVolumeHeaderByName($name)
getVolumeHeader( name => $name )
B<AFS::Object::VolumeHeader>
The following attributes should always be present.
Attributes Values
---------- ------
id Numeric Volume ID
status online | offline | busy
attached Boolean
The 'attached' attribute is a Boolean that indicates whether or not
the volume is attached by the volserver. A volume which can not be
brought online due to volume header problems will be offline, and
unattached (attached == 0), but a volume can be offline for other
reasons, (eg. vos offline, or more than one volume with the same ID on
the same server), and still be attached (attached == 1).
If the 'fast' argument was specified, then none of the other
attributes will be present.
The following attributes are present only if the volume's status is
'online':
Attributes Values
---------- ------
name Volume Name
type "RO" | "RW" | "BK"
size Numeric size in KB
The following attributes are present only if the 'long' argument was
specified:
Attributes Values
---------- ------
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
=back
=head2 partinfo
=over
=item Arguments
The vos help string is:
vos partinfo: list partition information
Usage: vos partinfo -server <machine name> [-partition <partition name>]
[-cell <cell name>] [-noauth] [-localauth]
[-verbose] [-encrypt]
The corresponding method invocation looks like:
my $result = $vos->partinfo
(
# Required arguments
server => $server,
# Optional arguments
partition => $partition,
cell => $cell,
noauth => 1,
localauth => 1,
verbose => 1,
encrypt => 1,
lib/AFS/Command/VOS.pod view on Meta::CPAN
The vos help string is:
vos status: report on volser status
Usage: vos status -server <machine name> [-cell <cell name>] [-noauth]
[-localauth] [-verbose] [-encrypt]
The corresponding method invocation looks like:
my $result = $vos->status
(
# Required arguments
server => $server,
# Optional arguments
cell => $cell,
noauth => 1,
localauth => 1,
verbose => 1,
encrypt => 1,
);
=item Return Values
This method returns an AFS::Object::VolServer object with one
attribute, which also may or may not contain one or more
AFS::Object::Transaction objects.
my $result = $vos->status
(
server => $server,
) || die $vos->errors();
print "Server has " . $result->transactions() . "active transactions\n";
foreach my $transaction ( $result->getTransactions() ) {
print("There are active transactions for volume ID " .
$transaction->volume() . "\n");
}
B<AFS::Object::VolServer>
This object has exactly one attribute, and several methods:
Attributes Values
---------- ------
transactions Number of active transactions on the volserver
Methods Returns
------- -------
getTransactions list of AFS::Object::Transaction objects
getVolumes list of volume IDs for which there are transactions
getTransactionByVolume($volume) a single AFS::Object::Transaction object for the volume $volume
B<AFS::Object::Transaction>
This object has several attributes:
Attributes Values
---------- ------
transaction Numeric transaction ID
created Creation date (in ctime format)
attachFlags String (exact meaning unclear)
volume Numeric volume ID
partition Vice partition on whcih the volume resides
procedure What is being done to the volume
packetRead Numeric value
lastReceiveTime Time value (utime format)
packetSend Numeric value
lastSendTime Time value (utime format)
NOTE: These attributes just come from a straight parsing of output like this:
--------------------------------------
transaction: 170423 created: Wed Oct 8 15:59:12 2003
attachFlags: offline
volume: 536963097 partition: /vicepf procedure: Restore
packetRead: 222 lastReceiveTime: 1065643165 packetSend: 1 lastSendTime: 1065643165
--------------------------------------
To understand the meaning of these various fields (which to the
author's knowledge are not documented anywhere), see the OpenAFS
source code. Some of these values are obvious, or intuitive, but
others are not.
=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 addsite
The vos help string is:
vos addsite: add a replication site
Usage: vos addsite -server <machine name for new site> -partition <partition name for new site>
-id <volume name or ID> [-cell <cell name>]
[-noauth] [-localauth] [-verbose] [-encrypt]
The corresponding method invocation looks like:
my $result = $vos->addsite
(
# Required arguments
server => $server,
partition => $partition,
id => $id,
# Optional arguments
cell => $cell,
noauth => 1,
localauth => 1,
verbose => 1,
encrypt => 1,
);
=head2 backup
The vos help string is:
vos backup: make backup of a volume
Usage: vos backup -id <volume name or ID> [-cell <cell name>]
[-noauth] [-localauth] [-verbose] [-encrypt]
The corresponding method invocation looks like:
my $result = $vos->backup
(
# Required arguments
id => $id,
# Optional arguments
cell => $cell,
noauth => 1,
localauth => 1,
verbose => 1,
( run in 0.872 second using v1.01-cache-2.11-cpan-13bb782fe5a )