The YANG module in YANG Version 1.1 is advertised through the ietf-yang-library instead of the NETCONF hello messages. The following example shows the NETCONF RPC that retrieves a list of all the YANG modules supported by a device: xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101"> xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library"/> The output of the RPC reply contains a list of all the YANG modules regardless of the YANG version each module uses. Cisco IOS XE Cupertino 17.7.1 uses the YANG Version 1.0; however, you can still download the YANG Version 1.1 from GitHub at https://github.com/YangModels/yang/tree/master/vendor/cisco/xe .
Alternatively, you can also download the YANG models from the device using the NETCONF get-schema operation, and migrate the downloaded models to this version using the migrate_yang_version.py script. The following example shows how to migrate from YANG Version 1.0 to YANG Version 1.1 using the script: migrate_yang_version.py [-h] [--out OUT] path Use the help command to view the options available with the script: python migrate_yang_version.py --help usage: migrate_yang_version.py [-h] [--out OUT] path positional arguments: path Path to the YANG files optional arguments:
-h, --help show this help message and exit --out OUT Path to the output YANG file The following example shows how to use the out argument to move a file from its original location to another folder: python migrate_yang_version.py --out testdir/outdir testdir/indir In the above example, testdir/outdir is the directory in which the YANG model Version 1.1 resides or where the output of the script is placed. This directory will be created, if it is not available. The testdir/indir directory is where the YANG model Version 1.0 resides; the input for the script.
After the YANG model Version 1.1 is created, either by downloading it from GitHub or by using the migrate_yang_version.py script and compiled on the client application, end-to-end YANG model tests can be executed and validated against Cisco IOS XE devices. Model-Driven Programmability YANG Model Version 1.1 Programmability Configuration Guide, Cisco IOS XE 17.16.x 159