- play_arrow Overview
- play_arrow Junos XML Management Protocol and Junos XML API Overview
- play_arrow Junos XML Protocol and Junos XML Tags Overview
- XML and Junos OS Overview
- XML Overview
- XML and Junos XML Management Protocol Conventions Overview
- Map Junos OS Commands and Command Output to Junos XML Tag Elements
- Map Configuration Statements to Junos XML Tag Elements
- Using Configuration Response Tag Elements in Junos XML Protocol Requests and Configuration Changes
- play_arrow Junos XML Protocol and JSON Overview
-
- play_arrow Manage Configurations Using the Junos XML Protocol
- play_arrow Change the Configuration Using the Junos XML Protocol
- Request Configuration Changes Using the Junos XML Protocol
- Upload and Format Configuration Data in a Junos XML Protocol Session
- Upload Configuration Data as a File Using the Junos XML Protocol
- Upload Configuration Data as a Data Stream Using the Junos XML Protocol
- Define the Format of Configuration Data to Upload in a Junos XML Protocol Session
- Specify the Scope of Configuration Data to Upload in a Junos XML Protocol Session
- Replace the Configuration Using the Junos XML Protocol
- Create, Modify, or Delete Configuration Elements Using the Junos XML Protocol
- Create New Elements in Configuration Data Using the Junos XML Protocol
- Merge Elements in Configuration Data Using the Junos XML Protocol
- Replace Elements in Configuration Data Using the Junos XML Protocol
- Replace Only Updated Elements in Configuration Data Using the Junos XML Protocol
- Delete Elements in Configuration Data Using the Junos XML Protocol
- Rename Objects In Configuration Data Using the Junos XML Protocol
- Reorder Elements In Configuration Data Using the Junos XML Protocol
- Protect or Unprotect a Configuration Object Using the Junos XML Protocol
- Change a Configuration Element’s Activation State Using the Junos XML Protocol
- Change a Configuration Element’s Activation State Simultaneously with Other Changes Using the Junos XML Protocol
- Replace Patterns in Configuration Data Using the NETCONF or Junos XML Protocol
- play_arrow Commit the Configuration on a Device Using the Junos XML Protocol
- Verify Configuration Syntax Using the Junos XML Protocol
- Commit the Candidate Configuration Using the Junos XML Protocol
- Commit a Private Copy of the Configuration Using the Junos XML Protocol
- Commit a Configuration at a Specified Time Using the Junos XML Protocol
- Commit the Candidate Configuration Only After Confirmation Using the Junos XML Protocol
- Commit and Synchronize a Configuration on Redundant Control Planes Using the Junos XML Protocol
- Log a Message About a Commit Operation Using the Junos XML Protocol
- View the Configuration Revision Identifier for Determining Synchronization Status of Devices with NMS
- play_arrow Ephemeral Configuration Database
- Understanding the Ephemeral Configuration Database
- Unsupported Configuration Statements in the Ephemeral Configuration Database
- Enable and Configure Instances of the Ephemeral Configuration Database
- Commit and Synchronize Ephemeral Configuration Data Using the NETCONF or Junos XML Protocol
- Managing Ephemeral Configuration Database Space
-
- play_arrow Request Operational and Configuration Information Using the Junos XML Protocol
- play_arrow Request Operational Information Using the Junos XML Protocol
- play_arrow Request Configuration Information Using the Junos XML Protocol
- Request Configuration Data Using the Junos XML Protocol
- Specify the Source for Configuration Information Requests in a Junos XML Protocol Session
- Specify the Output Format for Configuration Data in a Junos XML Protocol Session
- Request Commit-Script-Style XML Configuration Data Using the Junos XML Protocol
- Specify the Output Format for Configuration Groups and Interface Ranges Using the Junos XML Protocol
- Request Identifier Indicators for Configuration Elements Using the Junos XML Protocol
- Request Change Indicators for Configuration Elements Using the Junos XML Protocol
- Specify the Scope of Configuration Data to Return in a Junos XML Protocol Session
- Request the Complete Configuration Using the Junos XML Protocol
- Request a Configuration Hierarchy Level or Container Object Without an Identifier Using the Junos XML Protocol
- Request All Configuration Objects of a Specific Type Using the Junos XML Protocol
- Request a Specific Number of Configuration Objects Using the Junos XML Protocol
- Request Identifiers for Configuration Objects of a Specific Type Using the Junos XML Protocol
- Request a Single Configuration Object Using the Junos XML Protocol
- Request Subsets of Configuration Objects Using Regular Expressions
- Request Multiple Configuration Elements Using the Junos XML Protocol
- Retrieve a Previous (Rollback) Configuration Using the Junos XML Protocol
- Retrieve the Rescue Configuration Using the Junos XML Protocol
- Compare the Active or Candidate Configuration to a Prior Version Using the Junos XML Protocol
- Compare Two Previous (Rollback) Configurations Using the Junos XML Protocol
- Request an XML Schema for the Configuration Hierarchy Using the Junos XML Protocol
-
- play_arrow Junos XML Protocol Utilities
- play_arrow Develop Junos XML Protocol C Client Applications
-
- play_arrow Configuration Statements and Operational Commands
Parse the Junos XML Protocol Server Response
In a Junos XML protocol session with a device running
Junos OS, a client application sends RPCs to the Junos XML protocol
server to request information from and manage the configuration on
the device. The Junos XML protocol server encloses its response to
each client request in a separate pair of opening <rpc-reply>
and closing </rpc-reply>
tags. Each
response constitutes a well-formed XML document.
<rpc-reply xmlns:junos=""http://xml.juniper.net/junos/release/junos""> <!-- tag elements representing a response --> </rpc-reply>
The xmlns:junos
attribute in the
opening <rpc-reply>
tag defines the
default namespace for the enclosed Junos XML tag elements that are
qualified by the junos:
prefix. The release variable in the URI represents the Junos OS release
that is running on the Junos XML protocol server device, for example 20.4R1
The <rpc-reply>
tag element occurs
only within the <junoscript>
element.
Client applications must include code for parsing the stream of response
tag elements coming from the Junos XML protocol server, either processing
them as they arrive or storing them until the response is complete.
The Junos XML protocol server returns three classes of responses:
Operational Responses
Operational responses are responses to requests for information about the status of a switching, routing, or security platform. They correspond to the output from CLI operational commands.
The Junos XML API defines response tag elements for all defined
operational request tag elements. For example, the Junos XML protocol
server returns the information requested by the <get-interface-information>
tag in a response tag called <interface-information>
, and returns the information requested by the <get-chassis-inventory>
tag in a<chassis-inventory>
response
tag called <chassis-inventory>
.
Operational responses also can be returned in formatted ASCII, which
is enclosed within an output
element, or
in JSON format. For more information about formatting operational
responses see Specifying the Output Format
for Operational Information Requests in a Junos XML Protocol Session.
The following sample response includes information about
the interface ge-2/3/0. The namespace indicated by the xmlns
attribute in the opening <interface-information>
tag contains interface information for Junos OS Release 20.4.
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/20.4R1/junos"> <interface-information xmlns="http://xml.juniper.net/junos/20.4R1/junos-interface"> <physical-interface> <name>ge-2/3/0</name> <!-- other data tag elements for the ge-2/3/0 interface --> </physical-interface> </interface-information> </rpc-reply>
For more information about the xmlns
attribute and contents of operational response tag elements, see Requesting Operational Information Using the Junos
XML Protocol. For a summary of operational response tag
elements, see the Junos XML API Operational Developer Reference.
Configuration Information Responses
Configuration information responses are
responses to requests for information about the device’s current
configuration. The Junos XML API defines a tag element for every container
and leaf statement in the configuration hierarchy. You can instruct
the server to return configuration data in different formats including
Junos XML elements, formatted ASCII, Junos OS set
commands,
or JSON. If you do not specify a format, the default is XML. For more
information about formatting configuration information responses see Specifying the Output Format for Configuration Data
in a Junos XML Protocol Session.
The following sample response includes the information
at the [edit system login]
hierarchy level in
the configuration hierarchy. For brevity, the sample shows only one
user defined at this level.
<rpc-reply xmlns:junos="URL"> <configuration> <system> <login> <user> <name>admin</name> <full-name>Administrator</full-name> <!-- other data tag elements for the admin user --> </user> </login> </system> </configuration> </rpc-reply>
Configuration Change Responses
Configuration change responses are
responses to requests that change the state or contents of the device
configuration. For commit operations, the Junos XML protocol server
returns the <commit-results>
response
tag, which encloses an explicit indicator of success or failure.
<rpc-reply xmlns:junos="URL"> <commit-results> <!-- tag elements for information about the commit --> </commit-results> </rpc-reply>
For other operations, instead of emitting an explicit
success indicator, the Junos XML protocol server indicates success
by returning an opening <rpc-reply>
tag
and closing </rpc-reply>
tag with no
child elements.
<rpc-reply xmlns:junos="URL"> </rpc-reply>
For more information, see Requesting Configuration Changes Using the Junos XML Protocol and Committing the Candidate Configuration Using the Junos XML Protocol. For a summary of the available configuration tag elements, see the Junos XML API Configuration Developer Reference.