NAME
Net::Cisco::ACS::DeviceGroup - Access Cisco ACS functionality through REST API - DeviceGroup fields
SYNOPSIS
use Net::Cisco::ACS;
use Net::Cisco::ACS::DeviceGroup;
my $acs = Net::Cisco::ACS->new(hostname => '10.0.0.1', username => 'acsadmin', password => 'testPassword');
my %devicegroups = $acs->devicegroups;
# Retrieve all device groups from ACS
# Returns hash with device name / Net::Cisco::ACS::DeviceGroup pairs
print $acs->devicegroups->{"All Locations"}->toXML;
# Dump in XML format (used by ACS for API calls)
my $device = $acs->devicegroups("name","All Locations");
# Faster call to request specific device group information by name
my $devicegroup = $acs->devicegroups("id","250");
# Faster call to request specific device group information by ID (assigned by ACS, present in Net::Cisco::ACS::DeviceGroup)
$devicegroup->id(0); # Required for new device group!
my $id = $acs->create($devicegroup);
# Create new device group based on Net::Cisco::ACS::DeviceGroup 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($devicegroup);
# Update existing device based on Net::Cisco::ACS::DeviceGroup 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($devicegroup);
# Delete existing device based on Net::Cisco::ACS::DeviceGroup instance
DESCRIPTION
The Net::Cisco::ACS::DeviceGroup class holds all the device group relevant information from Cisco ACS 5.x
USAGE
All calls are typically handled through an instance of the Net::Cisco::ACS class. Net::Cisco::ACS::DeviceGroup acts as a container for device group related information.
- new
-
Class constructor. Returns object of Net::Cisco::ACS::DeviceGroup on succes. The following fields can be set / retrieved:
- description =item name =item id =item groupType
-
Formatting rules may be in place & enforced by Cisco ACS.
- description
-
The device group account description, typically used for full device group name.
- name
-
The device group name. This is a required value in the constructor but can be redefined afterwards.
- groupType
-
This points to the type of Device Group, typically Location or Device Type but can be customized. See also Net::Cisco::ACS::Device
deviceType
. - id
-
Cisco ACS generates a unique ID for each Device Group 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 device group.
- toXML
-
Dump the record in ACS accept XML formatting (without header).
- header
-
Generate the correct XML header. Takes output of
toXML
as argument.
BUGS
None yet
SUPPORT
None yet :)
AUTHOR
Hendrik Van Belleghem
CPAN ID: BEATNIK
hendrik.vanbelleghem@gmail.com
COPYRIGHT
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.
SEE ALSO
perl(1).
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 166:
You forgot a '=back' before '=head1'