Augment Existing IETF L2vpn YANG Model: We have a UI validation Framework. For the framework to be able to provide custom validations we need to add the following annotation to policy field in L2vpn model -ietf-l2vpn-ntw:vpn-servicevpn-nodesvpn-node0te-service-mappingte-mappingsr-policypolicy          tailf:meta-data "ui-data-validation" {            tailf:meta-value "leaf-validation";          }Is there a way to change the existing l2vpn model for the next NSO CFP build?
Hi Mukul,Here's an example for L3, you can leverage this for L2 as well. You need to create a separate yang file for annotations. I have attached test-ann.yang as an example on how to create annotations.<sup>Also keep in mind that just having the annotations yang file is not enough the L3 package in my example would need to be recompiled, but we have to specify the annotations yang file when recompiling:</sup><sup></sup><sup>Thanks,</sup><sup>Regi</sup>Hi,Thank you. To start with I copied the IETF-L2VPN package and unzipped it. I got the following files -ubuntudoc@ubuntudoc:~/temp$ tar -xvf ncs-5.7.2.1-ietf-l2vpn-nm-EXAMPLE-4.0.0.tar.gz ietf-l2vpn-nm/ietf-l2vpn-nm/CHANGESietf-l2vpn-nm/README.mdietf-l2vpn-nm/package-meta-data.xmlietf-l2vpn-nm/python/ietf-l2vpn-nm/python/ietf_l2vpn_nm/ietf-l2vpn-nm/python/ietf_l2vpn_nm/ietf_l2vpn_nm_actions.pyietf-l2vpn-nm/python/ietf_l2vpn_nm/ietf_l2vpn_nm_nano_plan.pyietf-l2vpn-nm/python/ietf_l2vpn_nm/ietf_l2vpn_nm_y1731.pyietf-l2vpn-nm/python/ietf_l2vpn_nm/main.pyietf-l2vpn-nm/python/ietf_l2vpn_nm/utils.pyietf-l2vpn-nm/src/ietf-l2vpn-nm/src/yang/ietf-l2vpn-nm/src/yang/ietf-ethertypes@2019-03-04.yangietf-l2vpn-nm/src/yang/ietf-inet-types@2010-09-24.yangietf-l2vpn-nm/src/yang/ietf-l2vpn-ntw-cisco-augmentations.yangietf-l2vpn-nm/src/yang/ietf-l2vpn-ntw-deviations.yangietf-l2vpn-nm/src/yang/ietf-l2vpn-ntw-nano-services.yangietf-l2vpn-nm/src/yang/ietf-l2vpn-ntw.yangietf-l2vpn-nm/src/yang/ietf-packet-fields@2019-03-04.yangietf-l2vpn-nm/src/yang/ietf-routing-types@2017-02-19.yangietf-l2vpn-nm/src/yang/ietf-vpn-common-oper-status-aa-ext.yangietf-l2vpn-nm/src/yang/ietf-vpn-common.yangietf-l2vpn-nm/src/java/ietf-l2vpn-nm/src/java/src/ietf-l2vpn-nm/templates/ietf-l2vpn-nm/templates/ietf-l2nm-l2vpn-evpn-mp-template.xmlietf-l2vpn-nm/templates/ietf-l2nm-l2vpn-template.xmlietf-l2vpn-nm/templates/ietf-l2nm-y1731-l2vpn-y1731-template.xmlietf-l2vpn-nm/load-dir/ietf-l2vpn-nm/load-dir/ietf-l2vpn-ntw-cisco-augmentations.fxsietf-l2vpn-nm/load-dir/ietf-ethertypes@2019-03-04.fxsietf-l2vpn-nm/load-dir/ietf-routing-types@2017-02-19.fxsietf-l2vpn-nm/load-dir/ietf-vpn-common.fxsietf-l2vpn-nm/load-dir/ietf-vpn-common-oper-status-aa-ext.fxsietf-l2vpn-nm/load-dir/ietf-l2vpn-ntw-nano-services.fxsietf-l2vpn-nm/load-dir/ietf-l2vpn-ntw.fxsietf-l2vpn-nm/load-dir/ietf-l2vpn-ntw-deviations.fxsietf-l2vpn-nm/load-dir/ietf-packet-fields@2019-03-04.fxsietf-l2vpn-nm/load-dir/ietf-inet-types@2010-09-24.fxsietf-l2vpn-nm/build-meta-data.xmlI created a ietf-l2vpn-nm/src/yang/ui-validation.yang with following contents (changing from the YANG you had provided)module ui-validation { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ui-validation"; prefix ui-validation; import tailf-common { prefix tailf; } import ietf-l2vpn-ntw { prefix ietf-l2vpn-ntw; } revision 2022-03-14 {  description "Initial revision."; } // annotate a single path tailf:annotate "/ietf-l2vpn-ntw:l2vpn-ntw/ietf-l2vpn-ntw:vpn-services/ietf-l2vpn-ntw:vpn-service/ietf-l2vpn-ntw:vpn-nodes/ietf-l2vpn-ntw:vpn-node/ietf-l2vpn-ntw:te-service-mapping/ietf-l2vpn-ntw:te-mapping/ietf-l2vpn-ntw:sr-policy/ietf-l2vpn-ntw:policy" {  tailf:meta-data "ui-data-validation" {  tailf:meta-value "leaf-validation";   } }}1. I'm not sure how to construct the whole path?2. How do I recompile this package back?ubuntudoc@ubuntudoc:~/temp$ ncsc --annotate ietf-l2vpn-nm/src/yang/ui-validation.yangncsc:    Try 'ncsc -h' for help and more informationHi Mukul,I've update the ticket with the makefile we use for `ietf-l2vpn-ntw` as well as updated it to include the annotation yang file you have ( tried to match your directory structure ).If you look in the Makefile you can see that I have added:<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"><pre>--annotate ./yang/ui-validation.yang</pre></div></div>Now you just have to run "make clean all" to recompile the package.Thanks,RegiOne more thing your xpath is incorrect. Look at the xpath for "sr-policy" in "ietf-l2vpn-ntw-deviations.yang" as an exampleThanks. I updated the yang path to -/l2vpn-ntw:l2vpn-ntw/l2vpn-ntw:vpn-services/l2vpn-ntw:vpn-service/l2vpn-ntw:vpn-nodes/l2vpn-ntw:vpn-node/l2vpn-ntw:te-service-mapping/l2vpn-ntw:te-mapping/l2vpn-ntw:te/l2vpn-ntw:sr-policy/l2vpn-ntw:sr-policy/l2vpn-ntw:policyfrom the ietf-l2vpn-ntw-deviations.yangI placed your MakeFile under src/ and ran "make clean all" ; It looks like a lot of packages were not found -ubuntudoc@ubuntudoc:~/temp/ietf-l2vpn-nm/src$ make clean allrm -rf ../load-dir java/src//mkdir -p ../load-dirmkdir -p java/src///opt/ncs/current/bin/ncsc --annotate ./yang/ui-validation.yang --deviation ./yang/ietf-l2vpn-ntw-deviations.yang --fail-on-warnings `ls ietf-l2vpn-ntw-cisco-augmentations-ann.yang > /dev/null 2>;1 ;; echo "-a ietf-l2vpn-ntw-cisco-augmentations-ann.yang"`       --yangpath ./yang --yangpath ../../cisco-flat-L2vpn-fp/src/yang --yangpath ../../custom-template-utils/src/yang --yangpath ../../core-fp-common/src/yang --yangpath ../../resource-manager/src/yang --yangpath ../../cisco-tsdn-core-fp-common/src/yang --yangpath ../../lsa-utils/src/yang -c -o ../load-dir/ietf-l2vpn-ntw-cisco-augmentations.fxs yang/ietf-l2vpn-ntw-cisco-augmentations.yang./yang/ietf-l2vpn-ntw-deviations.yang:10: error: module 'lsa-utils' not found./yang/ietf-l2vpn-ntw-deviations.yang:163: error: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not found./yang/ietf-l2vpn-ntw-deviations.yang:167: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not found./yang/ietf-l2vpn-ntw-deviations.yang:167: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not found./yang/ietf-l2vpn-ntw-deviations.yang:339: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not found./yang/ietf-l2vpn-ntw-deviations.yang:339: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not found./yang/ietf-l2vpn-ntw.yang:7: error: module 'custom-template-hook' not found./yang/ietf-l2vpn-ntw.yang:11: error: module 'cisco-flat-L2vpn-fp' not found./yang/ietf-l2vpn-ntw.yang:12: error: module 'cisco-tsdn-core-fp-common' not found./yang/ietf-l2vpn-ntw.yang:13: error: module 'lsa-utils' not found./yang/ietf-l2vpn-ntw.yang:40: error: module 'resource-allocator' not found./yang/ietf-l2vpn-ntw.yang:43: error: module 'id-allocator' not found./yang/ietf-l2vpn-ntw.yang:1277: error: the node 'resource-pools' from module 'resource-allocator' is not found./yang/ietf-l2vpn-ntw.yang:1284: error: the node 'resource-pools' from module 'resource-allocator' is not found./yang/ietf-l2vpn-ntw.yang:1701: error: the node 'l2vpn-route-policy' from module 'cisco-flat-L2vpn-fp' is not found./yang/ietf-l2vpn-ntw.yang:2971: error: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not found./yang/ui-validation.yang:14: error: prefix 'l2vpn-ntw' not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:8: error: module 'cisco-tsdn-core-fp-common' not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:11: error: module 'lsa-utils' not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:437: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:437: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:438: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:438: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:438: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:438: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:513: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not foundyang/ietf-l2vpn-ntw-cisco-augmentations.yang:513: error: The XPath expression references an undefined node: the node 'lsa' from module 'lsa-utils' (in node 'devices' from 'tailf-ncs') is not foundmake: *** Error 1You do need to have the dependent packages as per the folowing structure:<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"><pre>packages cisco-aa-service-assurance cisco-cs-sr-te-cfp cisco-flat-L2vpn-fp cisco-flat-L2vpn-fp-internal cisco-flat-L2vpn-fp-internal-ned cisco-flat-L3vpn-fp cisco-flat-L3vpn-fp-internal cisco-flat-L3vpn-fp-internal-ned cisco-ios-cli-6.74 cisco-ios-cli-6.77 cisco-iosxr-cli-7.33 cisco-iosxr-cli-7.38 cisco-iosxr-nc-7.3 cisco-iosxr-nc-7.315 cisco-iosxr-nc-7.4 cisco-iosxr-nc-7.5 cisco-rsvp-te-fp cisco-rsvp-te-fp-internal-ned cisco-sr-te-cfp cisco-sr-te-cfp-internal cisco-sr-te-cfp-internal-ned cisco-tsdn-core-fp-common core-fp-common core-fp-common-ned core-fp-delete-tag-service core-fp-plan-notif-generator custom-template-utils custom-template-utils-ned flat-l2vpn-multi-vendors flat-l3vpn-multi-vendors ietf-l2vpn-nm ietf-l3vpn-nm ietf-network-slice ietf-te-fp lsa-utils lsa-utils-ned resource-manager rsvp-te-multi-vendors sr-te-multi-vendors</pre></div></div>Make sure to untar them if they are tar'dThanks again. These errors are resolved but I still get this one - (although I double checked and yang path is correct)ubuntudoc@ubuntudoc:~/temp/ietf-l2vpn-nm/src$ make clean allrm -rf ../load-dir java/src//mkdir -p ../load-dirmkdir -p java/src///opt/ncs/current/bin/ncsc --annotate ./yang/ui-validation.yang --deviation ./yang/ietf-l2vpn-ntw-deviations.yang --fail-on-warnings `ls ietf-l2vpn-ntw-cisco-augmentations-ann.yang > /dev/null 2>;1 ;; echo "-a ietf-l2vpn-ntw-cisco-augmentations-ann.yang"`       --yangpath ./yang --yangpath ../../cisco-flat-L2vpn-fp/src/yang --yangpath ../../custom-template-utils/src/yang --yangpath ../../core-fp-common/src/yang --yangpath ../../resource-manager/src/yang --yangpath ../../cisco-tsdn-core-fp-common/src/yang --yangpath ../../lsa-utils/src/yang -c -o ../load-dir/ietf-l2vpn-ntw-cisco-augmentations.fxs yang/ietf-l2vpn-ntw-cisco-augmentations.yang./yang/ui-validation.yang:14: error: bad argument value "l2vpn-ntw:l2vpn-ntw/l2vpn-ntw:vpn-services/l2vpn-ntw:vpn-service/l2vpn-ntw:vpn-nodes/l2vpn-ntw:vpn-node/l2vpn-ntw:te-service-mapping/l2vpn-ntw:te-mapping/l2vpn-ntw:te/l2vpn-ntw:sr-policy/l2vpn-ntw:sr-policy/l2vpn-ntw:policy", should be of type absolute-schema-nodeidmake: *** Error 1 Seems like you're missing the beginning forward slash in "l2vpn-ntw:l2vpn-ntw/l2vpn-ntw:vpn-services/l2vpn-ntw:vpn-service/l2vpn-ntw:vpn-nodes/l2vpn-ntw:vpn-node/l2vpn-ntw:te-service-mapping/l2vpn-ntw:te-mapping/l2vpn-ntw:te/l2vpn-ntw:sr-policy/l2vpn-ntw:sr-policy/l2vpn-ntw:policy"I did try the slash earlier too.. then it says path not found :ubuntudoc@ubuntudoc:~/temp/ietf-l2vpn-nm/src$ make clean allrm -rf ../load-dir java/src//mkdir -p ../load-dirmkdir -p java/src///opt/ncs/current/bin/ncsc --annotate ./yang/ui-validation.yang --deviation ./yang/ietf-l2vpn-ntw-deviations.yang --fail-on-warnings `ls ietf-l2vpn-ntw-cisco-augmentations-ann.yang > /dev/null 2>;1 ;; echo "-a ietf-l2vpn-ntw-cisco-augmentations-ann.yang"`       --yangpath ./yang --yangpath ../../cisco-flat-L2vpn-fp/src/yang --yangpath ../../custom-template-utils/src/yang --yangpath ../../core-fp-common/src/yang --yangpath ../../resource-manager/src/yang --yangpath ../../cisco-tsdn-core-fp-common/src/yang --yangpath ../../lsa-utils/src/yang -c -o ../load-dir/ietf-l2vpn-ntw-cisco-augmentations.fxs yang/ietf-l2vpn-ntw-cisco-augmentations.yang./yang/ui-validation.yang:14: error: prefix 'l2vpn-ntw' not foundmake: *** Error 1ubuntudoc@ubuntudoc:~/temp/ietf-l2vpn-nm/src$ Another question is when this works ; what is the process to make sure these changes are available on an out of box installation of upcoming "TSDN 4.0.0 M5?" on NSO.looks like the import prefix is not matching with the prefix in the path.  try this /ietf-l2vpn-ntw:l2vpn-ntw/ietf-l2vpn-ntw:vpn-services/ietf-l2vpn-ntw:vpn-service/ietf-l2vpn-ntw:vpn-nodes/ietf-l2vpn-ntw:vpn-node/ietf-l2vpn-ntw:te-service-mapping/ietf-l2vpn-ntw:te-mapping/ietf-l2vpn-ntw:sr-policy/ietf-l2vpn-ntw:policyBut, we really want to add this as a compiled package outside the service pacakge, is this not possible?Thank you Srini. Compilation works now. Please help regarding commit / packaging of this change so that its available on out of box installation. I'll meanwhile test this out.This works as expected. We need a way to commit this now.Closing this ticket as potential method to augment tailf extension seems to have been completed successfully by submitter.Lets please keep the ticket open as the issue is still not resolved and we're looking at how this can be packaged.