Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
R
resolvers-yang
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • labs
  • resolvers-yang
  • Wiki
  • examples

Last edited by Ales Mrazek Sep 13, 2018
Page history

examples

Examples

All examples are located in examples/ directory.

Requirements:

  • Python 3.5+
  • resolvers-yang library must be installed.
  • yangson library

Using Python virtual environment is recommended. Look at devinstall

example-data.json

example-data.json is example of Json-encoded file, which is valid against resolvers-yang data model

You can edit this Json and validate it against data model using

    $ make validate

No output means that example-data.json is valid.

generate_conf.py

This script will generate unbound.conf and kresd.conf files in local files.

Run generate_conf.py script with path to Json file as parameter

    $ python generate_conf.py example-data.json

If generated unbound.conf is converted to JSON using unb_to_json.py script. The result do not have to be the same as input JSON for generate_conf.py script because the configuration designed to Knot Resolver is ignored for Unbound.

unb_to_json.py

This script will convert Unbound configuration text file unbound.conf to resolvers-yang data model valid Json-encoded file unb-data.json. As example configuration file can be used unbound.conf created by running generate_conf.py

Run unb_to_conf.py with path to unbound.conf as parameter

    $ python unb_to_json.py unbound.conf

No output means that the JSON data in created unb-data.json is valid.

If you generate another unbound.conf from this Json using generate_conf.py script, it should be equal to unbound.conf, which was used as input parameter to unb_to_json.py script.

Clone repository
  • datamodel
  • deckard
  • development
  • devinstall
  • examples
  • Home