- 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 Junos XML Protocol Sessions
- play_arrow Junos XML Protocol Session Overview
- play_arrow Manage Junos XML Protocol Sessions
- Satisfy the Prerequisites for Establishing a Connection to the Junos XML Protocol Server
- Configure clear-text or SSL Service for Junos XML Protocol Client Applications
- Connect to the Junos XML Protocol Server
- Start a Junos XML Protocol Session
- Authenticate with the Junos XML Protocol Server for Cleartext or SSL Connections
- Send Requests to the Junos XML Protocol Server
- Parse the Junos XML Protocol Server Response
- Parse Response Tag Elements Using a Standard API in NETCONF and Junos XML Protocol Sessions
- How Character Encoding Works on Juniper Networks Devices
- Handle an Error or Warning in Junos XML Protocol Sessions
- Halt a Request in Junos XML Protocol Sessions
- Lock, Unlock, or Create a Private Copy of the Candidate Configuration Using the Junos XML Protocol
- Terminate a Junos XML Protocol Session
- End a Junos XML Protocol Session and Close the Connection
- Sample Junos XML Protocol Session
- play_arrow Junos XML Protocol Tracing Operations
- play_arrow Junos XML Protocol Operations
- play_arrow Junos XML Protocol Processing Instructions
- play_arrow Junos XML Protocol Response Tags
- play_arrow Junos XML Element Attributes
- active
- count
- delete
- inactive
- insert
- junos:changed
- junos:changed-localtime
- junos:changed-seconds
- junos:commit-localtime
- junos:commit-seconds
- junos:commit-user
- junos:group
- junos:interface-range
- junos:key
- junos:position
- junos:total
- matching
- protect
- recurse
- rename
- replace
- replace-pattern
- start
- unprotect
- xmlns
-
- 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 Junos XML Protocol Utilities
- play_arrow Develop Junos XML Protocol C Client Applications
-
- play_arrow Configuration Statements and Operational Commands
Request an XML Schema for the Configuration Hierarchy Using the Junos XML Protocol
The schema represents all configuration elements
available in the version of the Junos OS that is running on a device.
(To determine the Junos OS version, emit the <get-software-information>
operational request tag, which is documented in the Junos XML API Operational Developer Reference.)
Client applications can use the schema to validate the configuration
on a device, or simply to learn which configuration statements are
available in the version of the Junos OS running on the device. The
schema does not indicate which elements are actually configured, or
even that an element can be configured on that type of device (some
configuration statements are available only on certain device types).
To request the set of currently configured elements and their settings,
emit the <get-configuration>
tag element
instead, as described in Requesting Configuration
Data Using the Junos XML Protocol.
Explaining the structure and notational conventions of the XML Schema language is beyond the scope of this document. For information, see XML Schema Part 0: Primer, available from the World Wide Web Consortium (W3C) at http://www.w3.org/TR/xmlschema-0/ . The primer provides a basic introduction and lists the formal specifications where you can find detailed information.
For further information, see the following sections:
Requesting an XML Schema for the Configuration Hierarchy
In a Junos XML protocol session with a device running
Junos OS, to request an XML Schema-language representation of the
entire configuration hierarchy, a client application emits the Junos
XML <get-xnm-information>
tag element
and its <type>
, and <namespace>
child tag elements with the indicated values in an <rpc>
tag element:
<rpc> <get-xnm-information> <type>xml-schema</type> <namespace>junos-configuration</namespace> </get-xnm-information> </rpc>
The Junos XML protocol server encloses the XML schema
in <rpc-reply>
and <xsd:schema>
tags:
<rpc-reply xmlns:junos="URL"> <xsd:schema> <!-- tag elements for the Junos schema --> </xsd:schema> </rpc-reply>
Creating the junos.xsd File
Most of the tag elements defined in the schema returned in the <xsd:schema>
tag belong to the default namespace
for Junos OS configuration elements. However, at least one tag, <junos:comment>
, belongs to a different namespace: http://xml.juniper.net/junos/Junos-version/junos
. By XML convention, a schema describes only one namespace, so schema
validators need to import information about any additional namespaces
before they can process the schema.
Starting in Junos OS Release 6.4 , the <xsd:import>
tag element is enclosed in the <xsd:schema>
tag element and references the file junos.xsd, which contains the required information about the junos
namespace. For example, the following <xsd:import>
tag element specifies the file for
Junos OS Release 20.4R1 (and appears on two lines for legibility
only):
<xsd:import schemaLocation="junos.xsd" \ namespace="http://xml.juniper.net/junos/20.4R1/junos"/>
To enable the schema validator to interpret the <xsd:import>
tag, you must manually create a file
called junos.xsd in the directory
where you place the .xsd file that
contains the complete Junos configuration schema. Include the following
text in the file. Do not use line breaks in the list of attributes
in the opening <xsd:schema>
tag. Line
breaks appear in the following example for legibility only. For the Junos-version variable, substitute the release number
of the Junos OS running on the device (for example, 20.4R1 for
the first release of Junos OS 20.4).
<?xml version="1.0" encoding="us-ascii"?> <xsd:schema elementFormDefault="qualified" \ attributeFormDefault="unqualified" \ xmlns:xsd="http://www.w3.org/2001/XMLSchema" \ targetNamespace="http://xml.juniper.net/junos/Junos-version/junos"> <xsd:element name="comment" type="xsd:string"/> </xsd:schema>
Schema validators might not be able to process the schema if they cannot locate or open the junos.xsd file.
Whenever you change the version of Junos OS running on the device, remember to update the Junos-version variable in the junos.xsd file to match.
Example: Requesting an XML Schema
The following examples show how to request the Junos OS configuration
schema. In the Junos XML protocol server’s response, the first <xsd:element>
statement defines the <undocumented>
Junos XML tag element, which can
be enclosed in most other container tag elements defined in the schema
(container tag elements are defined as <xsd:complexType>
).
The attributes in the opening tags of the Junos XML protocol server’s response appear on multiple lines for legibility only. The Junos XML protocol server does not insert newline characters within tags or tag elements. Also, in actual output the JUNOS-version variable is replaced by a value such as 20.4R1 for the initial version of Junos OS Release 20.4.

Another <xsd:element>
statement
near the beginning of the schema defines the Junos XML <configuration>
tag element. It encloses the <xsd:element>
statement that defines the <system>
tag element, which corresponds to the [edit system]
hierarchy level. The statements corresponding
to other hierarchy levels are omitted for brevity.
