Git Product home page Git Product logo

orc's Introduction

ORC (OpenWrt RESTCONF)

This is a prototype implementation of RESTCONF for the OpenWrt system that utilizes the UCI configuration files as a datastore.

Requirements

  1. Python 3 for the YANG conversion script
  2. 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 what the ./yin2json/yin2json.py script does.

Annotations

Before YANG modules can be used with this implementation they have to be annotated with the extensions provided in /yang/openwrt-uci-extension.yang. An example of an annotated module is /yang/restconf-example.yang

Script

  1. Convert the YANG modules to be included to YIN and put them in one folder, i.e. /yin. For example with pyang
    pyang -f yin ./yang/restconf-example.yang -p ./yang -o ./yin/restconf-example.yin 
  2. Run the main.py script
    python3 ./yin2json/yin2json.py -y ./yin -o ./generated ./yin/restconf-example.yin ...
    This converts the YIN files and generates a .h file in ./generated that has to be included in /src/generated/yang.h

Building

  1. Clone this repository
  2. Docker pull mgranderath/openwrt-build
  3. docker run -v $(pwd):/restconf mgranderath/openwrt-build
  4. The generated .ipk will be in the build folder

Architecture

Architecture

Testing

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 following commands:

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 /test/common.yaml.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.