list_DS.jacl

 

###   
### list_DS.jacl   
###   
###   
###   
###   
###   
   
proc list_DS {cname nname sname} {   
   
   
###   
### set up globals   
###   
   
global AdminConfig   
global AdminControl   
global AdminApp   

    puts " " 

    puts "Getting JDCProviders for $cname $nname $sname..."
    puts " " 
    set JDBCProviderIDs [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/JDBCProvider:/]

    if {[llength $JDBCProviderIDs] == 0} {
        puts "Cannot find JDBC Provider for $cname $nname $sname"
        return
    }



    foreach JDBCProviderID $JDBCProviderIDs {

        set JDBCName [$AdminConfig showAttribute $JDBCProviderID name]

        puts " "
        puts "Datasources for $JDBCName"

        set xDataSources [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/JDBCProvider:$JDBCName/DataSource:/]
        #set xDataSources [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/DataSource:/]

        if {[llength $xDataSources] == 0} {   
            puts "               "
            puts "No data sources configured for $cname $nname $sname $JDBCName"   
            puts "               "
        }   

        foreach  xDataSource $xDataSources {
            #set xyz [$AdminConfig showall $xDataSource]
            #set xyz [$AdminConfig list DataSource $xDataSource]
            set xyz [$AdminConfig showAttribute $xDataSource name]
            puts "$xyz"
        }


    }   
}
   
   
   
###   
### Main   
###   
   
   
if { !($argc == 3) } {   
   puts ""   
   puts "Usage:  "   
   puts " "   
   puts "wsadmin.sh -username system -password password -f list_DS.jacl cellname nodename servername" 
   puts ""   
   puts "For example:  "   
   puts " "   
   puts "wsadmin.sh -username was -password acme@ -f  list_DS.jacl hostnameNetwork hostname ops_1_1" 
} else {    
   set xcell        [lindex $argv 0]     
   set xnode        [lindex $argv 1]     
   set xserver      [lindex $argv 2]     
   list_DS $xcell $xnode $xserver    
}