Code Monkey home page Code Monkey logo

yang-utils's Introduction

Misc tools and scripts for working with yang models

This repo is just a random collection of tools and scripts that I use to work with yang models

note: that most of these are "spaghetti code"

validating and finding argumenting models

This script is something that I (quickly) slapped together to to make ydk-gen working. I had a bunch of issues validating the Cisco-IOS-XE-native.yang model and understanding how it all worked together..

Basically it does the following:

  1. loads all the models in the "model_path" path into a libyang collection
  2. loads the "model_name" and validates that.
  3. find all the models in the "model_path" that implements an Yang argument (extends a model)
  4. find all the "dead-end" containers in the "model_name"
    • dead-end container is an empty container without leafs, leaflists etc.
    • usually you would think a dead-end container would not implement the "presence".. eg. if the presence is set, then it would not be dead-end, but sometimes it actually does have that set and still there is a model that arguments it.
  5. Then maps all the "argumenting" models into dead-end containers so we can find "upstream" models that we want to include in the yang-model-set to get a complete model.
  6. finally prints some stats..

edit the model_path and model_name and just run it ;-)

yang-utils's People

Contributors

hyberdk avatar

Watchers

 avatar  avatar

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.