package
0.0.0-20240722162049-70b25efa5392
Repository: https://github.com/juniper/junos-terraform.git
Documentation: pkg.go.dev

# README

processYang

This module is to be used to generate yin files from yang files for which terraform api's are to be generated.

Yang file Details to be checked

Check the correct version and device type for the yang files. Yang files for junos devices can be downloaded from the following github repo -

https://github.com/Juniper/yang.git

Generate yin files and xpaths from the yang files

Yin files are an xml representation of the yang files. It makes it easier for the golang code to understand the data. All the xpaths are generated for a corresponding yang file. User can refer it while generating terraform api for the yang model. Refer following links for more details regarding yin files and xpaths

To generate yin file and xpath follow the following steps.

  1. Copy yang files to a particular repository on the device.
  2. Execute the following command -

cd cmd/processyang

go build

./processYang -config /var/tmp/config.toml

The yin-files and xpath-files will be generated in the same repository.

The Sample config file are provided in jtaf/Samples/config.toml . The same arguments can also be passed from command line during binary execution .

# Functions

Create Yin files from Yang files and also generate the xpath for the elements.
PrintHeader accepts a message of any length (ideally no more than 80 chars) and pretty prints it in a box.

# Structs

Node is a helper type for traversing the data tree.