Quantcast
Channel: THWACK: All Content - Network Configuration Manager
Viewing all articles
Browse latest Browse all 6057

Select array position in CCT

$
0
0

I am trying to write a CCT script that will configure multiple vlans with the vlan name on Cisco switches. I have the VLAN creation working, but I'm having trouble cycling through the VlanToExtendName array for each loop of the VlansToExtend array. I've tried different versions of this, but all either don't validate or error during execution. In this version, I tried to set the array position as a variable that I could increment. Even if I use @variable[0], it errors during execution. Any suggestions are appreciated.

 

This is what I tried, but it doesn't validate.

 

script ConfigureVLANextendCiscoNXOS (   

                                          NCM.Nodes @ContextNode,

                                          string [] @VlansToExtend,

                                          string [] @VlansToExtendName )

{

int @num=0

  // Enter configuration mode

  CLI

  {

   configure terminal

  }

 

 

  // Loop through selected VLANs

  foreach (@VlanItem in @VlansToExtend)

  {

    string @VlanName=@VlansToExtendName[@num]

    CLI

    {

       vlan @VlanItem

       name @VlanName

       mode fabricpath

    }

    @num=@num+1

  }


Viewing all articles
Browse latest Browse all 6057

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>