Trying to tinker with Config Change Templates and perhaps I'm using the wrong approach. I cannot get the config template to recognize the ( @interfaceItem.InterfaceAlias contains 'Camera' ). I can change that to something else like say ( @interfaceItem.InterfaceDescription contains '/40' ) and it will return all ports marked /40. Looking at the table structure I don't see why I wouldn't be able to pull from InterfaceAlias but looking for any recommendations to assist.
/*
.CHANGE_TEMPLATE_DESCRIPTION
.CHANGE_TEMPLATE_TAGS
.PLATFORM_DESCRIPTION
Cisco IOS
.PARAMETER_LABEL @ContextNode
NCM node
.PARAMETER_DESCRIPTION @ContextNode
The node the template will operate on. All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables.
*/
script testing1 (NCM.Nodes @ContextNode,
string @SomeVariable1)
{
CLI
{
configure terminal
}
foreach (@interfaceItem in @ContextNode.Interfaces)
{
if ( @interfaceItem.InterfaceAlias contains 'Camera' )
{
CLI
{
interface @interfaceItem.InterfaceDescription
description @SomeVariable1
power inline never
exit
}
}
}
}