[c-nsp] IOS-XR perl toolkit

Dale W. Carder dwcarder at wisc.edu
Wed Aug 21 17:31:38 EDT 2013


Does anyone have experience with the perl toolkit for IOS-XR?  I am
trying a simple example, and it does not seem to work.

It writes the XML as a file to disk so I know that much is working, but 
then it fails with "The table could not be found in the response XML" 
which I found in DataResponse.pm lines 128-129

      # Error - this should never happen
      die "The table could not be found in the response XML\n";


Am I doing something wrong, or does this library not actually work as
expected?  I have toolkit version 1.4.1 and the router is on 4.3.1.

Dale

-------------------------------------


#!/usr/bin/perl -w

use strict;
use Cisco::IOS_XR qw(:root_objects);

my $session = new Cisco::IOS_XR(
    transport => 'ssh',
    host => '1.2.3.4',
    port => 22,
    username => 'foo',
    password => 'bar',
    connection_timeout => 3);

my $node = '0/RP0/CPU0';
my $arp_table = Operational->ARP->NodeTable->Node($node)->EntryTable;

my $response = $arp_table->get_entries;

if (defined($response->get_error)) {
    die $response->get_error;
}

# this works
$response->write_file('foo.xml');

# this fails
foreach my $entry ($response->get_entries) {
    print "Entry: $entry \n";
}


More information about the cisco-nsp mailing list