Net::Cisco::ACS::User - Access Cisco ACS functionality through REST API - User fields
use Net::Cisco::ACS; use Net::Cisco::ACS::User; my $acs = Net::Cisco::ACS->new(hostname => '10.0.0.1', username => 'acsadmin', password => 'testPassword'); my $user = Net::Cisco::ACS::User->new("name"=>"soloh","description"=>"Han Solo","identityGroupName"=>"All Groups:MilleniumCrew","password"=>"Leia"); my %users = $acs->users; # Retrieve all users from ACS # Returns hash with username / Net::Cisco::ACS::User pairs print $acs->users->{"acsadmin"}->toXML; # Dump in XML format (used by ACS for API calls) my $user = $acs->users("name","acsadmin"); # Faster call to request specific user information by name my $user = $acs->users("id","150"); # Faster call to request specific user information by ID (assigned by ACS, present in Net::Cisco::ACS::User) $user->id(0); # Required for new user! my $id = $acs->create($user); # Create new user based on Net::Cisco::ACS::User instance # Return value is ID generated by ACS print "Record ID is $id" if $id; print $Net::Cisco::ACS::ERROR unless $id; # $Net::Cisco::ACS::ERROR contains details about failure my $id = $acs->update($user); # Update existing user based on Net::Cisco::ACS::User instance # Return value is ID generated by ACS print "Record ID is $id" if $id; print $Net::Cisco::ACS::ERROR unless $id; # $Net::Cisco::ACS::ERROR contains details about failure $acs->delete($user); # Delete existing user based on Net::Cisco::ACS::User instance
The Net::Cisco::ACS::User class holds all the user relevant information from Cisco ACS 5.x
All calls are typically handled through an instance of the Net::Cisco::ACS class. Net::Cisco::ACS::User acts as a container for user related information.
Class constructor. Returns object of Net::Cisco::ACS::User on succes. The following fields can be set / retrieved:
Formatting rules may be in place & enforced by Cisco ACS.
Read-only values:
The user account description, typically used for full name.
The user account name. This is a required value in the constructor but can be redefined afterwards.
The user group name. This is a required value in the constructor but can be redefined afterwards. See Net::Cisco::ACS::IdentityGroupName.
The enable password (for Cisco-level access), not needed if you work with command sets in your access policies.
Boolean flag to indicate account status.
Password. When querying user account information, the password will be masked as *********. This is a required value in the constructor but can be redefined afterwards.
Boolean flag to indicate account expiration status.
A read-only valie that indicates the password type, either for Internal User or Active Directory (needs confirmation).
Date field to automatically deactivate the account once passed.
Boolean flag to activate the automatic deactivation feature based on expiration dates.
Cisco ACS generates a unique ID for each User record. This field cannot be updated within ACS but is used for reference. Set to 0 when creating a new record or when duplicating an existing user.
Dump the record in ACS accept XML formatting (without header).
Generate the correct XML header. Takes output of toXML as argument.
toXML
None yet
None yet :)
Hendrik Van Belleghem CPAN ID: BEATNIK hendrik.vanbelleghem@gmail.com
This program is free software licensed under the...
The General Public License (GPL) Version 2, June 1991
The full text of the license can be found in the LICENSE file included with this module.
perl(1).
To install Net::Cisco::ACS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Cisco::ACS
CPAN shell
perl -MCPAN -e shell install Net::Cisco::ACS
For more information on module installation, please visit the detailed CPAN module installation guide.