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

How can use forloop in nso rfs template?

alessiagreco
Level 1
Level 1

 Example1 : Supposed your input payload is given below  { "l3-device-list" :{ "interface-list":{ "s-existing-trunk-vlan":[444, 454,222], } } }  Step1: Add variable in java inputParams.putQuotedEmptyIfNull( "s-existing-trunk-vlan", interfaceObj.leaf(l3VpnRfs._s_existing_trunk_vlan_).valueAsString() );  Step2: Add variable in  yang leaf-list s-existing-trunk-vlan { type uint32 { range "1..4096"; } } #3: Add loop in config template <dot1q> <?foreach {l3-device-list/interface-list/s-existing-trunk-vlan}?> <id>{.}</id> <?end?> <id>{$vlan-id}</id> </dot1q>  Example2 : Supposed your input payload is given below { "alc-last-mile-ag2-rfs": { "interface-name1":["0/0/1/7", "0/0/1/8", "0/0/1/9"], } }  Step1: Add variable in  yang leaf-list interface-name1 { type string; }  Step2:  Add loop in config template  <?foreach{interface-name1}?> <TenGigE> <id>{.}</id> <load-interval>30</load-interval> <bundle> <id> <id-value>{$B-ID}</id-value> <mode>active</mode> </id> </bundle> </TenGigE> <?end?> 

1 Reply 1

@alessiagreco did you not post this already here? https://community.cisco.com/t5/devnet-general-discussions/how-can-use-forloop-in-nso-rfs-template/m-p/5104183

It feel like this is a fake account.....

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io