processProviders

package
v0.0.0-...-8aeced7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

README

processProviders

The framework generates junos compatible terraform providers based on the input provided by the user. The provider remains independent of junos version and device type. The user needs to provide the device compatible yang files and the xpaths for which the provider is to be generated.

Steps to generate the providers

Pre-Requisite

Generate the yin file and xpath for the yang files with processYang module.

Steps

cd cmd/processyang

go build

./processProviders -config /var/tmp/config.toml

Update the xpath_list_to_be_generated.xml with the yin files, xpaths and group details.

The terraform api will be generated in the repository as provided inn config file .

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(source string, dest string)

copy file from source location to destination

func CreateProviders

func CreateProviders(jcfg cfg.Config) error

CreateProviders consumes a YANG file, Xpath file and module name to create a provider

func PrintHeader

func PrintHeader(message string)

PrintHeader accepts a message of any length (ideally no more than 80 chars) and pretty prints it in a box

Types

type ElementName

type ElementName struct {
	// contains filtered or unexported fields
}

ElementName is a helper type for traversing the data tree.

type FileList

type FileList struct {
	XMLName xml.Name `xml:"file-list"`
	XPaths  []path   `xml:"xpath"`
}

Struct to represent the XML structure

type Node

type Node struct {
	XMLName xml.Name
	Key     string `xml:"name,attr"`
	Val     string `xml:"value,attr"`
	Content []byte `xml:",innerxml"`
	Nodes   []Node `xml:",any"`
}

Node is a helper type for traversing the data tree.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL