AFS-Command

 view release on metacpan or  search on metacpan

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

specified in the arguments.

    my $result = $fs->examine
      (
       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

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

The objects have the following attributes and methods:

B<AFS::Object::CacheManager>

    Methods			Returns
    -------			-------
    getServerNames()		list of server hostnames (or addresses)
    getServers()		list of AFS::Object::Server objects
    getServer($server)		the AFS::Object::Server object for server $server

B<AFS::Object::Server>

    Attributes			Values
    ----------			------
    server			Hostname or IP address of the server
    preference			Numeric preference value

=back

=head2 listacl

=over

=item Arguments

The fs help string is:

    fs listacl: list access control list
    Usage: fs listacl [-path <dir/file path>+] [-id] [-if]
    Where: -id  initial directory acl
	   -if  initial file acl

The corresponding method invocation looks like:

    my $result = $fs->listacl
      (
       # Required arguments
       path			=> $path, # OR [ $path1, $path2, ... ]
       # Optional arguments
       id			=> 1,
       if			=> 1,
      );

=item Return Values

This method returns an AFS::Object::CacheManager object, which
contains one or more AFS::Object::Path objects, one for each path
specified in the arguments.  Each AFS::Object::Path object contains
one or two AFS::Object::ACL objects (one for normal, and one for
negative).

    my $result = $fs->listacl
      (
       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 $type ( qw( normal negative ) ) {
		my $acl = $pathobj->getACL($type);
		my %entries = $acl->getEntries();
		foreach my $principal ( keys %entries ) {
		    my $rights = $acl->getRights($principal);
		    print "$type rights for $principal are $rights\n";
		}
	    }
	}
    }

The objects have 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>

    Methods			Returns
    -------			-------
    getACLNormal()		the AFS::Object::ACL object for the normal rights
    getACLNegative()		the AFS::Object::ACL object for the negative rights
    getACL($type)		the AFS::Object::ACL object for rights of type $type,
				where $type is either 'normal' or 'negative'

B<AFS::Object::ACL>

    Methods			Returns
    -------			-------
    getPrincipals()		a list of the principals (users, groups) on the ACL
    getRights($principal)	the rights (permissions) of the specified $principal
    getEntries()		a list of key/value pairs, where the keys are the principals,
				and the values are the rights for that principal

=back

=head2 listaliases

=over

=item Arguments

The fs help string is:

    fs listaliases: list configured cell aliases
    Usage: fs listaliases

The corresponding method invocation looks like:

    my $result = $fs->listaliases();

=item Return Values

This method returns an AFS::Object::CacheManager object, which
contains one or more AFS::Object::Cell objects.

    my $result = $fs->listaliases() || die $fs->errors();
    foreach my $cellobj ( $result->getCells() ) {
	my $cell = $cellobj->cell();
	my $alias = $cellobj->alias();
	print "Cell '$cell' has alias '$alias'\n";
    }

The objects have the following attributes and methods:

B<AFS::Object::CacheManager>

    Methods			Returns
    -------			-------
    getCellNames()		list of cell names
    getCells()			list of AFS::Object::Cell objects
    getCell($cell)		the AFS::Object::Cell object for cell $cell

B<AFS::Object::Cell>

    Attributes			Values
    ----------			------
    cell			AFS cell name
    alias			Alias name for this cell

=back

=head2 listcells



( run in 1.155 second using v1.01-cache-2.11-cpan-6aa56a78535 )