Skip to content

Instantly share code, notes, and snippets.

@FilBot3
Created June 30, 2016 02:58
Show Gist options
  • Select an option

  • Save FilBot3/b8661c949617727630152cbe04f78d7e to your computer and use it in GitHub Desktop.

Select an option

Save FilBot3/b8661c949617727630152cbe04f78d7e to your computer and use it in GitHub Desktop.
Restart an IBM WAS ND Application
#
#
#
import sys
# Gets the Cell Name for the environment
cell_name = AdminControl.getCell()
# Node Name
node_name = sys.argv[0]
# JVM Name
process_name = sys.argv[1]
# Application Name
app_name = sys.argv[2]
# Get the full Application Manager string.
appManager = AdminControl.queryNames('cell=' + cell_name + ',node=' + node_name + ',type=ApplicationManager,process=' + process_name + ',*')
try :
print("Stopping "+ app_name +" on " + node_name +"")
# Stop an Application
AdminControl.invoke( appManager, 'stopApplication', app_name )
except :
print("An error occured.")
print("Error occured: ", sys.exc_info()[0])
# End of Stop Application
try :
print("Starting "+ app_name +" on " + node_name +"")
# Start an Application
AdminControl.invoke( appManager, 'startApplication', app_name )
except :
print("An error occured.")
print("Error occured: ", sys.exc_info()[0])
# End of Start Application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment