tmsh::create

Description

Mirrors the tmsh create command. Accepts the same components, object identifiers, and properties that the tmsh command create accepts.

Syntax

tmsh::create [args...]

Examples

proc script::run { } {
   if { $tmsh::argc < 4 } {
       puts "Requires three arguments: <pool name> <first member> <count>"
       exit
   }
   else {
       set poolname [lindex $tmsh::argv 1]
       set start [lindex $tmsh::argv 2]
       set total [lindex $tmsh::argv 3]
   }
   scan $start "%d.%d.%d.%d:%d" a b c d p
   set members ""
   for { set x 0 } { $x < $total } { incr x } {
       set members "$members $a.$b.$c.$d:$p"
       incr d
   }
   tmsh::create ltm pool $poolname members add \{ $members \}
   tmsh::log_dest screen
   tmsh::log_level notice
   tmsh::log "Created pool $poolname with members $members"
}

Results:

root@ltm1(Active)(tmos)# run cli script create_pool.tcl test6-pool 1.1.1.1:80 16
<133>Dec 30 15'''37'''01 golgotha.pdsea.f5net.com tmsh[24925]: 01420004'''5''' Created pool test6-pool with members  1.1.1.1:80 1.1.1.2:80 1.1.1.3:80 1.1.1.4:80 1.1.1.5:80 1.1.1.6:80 1.1.1.7:80 1.1.1.8:80 1.1.1.9:80 1.1.1.10:80 1.1.1.11:80 1.1.1.12:80 1.1.1.13:80 1.1.1.14:80 1.1.1.15:80 1.1.1.16:80