Python API: samgridBatchAdmin v8_1_5 samgridBatchAdmin.addCommand()
|  |
This is the python interface to the command 'samgridBatchAdmin add command'.
Command Description:
Add command to a given batch adapter in the station configuration.
Batch commands are defined by their type, command string and possible
outcomes. The predefined command types are:
['job submit command', 'job lookup command', 'job kill command', 'job output retrieval command', 'project submit command', 'project lookup command', 'project kill command', 'project output retrieval command', 'consumer submit command', 'consumer lookup command', 'consumer kill command', 'consumer output retrieval command', 'process submit command', 'process lookup command', 'process kill command', 'process output retrieval command', 'environment setup command']
The command string may contain one or more predefined templates:
['%__USER_PROJECT__', '%__USER_SCRIPT__', '%__USER_SCRIPT_ARGS__', '%__USER_JDF__', '%__USER_JOB_OUTPUT__', '%__USER_JOB_ERROR__', '%__USER_JOB_OUTPUT_DIR__', '%__USER_JOB_OUTPUT_FILE__', '%__USER_JOB_ERROR_FILE__', '%__USER_NUMBER_OF_JOBS__', '%__USER_NAME__', '%__USER_APPLICATION_TYPE__', '%__USER_PREEMPTION__', '%__BATCH_JOB_ID__', '%__BATCH_JOB_STATUS__', '%__BATCH_JOB_NAME__', '%__BATCH_QUEUE__', '%__BATCH_FLAGS__', '%__BATCH_HOST__', '%__UNIX_PROCESS_ID__', '%__UNIX_HOST__', '%__OTHER_STRING__']
For example, one might add the following command for the xyz's station
pbs adapter:
samgridBatchAdmin add command
--command-type='job submission command'
--command-string='qsub %__USER_SCRIPT__'
--adapter='pbs'
--station='xyz'
Note that there are separate samgridBatchAdmin commands for adding/deleting
expected batch command outcomes.
For more examples, as well as for a full description of available
templates and predefined command types, please see the
SAM Batch Adapter documentation.
Python Usage:
from SamgridBatchAdmin import samgridBatchAdmin
result = samgridBatchAdmin.addCommand(...)
Return value:
Arguments are passed as keyword-value pairs, as in:
myfunc(arg1='myarg', arg2='anotherarg', d=1)
Argument Keyword Description:
(*) indicates that this keyword is required
>>> indicates that either the API object or the CLI equivalent (<<<) is required
====================================================================================================================================
KEYWORD DATA TYPE DESCRIPTION
------------------------------------------------------------------------------------------------------------------------------------
(*) adapter string batch adapter name
(*) commandString string command string
(*) commandType string command type string
d SamBoolean debug flag
(*) station string station name
v SamBoolean verbose flag
====================================================================================================================================
Environment Defaults:
station = os.environ['SAM_STATION']
See Also: