NETCONF can be used to obtain the differences between configurations. The <md-compare> operation is a synchronous YANG modelled operation. See Individually YANG-modeled operations for more information.
The YANG model with detailed input and output parameters for the <md-compare> operation is available in the YANG distribution for the specific software release.
The following table summarizes a selection of the available input parameters.
Input parameter | Description |
---|---|
<path>/<subtree-path> |
The XML-formatted and correctly namespaced path to the tree location where the <md-compare> operation is executed. Omitting the <subtree-path> executes the <md-compare> operation from the root of the YANG tree. Optional. Default: root (/) |
<configuration-region> |
The SRĀ OS configuration region. See <get> for an example of the <configuration-region>. Optional. Default: configure |
<format> |
The NETCONF output format. See Output format selection for more information. Optional. Default: xml |
<source> |
The source configuration. See Table: Source and destination locations for more information. Optional. Default: <candidate/> |
<destination> |
The destination configuration. See Table: Source and destination locations for more information. Optional. Default: <baseline/> |
The following table describes the source and destination locations available for use.
Option | Description |
---|---|
<candidate/> | The candidate configuration. This is the default for the <source> input parameter. |
<baseline/> | The baseline configuration. This is the default for the <destination> input parameter. |
<url>URL</url> |
Uses the location specified in the URL. The following URL types are supported:
|
<running/> | The running configuration |
<startup/> | The startup configuration |
<booted/> | The booted configuration. To use this option, the <configuration-region> must be set to "bof". |
<rollback><checkpoint-id>NUMBER</checkpoint-id></rollback> | The configuration stored at the rollback checkpoint-id identified by NUMBER |
The results from the <md-compare> operation are displayed in the <results>/<md-compare-output> XML field.
The XML-formatted <md-compare> provides the correctly formatted and namespace-aware XML data that, if sent to the node, results in the target configuration. This option is similar to the use of compare summary netconf-rpc in the MD-CLI.
The MD-CLI-formatted <md-compare> provides the equivalent output as compare summary in the MD-CLI.
The following output shows the example configuration used in the <md-compare> operation examples.
<rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
<edit-config>
<target><candidate/></target>
<config>
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
<log>
<log-id>
<name>50</name>
<admin-state>enable</admin-state>
<description>Example</description>
<source>
<main>true</main>
<change>true</change>
</source>
<destination>
<cli>
</cli>
</destination>
</log-id>
</log>
</configure>
</config>
</edit-config>
</rpc>
]]>]]>
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
<ok/>
</rpc-reply>
]]>]]>
See the following sections for examples of the <md-compare> operation: