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:
<rpc> <get-configuration commit-scripts="view"/> <!-- OR --> <get-configuration commit-scripts="view"> <!-- tag elements for the configuration elements to return --> </get-configuration> </rpc>
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:
<rpc> <get-configuration commit-scripts="apply"/> <!-- OR --> <get-configuration commit-scripts="apply"> <!-- tag elements for the configuration elements to return --> </get-configuration> </rpc>
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:
<rpc> <get-configuration commit-scripts="apply-no-transients"/> <!-- OR --> <get-configuration commit-scripts="apply-no-transients"> <!-- tag elements for the configuration elements to return --> </get-configuration> </rpc>
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:
changed
, which is described in Requesting Change Indicators for Configuration Elements Using the Junos XML Protocol.database
, which is described in Specifying the Source for Configuration Information Requests in a Junos XML Protocol Session.format
, when usingcommit-scripts="apply"
orcommit-scripts="apply-no-transients"
.groups
, which is described in Specifying the Output Format for Configuration Groups and Interface Ranges Using the Junos XML Protocol.inherit
, which is described in Specifying the Output Format for Configuration Groups and Interface Ranges Using the Junos XML Protocol.interface-ranges
, which is described in Specifying the Output Format for Configuration Groups and Interface Ranges Using the Junos XML Protocol.junos:key
, which is described in Requesting Identifier Indicators for Configuration Elements Using the Junos XML Protocol.
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.