AFS

 view release on metacpan or  search on metacpan

pod/v2/afsperlvldb.pod  view on Meta::CPAN


  my ($succ, $fail) = $vldb->delentry(['volume', 'volume.projects']);
  ($succ, $fail) = $vldb->delentry('volume');
  ($succ, $fail) = $vldb->delgroups('home', 'server', '/vicepa', 1);

  my @addrlist = $vldb->listaddrs('', '', 0, 1);

  my $vldblist = $vldb->listvldb('server1', '/vicepa');
  my $vldblist = $vldb->listvldbentry('root.afs');

  $ok = $vldb->lock('volume');
  $ok = $vldb->unlock('volume');
  $ok = $vldb->unlockvldb('server1', '/vicepa');

  $ok = $vldb->syncserv('server1', '/vicepa');
  $ok = $vldb->syncvldb('server1', '/vicepa');
  $ok = $vldb->syncvldbentry('volume');

=head1 DESCRIPTION

This class is used to communicate with the B<AFS Volume Location
Server> in order to maintain and to administer the Volume Location
Database (VLDB) maintained by the Volume Location Server.  The VLDB is
used to allow AFS application programs to discover the location of any
volume within its cell, along with select information about the nature
and state of that volume.  This class provides methods to lookup for
volumes or to lock/unlock them in the DB.  It is used to remove and to
list DB entries, and to synchronize the VLDB against the AFS
partitions.

Before you can access any VLDB records you must establish a connection
to the Volume Location Server.  This is done by the constructor method
I<new> which returns a VLDB object.  A VLDB object is essentially a
handle to talk to the Volume Location Server in a given cell.  Such a
VLDB object is required before any of the other VLDB instance methods
can be called.

=head1 COMPATIBILITY

There was no version 1 implementation and hence there are no version
conflicts :-)

=head1 METHODS

=over 4

=item B<CONSTRUCTOR>

=item S< >

=item B<$vldb = AFS::VLDB-E<gt>new([VERBOSE [, TIMEOUT [, NOAUTH [, LOCALAUTH [, CELL [, ENCRYPT]]]]]);>

Creates a new object of the class AFS::VLDB.  An AFS::VLDB object is
essentially a handle to talk to the Volume Location Server.
Internally an AFS::VLDB object is a pointer to a ubik_client
structure, although this may change and the value returned from
AFS::VLDB::new should always be treaded as an opaque handle.

Set VERBOSE (default 0) to 1 to produce on the standard output stream
a detailed trace of the method's execution.  TIMEOUT is the time of
inactivity in seconds before the connection to the VLDB server is
declared dead (default 90 seconds).  Set LOCALAUTH (default 0) to 1
only when issuing a command on a server machine.  If NOAUTH is 1
(default 0) it establishes an unauthenticated connection to the
server, in which the servers treat the issuer as an unprivileged user.
CELL (default NULL) specifies the cell in which to run the
command. Set ENCRYPT to 1 (default 0) to encrypt the connection to the
VLDB server.

=item B<DESTRUCTOR>

=item S< >

=item B<$vldb-E<gt>DESTROY;>

Destroys the ubik connection to the Volume Location Server and frees the
ubik_client structure.


=item B<INSTANCE METHODS>

=item S< >

=item B<$ok = $vldb-E<gt>addsite(SERVER, PARTITION, VOLUME [, ROVOL, VALID]);>

Defines a new read-only site specified by the SERVER and PARTITION
arguments, in the Volume Location Database (VLDB) entry of the
read/write VOLUME (volume name or volume ID number).
ROVOL specifies either the complete name or volume ID number of the readonly
volume. This will only be honored if the source read/write volume does not
already have a readonly volume ID associated with it. If the source
read/write volume already has a readonly volume ID, the specified ID will
be ignored, and a warning will be printed.
If this is not specified and the source read/write volume does not already
have a readonly volume ID, a volume ID for the readonly volume will be
allocated for it when the B<vos->release> method is run.
The automatically allocated readonly volume IDs should be fine for almost
all cases, so you should almost never need to specify this argument. This
argument is supported when the AFS Perl modules are linked with the
OpenAFS system libraries v1.4.12 or later.
The VALID flag marks the site as up-to-date in the VLDB. You should only
do this if the new site already has a current readonly replica of the
volume, but for some reason it is not in the VLDB as a replica site.
This is useful when an existing read-only volume is dumped and restored
with the B<-readonly> flag at the new site. This argument is supported
when the AFS Perl modules are linked with the OpenAFS system libraries
v1.4.7 or later.

It calls the AFS system library function I<UV_AddSite> or
I<UV_AddSite2> (OpenAFS v.1.4.12 or later).

=item B<$ok = $vldb-E<gt>changeloc(VOLUME, SERVER, PARTITION);>

Changes the location of the read/write VOLUME (volume name or volume
ID number) in the VLDB to SERVER and PARTITION.  This method is only
available with OpenAFS.  It calls the AFS system library function
I<UV_ChangeLocation>.

=item B<($succ, $fail) = $vldb-E<gt>delentry(VOLUME [, NOEXECUTE]);>

=item B<($succ, $fail) = $vldb-E<gt>delentry(\@VOLUME [, NOEXECUTE]);>



( run in 1.159 second using v1.01-cache-2.11-cpan-5837b0d9d2c )