<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 format="text" [action="(merge | override | replace | \
update)"]>
<configuration-text>
<!-- formatted ASCII configuration statements to load -->
</configuration-text>
</load-configuration>
<load-configuration [action="(merge | override | replace | update)"] \
[format="xml"]>
<configuration>
<!-- tag elements for configuration elements to load -->
</configuration>
</load-configuration>
</rpc>
Description
Request that the Junos XML protocol 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. The data can be either formatted ASCII text (in which
case the format attribute must be set to the value text) or Junos XML tag elements (in which case the format attribute
is either omitted or set to the value xml).
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 the value text. If providing configuration data as Junos XML tag elements, enclose it in a <configuration> tag element and optionally set the format attribute to the value xml.
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 Junos 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.
- 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 statements are formatted as ASCII text, using 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 the routing platform and displayed by the CLI show configuration command.
- xml—Indicates that configuration statements are represented by the corresponding Junos XML tag elements. This is the default value if the format attribute is omitted.
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
See Changing Configuration Information.
Related Topics
- <load-configuration-results>
- <rpc>
- replace
- entries for <configuration> and <configuration-text> in the Junos XML API Configuration Reference
Hide Navigation Pane
Show Navigation Pane
Download
SHA1