Wednesday, November 18, 2009

WLST useful tips and tricks

Run a .py script with:

java weblogic.WLST

How to define a function with exception handling:

def connect_to_weblogic(username,password,adminurl):
try :
except :
print 'Cannot connect to server '

How to get the list of defined servers:

serverList = ls('Servers',returnMap='true')

(the "returnMap" options makes the serverList variable a HashMap with key=serverName)

How to get a list of RUNNING servers:

runningList = ls('ServerRuntimes',returnMap='true')

No comments: