Script to run:
~/profile/bin/wsadmin.sh -lang jython -f enable_disable_ecv.jy true (to enable)
~/profile/bin/wsadmin.sh -lang jython -f enable_disable_ecv.jy false (to disable)
~/profile/bin/wsadmin.sh -lang jython -f enable_disable_ecv.jy false (to disable)
import re
import os
import sys
first_arg=sys.argv[0]
app_name_all=AdminApp.list().splitlines()
for ecv in app_name_all:
if ecv.find("ecv")==-1:
STATUS=1
else:
deploymentID=AdminConfig.getid ('/Deployment:'+ ecv +'/')
deploymentObj1 = AdminConfig.showAttribute(deploymentID, 'deployedObject')
targetMap1 = AdminConfig.showAttribute(deploymentObj1, 'targetMappings')
targetMap1 = targetMap1[1:len(targetMap1)-1].split(" ")
for targetMapping in targetMap1:
if first_arg == "true":
AdminConfig.modify(targetMapping, [["enable", "true"]])
AdminConfig.save()
elif first_arg == "false":
AdminConfig.modify(targetMapping, [["enable", "false"]])
AdminConfig.save()
else:
print "Argument should be true/false"
No comments:
Post a Comment