Connect To The Junos Xml Protocol Server; Satisfying Protocol Prerequisites; Group Requests; Obtain And Record Parameters Required By The Junos::device - Juniper JUNOS OS 10.3 - XML MANAGEMENT PROTOCOL GUIDE 6-30-2010 Manual

Junos xml management protocol guide
Hide thumbs Also See for JUNOS OS 10.3 - XML MANAGEMENT PROTOCOL GUIDE 6-30-2010:
Table of Contents

Advertisement

Connect to the Junos XML Protocol Server

Copyright © 2010, Juniper Networks, Inc.
—Includes functions for controlling terminal modes, for example
Term::ReadKey
suppressing onscreen echo of a typed string such as a password.
If the application uses constants, declare their values at this point. For example, the
sample
script includes the following statements to declare constants
diagnose_bgp.pl
for formatting output:
use constant OUTPUT_FORMAT => "%-20s%-8s%-8s%-11s%-14s%s\n";
use constant OUTPUT_TITLE =>
"\n=============== BGP PROBLEM SUMMARY ===============\n\n";
use constant OUTPUT_ENDING =>
"\n===================================================\n\n";
The
load_configuration.pl
script includes the following statements to declare constants
for reporting return codes and the status of the configuration database:
use constant REPORT_SUCCESS => 1;
use constant REPORT_FAILURE => 0;
use constant STATE_CONNECTED => 1;
use constant STATE_LOCKED => 2;
use constant STATE_CONFIG_LOADED => 3;
The following sections explain how to use the
Junos XML protocol server on a device running Junos OS:
Satisfying Protocol Prerequisites on page 211
Group Requests on page 211
Obtain and Record Parameters Required by the JUNOS::Device Object on page 212
Obtaining Application-Specific Parameters on page 215
Converting Disallowed Characters on page 216
Establishing the Connection on page 217

Satisfying Protocol Prerequisites

The Junos XML protocol server supports several access protocols, listed in "Supported
Access Protocols" on page 27. For each connection to the Junos XML protocol server on
a device, the application must specify the protocol it is using. Using SSH or Secure Sockets
Layer (SSL) is recommended because they provide greater security by encrypting all
information before transmission across the network.
Before your application can run, you must satisfy the prerequisites for the protocol it
uses. For some protocols this involves activating configuration statements on the device,
creating encryption keys, or installing additional software on the device running Junos
OS or the machine where the application runs. For instructions, see "Prerequisites for
Establishing a Connection" on page 27.

Group Requests

Establishing a connection to the Junos XML protocol server on a device is one of the more
time- and resource-intensive functions performed by an application. If the application
sends multiple requests to a routing platform, it makes sense to send all of them within
the context of one connection. If your application sends the same requests to multiple
devices, you can structure the script to iterate through either the set of devices or the set
Chapter 9: Writing Junos XML Protocol Perl Client Applications
JUNOS::Device
object to connect to the
211

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junos os

Table of Contents