- 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 Operational Information Using the Junos XML Protocol
Within a Junos XML protocol session, a client application can request information about the current status of a Junos device. To request operational information, a client application emits the specific request tag element from the Junos XML API that returns the desired information.
Table 1 provides examples of request tags, which request the same information as the equivalent CLI command..
Request Tag | CLI Command |
---|---|
<get-interface-information> | show interfaces |
<get-chassis-inventory> | show chassis hardware |
<get-system-inventory> | show software information |
You can determine the appropriate Junos XML request tag using multiple methods, including:
Appending
| display xml rpc
to an operational command in the CLI.Using the Junos XML API Explorer - Operational Tags application to search for a command or request tag in a given release.
For example, the following command displays the request tag corresponding to the
show interfaces
command:
user@router> show interfaces | display xml rpc <rpc-reply xmlns:junos="http://xml.juniper.net/junos/23.4R1.9/junos"> <rpc> <get-interface-information> </get-interface-information> </rpc> </rpc-reply>
To execute an RPC, the client application encloses a request tag in an
<rpc>
element. The syntax depends on whether the
corresponding CLI command has any options included.
<rpc> <!-- If the command does not have options --> <operational-request/> <!-- If the command has options --> <operational-request> <!-- tag elements representing the options --> </operational-request> </rpc>
The client application can specify the format of the information returned by the
Junos XML protocol server. By setting the optional format
attribute
in the opening operational request tag, a client application can specify the format
of the response as XML-tagged format, which is the default, formatted ASCII text, or
JavaScript Object Notation (JSON). For more information about specifying the format,
see Specify the Output Format for Operational Information Requests in a Junos XML Protocol Session.
When displaying operational or configuration data that contains characters outside the 7-bit ASCII character set, the Junos device escapes and encodes these character using the equivalent UTF-8 decimal character reference. For more information see How Character Encoding Works on Juniper Networks Devices.
If the client application requests XML output, the Junos XML protocol server encloses
its response in the specific response tag element that corresponds to the request
tag element, which is then enclosed in an <rpc-reply>
tag
element.
<rpc-reply xmlns:junos="URL"> <operational-response xmlns="URL-for-DTD"> <!-- Junos XML tag elements for the requested information --> </operational-response> </rpc-reply>
For example, if the client application sends the
<get-interface-information>
RPC, the server returns the
<interface-information>
response tag.
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/23.4R1.9/junos"> <interface-information xmlns="http://xml.juniper.net/junos/23.4R1.9/junos-interface" junos:style="normal"> <physical-interface> <name>ge-0/0/0</name> <admin-status junos:format="Enabled">up</admin-status> <oper-status>up</oper-status> ...
For XML format, the opening tag for each operational response includes the
xmlns
attribute. The attribute defines the XML namespace for
the enclosed tag elements that do not have a namespace prefix (such as
junos:
). The namespace indicates which Junos XML document type
definition (DTD) defines the set of tag elements in the response.
The Junos XML API defines separate DTDs for operational responses from different
software modules. For instance, the DTD for interface information is called
junos-interface.dtd
and the DTD for chassis information is
called junos-chassis.dtd
. The division into separate DTDs and XML
namespaces means that a tag element with the same name can have distinct functions
depending on which DTD it is defined in.
The namespace is a URL of the following form:
http://xml.juniper.net/junos/release-code/junos-category
where:
release-code is the standard string that represents the Junos OS release that is running on the Junos XML protocol server device.
category specifies the DTD.
If the client application requests the output in formatted ASCII text, the Junos XML
protocol server encloses its response in an <output>
tag,
which is enclosed in an <rpc-reply>
tag.
<rpc-reply xmlns:junos="URL"> <output> operational-response </output> </rpc-reply>
If the client application requests the output in JSON format, the Junos XML protocol
server encloses the JSON data in the <rpc-reply>
tag
element.
<rpc-reply xmlns="URN" xmlns:junos="URL"> operational-response </rpc-reply>
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.