AFS-Command

 view release on metacpan or  search on metacpan

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

contains one AFS::Object::User or AFS::Object::Group
object for each user/group examined.

    my $result = $pts->examine
      (
       nameorid			=> [ $name1, $name2 ],
       cell				=> 1,
      ) || die $pts->errors();
    foreach my $userobj ( $result->getUser() ) {
	my ($name,$id) = ($userobj->name(),$userobj->id());
	print "User $name has id $id\n";
    }
    foreach my $groupobj ( $result->getGroups() ) {
	my ($name,$id) = ($groupobj->name(),$groupobj->id());
	print "Group $name has id $id\n";
    }

Each of these objects has the following attributes and methods:

B<AFS::Object::PTServer>

    Methods			Returns
    -------			-------
    getGroupNames()		list of group names
    getGroupIds()		list of group ids
    getGroups()			list of AFS::Object::Group objects
    getGroupByName($name)	the AFS::Object::Group object for group $name
    getGroupById($id)		the AFS::Object::Group object for id $id
    getGroup( name => $name )	the AFS::Object::Group object for group $name
    getGroup( id => $id )	the AFS::Object::Group object for id $id
    getUserNames()		list of user names
    getUserIds()		list of user ids
    getUsers()			list of AFS::Object::User objects
    getUserByName($name)	the AFS::Object::User object for user $name
    getUserById($id)		the AFS::Object::User object for id $id
    getUser( name => $name )	the AFS::Object::User object for user $name
    getUser( id => $id )	the AFS::Object::User object for id $id

B<AFS::Object::User>, B<AFS::Object::Group>

    Attributes			Values
    ----------			------
    name			User or group name
    id				User or group id
    owner			Owner of the entry
    creator			Creator of the entry
    membership			Number of groups the user is a member of, or..
				Number of members of the group
    groupquota			Group creation quota

=back

=head2 listentries

=over

=item Arguments

The pts help string is:

    pts listentries: list users/groups in the protection database
    Usage: pts listentries [-users] [-groups] [-cell <cell name>]
			   [-noauth] [-force]
    Where: -users   list user entries
	   -groups  list group entries

The corresponding method invocation looks like:

    my $result = $pts->listentries
      (
       # Optional arguments
       users			=> 1,
       groups			=> 1,
       cell			=> $cell,
       noauth			=> 1,
       force			=> 1,
      );

=item Return Values

This method returns an AFS::Object::PTServer object, which
contains one AFS::Object::User or AFS::Object::Group
object for each user/group listed.

    my $result = $pts->listentries
      (
       users			=> 1,
       groups			=> 1,
       cell				=> $cell,
      ) || die $pts->errors();
    # Starting to see a pattern?  The result is parsed in almost the
    # same way as shown for examine

Each of these objects has the following attributes and methods:

B<AFS::Object::PTServer>

    Methods			Returns
    -------			-------
    getGroupNames()		list of group names
    getGroupIds()		list of group ids
    getGroups()			list of AFS::Object::Group objects
    getGroupByName($name)	the AFS::Object::Group object for group $name
    getGroupById($id)		the AFS::Object::Group object for id $id
    getGroup( name => $name )	the AFS::Object::Group object for group $name
    getGroup( id => $id )	the AFS::Object::Group object for id $id
    getUserNames()		list of user names
    getUserIds()		list of user ids
    getUsers()			list of AFS::Object::User objects
    getUserByName($name)	the AFS::Object::User object for user $name
    getUserById($id)		the AFS::Object::User object for id $id
    getUser( name => $name )	the AFS::Object::User object for user $name
    getUser( id => $id )	the AFS::Object::User object for id $id

B<AFS::Object::User>, B<AFS::Object::Group>

    Attributes			Values
    ----------			------
    name			User or group name
    id				User or group id
    owner			Numeric id of the owner of the entry

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

    id				User or group id

    Methods			Returns
    -------			-------
    getMembership()		For a user, the list of group to which the user belongs,
				for a group, the members of the group

=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 adduser

The pts help string is:

    pts adduser: add a user to a group
    Usage: pts adduser -user <user name>+ -group <group name>+
		       [-cell <cell name>] [-noauth] [-force]

The corresponding method invocation looks like:

    my $result = $pts->adduser
      (
       # Required arguments
       user			=> $user, # OR [ $user1, $user2, ... ]
       group			=> $group, # OR [ $group1, $group2, ... ]
       # Optional arguments
       cell			=> $cell,
       noauth			=> 1,
       force			=> 1,
      );

=head2 chown

The pts help string is:

    pts chown: change ownership of a group
    Usage: pts chown -name <group name> -owner <new owner>
		     [-cell <cell name>] [-noauth] [-force]

The corresponding method invocation looks like:

    my $result = $pts->chown
      (
       # Required arguments
       name			=> $name,
       owner			=> $owner,
       # Optional arguments
       cell			=> $cell,
       noauth			=> 1,
       force			=> 1,
      );

=head2 delete

The pts help string is:

    pts delete: delete a user or group from database
    Usage: pts delete -nameorid <user or group name or id>+
		      [-cell <cell name>] [-noauth] [-force]

The corresponding method invocation looks like:

    my $result = $pts->delete
      (
       # Required arguments
       nameorid			=> $nameorid, # OR [ $nameorid1, $nameorid2, ... ]
       # Optional arguments
       cell			=> $cell,
       noauth			=> 1,
       force			=> 1,
      );

=head2 removeuser

The pts help string is:

    pts removeuser: remove a user from a group
    Usage: pts removeuser -user <user name>+ -group <group name>+
			  [-cell <cell name>] [-noauth] [-force]

The corresponding method invocation looks like:

    my $result = $pts->removeuser
      (
       # Required arguments
       user			=> $user, # OR [ $user1, $user2, ... ]
       group			=> $group, # OR [ $group1, $group2, ... ]
       # Optional arguments
       cell			=> $cell,
       noauth			=> 1,
       force			=> 1,
      );

=head2 rename

The pts help string is:

    pts rename: rename user or group
    Usage: pts rename -oldname <old name> -newname <new name>
		      [-cell <cell name>] [-noauth] [-force]

The corresponding method invocation looks like:

    my $result = $pts->rename
      (
       # Required arguments
       oldname			=> $oldname,
       newname			=> $newname,
       # Optional arguments
       cell			=> $cell,
       noauth			=> 1,
       force			=> 1,
      );

=head2 setfields

The pts help string is:



( run in 1.370 second using v1.01-cache-2.11-cpan-c966e8aa7e8 )