commands.json
Use the commands.json file to configure the commands that LSF Web Services is allowed to run.
Location
The commands.json file is located in the $LWS_TOP/conf directory.
Description
The commands.json file defines all the commands that LSF Web Services is allowed to execute. You can also use this file to define allow or disallow properties when running the commands.
Format and structure
The commands.json file is a JSON array in plain text format. Each element in
the JSON array is a JSON object that contains three fields. For example:
{
"command" : "bsub",
"unSupportedParameters" : ["-I", "-Ip", "-Is", "-IS", "-J"],
"standalone" : false
}
Each JSON object contains these fields:
- command
- Required field. The name of the command that LSF Web Services is
allowed to run (in the example,
bsub
is an LSF command to run). Specify a string for this value. - unSupportedParameters
- Optional field. The command parameters or options that LSF Web Services is not allowed to run with the command specified in the command field. Specify a JSON array of strings. Each string represents a parameter or option that LSF Web Services is not allowed to run with the specified command. In the example, LSF Web Services is not allowed to run the bsub command with the -I, -Ip, -Is, -IS, or -J options.
- standalone
- Optional field. Specify either true or false. When this field is set to false, LSF Web Services is not allowed to run the command specified in the command field without any parameters or any arguments. This field is for commands that will fall into interactive mode when called as a standalone command, such as the bsub command.
Examples
Allow running the bjobs command from LSF Web Services with
or without parameters or arguments:
{ "command" : "bjobs"}
Allow running the bjobs command from LSF Web Services, with
at least one parameter or argument, but not run as a standalone command:
{
"command" : "bjobs",
"standalone" : false
}
Allow running the bjobs command from LSF Web Services, run
as a standalone command but not with the -b parameter option:
{
"command" : "bjobs",
"unSupportedParameters" : ["-J"]
}
Allow running the bjobs command from LSF Web Services, but
not run as a standalone command and not with the -J parameter
option:
{
"command" : "bjobs",
"unSupportedParameters" : ["-J"],
"standalone" : false
}