Net::Cisco::ACS::Device - Access Cisco ACS functionality through REST API - Device fields
use Net::Cisco::ACS; use Net::Cisco::ACS::Device; my $acs = Net::Cisco::ACS->new(hostname => '10.0.0.1', username => 'acsadmin', password => 'testPassword'); my %devices = $acs->devices; # Retrieve all devices from ACS # Returns hash with device name / Net::Cisco::ACS::Device pairs print $acs->devices->{"MAIN_Router"}->toXML; # Dump in XML format (used by ACS for API calls) my $device = $acs->devices("name","MAIN_Router"); # Faster call to request specific device information by name my $device = $acs->devices("id","250"); # Faster call to request specific device information by ID (assigned by ACS, present in Net::Cisco::ACS::Device) $device->id(0); # Required for new device! my $id = $acs->create($device); # Create new device based on Net::Cisco::ACS::Device 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($device); # Update existing device based on Net::Cisco::ACS::Device 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($device); # Delete existing device based on Net::Cisco::ACS::Device instance
The Net::Cisco::ACS::Device class holds all the device relevant information from Cisco ACS 5.x
All calls are typically handled through an instance of the Net::Cisco::ACS class. Net::Cisco::ACS::Device acts as a container for device group related information.
Class constructor. Returns object of Net::Cisco::ACS::Device on succes. The following fields can be set / retrieved:
Formatting rules may be in place & enforced by Cisco ACS.
The device description.
The device ID. Cisco ACS generates a unique ID for each Host 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 host.
The device name, typically something like the sysName or hostname.
Boolean value (0 / 1) to indicate if TACACS+ is used on this device.
Read-only value that contains deviceType, location and other device type information. Only deviceType, location are retrievable by the respective methods.
deviceType
location
Boolean value (0 / 1) that indicates support for legacy versions of TACACS+.
The shared key for TACACS+. When retrieving this information, the key is masked as **********.
The TACACS+ singleConnect setting.
The shared key for RADIUS. When retrieving this information, the key is masked as **********.
Array reference that contains hash entries of all IP information for the device entry, separated as netMask and ipAddress keys.
netMask
ipAddress
Cleaned up instance of subnet.
subnet
The device location field, as defined in groupInfo.
groupInfo
The specific device Type field.
Boolean value (0 / 1). Used for RADIUS configuration.
TCP port for specific RADIUS purposes.
Dump the record in ACS accept XML formatting (without header).
Generate the correct XML header. Takes output of toXML as argument.
toXML
The device group account description, typically used for full device group name.
This points to the type of Device Group, typically Location or Device Type but can be customized. See also Net::Cisco::ACS::Device deviceType.
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.