Web API for Scripts: Difference between revisions
No edit summary |
|||
Line 20: | Line 20: | ||
Terminates a run of the script with given id. Returns id of the terminated script run operation. Returns immediately without waiting for a script run to be aborted. Returns 0 if the script is not running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script. | Terminates a run of the script with given id. Returns id of the terminated script run operation. Returns immediately without waiting for a script run to be aborted. Returns 0 if the script is not running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script. | ||
=== | === Get current run log === | ||
<pre> | <pre> | ||
GET api/scripts/runlog/current/{scriptId} | GET api/scripts/runlog/current/{scriptId} | ||
Line 27: | Line 27: | ||
Gets the current run log of the script with given id, i.e. a run that is currently in progress. Returns the object with the following fields: Log, Exceptions, AdditionalData, OperationId. Returns null if the script is not running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script. | Gets the current run log of the script with given id, i.e. a run that is currently in progress. Returns the object with the following fields: Log, Exceptions, AdditionalData, OperationId. Returns null if the script is not running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script. | ||
=== | === Get last run log === | ||
<pre> | <pre> | ||
GET api/scripts/runlog/last/{scriptId} | GET api/scripts/runlog/last/{scriptId} |
Revision as of 14:26, 22 February 2021
Scripts API is used to create, delete and edit script properties.
Note that the Workspace Elements API supports also scripts.
Methods
The scripts API has the following methods.
Start script run
GET api/scripts/run/{scriptId}
Starts a run of the script with given id. Returns id of the started script run operation. Returns immediately without waiting for a script run to be finished. Returns 0 if the script is already running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script.
End script run
GET api/scripts/end/{scriptId}
Terminates a run of the script with given id. Returns id of the terminated script run operation. Returns immediately without waiting for a script run to be aborted. Returns 0 if the script is not running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script.
Get current run log
GET api/scripts/runlog/current/{scriptId}
Gets the current run log of the script with given id, i.e. a run that is currently in progress. Returns the object with the following fields: Log, Exceptions, AdditionalData, OperationId. Returns null if the script is not running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script.
Get last run log
GET api/scripts/runlog/last/{scriptId}
Gets the last completed run log of the script with given id. Returns the object with the following fields: Log, Exceptions, AdditionalData, OperationId. Returns null if the script is has never been run yet. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script.