Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Replace Configuration Elements Using NETCONF

date_range 15-Jul-21

In a NETCONF session with a device running Junos OS, to replace configuration elements, including hierarchy levels or configuration objects, in the candidate configuration, a client application emits the basic tag elements described in Change Individual Configuration Elements Using NETCONF.

To represent the new definition for each configuration element being replaced (either within the <config> or <config-text> tag elements or in the file specified by the <url> tag element), the application emits the tag elements representing its parent hierarchy levels and its container tag element, as described in Change Individual Configuration Elements Using NETCONF. Within the container tag, the application includes each of the element’s identifier tag elements (if it has them) and all child tag elements (with values, if appropriate) that are being defined for the new version of the element. In the following example, the identifier tag element is called <name>. The application includes the operation="replace" attribute in the opening container tag:

content_copy zoom_out_map
<configuration>
    <!-- opening tags for each parent of the element -->
        <container-tag operation="replace"> 
            <name>identifier</name> 
            <!-- other child tag elements -->
        </container-tag> 
    <!-- closing tags for each parent of the element -->
</configuration>

The NETCONF server removes the existing element that has the specified identifiers and inserts the new element.

Note:

The operation="replace" attribute is not supported when loading configuration data into the ephemeral configuration database.

The application can also replace all objects in the configuration in one operation. For instructions, see Replace the Candidate Configuration Using NETCONF.

The following example shows how to grant new permissions for the object named operator at the [edit system login class] hierarchy level.

footer-navigation