Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Retrieve a Previous (Rollback) Configuration Using NETCONF

A NETCONF client application can use the <get-rollback-information> request tag to retrieve a previously committed configuration.

Junos OS and Junos OS Evolved store a copy of the most recently committed configuration and up to 49 previous configurations, depending on the platform. When you successfully commit a configuration, the device associates that configuration with a rollback index, where the most recently committed configuration has rollback index 0. The rollback index for a committed configuration increments with each commit. When you request a previously committed configuration, you can reference the configuration by its current rollback index.

A NETCONF client application can retrieve a previously committed (rollback) configuration from a device running Junos OS or a device running Junos OS Evolved. To retrieve the configuration using the rollback index, the client application executes the <get-rollback-information> RPC with the <rollback> element. The <rollback> element specifies the rollback index of the previous configuration to retrieve. The value can be from 0 (zero, for the most recently committed configuration) through one less than the number of stored previous configurations (maximum is 49). This operation is equivalent to the show system rollback operational mode command.

To request Junos XML-tagged output, which is the default, the application either includes the <format>xml</format> element or omits the <format> element.

The NETCONF server encloses its response in <rpc-reply>, <rollback-information>, and <configuration> elements. The <ok/> tag is a side effect of the implementation and does not affect the results.

To request formatted ASCII output, the application includes the <format>text</format> element.

The NETCONF server encloses its response in <rpc-reply>, <rollback-information>, <configuration-information>, and <configuration-output> elements.

To request JSON format, the application includes the <format>json</format> element.

The NETCONF server encloses its response in <rpc-reply>, <rollback-information>, <configuration-information>, and <json-output> elements.

The following example requests Junos XML-tagged output for the rollback configuration that has an index of 2. In actual output, the JUNOS-version variable has a value such as 24.4R1, which is the initial version of Junos OS Release 24.4.

Client Application sends XML rpc request with get-rollback-information tag to NETCONF Server. Server replies with rpc-reply containing rollback details: changed-seconds, changed-localtime, version, and host-name bigrouter.