WLST script to list all Composites deployed and the details (Label/Partition/processName)
############################################################################################### # List All Deployed Composites #This WLST script lists all Composites deployed and the details (Label Partition and processName) # @Team Fusion ######################################################## #Can attach properties file to this script. # ######################################################## #read properties file #propInputStream = FileInputStream("domain.properties"); #configProps = Properties(); #configProps.load(propInputStream); #adminusername = configProps.get('ADMIN_USERNAME'); #adminpassword = configProps.get('ADMIN_PASSWORD'); #adminurl = configProps.get('ADMIN_URL'); #connect(adminusername, adminpassword, adminurl) ######################################################## #Running the script # ######################################################## #WL_HOME\server\bin\setWLSEnv.cmd or #source $WL_HOME/server/bin/setWLSEnv.sh #java weblogic.WLST Folder_Loc/listComposites.py ################################################################################################ from java.io import FileInputStream import java.lang import string import sys from jarray import * connect('weblogic', 'welcome1', 't3://localhost:7001') domainName=cmo.getName(); serverList = cmo.getServers(); server1=serverList[1].getName(); domainRuntime() soainfraBean = ObjectName('oracle.soa.config:Location='+server1+',name=soa-infra,j2eeType=CompositeLifecycleConfig,Application=soa-infra') composites = mbs.getAttribute(soainfraBean, 'DeployedComposites') for composite in composites: x = str(composite).split(","); z = x[13].split("="); a = z[2]; X = String(a).split("/") partitionName = X[0]; Y = (X[1].split("!")) processName = Y[0]; Z = Y[1].split("*") revision = Z[0]; labelName = Z[1]; print processName print labelName print revision
2 comments:
I'm getting this script syntax error
[java] Problem invoking WLST - Traceback (innermost last):
[java] (no code object) at line 0
[java] File "/scratch/vbasaval/eclipse_workspace/OER/APICatalog/src/listDeployedComposite.py", line 14
[java] x = str(composite).split(",");
[java] ^
[java] SyntaxError: invalid syntax
[java] Java Result: 1
you seem to have hit the indentation problem .correct it and it should work
Post a Comment