Replacing the Candidate Configuration

You can replace the candidate configuration with a new configuration file using the <copy-config> tag, or you can use the <edit-config> tag with the <default-operation> subtag value set to replace.

For information about completely replacing the candidate configuration, see the following sections:

Using <copy-config>

One method for replacing the entire candidate configuration is to include the <copy-config> tag element in the <rpc> tag element. The <source> tag element encloses the <url> tag element to specify the filename that contains the new configuration data. The <target> tag element encloses the <candidate/> tag to indicate that the new configuration data replaces the candidate configuration:

<rpc>
    <copy-config>
        <target>
            <candidate/>
        </target>
        <source>
            <url>
                <!-- location specifier for file containing the new configuration -->
            </url>
        </source>
    </copy-config>
</rpc>
]]>]]>

Using <edit-config>

The other method for replacing the entire candidate configuration is to set the edit configuration mode to replace as a global variable. The candidate configuration includes the <default-operation> tag element with the value replace in the <edit-config> tag element, as described in Setting the Edit Configuration Mode. To specify the new configuration data, the application includes either a <config> tag element that contains the data or a <url> tag element that names the file containing the data, as discussed in Formatting the Configuration Data.

<rpc>
    <edit-config>
        <default-operation>replace</default-operation>
        <source>

        <!-- EITHER -->
            <config>
                <!-- tag elements representing the new configuration -->
            </config>
        <!-- OR -->
            <url>
                <!-- location specifier for file containing the new configuration -->
            </url>

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