Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Creating Configuration Elements Using NETCONF

In a NETCONF session with a device running Junos OS, to create configuration elements, including hierarchy levels or configuration objects, that do not already exist in the candidate configuration, a client application emits the basic tag elements described in Changing Individual Configuration Elements Using NETCONF.

To represent each configuration element being created (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 Changing 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 element. In the following, the identifier tag element is called <name>. The application includes the operation="create" attribute in the opening container tag:

<configuration>
    <!-- opening tags for each parent of the element -->
        <element operation="create">
            <name>identifier</name> <!-- if the element has an identifier -->
            <!-- other child tag elements -->
        </element>
    <!-- closing tags for each parent of the element -->
</configuration>

The NETCONF server adds the new element to the candidate configuration only if there is no existing element with that name (for a hierarchy level) or with the same identifiers (for a configuration object).

The following example shows how to enable OSPF on a device if it is not already configured:

Published: 2013-07-26