Displaying CLI Output as XML Tag Elements
To display the output from a CLI command as NETCONF and Junos XML tag elements instead of as the default formatted ASCII, pipe the command to the display xml command. Infrastructure tag elements in the response belong to the Junos XML management protocol instead of the NETCONF XML management protocol. The tag elements that describe Junos OS configuration or operational data belong to the Junos XML API, which defines the Junos content that can be retrieved and manipulated by both the Junos XML management protocol and the NETCONF XML management protocol operations.
The following example shows the output from the show chassis hardware command issued on an M20 router that is running the initial version of Junos OS Release 10.3 (the opening <chassis-inventory> tag appears on two lines for legibility only):
<rpc-reply xmlns:junos=”http://xml.juniper.net/junos/10.3R1/junos”>
<chassis-inventory \
xmlns="http://xml.juniper.net/junos/10.3R1/junos-chassis">
<chassis junos:style="inventory">
<name>Chassis</name>
<serial-number>00118</serial-number>
<description>M20</description>
<chassis-module>
<name>Backplane</name>
<version>REV 06</version>
<part-number>710-001517</part-number>
<serial-number>AB5911</serial-number>
</chassis-module>
<chassis-module>
<name>Power Supply A</name>
<!-- other child tags of <chassis-module> -->
</chassis-module>
<!-- other child tags of <chassis> -->
</chassis>
</chassis-inventory>
</rpc-reply>
]]>]]>
Hide Navigation Pane
Show Navigation Pane
Download
SHA1