ON THIS PAGE
<load-configuration>
Usage
<rpc> <load-configuration configuration-revision="revision-id"/> <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="(merge | override | update)"] format="json" /> <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="(merge | override | update)"] format="json"> <configuration-json> <!-- JSON configuration data to load --> </configuration-json> </load-configuration> <load-configuration action="set" format="text"> <configuration-set> <!-- configuration mode commands to load --> </configuration-set> </load-configuration> </rpc>
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.
Provide the data to load in one of the following ways:
Set the empty
<load-configuration/>
tag’sconfiguration-revision
attribute to the configuration revision identifier of a previously committed configuration. The specified configuration completely replaces the candidate configuration.Set the empty
<load-configuration/>
tag’srescue
attribute to the valuerescue
. The rescue configuration completely replaces the candidate configuration.Set the empty
<load-configuration/>
tag’srollback
attribute to the rollback index of a previously committed configuration. The device stores a copy of the most recently committed configuration and up to 49 previous configurations. The specified configuration completely replaces the candidate configuration.Set the empty
<load-configuration/>
tag’surl
attribute to the pathname of a file that contains the configuration data to load. Set theformat
attribute tojson
,text
, orxml
to load a configuration in the respective format-JavaScript Object Notation (JSON), formatted ASCII text, or Junos XML tag elements (the default). To provide the configuration data as configuration mode commands, include theaction="set"
attribute, and either omit theformat
attribute or set the value totext
.In the following example, the
url
attribute identifies that the configuration data should be loaded from the /tmp/add.conf file.<load-configuration url="/tmp/add.conf" format="text"/>
Enclose the configuration data as a data stream within an opening
<load-configuration>
and closing</load-configuration>
tag. If providing the configuration data as formatted ASCII text, enclose the data in a<configuration-text>
tag element, and set theformat
attribute totext
. If providing the configuration data as Junos XML tag elements, enclose the data in a<configuration>
tag element, and either omit theformat
attribute or set the value toxml
. If providing the configuration data as configuration mode commands, enclose the data in a<configuration-set>
tag element, set theaction
attribute toset
, and either omit theformat
attribute or set the value totext
. If providing the configuration data in JSON, enclose the data in a<configuration-json>
tag element, and set theformat
attribute tojson
.
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 the following
The following are acceptable values:
|
configuration-revision |
Load a previously committed configuration by referencing its configuration revision identifier. The specified configuration completely replaces the candidate configuration. |
format |
Specify the format used for the configuration data. Acceptable values are:
|
rescue |
Specify that the rescue configuration replace the current candidate configuration. The only valid value is "rescue". Note:
Starting in Junos OS Release 18.1R1 you can also use the |
rollback |
Load a previously committed configuration by referencing its numerical rollback index. Valid values are 0 (zero, for the most recently committed configuration) through one less than the number of stored previous configurations (maximum is 49). Note:
Starting in Junos OS Release 18.1R1 you can also use the |
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 a Hypertext Transfer Protocol (HTTP) URL:
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 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 devices running Junos OS 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.