cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
379
Views
0
Helpful
1
Replies

Sharing yang models between packages

paulohperes
Level 1
Level 1

Hello everyone,

I'm starting with NSO, about yang models, if I have a yang model that repeat trough serveral packages, I need create same yang model for a individual packages or a can share the model beteewen packages with a default dir with my yang models?

Thanks,

Paulo

1 Accepted Solution

Accepted Solutions

snovello
Cisco Employee
Cisco Employee
A yang model must reside in a package. You can have a package that only contains yang models if you want, for shared datatypes or groupings it seems like a good idea.

To make use of a yang model in a different package you first change the Makefile (in src/Makefile), so the ncsc yang compiler can see the referenced yang module. Look for YANGPATH, the comments in the Makefile explain what you need to do.

You should also update package-meta-data.xml to reference the required package (see https://developer.cisco.com/docs/nso/guides/#!development-guide-nso-packages/nso-packages)

View solution in original post

1 Reply 1

snovello
Cisco Employee
Cisco Employee
A yang model must reside in a package. You can have a package that only contains yang models if you want, for shared datatypes or groupings it seems like a good idea.

To make use of a yang model in a different package you first change the Makefile (in src/Makefile), so the ncsc yang compiler can see the referenced yang module. Look for YANGPATH, the comments in the Makefile explain what you need to do.

You should also update package-meta-data.xml to reference the required package (see https://developer.cisco.com/docs/nso/guides/#!development-guide-nso-packages/nso-packages)