-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Description
Use a YANG model to have a clear schema for the PED files. This can also serve as input to IETF work.
Developments: https://github.com/mpeuster/tng-sdk-benchmark/blob/feature-73/models/
YANG background
- Wikipedia (lots of useful pointers to RFCs etc.)
- RFC7950 YANG Data Modeling Language
- https://blogs.cisco.com/getyourbuildon/yang-opensource-tools-for-data-modeling-driven-management
- https://wiki.onosproject.org/display/ONOS/YANG+Tools
- https://whatis.techtarget.com/definition/YANG-data-modeling-language
- YANG for Dummies
- Learning YANG
Examples
Tooling
Custom toolchain called from Makefile.
The toolchain automatically generates different model documentations in doc/ (txt tree, html tree, uml). It also generates the Python model (ietf_ped_model.py) and finally it checks the example PEDs (*.yaml) against this model by loading them into the model.
Requirements:
pip install pyang pyangbindpyangalso needs to be install system wide to have correct paths to schema artefacts in system dirs
Call:
# validate model, build model, and test examples
make
# single targets
make validate # validate the model against ietf rules
make build # generate the python code model
make test # test the example PED files against modelTODOs Toolchain
- setup tooling (editor, pyang generation, documentation in README)
- create
modelsfolder in repo - initial model to play with https://github.com/mpeuster/tng-sdk-benchmark/blob/feature-73/models/ped.yang
- tool to validate PED file (*.yml) against YANG model: Custom build
- Jenkins integration (can we also trigger tests etc. with pytest? tox?)
- Problem:
mandatoryfields are not mandatory in validation (ignore this for now) - ...
TODOs Model
- complete model
- be more specific with units like CIDRs for addresses
- be more specific in many of the
stringtypes. Seepatternkeyword.
TODO Implementation
- make should place generated model to the right place in the source tree
- update implementation to support new model
Goal
Replace all legacy interactions with the PED model inside tng-sdk-bench with a pyang/pybind based solution using generated Python code.
Reactions are currently unavailable