Overview Of A Junos Xml Protocol Session - 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

Junos 10.3 Junos XML Management Protocol Guide

Overview of a Junos XML Protocol Session

6
<snmp-index>3</snmp-index>
</interface>
When a client application needs to extract a specific value from formatted ASCII output,
it must rely on the value's location, expressed either absolutely or with respect to labels
or values in adjacent fields. Suppose that the client application wants to extract the
interface index. It can use a regular-expression matching utility to locate specific strings,
but one difficulty is that the number of digits in the interface index is not necessarily
predictable. The client application cannot simply read a certain number of characters
after the
label, but must instead extract everything between the label
Interface index:
and the subsequent label, which is
, SNMP ifIndex
A problem arises if the format or ordering of output changes in a later version of the
Junos OS, for example, if a
number:
Physical interface: fxp0, Enabled, Physical link is Up
Interface index: 4, Logical index: 12, SNMP ifIndex: 3
An application that extracts the interface index number delimited by the
and
SNMP ifIndex
labels now obtains an incorrect result. The application must be updated
manually to search for the following label instead:
, Logical index
In contrast, the structured nature of XML-tagged output enables a client application to
retrieve the interface index by extracting everything within the opening
closing
</index>
tag. The application does not have to rely on an element's position in
the output string, so the Junos XML protocol server can emit the child tag elements in
any order within the
<interface>
in a future release does not affect an application's ability to locate the
element and extract its contents.
Tagged output is also easier to transform into different display formats. For instance,
you might want to display different amounts of detail about a given device component
at different times. When a device returns formatted ASCII output, you have to design and
write special routines and data structures in your display program to extract and store
the information needed for a given detail level. In contrast, the inherent structure of XML
output is an ideal basis for a display program's own structures. It is also easy to use the
same extraction routine for several levels of detail, simply ignoring the tag elements you
do not need when creating a less detailed display.
Communication between the Junos XML protocol server and a client application is session
based. The two parties explicitly establish a connection before exchanging data and
close the connection when they are finished. Each request from the client application
and each response from the Junos XML protocol server constitutes a well-formed XML
document, because the tag streams obey the structural rules defined in the Junos XML
protocol and Junos XML DTDs for the kind of information they encode. Client applications
must produce a well-formed XML document for each request by emitting tag elements
in the required order and only in the legal contexts.
field is added following the interface index
Logical index
tag element. Adding a new
Interface index:
tag and
<index>
tag element
<logical-index>
tag
<index>
Copyright © 2010, Juniper Networks, Inc.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junos os

Table of Contents