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

Regarding platform-specific yang model

anibhara
Cisco Employee
Cisco Employee

Hi Team,

 

You can see that in the link below there are some platform-specific yang models such as Cisco-IOS-XR-fretta-dnx-lpts-oper.yang, Cisco-IOS-XR-spitfire-lpts-oper.yang, Cisco-IOS-XR-asr9k-lpts-oper.yang

https://wwwin-opengrok.cisco.com/xr-dev/search?full=PlatformLPTSPIfib&defs=&refs=&path=&type=&si=ful...

 

Which is not present in http://ydk.cisco.com/py/docs/

 

Looks like they are not compiled to ydk lib since importing them throws an error:

 

>>> import ydk.models.cisco_ios_xr.Cisco_IOS_XR_fretta_dnx_lpts_oper
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_fretta_dnx_lpts_oper'

 

>>> import ydk.models.cisco_ios_xr.Cisco_IOS_XR_spitfire_lpts_oper
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_spitfire_lpts_oper'

 

However, I am able to import this: CISCO_IOS_XR_asr9k_lpts_oper

>>> import ydk.models.cisco_ios_xr.Cisco_IOS_XR_asr9k_lpts_oper
>>>

 

Any idea of how I can import and use Cisco-IOS-XR-fretta-dnx-lpts-oper.yang, Cisco-IOS-XR-spitfire-lpts-oper.yang

 

1 Reply 1

yangorelik
Spotlight
Spotlight

In any case when your set of models is different from those offered in www.Pipy.org repository, you need to build your own model package. The package generation process is described here. The most important part of the process is building profile of the bundle. The most resent documentation on profiles is presented here. You also can find multiple examples of profiles under path: ydk-gen/profiles/bundles.

Please note that for your purpose you might not need all the XR related yang files. You might choose very limited but sufficient set of YANG files, which is needed for your application. To make sure that set of models is complete in your model repository (directory), you need to run command 'pyang *.yang' in that directory; if the set is complete the pyang will not produce any errors. Important to note that YDK is working only with YANG version 1.0 and pyang version 1.6.

Please let me know if you are facing issues and I will try to help you.

Yan Gorelik
YDK Solutions