- 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 Identifier Indicators for Configuration Elements Using the Junos XML Protocol
In a Junos XML protocol session with a device running
Junos OS, to request that the server indicate whether a child configuration
element is an identifier for its parent element, a client application
includes the junos:key="key"
attribute
in the opening <junoscript>
tag for
the Junos XML protocol session or includes the junos:key="key"
or key="key"
attribute in the <get-configuration>
request tag:
<junoscript version="version" hostname="hostname" junos:key="key" release="release-code"> <!-- OR --> <rpc> <get-configuration (junos:key | key)="key"> <!-- tag elements for the configuration elements to return --> </get-configuration> </rpc>
For more information about the <junoscript>
tag, see Starting Junos XML Protocol
Sessions.
When the identifier indicator is requested, the Junos
XML protocol server includes the junos:key="key"
attribute in the opening tag for each identifier. As always, the
Junos XML protocol server encloses its response in <rpc-reply>
and <configuration>
tag elements.
In the following example, the identifier tag element is called <name>
:
<rpc-reply xmlns:junos="URL"> <configuration attributes> <!-- opening tag for each parent of the object --> <!-- For each configuration object with an identifier --> <object> <name junos:key="key">identifier</name> <!-- additional children of object --> </object> <!-- closing tag for each parent of the object --> </configuration> </rpc-reply>
If the requested output format is JSON, the Junos XML
protocol server adds a metadata object that includes "junos:key" : "key"
to indicate the identifier.
If the Junos OS object uses name
for the
identifier, a metadata object with name "@" is added as a new member
of the object. If the Junos OS object uses an identifier other than name
, the metadata object is added as a sibling name/value
pair that uses the name "@" concatenated with the identifier name.
The response is enclosed in <configuration-json>
and <rpc-reply>
tag elements.
<rpc-reply xmlns:junos="URL"> <configuration-json> { "configuration" : { /* JSON objects for parent levels of the element */ "object" : [ { "@" : { "junos:key" : "key" }, "name" : "identifier", "identifier-name" : "identifier-value", "@identifier-name" : { "junos:key" : "key" }, /* additional data and child objects */ # if any } ] /* closing braces for parent levels of the element */ } } </configuration-json> </rpc-reply>
In the following output, the combination of name
and next-hop
uniquely
identify the static route:
{ "configuration" : { "routing-options" : { "static" : { "route" : [ { "@" : { "junos:key" : "key" }, "name" : "172.16.0.0/12", "next-hop" : ["198.51.100.1"], "@next-hop" : { "junos:key" : "key" }, "retain" : [null], "no-readvertise" : [null] } ] } } } }
Starting in Junos OS Release 16.1, devices running Junos OS emit JSON-formatted configuration data using a new default implementation for serialization. The new default uses the "@" symbol instead of the field name "attribute" to indicate an attribute.
The client application can include one or more of the following
other attributes in the <get-configuration/>
tag or opening <get-configuration>
tag when the junos:key
attribute is included
in the opening <junoscript>
or <get-configuration>
tags:
changed
, which is described in Requesting Change Indicators for Configuration Elements Using the Junos XML Protocolcommit-scripts
, which is described in Requesting Commit-Script-Style XML Configuration Data Using the Junos XML Protocoldatabase
, which is described in Specifying the Source for Configuration Information Requests in a Junos XML Protocol Sessioninherit
and optionallygroups
andinterface-ranges
, which are described in Specifying the Output Format for Configuration Groups and Interface Ranges Using the Junos XML Protocol
When requesting an indicator for identifiers, it does not make
sense to include the format="text"
attribute
in the <get-configuration>
tag element
(as described in Specifying the Output
Format for Configuration Data in a Junos XML Protocol Session). The junos:key="key"
attribute appears
only in Junos XML-tagged output, which is the default output format,
and in JSON output. The compare
attribute
produces only text output, so when the compare
attribute is included in the <get-configuration>
tag, the junos:key="key"
attribute does
not appear in the output.
The following example shows how indicators for identifiers appear
on configuration elements at the [edit interfaces]
hierarchy level in the candidate configuration when the junos:key="key"
attribute is included in the opening <junoscript>
tag emitted by the client application
for the session. The two opening <junoscript>
tags appear on multiple lines for legibility only. Neither client
applications nor the Junos XML protocol server insert newline characters
within tags. Also, for brevity the output includes just one interface,
the loopback interface lo0.

Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.