Using the Grid Script Client to Manage the Grid
The ION Grid includes a built-in utility class that can help you control the grid and grid applications as well as query the grid for status information. It is primarily built to be used from the command line or a scripting language
For example, if you need to schedule backups, it is useful to have a script that shuts down an application programmatically, sets the application offline, performs the maintenance tasks, starts the application, and finally queries the application for its status to ensure it is running correctly.
Supported Commands
The following commands are supported. The result will be presented on standard out and the return code will be 0 unless there is an ERROR message. In the case of an ERROR, the return code will be 1 and all messages will be presented on standard err. If you get an ERROR result the command has failed to complete
Command | Results and Descriptions |
---|---|
startgrid
|
SUCCESS - grid successfully started TIMED_OUT - grid not started within timeout period |
stopgrid
|
SUCCESS - grid successfully stopped TIMED_OUT - grid not stopped within timeout period |
gridoffline
|
SUCCESS - grid is set offline |
gridonline
|
SUCCESS - grid is set online |
gridstatus
|
REGISTRY_STOPPED - the registry is stopped ADMINROUTER_STOPPED - the admin router is stopped GRIDAGENT_STOPPED - reported once for each grid agent that is stopped GRIDAGENT_RUNNING - reported once for each grid agent that is running OK - registry, router, and all grid agents are running STOPPED - when only grid agents are running OFFLINE - the grid is offline ONLINE - the grid is online NO_OFFLINE_STATUS - unable to get offline status (the grid might be stopped) |
hostoffline hostName
|
SUCCESS - host is set offline |
hostonline hostName
|
SUCCESS - host is set offline |
hoststatus hostName
|
GRIDAGENT_RUNNING - the grid agent is running GRIDAGENT_STOPPED - the grid agent is stopped OFFLINE - the host is offline ONLINE - the host is online NO_OFFLINE_STATUS - unable to get offline status for this host (the grid might be stopped) |
applicationstatus application
|
OK - the application global status returns OK NOT_OK - the application global status returns NOT OK COMMENT - each line of the application status report is reported as a COMMENT line NO_APPLICATION_STATUS - unable to get application status STOPPED - the application is stopped OFFLINE - the application is offline ONLINE - the application is online NO_OFFLINE_STATUS - unable to get offline status for this application (the grid might be stopped) |
applicationoffline -p true/false application
|
SUCCESS - application is set offline -p controls whether the application should be set permanently offline (true) or offline until Grid is next restarted (false). |
applicationonline application
|
SUCCESS - application is set online |
startapplication application
|
SUCCESS - application is started TIMED_OUT - application not started within timeout period |
stopapplication application
|
SUCCESS - application is stopped TIMED_OUT - application not stopped within timeout period |
deploystatus application
|
OK - application is successfully installed - version is <version> NOT_OK - application is not deployed NOT_OK - deploy is in progress NOT_OK - undeploy is in progress ERROR - failed to query application deploy state ERROR - deploy failed ERROR - undeploy failed ERROR - application state is unknown: <state> |