+

Search Tips   |   Advanced Search

 

###
### set_http_transport.jacl
###
###
### Usage: 
###
### wsadmin.sh -username system -password password -f set_http_transport.jacl "server1 server2 ..."
###
###
        



proc set_http_transport {snames} {

puts " "
puts "snames: snames"
puts " "


###
### set up globals
###

global AdminConfig
global AdminControl
global AdminApp


set cells [$AdminConfig list Cell]

foreach cell $cells {
     set cname [$AdminConfig showAttribute $cell name]
     set nodes [$AdminConfig list Node $cell]

     puts " "
     puts "Cell: $cname         "

     foreach node $nodes {

        set nname [$AdminConfig showAttribute $node name]
        puts " "
        puts "Node: $nname            "


        foreach sname $snames {


            set serverid [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/]

            if {[llength $serverid] == 0} {
               continue 
            }

            puts " "
            puts "Setting HTTP transport for server: $sname"

            set wc [$AdminConfig list WebContainer $serverid]

            puts $wc

            set transportsAttr [$AdminConfig showAttribute $wc transports]
            set transports [lindex $transportsAttr 0]

            set transport [lindex $transports 0]

            puts $transport

            #$AdminConfig modify $transport {{address {{host {$node}} {port 9081}}}}

        }
    }
}

$AdminConfig save

}



###
### Main
###
### Test servers: nap_1_1 nap_2_1 
###


if { !($argc == 1) } {
   puts ""
   puts "Usage:, "
   puts " "
   puts "wsadmin.sh -username system -password password -f set_http_transport.jacl \"server1 server2 ...\""
} else { 
   set xservers      [lindex $argv 0]  
   set_http_transport $xservers 
}