cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
830
Views
15
Helpful
2
Replies

NSO template based service question

matari
Level 1
Level 1

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?

2 Accepted Solutions

Accepted Solutions

Asandovalros
Cisco Employee
Cisco Employee

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

View solution in original post

snovello
Cisco Employee
Cisco Employee
The short answer is that the yang defines data structure and api contracts. Your templates and coded logic decide what to provision. The Ned provides a device model so if your service wants to create configuration there is a language for you to exprsss that. So no overlaps here.
I suggest you look at the training about building a service in nso. That will clarify.

View solution in original post

2 Replies 2

Asandovalros
Cisco Employee
Cisco Employee

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

snovello
Cisco Employee
Cisco Employee
The short answer is that the yang defines data structure and api contracts. Your templates and coded logic decide what to provision. The Ned provides a device model so if your service wants to create configuration there is a language for you to exprsss that. So no overlaps here.
I suggest you look at the training about building a service in nso. That will clarify.