06-13-2022 07:45 AM
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 |
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!
06-13-2022 07:55 AM - edited 06-13-2022 10:24 PM
06-14-2022 07:49 AM
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
!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide