Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Request Commit-Script-Style XML Configuration Data Using the Junos XML Protocol

On devices running Junos OS, to view the current configuration in Extensible Markup Language (XML), you issue the show configuration | display xml operational mode command. To view the configuration in commit-script-style XML, you use the show configuration | display commit-scripts view command. This command displays the configuration in the format that would be input to a commit script.

In a Junos XML protocol session with a device running Junos OS, to request that the server display the configuration as commit-script-style XML data, a client application includes the commit-scripts="view" attribute in the <get-configuration/> tag or opening <get-configuration> tag. It encloses the request in an <rpc> tag element:

To view the configuration with commit script changes applied, including both transient and non-transient changes, issue the show configuration | display commit-scripts operational mode command on a device running Junos OS. Starting in Junos OS Release 12.1, you can also request this data through the Junos XML protocol server.

To request that the Junos XML protocol server display the configuration with commit script changes applied, including both transient and non-transient changes, a client application includes the commit-scripts="apply" attribute in the <get-configuration/> tag or opening <get-configuration> tag. It encloses the request in an <rpc> tag element:

To view the configuration with commit script changes applied, but exclude transient changes, issue the show configuration | display commit-scripts no-transients operational mode command on a device running Junos OS. Starting in Junos OS Release 12.1, you can also request this data through the Junos XML protocol server.

To request that the Junos XML protocol server display the configuration with commit script changes applied, but exclude transient changes, a client application includes the commit-scripts="apply-no-transients" attribute in the <get-configuration/> tag or opening <get-configuration> tag. It encloses the request in an <rpc> tag element:

The commit-scripts attribute can be combined with one or more of the following other attributes in the <get-configuration/> tag or opening <get-configuration> tag:

You do not need to include the changed, groups or inherit attributes with the commit-scripts="view" attribute. The commit-scripts-style XML view includes the junos:changed="changed" attribute in the XML tags, and it displays the output with inheritance applied. The tag elements inherited from user-defined groups or interface ranges are displayed within the inheriting tag elements, and the XML tags already include the junos:group attribute. To explicitly display the junos:interface-range attribute in the commit-scripts-style view, you must include the interface-ranges="interface-ranges" attribute in the <get-configuration> tag.

If you specify a value of commit-scripts="apply" or commit-scripts="apply-no-transients", you can specify an output format of formatted ASCII text by also including the format="text" attribute.