Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Write NETCONF Perl Client Applications

The Juniper Networks NETCONF Perl client enables programmers familiar with the Perl programming language to create their own Perl applications to manage and configure Junos devices. The Net::Netconf::Manager module provides a release-independent object-oriented interface for communicating with a NETCONF server on managed devices. The module enables you to connect to a device, establish a NETCONF session, and execute operational and configuration requests.

The following outline lists the basic tasks involved in writing a NETCONF Perl client application that manages Junos devices. Each task provides a link to more detailed information about performing that task.

  1. Import Perl Modules and Declare Constants—Import Perl Modules and Declare Constants in NETCONF Perl Client Applications
  2. Connect to the NETCONF Server—Connect to the NETCONF Server in Perl Client Applications and Collect Parameters Interactively in NETCONF Perl Client Applications
  3. Submit Requests to the NETCONF Server—Submit a Request to the NETCONF Server in Perl Client Applications
  4. Parse and Format the Response from the NETCONF Server—Parse the NETCONF Server Response in Perl Client Applications
  5. Close the Connection to the NETCONF Server—Close the Connection to the NETCONF Server in Perl Client Applications

The tasks are illustrated in the following example, which uses the Net::Netconf::Manager object to request information from a device running Junos OS. The example presents the minimum code required to execute a simple query.

  1. Import required modules and declare constants.

  2. Create a Manager object and connect to the device.

  3. Construct the query and send it to the NETCONF server.

  4. Process the response as needed.

  5. Disconnect from the NETCONF server.