cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
759
Views
10
Helpful
2
Replies

DNA Center - Velocity template for 9800 Policy Profile

stefan.tabell
Level 1
Level 1

Hi! 

 

Looking for some help and guidance regarding how to filter down the results in an #foreach loop in a DNA Center template. My goal is to apply a calendar-profile only to a specific WLAN.

 

I have created the following template:

wireless profile calendar-profile name WEEKDAYS
day monday
day tuesday
day wednesday
day thursday
day friday
recurrence weekly
start 06:00:00 end 18:00:00
!
#foreach ($prof in $__policyprofile)
wireless profile policy $prof
shutdown
calendar-profile name WEEKDAYS
action wlan_enable
no shutdown
!
#end

 

However, when running the simulation it then creates a set of commands for each of my configured policy profiles.

 

wireless profile calendar-profile name WEEKDAYS
day monday
day tuesday
day wednesday
day thursday
day friday
recurrence weekly
start 06:00:00 end 18:00:00
!
wireless profile policy default-policy-profile
shutdown
calendar-profile name WEEKDAYS
action wlan_enable
no shutdown
!
wireless profile policy SSID1-_Global_NF_39282718
shutdown
calendar-profile name WEEKDAYS
action wlan_enable
no shutdown
!
wireless profile policy SSID2_Global_NF_607d2cf4
shutdown
calendar-profile name WEEKDAYS
action wlan_enable
no shutdown
!

 

Any suggestions on how I can limit the calendar-profile to only be applied to either a specified SSID (as example "SSID1") or if I can get a dropdown where I can select which profiles this should be applied for. 

 

Looking forward to your replies! 

2 Replies 2

wichwagon
Level 1
Level 1

I have same problem..

 

get-mobdro.com

aradford
Cisco Employee
Cisco Employee

Sure,  you just need to put an "if" statement containing the profile you want to apply this too

 

#foreach ($prof in $__policyprofile)
#if ($prof == "hk_Global_NF_a38f71c1")
wireless profile policy $prof
shutdown
calendar-profile name WEEKDAYS
action wlan_enable
no shutdown
!
#end
#end

 

When i run the simulation, this is the output:

 

wireless profile policy hk_Global_NF_a38f71c1
shutdown
calendar-profile name WEEKDAYS
action wlan_enable
no shutdown
!