- 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
Send Requests to the Junos XML Protocol Server
In a Junos XML protocol session with a device
running Junos OS, a client application initiates a request by emitting
the opening <rpc>
tag, one or more tag
elements that represent the particular request, and the closing </rpc>
tag, in that order.
<rpc> <!--tag elements representing a request--> </rpc>
The application encloses each request in its own separate pair
of opening <rpc>
and closing </rpc>
tags. Each request must constitute a well-formed
XML document by including only compliant and correctly ordered tag
elements. The Junos XML protocol server ignores any newline characters,
spaces, or other white space characters that occur between tag elements
in the tag stream, but it preserves white space within tag elements.
Optionally, a client application can include one or more attributes
of the form attribute-name="value"
in the opening <rpc>
tag for each request. The Junos XML protocol server echoes each
attribute, unchanged, in the opening <rpc-reply>
tag in which it encloses its response.
A client application can use this feature to associate requests
and responses by including an attribute in each opening <rpc>
request tag that assigns a unique identifier.
The Junos XML protocol server echoes the attribute in its opening <rpc-reply>
tag, making it easy to map the response
to the initiating request. The client application can freely define
attribute names, except as described in the following note.
The xmlns:junos
attribute name
is reserved. The Junos XML protocol server sets the attribute to an
appropriate value on the opening <rpc-reply>
tag, so client applications must not emit it in the opening <rpc>
tag.
Although operational and configuration requests conceptually
belong to separate classes, a Junos XML protocol session does not
have distinct modes that correspond to CLI operational and configuration
modes. Each request tag is enclosed within its own <rpc>
tag, so a client application can freely alternate operational and
configuration requests. A client application can make three classes
of requests:
Operational Requests
Operational requests are requests for information
about the status of a device running Junos OS. Operational requests
correspond to the Junos OS CLI operational mode commands. The Junos
XML API defines a request tag for many CLI commands. For example,
the <get-interface-information>
tag
corresponds to the show interfaces
command, and the <get-chassis-inventory>
tag requests the same information
as the show chassis hardware
command.
The following RPC requests detailed information about interface ge-2/3/0:
<rpc> <get-interface-information> <interface-name>ge-2/3/0</interface-name> <detail/> </get-interface-information> </rpc>
For more information about operational requests, see Requesting Operational Information Using the Junos XML Protocol. For information about the Junos XML request tag elements available in the current Junos OS Release, see the Junos XML API Operational Developer Reference and the XML API Explorer.
Configuration Information Requests
Configuration information requests are requests for information about the device’s candidate configuration, a private configuration, the ephemeral configuration, or the committed configuration (the one currently in active use on the routing, switching, or security platform). The candidate and committed configurations diverge when there are uncommitted changes to the candidate configuration.
The Junos XML protocol defines the <get-configuration>
operation for retrieving configuration information. The Junos XML
API defines a tag element for every container and leaf statement in
the configuration hierarchy.
The following example shows how to request information
about the [edit system login]
hierarchy level
in the candidate configuration:
<rpc> <get-configuration> <configuration> <system> <login/> </system> </configuration> </get-configuration> </rpc>
For more information about configuration information requests, see Requesting Configuration Data Using the Junos XML Protocol. For a summary of Junos XML configuration tag elements, see the Junos XML API Configuration Developer Reference and the XML API Explorer.
Configuration Change Requests
Configuration change requests are requests
to change the configuration, or to commit those changes to put them
into active use on the device running Junos OS. The Junos XML protocol
defines the <load-configuration>
operation
for changing configuration information. The Junos XML API defines
a tag element for every CLI configuration statement described in the
Junos OS configuration guides.
The following example shows how to create a new Junos
OS user account called admin
at the [edit system login]
hierarchy level in the candidate
configuration:
<rpc> <load-configuration> <configuration> <system> <login> <user> <name>admin</name> <full-name>Administrator</full-name> <class>superuser</class> </user> </login> </system> </configuration> </load-configuration> </rpc>
For more information about configuration change requests, see Requesting Configuration Changes Using the Junos XML Protocol and Committing the Candidate Configuration Using the Junos XML Protocol. For a summary of Junos XML configuration tag elements, see the Junos XML API Configuration Developer Reference and the XML API Explorer.