cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1069
Views
2
Helpful
3
Replies

NED config YANG modules not showing in "get-schema".

rogaglia
Cisco Employee
Cisco Employee

Hi,

Anyone could help me on why NED config YANG modules are not shown in “get-schema” via NSO NETCONF northbound API and how to add them? I have a northbound system that uses the “get-schema” option.

Roque

1 Accepted Solution

Accepted Solutions

Jan Lindblad
Cisco Employee
Cisco Employee

At first, it sounds kind of obvious that device YANG models should be possible to retrieve using get-schema. All YANGs should, right? But the devil's in the details.

As you know, when NSO compiles the device YANGs, it also rewrites them so that they augment /devices/device. The compiler still keeps the namespace string intact, however, so that the device will recognize the XML as its own. So if we let users retrieve these rewritten YANG models using get-schema, still having the same namespace string as the real device models, this could lead to confusion, and we'd be at fault. So this has been disabled.

There may be no perfect way of dealing with this, but of course some kind of alternate behavior could be devised. Before you write that feature request, however, consider what's going to be released in just a few weeks: common data models (CDM). With CDM in place, a given namespace may actually translate to multiple versions of YANGs. Which one should we return at get-schema? If get-schema was a bit weakly defined in the traditional NSO world, it's completely lost in the CDM world.

So I think get-schema for device models is problematic and will only get more so as our world grows away from the simple place where get-schema comes from. What you could do is to invent your own get-schema operation that takes relevant input and does the right thing in your environment.

View solution in original post

3 Replies 3

Jan Lindblad
Cisco Employee
Cisco Employee

At first, it sounds kind of obvious that device YANG models should be possible to retrieve using get-schema. All YANGs should, right? But the devil's in the details.

As you know, when NSO compiles the device YANGs, it also rewrites them so that they augment /devices/device. The compiler still keeps the namespace string intact, however, so that the device will recognize the XML as its own. So if we let users retrieve these rewritten YANG models using get-schema, still having the same namespace string as the real device models, this could lead to confusion, and we'd be at fault. So this has been disabled.

There may be no perfect way of dealing with this, but of course some kind of alternate behavior could be devised. Before you write that feature request, however, consider what's going to be released in just a few weeks: common data models (CDM). With CDM in place, a given namespace may actually translate to multiple versions of YANGs. Which one should we return at get-schema? If get-schema was a bit weakly defined in the traditional NSO world, it's completely lost in the CDM world.

So I think get-schema for device models is problematic and will only get more so as our world grows away from the simple place where get-schema comes from. What you could do is to invent your own get-schema operation that takes relevant input and does the right thing in your environment.

Hi Jan,

Thanks for your answer.

How are config modules different than other modules? I mean that there are modules for stats or ned-settings that augment /ncs:devices/ncs:device, just not the config tree.

Roque

Hiro Takahashi
Cisco Employee
Cisco Employee

Hello Roque,

This might not be perfect, but manually loading schema could be a workaround.


$ ncs --addloadpath packages/cisco-ios/src/yang/

Best regards,

Hiro