- 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
Replace Elements in Configuration Data Using the Junos XML Protocol
In a Junos XML protocol session with a device running
Junos OS, to replace individual configuration elements (hierarchy
levels or configuration objects), a client application emits the <load-configuration>
tag element with the action="replace"
attribute in an <rpc>
tag element.
<rpc> <!-- For a file --> <load-configuration action="replace" url="file" [format="text"]/> <!-- For a data stream --> <load-configuration action="replace" [format="text"]> <!-- configuration data --> </load-configuration> </rpc>
Starting in Junos OS
Release 18.1R1, the ephemeral configuration database supports loading
configuration data using the <load-configuration>
action
attribute values of override
and replace
in
addition to the previously supported values of merge
and set
.
For more information about the url
and format
attributes, see Uploading and Formatting Configuration Data in a
Junos XML Protocol Session.
To use Junos XML tag elements to define the replacement,
the application includes the basic tag elements described in Creating, Modifying, or Deleting Configuration Elements
Using the Junos XML Protocol. Within the container tag,
it includes the same child tag elements as for a new element: each
of the replacement’s identifier tag elements (if it has them)
and all child tag elements being defined for the replacement element.
In the following, the identifier tag element is called <name>
. The application also includes the replace="replace"
attribute in the opening container tag:
<configuration> <!-- opening tag for each parent of the element --> <container-tag replace="replace"> <name>identifier</name> <!-- tag elements for other children, if any --> </container-tag> <!-- closing tag for each parent of the element --> </configuration>
To use formatted ASCII text to represent the element,
the application includes the complete statement path described in Creating, Modifying, or Deleting Configuration Elements
Using the Junos XML Protocol. As for a new element, it
includes each of the replacement’s identifiers (if it has them)
and all child statements (with values if appropriate) that it is defining
for the replacement. It places the replace:
statement above the element’s container statement.
<configuration-text> /* statements for parent levels of the element */ replace: element identifier { /* child statements if any */ } /* closing braces for parent levels of the element */ </configuration-text>
Junos OS does not support using the replace operation when loading JSON-formatted configuration data. To replace configuration elements when using JSON, you must delete the existing element and then add the replacement element.
The following example shows how to grant new permissions for
the object named operator
at the [edit system login class]
hierarchy level. The information is provided in Junos XML-tagged
format (the default).

The following example shows how to use formatted ASCII text to make the same change.

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.
<load-configuration>
action
attribute values of override
and replace
in
addition to the previously supported values of merge
and set
.