AFS-Command

 view release on metacpan or  search on metacpan

lib/AFS/Command/FS.pm  view on Meta::CPAN

		       hosts			=> [split(/\s+/,$2)],
		      );
		    delete $paths{$1};

		}

	    }

	    if ( $operation eq 'storebehind' ) {

		if ( /Default store asynchrony is (\d+) kbytes/ ) {

		    $default = $1;
		    next;

		} elsif ( /Will store (.*?) according to default./ ) {

		    $path->_setAttribute
		      (
		       path 			=> $1,
		       asynchrony 		=> 'default',
		      );

		    delete $paths{$1};
		    @paths = grep($_ ne $1,@paths);

		} elsif ( /Will store up to (\d+) kbytes of (.*?) asynchronously/ ) {

		    $path->_setAttribute
		      (
		       path 			=> $2,
		       asynchrony 		=> $1,
		      );

		    delete $paths{$2};
		    @paths = grep($_ ne $2,@paths);

		}

	    }

	    if ( $operation eq 'quota' ) {

lib/AFS/Command/FS.pm  view on Meta::CPAN

	    }

	}

	$result->_addPath($path);

    }

    if ( $operation eq 'storebehind' ) {

	$result->_setAttribute( asynchrony => $default );

	#
	# This is ugly, but we get the default last, and it would be nice
	# to put this value into the Path objects as well, rather than the
	# string 'default'.
	#
	foreach my $path ( $result->getPaths() ) {
	    if ( defined($path->asynchrony()) && $path->asynchrony() eq 'default' ) {
		$path->_setAttribute( asynchrony => $default );
	    }
	}
    }

    foreach my $pathname ( keys %paths ) {

	my $path = AFS::Object::Path->new
	  (
	   path			=> $pathname,
	   error		=> "Unable to determine results",

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


=head2 storebehind

=over

=item Arguments

The fs help string is:

    fs storebehind: store to server after file close
    Usage: fs storebehind [-kbytes <asynchrony for specified names>]
			  [-files <specific pathnames>+] [-allfiles <new default (KB)>]
			  [-verbose]
    Where: -verbose  show status

The corresponding method invocation looks like:

    my $result = $fs->storebehind
      (
       # Optional arguments
       kbytes			=> $kbytes,

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

	    }
	}
    }

Each of these objects has the following attributes and methods:

B<AFS::Object::CacheManager>

    Attributes			Values
    ----------			------
    asynchrony			Default value (in KB) of asynchronous writes

    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

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

    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
    asynchrony			The number of KB of asynchronous writes for this file

=back

=head2 sysname

=over

=item Arguments

The fs help string is:

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

       localauth                => 1,
       verbose                  => 1,
       encrypt                  => 1,
      );


=head2 syncserv

The vos help string is:

    vos syncserv: synchronize server with VLDB
    Usage: vos syncserv -server <machine name> [-partition <partition name>]
			[-cell <cell name>] [-noauth] [-localauth] [-verbose] [-encrypt]

The corresponding method invocation looks like:

    my $result = $vos->syncserv
      (
       # Required arguments
       server			=> $server,
       # Optional arguments

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

       noauth                   => 1,
       localauth                => 1,
       verbose                  => 1,
       encrypt                  => 1,
      );

=head2 syncvldb

The vos help string is:

    vos syncvldb: synchronize VLDB with server
    Usage: vos syncvldb [-server <machine name>] [-partition <partition name>]
			[-volume <volume name or ID>] [-cell <cell name>]
			[-noauth] [-localauth] [-verbose] [-encrypt]

The corresponding method invocation looks like:

    my $result = $vos->syncvldb
      (
       # Optional arguments
       server			=> $server,

t/20fs_basic.t  view on Meta::CPAN

# All the common _paths_method methods
#
my $paths = [ $pathafs, $pathnotafs, $pathbogus ];

my %pathops =
  (
   diskfree			=> [qw( volname total used avail percent )],
   examine			=> [qw( volname total avail id quota )],
   listquota			=> [qw( volname quota used percent partition )],
   quota			=> [qw( percent )],
   storebehind			=> [qw( asynchrony )],
   whereis			=> [qw( hosts )],
   whichcell			=> [qw( cell )],
  );

foreach my $pathop ( keys %pathops ) {

    unless ( $fs->supportsOperation($pathop) ) {
	my $total = scalar(@{$pathops{$pathop}}) + 2;
	$total++ if $pathop eq 'storebehind';
	for ( my $count = 1 ; $count <= $total ; $count++ ) {

t/20fs_basic.t  view on Meta::CPAN

    if ( ref $result && $result->isa("AFS::Object::CacheManager") ) {
	print "ok $TestCounter\n";
	$TestCounter++;
    } else {
	print "not ok $TestCounter..$TestTotal\n";
	die("Unable to call fs->$pathop:\n" . $fs->errors() .
	    Data::Dumper->Dump([$fs],['fs']));
    }

    if ( $pathop eq 'storebehind' ) {
	if ( defined($result->asynchrony()) ) {
	    print "ok $TestCounter\n";
	} else {
	    print "not ok $TestCounter\n";
	    warn("Result object for fs->storebehind() has no attr 'asynchrony'\n");
	}
    } else {
	print "ok $TestCounter\n";
    }
    $TestCounter++;

    foreach my $pathname ( @$paths ) {

	my $path = $result->getPath($pathname);
	if ( ref $path && $path->isa("AFS::Object::Path") ) {



( run in 1.064 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )