ORC (OpenWrt RESTCONF)
This is a prototype implementation of RESTCONF for the OpenWrt system that utilizes the UCI configuration files as a datastore.
- Python 3 for the YANG conversion script
- Tool for converting YANG to YIN
Adding YANG modules
To add YANG modules for OpenWrt they have to go through some pre-processing. This is
./yin2json/yin2json.py script does.
Before YANG modules can be used with this implementation they have to be
annotated with the extensions provided in
An example of an annotated module is
- Convert the YANG modules to be included to YIN and put them in one folder, i.e.
/yin. For example with
pyang -f yin ./yang/restconf-example.yang -p ./yang -o ./yin/restconf-example.yin
- Run the
main.pyscriptThis converts the YIN files and generates a
python3 ./yin2json/yin2json.py -y ./yin -o ./generated ./yin/restconf-example.yin ...
./generatedthat has to be included in
- Clone this repository
Docker pull mgranderath/openwrt-build
docker run -v $(pwd):/restconf mgranderath/openwrt-build
- The generated
.ipkwill be in the
The tests are inside the
/test directory and are based on the Python
Tavern Testing Framework. After
installing the framework the tests can be run using either of the
tavern-ci ./test/test_restconf.tavern.yml # or py.test ./test/test_restconf.tavern.yml
This will run integration tests that check the actual implementation. The
url where the server is located can be changed in