Raritan PX2/PX3 JSON-RPC API
|
There is a single manager instance. More...
import"LuaService.idl";
Public Member Functions | |
int | setScript (in string name, in string script, in ScriptOptions options) |
Upload a script to instance. More... | |
int | getScript (in string name, out string script) |
To download a script file to user. More... | |
vector< string > | getScriptNames () |
Returns all script names in a string vector. More... | |
int | deleteScript (in string name) |
Deletes a script. More... | |
int | setScriptOptions (in string name, in ScriptOptions options) |
Sets new options for a script. More... | |
int | getScriptOptions (in string name, out ScriptOptions options) |
Returns the options for a script. More... | |
Environment | getEnvironment () |
To query the environment information. More... | |
int | getScriptOutput (in string name, in long iAddr, out long oAddr, out long nAddr, out string oString, out boolean more) |
To get output from a script as a string. More... | |
int | startScript (in string name) |
To start a script. More... | |
int | terminateScript (in string name) |
To stop a script. More... | |
int | getScriptState (in string name, out ScriptState state) |
Returns the state for a single script. More... | |
map< string, ScriptState > | getScriptStates () |
Returns the state for all scripts. More... | |
Public Attributes | |
constant int | NO_ERROR = 0 |
Error codes. More... | |
constant int | ERR_INVALID_NAME = 1 |
script name is invalid | |
constant int | ERR_NO_SUCH_SCRIPT = 2 |
script name not found | |
constant int | ERR_MAX_SCRIPT_NUMBERS_EXCEEDED = 3 |
maximum amount of stored script files is reached | |
constant int | ERR_MAX_SCRIPT_SIZE_EXCEEDED = 4 |
maximum size of a script file is reached | |
constant int | ERR_MAX_ALL_SCRIPT_SIZE_EXCEEDED = 5 |
maximum size of all script files is reached | |
constant int | ERR_NOT_TERMINATED = 6 |
script is not terminated | |
constant int | ERR_NOT_RUNNING = 7 |
script is not running | |
constant int | ERR_INVALID_ADDR = 8 |
address parameter is wrong | |
There is a single manager instance.
int luaservice::Manager::deleteScript | ( | in string | name | ) |
Deletes a script.
name | The name of the script |
Environment luaservice::Manager::getEnvironment | ( | ) |
To query the environment information.
int luaservice::Manager::getScript | ( | in string | name, |
out string | script | ||
) |
To download a script file to user.
name | The name of an existing script |
vector<string> luaservice::Manager::getScriptNames | ( | ) |
Returns all script names in a string vector.
If there are no scripts the vector is empty.
int luaservice::Manager::getScriptOptions | ( | in string | name, |
out ScriptOptions | options | ||
) |
Returns the options for a script.
name | The name of the script |
options | The return value |
int luaservice::Manager::getScriptOutput | ( | in string | name, |
in long | iAddr, | ||
out long | oAddr, | ||
out long | nAddr, | ||
out string | oString, | ||
out boolean | more | ||
) |
To get output from a script as a string.
The output is stored in a string buffer with a defined size. The buffer is addressable with an (virtual) address. The address will be increased ervery time when the buffer will be filled.
To get the output for the first time just call with address zero and then work with the returned nAddr argument.
If iAddr is negative then the latest n bytes will be returned eg. -12 returns the last 12 characters. If iAddr is zero then the whole available buffer will be returned. If iAddr is positive then the returned buffer starts at this address. If iAddr is equal to nAddr then there is no data available If iAddr and oAddr is not equal then there were data lost (execption: first call with zero).
name | The name of the script |
iAddr | Where the string buffer should start |
oAddr | The virtual address from where the string starts. |
nAddr | The next virtual address for query |
more | A boolean whitch indicates if there is more data available |
int luaservice::Manager::getScriptState | ( | in string | name, |
out ScriptState | state | ||
) |
Returns the state for a single script.
name | The script name |
state | The state of the script |
map<string, ScriptState> luaservice::Manager::getScriptStates | ( | ) |
Returns the state for all scripts.
If the map is empty then there are no scripts on the machine.
int luaservice::Manager::setScript | ( | in string | name, |
in string | script, | ||
in ScriptOptions | options | ||
) |
Upload a script to instance.
If there is a script with the same name the new script will replace the existing script (script must be in STAT_NEW or STAT_TERMINATED).
name | The name of the script file |
script | The script file packed in a string |
options | Options that can be set or not |
int luaservice::Manager::setScriptOptions | ( | in string | name, |
in ScriptOptions | options | ||
) |
Sets new options for a script.
name | The name of the script |
options | The new options |
int luaservice::Manager::startScript | ( | in string | name | ) |
To start a script.
The function starts a lua script.
int luaservice::Manager::terminateScript | ( | in string | name | ) |
To stop a script.
This command stops a running or restarting script. After terminating the option autorestart will not be evaluated.
constant int luaservice::Manager::NO_ERROR = 0 |
Error codes.
no Error