Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Automation Scripting User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Map Operational Mode Commands and Output Fields to Junos XML Notation

date_range 14-Jul-21

In SLAX and XSLT op scripts, you use tag elements from the Junos XML API to represent operational mode commands and output fields in the scripts. For the Junos XML equivalent of commands and output fields, consult the Junos XML API Operational Developer Reference.

You can also display the Junos XML tag elements for operational mode command output by directing the output from the command to the | display xml command:

content_copy zoom_out_map
user@host> command-string | display xml

For example:

content_copy zoom_out_map
user@host> show interfaces terse | display xml
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/10.0R1/junos">
    <interface-information xmlns="http://xml.juniper.net/junos/10.0RI0/junos-interface" junos:style="terse">
        <physical-interface>
            <name>dsc</name>
            <admin-status>up</admin-status>
            <oper-status>up</oper-status>
        </physical-interface>
        <physical-interface>
            <name>fxp0</name>
            <admin-status>up</admin-status>
            <oper-status>up</oper-status>
            <logical-interface>
                <name>fxp0.0</name>
                <admin-status>up</admin-status>
                <oper-status>up</oper-status>
                ...
footer-navigation