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:
In YDK 0.5.0, this model is part of the cisco-ios-xr bundle and the import statement becomes:
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.