- 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 Configuration Data Using the Junos XML Protocol
In a Junos XML protocol session with a device running
Junos OS, to request configuration data for a routing, switching,
or security platform, a client application encloses the <get-configuration>
element in an <rpc>
tag. By setting optional attributes, the client application can
specify the source and formatting of the configuration information
returned by the Junos XML protocol server. By including the appropriate
optional child tag elements, the application can request the entire
configuration or specific portions of the configuration. The basic
syntax is as follows:
<rpc> <!-- If requesting the complete configuration --> <get-configuration [optional attributes]/> <!-- If requesting part of the configuration --> <get-configuration [optional attributes]> <configuration> <!-- tag elements representing the data to return --> </configuration> </get-configuration> </rpc>
To view configuration data in a specific instance of the
ephemeral configuration database, a client application must open the
ephemeral instance using the <open-configuration>
operation with the appropriate child tags before executing the <get-configuration>
request.
Starting in Junos OS Release 13.1, within a Junos XML
protocol session, a logical system user can use the Junos XML protocol <get-configuration>
operation to request specific logical
system configuration hierarchies using child configuration tags as
well as request the entire logical system configuration. When requesting
the entire logical system configuration, the RPC reply includes the <configuration>
root tag. Prior to Junos OS Release 13.1,
the <configuration>
root tag was omitted.
The Junos XML protocol server encloses its reply in an <rpc-reply>
tag element. It includes attributes
with the junos:
prefix in the opening <configuration>
tag to indicate when the configuration
was last changed or committed and the user who committed it (the attributes
appear on multiple lines in the syntax statement only for legibility).
For more information about the attributes, see Specifying the Source for Configuration Information
Requests in a Junos XML Protocol Session.
<rpc-reply xmlns:junos="URL"> <!-- If the application requests Junos XML tag elements --> <configuration junos:(changed | commit)-seconds="seconds" \ junos:(changed | commit)-localtime="YYYY-MM-DD hh:mm:ss TZ" \ [junos:commit-user="username"]> <!-- Junos XML tag elements representing configuration elements --> </configuration> <!-- If the application requests formatted ASCII text --> <configuration-text> <!-- formatted ASCII configuration statements --> </configuration-text> <!-- If the application requests configuration mode set commands --> <configuration-set> <!-- configuration mode commands --> </configuration-set> <!-- If the application requests JSON format --> <configuration-json> <!-- JSON configuration data --> </configuration-json> </rpc-reply>
If a Junos XML tag element is returned within an <undocumented>
tag element, the corresponding configuration
element is not documented in the Junos OS configuration guides or
officially supported by Juniper Networks. Most often, the enclosed
element is used for debugging only by support personnel. In a smaller
number of cases, the element is no longer supported or has been moved
to another area of the configuration hierarchy, but appears in the
current location for backward compatibility.
When displaying operational or configuration data that contains characters outside the 7-bit ASCII character set, Junos OS escapes and encodes these character using the equivalent UTF-8 decimal character reference. For more information see Understanding Character Encoding on Devices Running Junos OS.
For reference pages for the <configuration>
, <configuration-json>
, <configuration-set>
, <configuration-text>
, and <undocumented>
tag elements,
see the Junos XML API Operational Developer Reference.
If the client application locks the candidate configuration before making requests, it needs to unlock it after making its read requests. Other users and applications cannot change the configuration while it remains locked. For more information, see Locking and Unlocking the Candidate Configuration or Creating a Private Copy Using the Junos XML Protocol.
The following topics describe how a client application specifies the source, format, and amount of information returned by the Junos XML protocol server:
Specifying the Source for Configuration Information Requests in a Junos XML Protocol Session
Specifying the Output Format for Configuration Data in a Junos XML Protocol Session
Specifying the Scope of Configuration Data to Return in a Junos XML Protocol Session
Applications can also request other configuration-related information, including an XML schema representation of the configuration hierarchy or information about previously committed configurations. For more information, see the following:
Retrieving a Previous (Rollback) Configuration Using the Junos XML Protocol
Retrieving the Rescue Configuration Using the Junos XML Protocol
Comparing the Active or Candidate Configuration to a Prior Version Using the Junos XML Protocol
Comparing Two Previous (Rollback) Configurations Using the Junos XML Protocol
Requesting an XML Schema for the Configuration Hierarchy Using the Junos XML Protocol