Hi Joao,
I have created a pyhthon script, which tries to clean up as many apps as possible (only use in staging or testing environments).
It does work pretty well, but still does not get all the toolkits. You are welcome to help me on this ;)
CODE...........................
import re
import sys
import time
oSysOut = sys.stdout
timestr = time.strftime("%Y%m%d-%H%M%S")
filename = "CleanupAllAppsLog_" + timestr + ".txt"
print "Switching to file output: " + filename
f = open(filename, 'w')
sys.stdout = f
apps = re.split(r'\n\s*\n',AdminTask.BPMListProcessApplications())
apps.remove("")
countDeact = 0
countDel = 0
try:
for app in [a[a.index('Acronym:')+9:a.index('Description:')].rstrip() for a in apps if a.find('Toolkit: false') > 0 if a.find('SYS') < 0]:
snapshots = re.split(r'\n\s*\n',AdminTask.BPMShowProcessApplication('[-containerAcronym '+app+']').split('List of Snapshots:',1)[1])
for snap in [s[s.index('Acronym: ')+9:s.index('Created On:')].rstrip() for s in snapshots if s.find('instances: 0') > 0 if s.find('State: State[Inactive]') > 0]:
print "Processing Snapshot "+ snap +" of ProcessApp [" + app + "]:"
try:
print AdminTask.BPMDeactivate('[-containerAcronym '+app+' -containerSnapshotAcronym '+snap+']')
countDeact = countDeact + 1
print AdminTask.BPMDeleteSnapshot('[-containerAcronym '+app+' -containerSnapshotAcronyms '+snap+']')
countDel = countDel + 1
except java.lang.Exception,e:
print str(e)
continue
#endTry
except:
pass
print "Finished cleanup for all apps, "+ countDeact + " snapshots were deactivated, " + countDel + " snapshots were deleted."
f.close()
sys.stdout = oSysOut
print "Finished processing"
CODEEND..........................................
------------------------------
Nils Schiwek
------------------------------