Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Replace Only Updated Elements in Configuration Data Using the Junos XML Protocol

In a Junos XML protocol session with a device running Junos OS, to replace configuration elements (hierarchy levels and configuration objects) only if they differ between the loaded configuration and the existing configuration, the application emits the <load-configuration> tag element with the action="update" attribute in an <rpc> tag element.

For more information about the url and format attributes, see Uploading and Formatting Configuration Data in a Junos XML Protocol Session.


Starting in Junos OS Release 21.1R1, the ephemeral configuration database supports the action="update" attribute on supported platforms.

This operation is equivalent to the Junos OS CLI load update configuration mode command. The Junos OS configuration management software compares the two complete configurations. Each configuration element that is different in the loaded configuration replaces its corresponding element in the existing configuration. Elements that are the same in both configurations remain unchanged. When the configuration is later committed, only system processes that are affected by the changed configuration elements parse the new configuration.

To represent the replacement elements, the application uses the same syntax as for new elements, as described in Creating New Elements in Configuration Data Using the Junos XML Protocol. In the following Junos XML and JSON representations of the configuration, the object identifier is called name.

Junos XML elements:

ASCII text:



You can load configuration data formatted using JavaScript Object Notation (JSON) starting in Junos OS Release 16.1.

The following example shows how to update the candidate configuration with the contents of the file /tmp/new.conf (which resides on the device). The file contains a complete configuration represented as Junos XML tag elements (the default), so the format attribute is omitted.