CLI REST-API

run-script

run-script [option] [scriptname] [parameters]
The "run-script" command runs a script from /etc/syncteam/scripts directory.
It is possible to run the script with parameters.

RESTAPI: The data can be passed in the body like this:
{
    "parameters": {
        "scriptname": "myscript"
    }
}
NameValueDescriptionExample
jsonprints out a JSON-formatted structure
stopjob-idstops the running scriptmyscript
listpattern statusshows a list of scripts; use the search [pattern] to filter the list; [status] can be: running, done or anyrun-script all any
scriptnamethe name of the scriptfilemyscript
parametersoptional parameters to add to the scriptmy parameters
See also:
add-offset: adds the time to the clocks.
alias: adds an alias.
alias-delete: deletes an alias.
alias-list: lists all aliases.
cancel-token: cancels the auth token.
changes: lists changed configuration parameters in different formats.
commit: applies all configuration changes.
commit-to: pushes configuration changes to a remote system or a group of remote systems.
diff: shows differences between the system- and the "startup"-configuration set.
edit: opens a file to edit.
exec: executes all CLI commands in the specified file.
exit: exits the current sub-menu / quits the program if main-menu.
export: exports all objects.
fdm-stream: listen and receives data from fdm.
find: find elements.
get-macro: allows to get a group of objects with one single API call.
get-token: gets the auth token.
goto-config: goes into same menu-path beginning with configuration.
goto-status: goes into same menu-path beginning with status.
help: lists all global commands.
import: reads a previously exported data structure into the system configuration.
job-status: gets the job state.
job-stop: stops the job entry.
list: lists all objects inside a menu.
lock: locks an element.
main: return to the main menu/top level of the menu hierarchy.
monitor: monitor system states.
monitor-alarms: lists all currently active alarms and then updates its output continously.
monitor-object: prints and checks the name and value of a specified object.
monitor-view: prints and checks all objects inside a menu.
no: disables an object.
ping: check connectivity to a network node.
protect: protects an object.
quit: quits the CLI.
read: loads a package configuration from the configuration database.
reboot: schedules a system reboot.
remote-get-object: read the current value of a single object from a remote host.
remote-run-command: execute a CLI command on a remote host.
remote-set-object: change the value of a configuration parameter on a remote host.
rollback: discards all parameter changes made in this CLI session.
service: allows the control of a service
set-clk-time: manually sets the time to a clock.
set-macro: allows to change the value of a group of objects with one single API call.
setvar: allows to set a custom variable.
show: show system states.
show-alarms: lists all currently active alarms.
show-locks: prints a list of locks.
show-object: prints the name and value of a single specified object.
traceroute: print the network path used to reach the node.
unlock: unlocks an element.
unprotect: unprotects an object.
update-values: updates all objects of the specified menu/submenu.
uptime: print the current uptime of the server.
validate-configuration: shows configuration errors.
version: shows the current lt_cli version.
view: shows all objects and submenus inside a menu.
write: saves a package configuration to the configuration database.

REST-API Support:


This command is supported by the REST API:

Method: PUT
URL: /api/run-script
Body:
{
    "parameters": {
        "scriptname": [scriptname]
    }
}

Example using curl:
curl -X PUT /api/run-script -d 
"{
    \"parameters\": {
        \"scriptname\": \"myscript\"
    }
}"