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

DNA Center Template programmer simple loop.

glsparks
Level 1
Level 1

Hi All,

A simple one no doubt. I am trying to get a DNA template to loop through a list of devices using the Template Programmer api. My plan is to use the bulkfile parameter to point to a csv file with all the devices IP's in and reference a json params file.

python template.py --template test --bulkfile devices.csv --paramsfile test.json 

CSV file e.g

device_ip

192.168.1.1,

192.168.2.1

 json params file to store the  IP & MASK e.g

{"IP":"192.168.1.1",

"MASK":255.255.255.0"},

{"IP":"192.168.2.1",

"MASK":255.255.255.0"},

The template: 

int g1/0 $IP $MASK

How do i construct the loop so as to go through the csv and apply the contents of the json? I can't wrap my head around this today

everything i try doesn't seem to read in the variables.

 

0 Replies 0

Review Cisco Networking for a $25 gift card