API Method: StartActionAndWait

This method is useful is you are writing a script, and want to wait for the action to finish so that you can check the result, or get the output.

There are several variants of this API call available which might be easier for scripts (or humans) to work with:

There are 2 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. Like every OliveTin API method, they are called with an HTTP POST and a JSON request body (eg: curl --json '{…​}').

Webhook/API reference table
Function HTTP Method Request Type (How to select an action) Response Type

StartAction

POST

bindingId, arguments, tracking ID, justification

Execution Tracking ID

StartActionAndWait

POST

actionId, arguments, justification

Log Entry (waits for the action to finish)

StartActionAndWait checks that the caller is allowed to view the action’s logs after the action has finished. A caller that can start an action but cannot view its logs receives a permission error, even though the action has already run - so retrying on that error can run the action again. Use StartAction when you do not need the log entry.
StartActionByGet and StartActionByGetAndWait are deprecated and will be removed in a future version. Use StartAction or StartActionAndWait instead.

You can also browse these methods in the OpenAPI/Swagger docs if you prefer. The Protobuf definition is the source of truth for all request and response fields.

Example API call: Start an action with arguments, and wait for it to finish

curl
user@host: curl 'http://olivetin.example.com:1337/api/StartActionAndWait' --json '{"actionId": "Ping_host", "arguments": [{"name": "host", "value": "example.com"}]}'
{"logEntry":{"actionTitle":"Ping host","output":"...","exitCode":0, ... }}

See Response type: LogEntry for the full response.