Automation Solution: Testing Data Models

If your automation solution relies on a back-end database with strict database schema you can stop reading… but if you (like most others) still live in the land of text files encoded in your favorite presentation format (because it’s hip to hate YAML), you might appreciate the solution Donald Johnson uses to check his data models before committing them into Git repository.

Explore our Network Automation Solutions Showcase to find other solutions created by the attendees of our Building Network Automation Solutions online course.

2 comments:

  1. We have something similar for GNS3 device templates. The check.py script validates all files in the appliances/ directory using the JSON schema files in the schemas/ directory.

    Maybe the wheel was re-invented :) but there's no need for users to edit python scripts when a new schema is introduced.
    Replies
    1. Agreed, would suggest using jsonschema as well, as it is becoming the de facto standard in Python. For Ansible specific use cases, I published this module a year or so ago. https://github.com/networktocode/ntc-ansible/blob/master/library/ntc_validate_schema.py
Add comment
Sidebar