Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Retrieve the Rescue Configuration Using NETCONF

The rescue configuration is a configuration saved in case it is necessary to restore a valid, nondefault configuration. (To create a rescue configuration in a NETCONF session, use the Junos XML <request-save-rescue-configuration> tag element or the request system configuration rescue save CLI operational mode command. For more information, see the Junos XML API Operational Developer Reference or the CLI Explorer.)

In a NETCONF session with a device running Junos OS, a client application requests the rescue configuration by emitting the Junos XML <get-rescue-information> tag element in an <rpc> tag element. This operation is equivalent to the show system configuration rescue operational mode command.

To request Junos XML-tagged output, the application either includes the <format> tag element with the value xml or omits the <format> tag element (Junos XML tag elements are the default):

The NETCONF server encloses its response in <rpc-reply>, <rescue-information>, and <configuration> tag elements. The <ok/> tag is a side effect of the implementation and does not affect the results. For information about the attributes in the opening <configuration> tag, see Specify the Source for Configuration Information Requests Using NETCONF.

To request formatted ASCII output, the application includes the <format> tag element with the value text.

The NETCONF server encloses its response in <rpc-reply>, <rescue-information>, <configuration-information>, and <configuration-output> tag elements. For more information about the formatted ASCII notation used in Junos OS configuration statements, see the CLI User Guide.

Starting in Junos OS Release 16.1, to request the rescue configuration in JSON format, the application includes the <format> tag element with the value json in the <get-rescue-information> element. Prior to Junos OS Release 16.1, JSON-formatted data is requested by including the format="json" attribute in the opening <get-rescue-information> tag.

When you use the format="json" attribute to specify the format, the NETCONF server encloses its response in an <rpc-reply> element, the field name for the top-level JSON member is "rescue-information", and the emitted configuration data uses an older implementation for serialization. When you use the <format>json</format> element to request JSON-formatted data, the NETCONF server encloses its response in <rpc-reply>, <rescue-information>, <configuration-information>, and <json-output> tag elements, the field name for the top-level JSON member is "configuration", and the emitted configuration data uses a newer implementation for serialization.

Change History Table

Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.

Release
Description
16.1
Starting in Junos OS Release 16.1, to request the rescue configuration in JSON format, the application includes the <format> tag element with the value json in the <get-rescue-information> element. Prior to Junos OS Release 16.1, JSON-formatted data is requested by including the format="json" attribute in the opening <get-rescue-information> tag.