08-15-2022
04:17 AM
- last edited on
05-08-2023
12:06 PM
by
Paul Zimmerman
Assume that we are building a new template based service package from scratch in NSO, so if we are creating .yang data model where it contains the data structure and hierarchy tree of a particular service, then why do we need XML / XPATH templates for building the service package? what is the benefit of XML/XPATH templates here? what i understand that NSO supports all device data templates according to NED's packages that is pre-loaded so if we are defining a new service package, then yang shall be enough for NSO to add new data tree in NSO CDB and then its the NED's job to take responsibility of building templates that matches this new data tree and translate it to something the device can understand.
so in my opinion if we are creating XML template for each name space then we are overriding NED's
Any ideas?
Solved! Go to Solution.
09-02-2022 10:36 AM
Hello matari.
When you are creating a service package, you are essentially mapping the requirements of your business context into the different devices and vendors of your network. We can think about them in layers, where our YANG file serves the purpose of shaping the inputs under this context, and the XML templates render the outputs of the service.
The information that you put in the YANG model serves as a definition of what your service is going to do. It must contain the bare minimum input data for what you intend to do, but you can add functionalities in order to have a very rich model such as validations with xpath (ex. data types, configs in target devices, etc), references to other service packages, and more.
After this, the purpose of the XML template is to take this input data and render it into the actual configurations for the different device types and vendors in your network. This is the layer which actually gives a shape to the payload that NSO will be pushing.
The detail here is that you don't need to provide all the data in the YANG model, just the bare minimum. The XML templates can have logic and hardcoded data as you see fit for what you intend to do. They can serve different applications, for example the applying of a Golden Template, where most of the values are static except for those passed from the YANG model.
In between these two layers, you can have custom python/java logic in order to add more functionalities, for example formatting the values, using different XML templates for each device so that the YANG is vendor-agnostic, etc.
Template-based services are normally used for RFS (Resource Facing Services), which are independent modules intended to provide very specific services to the devices.
There is an interesting lecture material from the NetDevOps series with more information
05-09-2023 03:04 AM
09-02-2022 10:36 AM
Hello matari.
When you are creating a service package, you are essentially mapping the requirements of your business context into the different devices and vendors of your network. We can think about them in layers, where our YANG file serves the purpose of shaping the inputs under this context, and the XML templates render the outputs of the service.
The information that you put in the YANG model serves as a definition of what your service is going to do. It must contain the bare minimum input data for what you intend to do, but you can add functionalities in order to have a very rich model such as validations with xpath (ex. data types, configs in target devices, etc), references to other service packages, and more.
After this, the purpose of the XML template is to take this input data and render it into the actual configurations for the different device types and vendors in your network. This is the layer which actually gives a shape to the payload that NSO will be pushing.
The detail here is that you don't need to provide all the data in the YANG model, just the bare minimum. The XML templates can have logic and hardcoded data as you see fit for what you intend to do. They can serve different applications, for example the applying of a Golden Template, where most of the values are static except for those passed from the YANG model.
In between these two layers, you can have custom python/java logic in order to add more functionalities, for example formatting the values, using different XML templates for each device so that the YANG is vendor-agnostic, etc.
Template-based services are normally used for RFS (Resource Facing Services), which are independent modules intended to provide very specific services to the devices.
There is an interesting lecture material from the NetDevOps series with more information
05-09-2023 03:04 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide