oc-pyang icon indicating copy to clipboard operation
oc-pyang copied to clipboard

Script to generate models for openconfig/public

Open wenovus opened this issue 3 years ago • 0 comments

Some might want to browse through historical models, or just to look at their local models in their local openconfig/public repo. Having a script to auto-generate it using the .spec.yml files would be convenient.

Script to generate aft models:

#!/bin/bash
cd ${GOPATH}/src/github.com/openconfig/public/release/models

NIDOCS="ni-docs"
mkdir ${NIDOCS}
pyang --plugindir ${GOPATH}/src/github.com/openconfig/oc-pyang/openconfig_pyang/plugins/ network-instance/openconfig-network-instance.yang aft/openconfig-aft-network-instance.yang -p ../../ -f docs --doc-format html --strip-ns --doc-title ni > ${NIDOCS}/docs.html
pyang --plugindir ${GOPATH}/src/github.com/openconfig/oc-pyang/openconfig_pyang/plugins/ network-instance/openconfig-network-instance.yang aft/openconfig-aft-network-instance.yang -p ../../ -f oc-jstree --oc-jstree-no-path > ${NIDOCS}/ni.html

cp -r ${GOPATH}/src/github.com/openconfig/oc-pyang/openconfig_pyang/plugins/templates/css ${NIDOCS}
cp -r ${GOPATH}/src/github.com/openconfig/oc-pyang/openconfig_pyang/plugins/templates/js ${NIDOCS}

wenovus avatar Aug 26 '22 23:08 wenovus