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

# Setting the Default Mode for Incorporating New Configuration Data

By default, the NETCONF server merges new configuration data into the candidate configuration, according to the following rules:

- A configuration element (hierarchy level or configuration object) that exists in the candidate but not in the new configuration remains unchanged.
- A configuration element that exists in the new configuration but not in the candidate is added to the candidate.
- If a configuration element exists in both configurations, the semantics are as follows:
  - If a child statement of the configuration element (represented by a child tag element) exists in the candidate but not in the new configuration, it remains unchanged.
  - If a child statement exists in the new configuration but not in the candidate, it is added to the candidate.
  - If a child statement exists in both configurations, the value in the new data replaces the value in the candidate.

Merge mode applies to all elements in the new configuration that do not have the operation attribute in their opening container tag to specify a different mode. (For information about the operation attribute, see Changing Individual Configuration Elements.)

Merge mode is the default mode for incorporating new configuration data (it is used when a client application does not specify a different mode). To explicitly specify merge mode, the application can include the <default-operation> tag element with the value merge in the <edit-config> tag element:

`

    <rpc>
        <edit-config>
          <default-operation>merge</default-operation>
            <!- - other child tag elements of the <edit-config> tag element - ->
        </edit-config>
    </rpc>
    ]]>]]>

`

The client application can specify one of two alternative default modes for incorporating new configuration data:

- In replace mode, the new configuration data completely replaces the candidate configuration. To specify replace mode, the candidate application includes the <default-operation> tag element with the value replace in the <edit-config> tag element:
  `

      <rpc>
          <edit-config>
            <default-operation>replace</default-operation>
              <!- - other child tag elements of the <edit-config> tag element - ->
          </edit-config>
      </rpc>
      ]]>]]>

  `

  We recommend using replace mode only when you completely overwrite the candidate configuration with new configuration data. When the default mode is replace, we do not recommend including the operation attribute on individual configuration elements in the new configuration to specify a different incorporation mode for them.

  It is also possible to replace individual configuration elements while merging or creating others. See Replacing Configuration Elements.

- In no-change mode, configuration elements in the existing candidate configuration remain unchanged unless the new configuration includes a corresponding element that has the operation attribute in its opening container tag to specify an incorporation mode. This mode prevents the NETCONF server from creating parent hierarchy levels for an element that is being deleted. For more information, see Deleting Configuration Elements. To specify no-change mode, the candidate application includes the <default-operation> tag element with the value none in the <edit-config> tag element:
  `

      <rpc>
          <edit-config>
            <default-operation>none</default-operation>
              <!- - other child tag elements of the <edit-config> tag element - ->
          </edit-config>
      </rpc>
      ]]>]]>

  `

  If the new configuration data includes a configuration element that does not exist in the candidate, the NETCONF server returns an error. We recommend using no-change mode only when you remove configuration elements from the candidate configuration. When creating or modifying elements, applications need to use merge mode.

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