Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

<edit-config>

 

Usage

Description

Request that the NETCONF server incorporate configuration data into the candidate configuration or open configuration database. Provide the data in one of three ways:

  • Include the <config> tag element to provide a data stream of Junos XML configuration tag elements to incorporate. The tag elements are enclosed in the <configuration> tag element.

  • Include the <config-text> tag element to provide a data stream of CLI configuration statements to incorporate. The configuration statements are enclosed in the <configuration-text> tag element.

  • Include the <url> tag element to specify the location of a file that contains the Junos OS configuration to incorporate. The format of the configuration data can be Junos XML elements or CLI configuration statements.

If a client application issues the Junos XML protocol <open-configuration> operation to open a specific configuration database before executing the <edit-config> operation on the target <candidate/>, Junos OS performs the <edit-config> operation on the open configuration database. Otherwise, the operation is performed on the candidate configuration.

<config>Enclose the <configuration> tag element.
<configuration>Enclose the configuration data written in Junos XML. This configuration data is provided as a data stream and is incorporated into the candidate configuration or open configuration database. For information about the syntax for representing the elements to create, delete, or modify, see Mapping Configuration Statements to Junos XML Tag Elements.
<config-text>Enclose the <configuration-text> tag element.
<configuration-text>Enclose the configuration data formatted as CLI configuration statements. This configuration data is provided as a data stream and is incorporated into the candidate configuration or open configuration database.
<default-operation>(Optional) Specify how to incorporate the new configuration data into the candidate configuration or open configuration database, particularly when there are conflicting statements. The following are acceptable values:
  • merge—Combine the new configuration data with the existing configuration according to the rules defined in Setting the Edit Configuration Mode in a NETCONF Session. This is the default mode if the <default-operation> tag element is omitted. It applies to all elements in the new data that do not have the operation attribute in their opening container tag to specify a different mode.

  • none—Retain each configuration element in the existing configuration unless the new data 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 Setting the Edit Configuration Mode in a NETCONF Session.

  • replace—Discard the existing configuration data in the candidate configuration or open configuration database and replace it with the new data. For more information, see Replacing the Candidate Configuration Using NETCONF.

<error-option>(Optional) Specify how the NETCONF server handles errors encountered while it incorporates the configuration data. The following are acceptable values:
  • ignore-error—Specify that the NETCONF server continue to incorporate the new configuration data even if it encounters an error.

  • stop-on-error—Specify that the NETCONF server stop incorporating the new configuration data when it encounters an error. This is the default behavior if the <error-option> tag element is omitted.

<test-option>(Optional) Specify whether the NETCONF server validate the configuration data before incorporating it into the candidate configuration. The acceptable values defined in the NETCONF specification are set (no validation) and the default test-then-set (do not incorporate data if validation fails).

Regardless of the value provided, the NETCONF server for the Junos OS performs a basic syntax check on the configuration data in the <edit-config> tag element. It performs a complete syntactic and semantic validation on the candidate configuration in response to the <validate> and <commit> tag elements, but not for the <edit-config> tag element.

Note

The <test-option> element is not supported when incorporating configuration data into the ephemeral configuration database.

<url>Specify the full pathname of the file that contains the configuration data to load. When the configuration data is formatted as Junos XML tag elements, set the <url> format attribute to "xml" or omit the attribute. When the configuration data is formatted as CLI configuration statements, set the <url> format attribute to "text". For more information, see Uploading and Formatting Configuration Data in a NETCONF Session.

The <target> tag element and its contents are explained separately.