Vyatta Network OS Documentation

Learn how to install, configure and operate the Vyatta NOS, which helps drive our virtual networking & physical platforms portfolio.

Display specific parts of YANG files, in a tree-like structure

An example of how to use the tree-path option in the pyang utility to display a specific part of the YANG information structure.

Note: It's best to run pyang in the directory that contains all the YANG files. Otherwise, pyang may not find the imported modules.
Use pyang to display the interfaces/dataplane/ip YANG subtree based on the content of all YANG files in the current directory.
$ pyang -f tree --tree-path=interfaces/dataplane/ip *.yang
You can see a range of prefixes in the output:
module: vyatta-interfaces-v1
  +--rw interfaces
     +--rw vyatta-interfaces-dataplane-v1:dataplane* [tagnode]
        +--rw vyatta-interfaces-dataplane-v1:ip
           +--rw vyatta-interfaces-dataplane-v1:enable-proxy-arp?       empty
           +--rw vyatta-interfaces-dataplane-v1:rpf-check?              enumeration
           +--rw vyatta-interfaces-dataplane-v1:gratuitous-arp-count?   uint32
           +--rw vyatta-interfaces-dataplane-v1:gratuitous-arp
           |  +--rw vyatta-interfaces-dataplane-v1:request? garp-packet-action
           |  +--rw vyatta-interfaces-dataplane-v1:reply?   garp-packet-action
           +--rw vyatta-interfaces-dataplane-v1:disable-forwarding? empty
           +--rw vyatta-interfaces-dataplane-unnumbered-v1:unnumbered
           |  +--rw vyatta-interfaces-dataplane-unnumbered-v1:donor-interface* [tagnode]
           |     +--rw vyatta-interfaces-dataplane-unnumbered-v1:tagnode            union
           |     +--rw vyatta-interfaces-dataplane-unnumbered-v1:preferred-address? types:ipv4-address
           +--rw vyatta-interfaces-tcp-mss-v1:tcp-mss!
           |  +--rw vyatta-interfaces-tcp-mss-v1:limit?     uint16
           |  +--rw vyatta-interfaces-tcp-mss-v1:mtu?       empty
           |  +--rw vyatta-interfaces-tcp-mss-v1:mtu-minus? uint16
           +--rw vyatta-protocols-igmp-v1:igmp!
           |  +--rw vyatta-protocols-igmp-v1:querier!
           |  |  +--rw vyatta-protocols-igmp-v1:forced?             empty
           |  |  +--rw vyatta-protocols-igmp-v1:querier-timeout?    uint32