Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
 

Related Documentation

  • <load-configuration-results>
  • <rpc>
  • entries for <configuration> and <configuration-text>, and <configuration-set> in the Junos XML API Configuration Reference
  • Junos XML Management Protocol Guide
 

<load-configuration>

Usage

<rpc>
<load-configuration rescue="rescue"/>

<load-configuration rollback="index"/>

<load-configuration url="url" [action="(merge | override | replace | update)"]
[format="(text | xml)"] />]

<load-configuration url="url" action="set" format="text" />

<load-configuration [action="(merge | override | replace | update)"]
[format="xml"]>
<configuration>
<!-- tag elements for configuration elements to load -->
</configuration>
</load-configuration>
<load-configuration [action="(merge | override | replace | update)"]
format="text"> <configuration-text>
<!-- formatted ASCII configuration statements to load -->
</configuration-text>
</load-configuration>

<load-configuration action="set" format="text">
<configuration-set>
<!-- set configuration mode commands to load -->
</configuration-set>
</load-configuration>
</rpc>

Release Information

This is a Junos XML management protocol operation. It is a Juniper Networks proprietary extension to NETCONF and is identified in the capabilities exchange by the URI http://xml.juniper.net/netconf/junos/1.0 . This operation is only supported in NETCONF sessions on Juniper Networks devices running the Junos OS.

Description

Request that the NETCONF server load configuration data into the candidate configuration. Provide the data to load in one of four ways:

  • Set the empty <load-configuration/> tag’s rescue attribute to the value rescue. The rescue configuration completely replaces the candidate configuration.
  • Set the empty <load-configuration/> tag’s rollback attribute to the numerical index of a previous configuration. The routing platform stores a copy of the most recently committed configuration and up to 49 previous configurations. The specified previous configuration completely replaces the candidate configuration.
  • Set the empty <load-configuration/> tag’s url attribute to the pathname of a file that contains the configuration data to load. If providing the configuration data as formatted ASCII text, set the format attribute to text. If providing the configuration data as Junos XML tag elements, either omit the format attribute or set the value to xml. If providing the configuration data as a set of configuration mode commands, set the action attribute to set, and either omit the format attribute or set the value to text.

    In the following example, the url attribute identifies /tmp/add.conf as the file to load.

    <load-configuration url="/tmp/add.conf"/>
  • Enclose the configuration data within an opening <load-configuration> and closing </load-configuration> tag. If providing the configuration data as formatted ASCII text, enclose it in a <configuration-text> tag element, and set the format attribute to text. If providing the configuration data as Junos XML tag elements, enclose it in a <configuration> tag element, and either omit the format attribute or set the value to xml. If providing the configuration data as a set of configuration mode commands, enclose it in a <configuration-set> tag element, set the action attribute to set, and either omit the format attribute or set the value to text.

Attributes

For detailed information on the attributes, see the Junos XML Management Protocol Guide

action

Specifies how to load the configuration data, particularly when the candidate configuration and loaded configuration contain conflicting statements. The following are acceptable values:

  • merge—Combines the data in the loaded configuration with the candidate configuration. If statements in the loaded configuration conflict with statements in the candidate configuration, the loaded statements replace the candidate ones. This is the default behavior if the action attribute is omitted.
  • override—Discards the entire candidate configuration and replaces it with the loaded configuration. When the configuration is later committed, all system processes parse the new configuration.
  • replace—Substitutes each hierarchy level or configuration object defined in the loaded configuration for the corresponding level or object in the candidate configuration.

    If providing the configuration data as formatted ASCII text (either in the file named by the url attribute or enclosed in a <configuration-text> tag element), also place the replace: statement on the line directly preceding the statements that represent the hierarchy level or object to replace. For more information, see the discussion of loading a file of configuration data in the CLI User Guide.

    If providing the configuration data as Junos XML tag elements, also set the replace attribute to the value replace on the opening tag of the container tag element that represents the hierarchy level or object to replace.

  • set—Loads a set of Junos OS configuration mode commands. This option executes the configuration instructions line by line as they are stored in a file named by the url attribute or enclosed in a <configuration-set> tag element. The instructions can contain any configuration mode command, such as set, delete, edit, or deactivate. When providing the configuration data as a set of commands, the only acceptable value for the format attribute is text. If the action attribute value is set, and the format attribute is omitted, the format automatically defaults to text rather than xml. This option was added in Junos OS Release 11.4.
  • update—Compares the loaded configuration and candidate configuration. For each hierarchy level or configuration object that is different in the two configurations, the version in the loaded configuration replaces the version in the candidate configuration. When the configuration is later committed, only system processes that are affected by the changed configuration elements parse the new configuration.
format

Specifies the format used for the configuration data. There are two acceptable values:

  • text—Indicates that configuration data is formatted as ASCII text or as a set of configuration mode commands.

    ASCII text format uses the newline character, tabs and other white space, braces, and square brackets to indicate the hierarchical relationships between the statements. This is the format used in configuration files stored on a routing platform running Junos OS and is displayed by the CLI show configuration command. Set command format consists of a series of Junos OS configuration mode commands and is displayed by the CLI show configuration | display set command. To import a set of configuration mode commands, you must set the action attribute to set.

  • xml—Indicates that configuration statements are represented by the corresponding Junos XML tag elements. If the format attribute is omitted, xml is the default format for all values of the action attribute except set, which defaults to format text.
rescue

Specifies that the rescue configuration replace the current candidate configuration. The only valid value is rescue.

rollback

Specifies the numerical index of the previous configuration to load. Valid values are 0 (zero, for the most recently committed configuration) through one less than the number of stored previous configurations (maximum is 49).

url

Specifies the full pathname of the file that contains the configuration data to load. The value can be a local file path, an FTP location, or a Hypertext Transfer Protocol (HTTP) URL:

  • A local filename can have one of the following forms:
    • /path/filename—File on a mounted file system, either on the local flash disk or on hard disk.
    • a:filename or a:path/filename—File on the local drive. The default path is / (the root-level directory). The removable media can be in MS-DOS or UNIX (UFS) format.
  • A filename on an FTP server has the following form:
    ftp://username:password@hostname/path/filename
  • A filename on an HTTP server has the following form:

    http://username:password@hostname/path/filename

In each case, the default value for the path variable is the home directory for the username. To specify an absolute path, the application starts the path with the characters %2F; for example, ftp://username:password@hostname/%2Fpath/filename.

Usage Guidelines

 

Related Documentation

  • <load-configuration-results>
  • <rpc>
  • entries for <configuration> and <configuration-text>, and <configuration-set> in the Junos XML API Configuration Reference
  • Junos XML Management Protocol Guide
 

Published: 2013-07-26

 

Related Documentation

  • <load-configuration-results>
  • <rpc>
  • entries for <configuration> and <configuration-text>, and <configuration-set> in the Junos XML API Configuration Reference
  • Junos XML Management Protocol Guide
 

Published: 2013-07-26