Skip to content
  • Kirk Webb's avatar
    Netconf-over-ssh library for snmpit. · 8bf81708
    Kirk Webb authored
    I don't know what I like most about this module, working with Expect or
    handling XML namespaces... Includes the basics of the Netconf protocol.
    Only tested with HP Netconf-over-ssh (Comware)!
    
    Main interface calls:
    
    $ncobj = snmpit_libNetconf->new($switch, $userpass, $port, $debuglvl)
    
    Create a new Netconf library object, pointed at switch host $switch.
    Username with optional password are passed as second argument (delimit
    with ':'). $port is port to connect to, and $debuglvl is the debugging
    level. Last two arguments are optional.
    
    $ncobj->doGet($filter)
    
    Execute Netconf "Get", with optional Netconf XML filter argument.
    
    $ncobj->doGetConfig($filter, $source)
    
    Get entire switch config, or partial config if $filter is supplied.
    $source is which config (running or saved).  Arguments are optional.
    
    $ncobj->doEditConfig($xmlconf, $target, $defop);
    
    Edit the switch's config.  $xmlconf is an XML::LibXML::Node object
    containing the XML-encoded configuration update. $target identifies what
    to apply it to (running or startup. Defaults to running). $defop is the
    default operation (merge, replace, none. Defaults to "merge").  Last two
    arguments are optional.
    
    $ncobj->doRPC($cmd, $xmlarg)
    
    Generic RPC dispatcher (Used by the other "do" commands above).  $cmd is
    the rpc command to execute. Optional $xmlarg parameter is an
    XML:LibXML::Node object that encodes the arguments to $cmd.
    8bf81708