To replace configuration elements (hierarchy levels and configuration objects) only if they differ in the loaded configuration and the candidate configuration or private copy, the application emits the <load-configuration> tag element with the action="update" attribute in an <rpc> tag element:
<rpc>
<!- - For a file - ->
<load-configuration action="update" url="file" [format="text"]/>
<!- - For a data stream - ->
<load-configuration action="update" [format="text"]>
<!- - configuration data - ->
</load-configuration>
</rpc>
For more information about the url and format attributes, see Specifying the Source and Format of New Configuration Data.
This operation is equivalent to the JUNOS CLI load update configuration mode command. The JUNOS configuration management software compares the two 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, or exist only in the existing configuration, 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 Configuration Elements. In the following, the identifier tag element is called <name>:
<configuration>
<!- - opening tag for each parent of the element - ->
<container-tag>
<name>identifier</name>
<!- - tag elements for other children, if any - ->
</container-tag>
<!- - closing tag for each parent of the element - ->
</configuration>
OR
<configuration-text>
/* statements for parent levels of the element */
element identifier {
/* child statements if any */
}
/* closing braces for parent levels for the element */
</configuration-text>
The following example shows how to update the candidate configuration with the contents of the file /tmp/new.conf (which resides on the routing platform). The file contains a complete configuration represented as JUNOS XML tag elements (the default), so the format attribute is omitted.
