Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

<load-configuration>

Usage

Description

Request that the NETCONF or Junos XML protocol server load configuration data into the candidate configuration or open configuration database.

If a client application issues the Junos XML protocol <open-configuration> operation to open a specific configuration database before executing the <load-configuration> operation, the server loads the configuration data into the open configuration database. Otherwise, the server loads the configuration data into the candidate configuration.

Table 1 describes the common load configuration operations.

Table 1: Load Configuration Data
<load-configuration> Operation Description
<load-configuration configuration-revision="revision-id"/>

Load a previously committed configuration by referencing its configuration revision ID. The specified configuration completely replaces the candidate configuration.

<load-configuration rescue="rescue"/>

Load the rescue configuration. The rescue configuration completely replaces the candidate configuration.

<load-configuration rollback="index"/>

Load a previously committed configuration by referencing its numerical rollback index. The specified configuration completely replaces the candidate configuration.

<load-configuration url="url" format="(text | xml | json)/>

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

Load configuration data from the file specified in the url attribute. Specify the full path of the file that contains the configuration data to load and the format of the data in the file. For example:

<load-configuration url="/tmp/add.conf" format="text"/>
<load-configuration format="xml">
    <configuration>...</configuration>
</load-configuration>

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

Load the configuration as a data stream. Enclose the configuration data in the appropriate set of tags for the format.

Attributes

action

Specify how to load the configuration data, particularly when the target configuration database and the loaded configuration contain conflicting statements.

The ephemeral configuration database supports all of the action attribute values. The update value is supported in Junos OS Release 21.1R1 and later.

  • Default: merge

  • Values:

    • merge—Combine the data in the loaded configuration with the data in the target configuration. If statements in the loaded configuration conflict with statements in the target configuration, the loaded statements replace those statements in the target configuration.

    • override—Discard the entire candidate configuration and replace it with the loaded configuration. When you commit the configuration, all system processes parse the new configuration.

    • replace—Substitute each hierarchy level or configuration object defined in the loaded configuration for the corresponding level or object in the candidate configuration.

      If the configuration data format is ASCII text, place the replace: statement on the line directly preceding the statements that represent the hierarchy level or object to replace. If the configuration data is Junos XML elements, include the replace="replace" attribute in the opening tags of the elements that represent the hierarchy levels or objects to replace.

    • set—Load configuration data formatted as Junos OS configuration mode commands. This option executes the configuration instructions line by line. You can store the instructions in a file named by the url attribute, or you can enclose the instructions in a <configuration-set> element to provide a data stream. The instructions can contain any configuration mode command, such as set, delete, edit, or deactivate. When using the set action, the default and only acceptable value for the format attribute is "text".

    • update—Compare a complete loaded configuration against the 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 you commit the configuration, only system processes that are affected by the changed configuration elements parse the new configuration.

configuration-revision

Load a previously committed configuration by referencing its configuration revision ID. The specified configuration completely replaces the candidate configuration.

format

Specify the format used for the configuration data.

  • Default:

    • xml, for all action values except set

    • text, when action="set"

  • Values:

    • json–Indicate that the configuration data format is JSON.

    • text—Indicate that the configuration data format is ASCII text or 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. Junos devices use this format for configuration files stored on the device and for the output of the CLI show configuration command.

      The set command format consists of Junos OS configuration mode commands. You can view this format using the show configuration | display set CLI command. To load configuration mode commands, you must set the action attribute to "set".

    • xml—Indicate that the configuration data is Junos XML elements.

rescue

Replace the candidate configuration with the rescue configuration.

  • Values: rescue

Note:

You can also use the <rollback-config> RPC to load a previously committed configuration. The <rollback-config> RPC is useful for applications that do not support executing RPCs that include XML attributes.

rollback

Load a previously committed configuration by referencing its numerical rollback index. Valid values are 0 (for the most recently committed configuration) through one less than the number of stored previous configurations (maximum is 49).

Note:

You can also use the <rollback-config> RPC to load a previously committed configuration. The <rollback-config> RPC is useful for applications that do not support executing RPCs that include XML attributes.

url

Specify 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 an HTTP URL.

  • Syntax:

    • Local filename:

      • /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.

    • ftp://username:password@hostname/path/filename

    • 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.

Release Information

This operation is a Junos XML management protocol operation. It is supported in Junos XML protocol sessions, and it is supported as a Juniper Networks proprietary extension in NETCONF sessions on Junos devices that identify the URI http://xml.juniper.net/netconf/junos/1.0 in the capabilities exchange.

action attribute value set added in Junos OS Release 11.4.

format attribute value json added in Junos OS Release 16.1.

configuration-revision attribute added in Junos OS Release 20.4R1 and Junos OS Evolved Release 20.4R1.