The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Cisco::ACS::Host - Access Cisco ACS functionality through REST API - Host fields

SYNOPSIS

        use Net::Cisco::ACS;
        use Net::Cisco::ACS::Host;

        my $acs = Net::Cisco::ACS->new(hostname => '10.0.0.1', username => 'acsadmin', password => 'testPassword');
        my $host = Net::Cisco::ACS::Host->new(macAddress=>"00-00-00-00-00-00", "description"=>"R2D2","identityGroupName"=>"All Groups:Droids");
        
        my %hosts = $acs->hosts;
        # Retrieve all hosts from ACS
        # Returns hash with host macAddress / Net::Cisco::ACS::Host pairs

        print $acs->hosts->{"00-00-00-00-00-00"}->toXML;
        # Dump in XML format (used by ACS for API calls)
        
        my $host = $acs->hosts("macAddress","00-00-00-00-00-00");
        # Faster call to request specific host information by MAC Address. No name field exists.

        my $host = $acs->hosts("id","250");
        # Faster call to request specific hosts information by ID (assigned by ACS, present in Net::Cisco::ACS::Host)

        $host->id(0); # Required for new host!
        my $id = $acs->create($host);
        # Create new host based on Net::Cisco::ACS::Host 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($host);
        # Update existing device based on Net::Cisco::ACS::Host 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($host);
        # Delete existing host based on Net::Cisco::ACS::Host instance
  

DESCRIPTION

The Net::Cisco::ACS::Host class holds all the Internal Host relevant information from Cisco ACS 5.x. Hosts (in this case) are not to be confused with Net::Cisco::ACS::Device. Hosts are used as an identity item, in case of e.g dot1x configurations.

USAGE

The Net::Cisco::ACS::Host class holds all the user 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::Host acts as a container for host identity related information.

new

Class constructor. Returns object of Net::Cisco::ACS::Host on succes. The following fields can be set / retrieved:

description
enabled
identityGroupName
macAddress
id

Formatting rules may be in place & enforced by Cisco ACS.

Read-only values:

created
lastModified
lastEnabled
description

The host description, typically used for host name. This is the only text-field for this record type.

enabled

Boolean flag to indicate record status.

macAddress

MAC Address for host. Used for actual identification.

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.

toXML

Dump the record in ACS accept XML formatting (without 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).