proc CreateTopology { args } { # Example: set topology1Obj [CreateTopologyNgpf -name Topo-1 -portList [list "$ixChassisIp 1 1"]] set paramList {} set argIndex 0 while {$argIndex < [llength $args]} { set currentArg [lindex $args $argIndex] switch -exact -- $currentArg { -name { set name [lindex $args [expr $argIndex + 1]] append paramList " -name $name" incr argIndex 2 } -portList { set portList [lindex $args [expr $argIndex + 1]] incr argIndex 2 } default { puts "Connect: No such parameter: $currentArg" return 1 } } } if {[info exists portList] == 0} { puts "\nError: CreateToplogy: Requires portList" return 1 } puts "\nCreate Topology: Getting vport for: $portList" set vportList [GetVportMappingToPhyPort $portList] puts "Create Topology: Vport: $vportList" append paramList " -vports [list $vportList]" puts "\nCreateTopology: $paramList" set topologyObj [ixNet add [ixNet getRoot] "topology"] if {[catch {eval ixNet setMultiAttribute $topologyObj $paramList} errMsg]} { puts "\nConnect failed $paramList" return 1 } ixNet commit return [lindex [ixNet remapIds $topologyObj] 0] }