Showing results for 
Search instead for 
Did you mean: 
Cisco Employee

Model bundles introduced in YDK 0.5.0

Model bundles were one of the major enhancements introduced in YDK 0.5.0 .  With bundles, model APIs are grouped by model family.  This represents a significant change to how YDK is packaged.  Before YDK 0.5.0, the YDK Python package was monolithic.  It grouped all core functionality (services and service providers) and all model APIs (Cisco IOS XR, OpenConfig, IETF, etc):

$ pip list | grep ydk
ydk (0.4.2)

Starting in YDK 0.5.0, the core YDK package is limited to core functionality (services and service providers).  Model APIs are grouped in separate packages (model bundles) by model family (Cisco IOS XR, OpenConfig, IETF, etc):

$ pip list | grep ydk
ydk (0.5.0)
ydk-models-cisco-ios-xr (0.1.0)
ydk-models-ietf (0.1.0)
ydk-models-openconfig (0.1.0)

This new modular packaging allows you individually install and upgrade the model APIs you care about.  Python packaging takes care of the dependencies among model bundles and between bundles and the core package.  You can find the steps to install the core YDK package and the individual model bundles in the YDK-Py README .

Does this new packaging affect current YDK apps?  You need to introduce a minor change in how you import model modules.  The path to a model API now reflects the model bundle it belongs to.  Before YDK 0.5.0, model APIs where loosely grouped based on a substring of the model name.   For the Cisco-IOS-XR-ip-ntp-cfg model, the import statement was:

import ydk.models.ip.Cisco_IOS_XR_ip_ntp_cfg

In YDK 0.5.0, this model is part of the cisco-ios-xr bundle and the import statement becomes:

import ydk.models.cisco_ios_xr.Cisco_IOS_XR_ip_ntp_cfg

No other change should be required on applications that could run on YDK 0.4.2.

Need further examples?  Take a look at the ydk-py-samples repository.

Happy coding!

Recognize Your Peers
Content for Community-Ad