...
Note | ||
---|---|---|
| ||
Note that all the services require that the calling user is authenticated. You can use Basic authentication with your HTTP request. |
Services
Method | Full Path | Availability |
---|---|---|
findScriptFiles | <your_base_url>/rest/keplerrominfo/refapp/latest/async-script/findScriptFiles | 4.0.0+ |
checkScript | <your_base_url>/rest/keplerrominfo/refapp/latest/async-script/checkScript | 4.0.0+ |
runScript | <your_base_url>/rest/keplerrominfo/refapp/latest/async-script/runScript | 4.0.0+ |
runDetachedScript | <your_base_url>/rest/keplerrominfo/refapp/latest/async-script/runDetachedScript | 4.0.0+ |
getResult | <your_base_url>/rest/keplerrominfo/refapp/latest/async/getResult | 4.0.0+ |
findScriptFiles
Allows you to scan a folder for specific files for which the filename matches a specific regular expression.
Parameter | Type | Required | Description |
---|---|---|---|
dirPath | string | yes | The path of the directory to scan |
regex | string | yes | The regular expression to match the filenames against |
Returns a ScriptFileListResponse.
|
---|
|
---|
|
---|
checkScript
Schedules a check script task to be run asynchronously for the given script and returns a ScriptScheduledResponse.
Parameter | Type | Required | Description |
---|---|---|---|
source | ScriptSource | yes | The script to check |
|
---|
|
---|
|
---|
runScript
Schedules a run script task to be run asynchronously for the given script and returns a ScriptScheduledResponse.
Parameter | Type | Required | Description |
---|---|---|---|
source | ScriptSource | yes | The script to run |
|
---|
|
---|
|
---|
runDetachedScript
Schedules a task to execute the script passed in as parameter on the server side and does not return the response or any information about it (simply runs the script).
Parameter | Type | Required | Description |
---|---|---|---|
source | ScriptSource | yes | The script to run |
|
---|
|
---|
getResult
Checks if the task identified by the provided id is still running or has finished and returns an AsyncResultResponse. If the task has finished execution, the result is removed from memory and returned in the response. Subsequent calls to this method will not return the result.
Parameter | Type | Required | Description |
---|---|---|---|
key | int | yes | The unique key identifying a scheduled task. |
|
---|
|
---|
Beans
ScriptFileListResponse
Field | Type | Description |
---|---|---|
files | string [] | List of absolute paths |
...
AsyncResultResponse
...
Field | Type | Description |
---|---|---|
running | boolean | Signals that the script is still running |
outcome | Object | The results |
ScriptScheduledResponse
Field | Type | Description |
---|---|---|
key | int | The unique key of the scheduled task |
ScriptSource
Field | Type | Description |
---|---|---|
type | string | The type of the source |
code | string | The source code |
CURL Example
The following curl calls show how you would call SIL scripts from your favourite system (that's Linux, I hope). The commands assume that username / password is 'admin'
Notice the way you pass multiple parameters to the SIL scripts. The logic is the same, you post the script to start running asynchronously, then you come back later for the results.
Code Block |
---|
$curl -H "Content-Type: application/json" -u admin:admin -d " {\"source\" : { \"type\": \"file\", \"code\": \"return 1;\"}}" 192.168.19.250:7210/rest/keplerrominfo/refapp/latest/async-script/runScript {"key":4} $curl -H "Content-Type: application/json" -u admin:admin -d "{\"key\" : 3}" 192.168.19.250:7210/rest/keplerrominfo/refapp/latest/async/getResult {"running":false,"outcome":{"results":["1"]}} |