AFS-Command

 view release on metacpan or  search on metacpan

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

      (
       # Required arguments
       server			=> $server,
       # Optional arguments
       partition		=> $partition,
       fast			=> 1,
       long			=> 1,
       quiet			=> 1,
       extended			=> 1, # Not really... see below
       cell                     => $cell,
       noauth                   => 1,
       localauth                => 1,
       verbose                  => 1,
       encrypt                  => 1,
      );

NOTE: 'extended' is not supported in this version of the API, and
specifying it will result in a warning, but not an error.  However,
'vos examine' does parse the extended output, so if you really want
that data you can get it on a volume by volume basis.  Adding support
for 'extended' to 'vos listvol' is on the todo list.

=item Return Values

This method returns an AFS::Object::VolServer object, which
merely contains one or more AFS::Object::Partition objects,
which in turn have a few attributes and contain one or more
AFS::Object::VolumeHeader objects.

    my $result = $vos->listvol
      (
       server			=> $server,,
       cell				=> $cell,
      ) || die $vos->errors();
    foreach my $partition ( $result->getPartitions() ) {
	my $partname 		= $partition->partition();
	my $total			= $partition->total();
	my $online			= $partition->online();
	my $offline			= $partition->offline();
	my $busy			= $partition->busy();
	print("Partition $partname has $total total volumes, of which " .
	      "$online are online, $offline are offline, and $busy are busy.\n");
	foreach my $header ( $partition->getVolumeHeaders() ) {
	    # Do something interesting with $header.
	}
    }

There are several other ways to get at the headers, of course.

	foreach my $name ( $partition->getVolumeNames() ) {
	    my $header = $partition->getVolumeHeaderByName($name)
	    # Do something interesting with $header.
	}

	foreach my $id ( $partition->getVolumeIds() ) {
	    my $header = $partition->getVolumeHeaderById($id);
	    # Do something interesting with $header.
	}

And there is yet one more method to extract the headers (don't say the
author doesn't pander to lots of different programming styles,
provided of course they are one of his own).


	foreach my $name ( $partition->getVolumeNames() ) {
	    my $header = $partition->getVolumeHeader( name => $name );
	    # Do something interesting with $header.
	}

	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



( run in 0.606 second using v1.01-cache-2.11-cpan-e1769b4cff6 )