Starting Actions from the API
There are several variants of this API call available which might be easier for scripts (or humans) to work with!
There are 4 main methods to start an action in OliveTin, which can be used in scripts or other applications. These methods allow you to trigger actions either immediately or wait for them to complete, and they can be accessed via HTTP requests.
Function | HTTP Method | Request Type (How to select an action) | Response Type |
---|---|---|---|
POST |
|||
GET |
|||
POST |
|||
GET |
Request type: Action ID in the URL
Used by:
If you are trying to integrate OliveTin with your own scripts or processes, it’s probably easiest to start actions by using an ID directly in the URL, see the example.
Request type: OliveTin request object
Used by:
{
"actionId": "string",
"arguments": [
{
"name": "string",
"value": "string"
}
],
"uniqueTrackingId": "string"
}
To find your Action ID, and understand how Action IDs work, see the Action ID documentation
If you need more control over the execution, then the only other option is to submit a OliveTin reqjest object
, which is just a very simple JSON structure like this;
{
"actionId": "Generate cryptocurrency",
"arguments": [],
"uniqueTrackingId": "my-tracking-id",
}
More detailed examples can be seen below.
Response type: Execution Tracking ID
Used by:
{"executionTrackingId":"5bb4860c-bbd0-4bc9-a7d6-42240551500c"}
Response type: LogEntry
Used by:
{
"logEntry": {
"datetimeStarted": "2024-02-27 14:14:49",
"actionTitle": "Restart httpd on server1",
"stdout": "",
"stderr": "",
"timedOut": true,
"exitCode": -1,
"user": "",
"userClass": "",
"actionIcon": "🔄",
"tags": [
],
"executionTrackingId": "b04b1e90-d457-4158-b7dc-da9e81f21568",
"datetimeFinished": "2024-02-27 14:14:52",
"actionId": "restart_httpd",
"executionStarted": true,
"executionFinished": true,
"blocked": false
}
}