[Contents] [Prev] [Next] [Index] [Report an Error]

Changing Individual Configuration Elements

You change individual configuration elements within a candidate configuration using the <edit-config> tag element within the <rpc> tag. By default, the NETCONF server merges new configuration data into the existing candidate configuration. However, a client application can also replace, create, or delete individual configuration elements (hierarchy levels or configuration objects). The same basic tag elements are emitted for all operations: <config>, <config-text>, or <url> tag sub-elements within the <edit-config> tag element:

<rpc>
    <edit-config>
        <target>
            <candidate/>
        </target>

    <!- - EITHER - ->
        <config>
            <configuration>
                <!- - tag elements representing the configuration elements to change - ->
            </configuration>
        </config>
    <!- - OR - ->
        <config-text>
            <configuration-text>
                <!- - tag elements representing the configuration elements to change - ->
            </configuration-text>
        </config-text>
    <!- - OR - ->
        <url>
            <!- - location specifier for file containing changes - ->
        </url>

    </edit-config>
</rpc>
]]>]]>

Using configuration data within the <config> or <config-text> tag elements or the file specified within the <url> tag element, the application defines a configuration element by including the tag elements representing all levels of the configuration hierarchy from the root (represented by the <configuration> tag element) down to the immediate parent level for the element. To represent the element, the application includes its container tag element. The child tag elements included within the container tag element depend on the operation, and are described in the following sections:

For more information about the tag elements that represent configuration statements, see Mapping Configuration Statements to JUNOS XML Tag Elements. For information about the tag elements for a specific configuration element, see the JUNOS XML API Configuration Reference.

The NETCONF server indicates that it changed the configuration in the requested way by enclosing the <ok/> tag in the <rpc-reply> tag element:

<rpc-reply xmlns="URN" xmlns:junos="URL">
    <ok/>
</rpc-reply>
]]>]]>

For more information, see the following sections:


[Contents] [Prev] [Next] [Index] [Report an Error]