cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1544
Views
0
Helpful
2
Replies

importing NEDs into service yang with NSO5.x

erdemk
Level 1
Level 1

Dear community members,

 

I couldn't figure out how to import NEDs into service yang in nso5.x.
I couldn't find an example in examples.ncs directory.
May be, things are now changed after CDM..
This is just to see how it is to be done.
Any help is appreciated.


FIRST, I LOOKED TO WHAT IS INCLUDED IN YANG AND XML FILES

A - NSO 4.7

A1 - ios

a) ned directory under nso-instance/packages/neds is cisco-ios

b) yang file for cisco-ios ned : tailf-ned-cisco-ios.yang
module tailf-ned-cisco-ios {
namespace "urn:ios";
prefix ios;

c) package-meta-data.xml
package name : cisco-ios


-->

in service yang file, we import like this :
import tailf-ned-cisco-ios {
prefix ios;
}

 

A2 - ios-xr

a) ned directory under nso-instance/packages/neds is cisco-iosxr

b) module tailf-ned-cisco-ios-xr {
namespace 'http://tail-f.com/ned/cisco-ios-xr';
prefix cisco-ios-xr;

c) package-meta-data.xml
package name : cisco-iosxr

d) in service yang file, we import ilke this :
import tailf-ned-cisco-ios-xr {
prefix cisco-ios-xr;
}


== > seems that, module name and prefix from yang files of each NED, namely tailf-ned-cisco-ios.yang and tailf-ned-cisco-ios-xr.yang respectively are used as import in service yang files.

 

B - NSO 5.3

a) directory under nso-instance/packages/neds is cisco-ios-cli-3.8

b) yang file for cisco-ios ned : tailf-ned-cisco-ios.yang ( file name is same as nso 4.7 neds ) ned version is cisco-ios-cli-3.8
module tailf-ned-cisco-ios {
namespace "urn:ios";
prefix ios;

c) package-meta-data.xml
package name : cisco-ios-cli-3.8


I tried following with no success, with module not found error each time :

 

import cisco-ios-cli-3.8 {
prefix cisco-ios-cli-3.8;
}
import tailf-ned-cisco-ios {
prefix ios;
}

import tailf-ned-cisco-ios-cli-3.8 {
prefix cisco-ios-cli-3.8;


(py3.6) erdem@erdem-VirtualBox:~/nso-5.3/ncs-run/packages/ll
total 16
drwxr-xr-x 4 erdem erdem 4096 Haz 30 16:10 ./
drwxr-xr-x 8 erdem erdem 4096 Haz 29 12:46 ../
lrwxrwxrwx 1 erdem erdem 37 Haz 30 16:08 cisco-ios-cli-3.8 -> ../../packages/neds/cisco-ios-cli-3.8/
lrwxrwxrwx 1 erdem erdem 40 Haz 30 16:10 cisco-iosxr-cli-7.19 -> ../../packages/neds/cisco-iosxr-cli-7.19/
lrwxrwxrwx 1 erdem erdem 37 Haz 30 16:09 cisco-nx-cli-5.14 -> ../../packages/neds/cisco-nx-cli-5.14/
lrwxrwxrwx 1 erdem erdem 38 Haz 30 16:09 huawei-vrp-cli-6.3 -> ../../packages/neds/huawei-vrp-cli-6.3/
drwxr-xr-x 7 erdem erdem 4096 Mar 11 00:20 multivendor/
drwxr-xr-x 7 erdem erdem 4096 Haz 30 14:22 svi/

 

Thanks and regards.

1 Accepted Solution

Accepted Solutions

tcragg1
Cisco Employee
Cisco Employee

There are 2 things you need to do to import a device NED into a service model. Firstly, you have to have the import statement in the service YANG. The import statement for the Cisco IOS/IOS-XE CLI NED should be the following:

 

import tailf-ned-cisco-ios {

  prefix ios;

}

 

On its own, this is not enough, as the service model will not be able to find the YANG for the device NED when you attempt to run a make on the service source files. To solve this, you add a YANGPATH entry to the Makefile for the service. The YANGPATH command you add will look something like this (there will probably be a similar line already in place but commented out in the Makefile):

 

YANGPATH += yangpath ../../cisco-ios-cli-3.8/src/ncsc-out/modules/yang

 

If you update to a newer version of the NED, you will need to update the YANGPATH directive and re-make the service to use the model from the newer NED version.

View solution in original post

2 Replies 2

tcragg1
Cisco Employee
Cisco Employee

There are 2 things you need to do to import a device NED into a service model. Firstly, you have to have the import statement in the service YANG. The import statement for the Cisco IOS/IOS-XE CLI NED should be the following:

 

import tailf-ned-cisco-ios {

  prefix ios;

}

 

On its own, this is not enough, as the service model will not be able to find the YANG for the device NED when you attempt to run a make on the service source files. To solve this, you add a YANGPATH entry to the Makefile for the service. The YANGPATH command you add will look something like this (there will probably be a similar line already in place but commented out in the Makefile):

 

YANGPATH += yangpath ../../cisco-ios-cli-3.8/src/ncsc-out/modules/yang

 

If you update to a newer version of the NED, you will need to update the YANGPATH directive and re-make the service to use the model from the newer NED version.

Thanks