At Network to Code, we’re happy to announce that Yangify has been officially released and is the first project of many that’ll be released over the coming months that’ll be the foundation of the Rosetta RESTCONF API, the industry’s first open source model-driven HTTP-based API.
At its core, Yangify is a parsing and translation engine built for model-driven network automation using YANG as the de facto standards-based modeling language.
Here is a short description of each core function of Yangify:
Parsing: any configuration and operational commands (from devices) parsed will generate normalized JSON data that maps to the YANG model; we commonly refer to this data as Yangify’d JSON.
Translating: Any Yangify’d JSON (generated by users and automation systems) gets translated into the required CLI commands (or APIs) that need to get applied to the device.
YANG Models
YANG models are the foundation of what Yangify does. In order to use Yangify, you’ll need to have access to YANG models. These can be standards based models from groups like OpenConfig or IETF or custom models, as we alluded to in our last post. You’ll just need to document the location of your models so Yangify knows where to look for them. All of this can be seen in the tutorials found in the docs.
Yangify Parsing
The following visuals represent what parsing in Yangify is all about:
Yangify Translating
The following visuals represent what translating in Yangify is all about:
Why Yangify?
It’s quite simple. Yangify is a framework that brings structure and sanity for working with YANG based data. Yangify is actually built on top of yangson, so you could in theory do what Yangify is doing manually by only using yangson for model validation, but then no parser or translator would look alike or follow the same patterns. Our goal is to provide the framework, structure, and repository for all parsers and translators so we can work together as in industry to solve problems in a more efficient manner. Additionally, there is still the need in the industry to have more useful and usable YANG tools, and Yangify will play a part in growing the adoption of consuming YANG data models for network automation.
Does this all sound amazing? Want to know more about how Network to Code can help you do this, reach out to our sales team. If you want to help make this a reality for our clients, check out our careers page.
Imagine being able to use a single API to communicate with any piece of network equipment regardless of vendor. Imagine if this API used standards-based YANG models and even permitted the use of custom YANG models. Imagine if this API was open source.
Within the next few months, you won’t have to imagine anymore. Network to Code has been working hard to make this a reality.
The Problem Statement
Before we look at the solution, let’s level-set the problem.
While many of the modern network operating systems (NOSs) offer APIs nowadays, many of them are unique per vendor, or worse, they are unique per platform. Of course, there are still even more legacy platforms in production without API support. Those devices offer SSH access to the device’s command line interface (CLI). In both of these use cases, the data returned from a command or API call is vendor-specific.
Note: While we know a few vendors have added support for vendor-neutral data models, they are few and far between, are often buggy, and often lack parity with other platforms and vendors.
If the data returned is vendor-specific, it means that to consume the data and streamline network automation activities, there needs to be some level of data normalization. The act of normalization needs to consider both text parsing for legacy devices and transforming already structured data such as JSON/XML into the normalized and desired-state structured data. Moreover, for a comprehensive solution that also includes configuration management, the normalization process needs to have ways to translate the normalized data back into the vendor’s native configuration (specific CLI commands or structured data).
The Solution
The easy response to this is that all vendors and devices should support the same models and APIs (and we agree!). However, it’ll be a while. The industry moves slowly. While progress is being made in the industry on routers and switches, consider different device types like firewalls and load balancers. There is still much work to be done here (more vendor support and demand from buyers is needed).
Network to Code to Open Source Model Driven Programmability API Framework
In order to mitigate the problem at hand and move the industry forward, Network to Code will be open sourcing four different projects creating a vendor-neutral and extensible RESTCONF API. This API will be able to talk to any device with any OS including legacy devices that only support SSH.
The four projects we’ll be releasing, in the order of which they’ll be released:
Yangify
Yangify is an engine that focuses on parsing and translating native configuration into JSON-encoded YANG data using native Python in contrast to a domain specific language (DSL). It takes native configuration from the likes of show commands and creates a structured and methodical approach to create JSON data that adheres to YANG models. It also translates YANGify’d JSON into the native configuration (CLI commands or native JSON/XML). For anyone that has been doing any text parsing on their journey already, Yangify is analogous to TextFSM, although Yangify parses and translates, not just parses.
Rosetta
Rosetta provides two core functions. First, the Rosetta project will store all Yangify parsers and translators. Second, it’ll provide an intuitive Python interface to consume all of the parsers and translators. Rosetta is analogous to ntc-templates with the TextFSM analogy.
NTC YANG Models
Standards-based YANG models are actually quite complex and nested and usually have a steep learning curve. These models need to account for nearly every use case a feature may have. In order to obtain the benefits model-driven APIs, but make them easier to consume and practical for most Enterprises, this project will contain a combination of stripped down standards-based YANG models and extremely simplified models focused on the core feature sets often found in Enterprise networks.
Rosetta RESTCONF API
The capstone to all of this is a lightweight RESTCONF API that brings together all of the aforementioned functionality, but also integrates southbound connectivity to network devices making this a complete multi-vendor API. The API will communicate with network devices while parsing and translating native configurations in real-time. The Rosetta RESTCONF API will also support candidate configurations and the ability to hook into other systems using the Python API, configurable and triggered on any incoming API call. In order to achieve device connectivity, NAPALM will be used within the Rosett RESTCONF API.
Bringing everything that will be open sourced and combining it with NAPALM, the following is a visual representation of what the full stack looks like for the Rosetta RESTCONF API.
The Rosetta RESTCONF API
I’d also like to extend a huge thanks to David Barroso for the core development of these projects and helping make them a reality.
Interested to hear more? Feel free to reach out! Otherwise, come back next week to hear more about Yangify, when it gets released.
Does this all sound amazing? Want to know more about how Network to Code can help you do this, reach out to our sales team. If you want to help make this a reality for our clients, check out our careers page.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies. In case of sale of your personal information, you may opt out by using the link Do not sell my personal information. Privacy | Cookies
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
__hssc
30 minutes
HubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.
__hssrc
session
This cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.
cookielawinfo-checkbox-advertisement
1 year
Set by the GDPR Cookie Consent plugin, this cookie records the user consent for the cookies in the "Advertisement" category.
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
CookieLawInfoConsent
1 year
CookieYes sets this cookie to record the default button state of the corresponding category and the status of CCPA. It works only in coordination with the primary cookie.
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Cookie
Duration
Description
__cf_bm
30 minutes
Cloudflare set the cookie to support Cloudflare Bot Management.
li_gc
5 months 27 days
Linkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.
lidc
1 day
LinkedIn sets the lidc cookie to facilitate data center selection.
UserMatchHistory
1 month
LinkedIn sets this cookie for LinkedIn Ads ID syncing.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Cookie
Duration
Description
__hstc
5 months 27 days
Hubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).
_ga
1 year 1 month 4 days
Google Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.
_gat_gtag_UA_*
1 minute
Google Analytics sets this cookie to store a unique user ID.
_gid
1 day
Google Analytics sets this cookie to store information on how visitors use a website while also creating an analytics report of the website's performance. Some of the collected data includes the number of visitors, their source, and the pages they visit anonymously.
AnalyticsSyncHistory
1 month
Linkedin set this cookie to store information about the time a sync took place with the lms_analytics cookie.
CONSENT
2 years
YouTube sets this cookie via embedded YouTube videos and registers anonymous statistical data.
hubspotutk
5 months 27 days
HubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.
ln_or
1 day
Linkedin sets this cookie to registers statistical data on users' behaviour on the website for internal analytics.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Cookie
Duration
Description
bcookie
1 year
LinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.
bscookie
1 year
LinkedIn sets this cookie to store performed actions on the website.
li_sugr
3 months
LinkedIn sets this cookie to collect user behaviour data to optimise the website and make advertisements on the website more relevant.
VISITOR_INFO1_LIVE
5 months 27 days
YouTube sets this cookie to measure bandwidth, determining whether the user gets the new or old player interface.
YSC
session
Youtube sets this cookie to track the views of embedded videos on Youtube pages.
yt-remote-connected-devices
never
YouTube sets this cookie to store the user's video preferences using embedded YouTube videos.
yt-remote-device-id
never
YouTube sets this cookie to store the user's video preferences using embedded YouTube videos.
yt.innertube::nextId
never
YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.
yt.innertube::requests
never
YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.