Created
June 30, 2016 02:58
-
-
Save FilBot3/b8661c949617727630152cbe04f78d7e to your computer and use it in GitHub Desktop.
Restart an IBM WAS ND Application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # | |
| # | |
| 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