- 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 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
Define the Format of Configuration Data to Upload in a Junos XML Protocol Session
In a Junos XML protocol session with a device running Junos OS, a client application can upload configuration data to the device either in a file or as a data stream emitted during the Junos XML protocol session. In both cases, the client application can use Junos XML tag elements, formatted ASCII text, Junos OS configuration mode commands, or JavaScript Object Notation (JSON) to define the new configuration data.
If the application uses Junos XML tag elements, it includes
the tag elements representing all levels of the configuration hierarchy
from the root (the <configuration>
tag
element) down to each new or changed element. The notation is the
same as that used to request configuration information, and is described
in detail in Requesting Configuration
Changes Using the Junos XML Protocol.
<configuration> <!-- tag elements representing the configuration data --> </configuration>
If the application provides the configuration data as formatted
ASCII text, it uses the standard Junos OS CLI notation to indicate
the hierarchical relationships between configuration statements—the
newline character, tabs and other white space, braces, and square
brackets. For each new or changed element, the complete statement
path is specified, starting with the top-level statement that appears
directly under the [edit]
hierarchy level.
When ASCII text is provided as a data stream, it is enclosed
in the <configuration-text>
tag element.
<configuration-text> /* formatted ASCII configuration statements */ </configuration-text>
When ASCII text is provided in a file, the <configuration-text>
tag element is not included in the file.
When providing configuration data as ASCII text, the
application must also include the format="text"
attribute in the <load-configuration>
tag.
<rpc> <load-configuration url="file-location" format="text"/> </rpc> <rpc> <load-configuration format="text"> <configuration-text> /* formatted ASCII configuration data */ </configuration-text> </load-configuration> </rpc>
Starting in Junos OS Release 11.4, you can load configuration
data as configuration mode set
commands. When you provide
configuration data as configuration mode set
commands,
Junos OS executes the configuration instructions line by line. For
each element, you can specify the complete statement path in the command,
or you can use navigation commands, such as edit
and up
, to move around the configuration hierarchy as you would
in CLI configuration mode.
When configuration mode set
commands are provided
as a data stream, the commands are enclosed in the <configuration-set>
tag element.
<configuration-set> /* configuration mode commands */ </configuration-set>
When configuration mode set
commands are provided
in a file, the <configuration-set>
tag
element is not included in the file.
When providing configuration data as Junos OS configuration
mode commands, the application must also include the action="set"
and format="text"
attributes in the <load-configuration>
tag.
<rpc> <load-configuration url="file-location" action="set" format="text"/> </rpc> <rpc> <load-configuration action="set" format="text"> <configuration-set> /* configuration mode commands to load */ </configuration-set> </load-configuration> </rpc>
Starting in Junos OS Release 16.1, you can load configuration data formatted using JavaScript Object Notation (JSON) on the device. If the application provides configuration data in JSON format, it includes the configuration data representing all levels of the configuration hierarchy from the root down to each new or changed element.
When configuration data in JSON format is provided as
a data stream, the data is enclosed in the <configuration-json>
tag element.
<configuration-json> /* JSON-formatted configuration data */ </configuration-json>
When configuration data in JSON format is provided in a file,
the <configuration-json>
tag element
is not included in the file.
When providing configuration data in JSON format, the
application must also include the format="json"
attribute in the <load-configuration>
tag.
<rpc> <load-configuration url="file-location" format="json"/> </rpc> <rpc> <load-configuration format="json"> <configuration-json> /* JSON-formatted configuration data */ </configuration-json> </load-configuration> </rpc>
The format
attribute can be
combined with one or more of the following attributes:
url
action
Note:JSON format is only supported for
action
values of merge, override, and update.
For reference pages for the <configuration>
, <configuration-text>
, <configuration-set>
, and <configuration-json>
tag elements, see the Junos XML API Operational Developer Reference.