Create 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 target configuration, which
can be either the candidate configuration or the open configuration
database (if the client application issued the Junos XML protocol <open-configuration>
operation prior to executing
the <edit-config>
operation), a client
application emits the basic tag elements described in Change 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 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 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 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 target 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: