|
@@ -5,53 +5,97 @@ There are several variants of this API call available which might be easier for
|
|
|
|
|
|
|
|
include::partial$api/start_action_methods.adoc[]
|
|
include::partial$api/start_action_methods.adoc[]
|
|
|
|
|
|
|
|
-[#api-request-idurl]
|
|
|
|
|
-== Request type: Action ID in the URL
|
|
|
|
|
|
|
+All request and response field names below are the protobuf JSON names (lowerCamelCase) from the link:https://github.com/OliveTin/OliveTin/blob/main/proto/olivetin/api/v1/olivetin.proto[OliveTin Protobuf definition], which is the source of truth for the API.
|
|
|
|
|
+
|
|
|
|
|
+[#api-ids]
|
|
|
|
|
+== Action IDs vs Binding IDs
|
|
|
|
|
+
|
|
|
|
|
+* `actionId` is the `id` you set on the action in your `config.yaml`. To find your Action ID, and understand how Action IDs work, see the xref:action_customization/ids.adoc[Action ID] documentation.
|
|
|
|
|
+* `bindingId` identifies one button/instance of an action. For a normal action this is the same as the action ID. For actions generated from xref:entities/intro.adoc[entities], each entity gets its own binding ID. Binding IDs are returned by `GetDashboard` (as `action.bindingId`).
|
|
|
|
|
+
|
|
|
|
|
+[#api-request-actionid]
|
|
|
|
|
+== Request type: Action ID only
|
|
|
|
|
|
|
|
Used by:
|
|
Used by:
|
|
|
|
|
|
|
|
*** xref:api/method_StartActionByGet.adoc[StartActionByGet]
|
|
*** xref:api/method_StartActionByGet.adoc[StartActionByGet]
|
|
|
*** xref:api/method_StartActionByGetAndWait.adoc[StartActionByGetAndWait]
|
|
*** xref:api/method_StartActionByGetAndWait.adoc[StartActionByGetAndWait]
|
|
|
|
|
|
|
|
-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, xref:api/method_StartActionByGet.adoc#api-eg-startIdUrl[see the example].
|
|
|
|
|
|
|
+If you are trying to integrate OliveTin with your own scripts or processes, this is probably the easiest way to start actions. You cannot pass arguments with this request type.
|
|
|
|
|
+
|
|
|
|
|
+[source,json]
|
|
|
|
|
+.`StartActionByGetRequest` / `StartActionByGetAndWaitRequest`
|
|
|
|
|
+----
|
|
|
|
|
+{
|
|
|
|
|
+ "actionId": "string"
|
|
|
|
|
+}
|
|
|
|
|
+----
|
|
|
|
|
+
|
|
|
|
|
+See xref:api/method_StartActionByGet.adoc#api-eg-startActionId[the example].
|
|
|
|
|
|
|
|
-[#api-request-obj]
|
|
|
|
|
-== Request type: OliveTin request object
|
|
|
|
|
|
|
+[#api-request-startaction]
|
|
|
|
|
+== Request type: StartAction request object
|
|
|
|
|
|
|
|
Used by:
|
|
Used by:
|
|
|
|
|
|
|
|
*** xref:api/method_StartAction.adoc[StartAction]
|
|
*** xref:api/method_StartAction.adoc[StartAction]
|
|
|
-*** xref:api/method_StartActionAndWait.adoc[StartActionAndWait]
|
|
|
|
|
|
|
+
|
|
|
|
|
+This is the request the OliveTin web UI uses, and gives you the most control over the execution.
|
|
|
|
|
|
|
|
[source,json]
|
|
[source,json]
|
|
|
-.OliveTin request object structure
|
|
|
|
|
|
|
+.`StartActionRequest`
|
|
|
----
|
|
----
|
|
|
{
|
|
{
|
|
|
- "actionId": "string",
|
|
|
|
|
|
|
+ "bindingId": "string",
|
|
|
"arguments": [
|
|
"arguments": [
|
|
|
{
|
|
{
|
|
|
"name": "string",
|
|
"name": "string",
|
|
|
"value": "string"
|
|
"value": "string"
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
- "uniqueTrackingId": "string"
|
|
|
|
|
|
|
+ "uniqueTrackingId": "string",
|
|
|
|
|
+ "justification": "string"
|
|
|
|
|
+}
|
|
|
|
|
+----
|
|
|
|
|
+
|
|
|
|
|
+* `bindingId` (required) - see <<api-ids>>.
|
|
|
|
|
+* `arguments` (optional) - values for the action's xref:args/intro.adoc[arguments].
|
|
|
|
|
+* `uniqueTrackingId` (optional) - if you set this, it is used as the execution tracking ID, otherwise one is generated for you.
|
|
|
|
|
+* `justification` (optional) - the reason for running the action, for actions that require a justification.
|
|
|
|
|
+
|
|
|
|
|
+[source,json]
|
|
|
|
|
+.Example
|
|
|
|
|
+----
|
|
|
|
|
+{
|
|
|
|
|
+ "bindingId": "generate_cryptocurrency",
|
|
|
|
|
+ "arguments": [],
|
|
|
|
|
+ "uniqueTrackingId": "my-tracking-id"
|
|
|
}
|
|
}
|
|
|
----
|
|
----
|
|
|
|
|
|
|
|
-To find your Action ID, and understand how Action IDs work, see the xref:action_customization/ids.adoc[Action ID] documentation
|
|
|
|
|
|
|
+[#api-request-startactionandwait]
|
|
|
|
|
+== Request type: StartActionAndWait request object
|
|
|
|
|
|
|
|
-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;
|
|
|
|
|
|
|
+Used by:
|
|
|
|
|
+
|
|
|
|
|
+*** xref:api/method_StartActionAndWait.adoc[StartActionAndWait]
|
|
|
|
|
|
|
|
[source,json]
|
|
[source,json]
|
|
|
|
|
+.`StartActionAndWaitRequest`
|
|
|
----
|
|
----
|
|
|
{
|
|
{
|
|
|
- "actionId": "Generate cryptocurrency",
|
|
|
|
|
- "arguments": [],
|
|
|
|
|
- "uniqueTrackingId": "my-tracking-id",
|
|
|
|
|
|
|
+ "actionId": "string",
|
|
|
|
|
+ "arguments": [
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "string",
|
|
|
|
|
+ "value": "string"
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ "justification": "string"
|
|
|
}
|
|
}
|
|
|
----
|
|
----
|
|
|
|
|
|
|
|
-More detailed examples can be seen below.
|
|
|
|
|
|
|
+Note that this request selects the action with `actionId` (not `bindingId`), and does not accept a `uniqueTrackingId`.
|
|
|
|
|
|
|
|
[#api-response-trackingid]
|
|
[#api-response-trackingid]
|
|
|
== Response type: Execution Tracking ID
|
|
== Response type: Execution Tracking ID
|
|
@@ -75,29 +119,40 @@ Used by:
|
|
|
*** xref:api/method_StartActionAndWait.adoc[StartActionAndWait]
|
|
*** xref:api/method_StartActionAndWait.adoc[StartActionAndWait]
|
|
|
*** xref:api/method_StartActionByGetAndWait.adoc[StartActionByGetAndWait]
|
|
*** xref:api/method_StartActionByGetAndWait.adoc[StartActionByGetAndWait]
|
|
|
|
|
|
|
|
|
|
+The `output` field contains the combined stdout and stderr of the action.
|
|
|
|
|
+
|
|
|
.Example log entry
|
|
.Example log entry
|
|
|
[source,json]
|
|
[source,json]
|
|
|
----
|
|
----
|
|
|
{
|
|
{
|
|
|
- "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
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ "logEntry": {
|
|
|
|
|
+ "datetimeStarted": "2026-11-12 11:56:29",
|
|
|
|
|
+ "actionTitle": "Restart httpd on server1",
|
|
|
|
|
+ "output": "Restarting httpd...\n",
|
|
|
|
|
+ "timedOut": false,
|
|
|
|
|
+ "exitCode": 0,
|
|
|
|
|
+ "user": "guest",
|
|
|
|
|
+ "userClass": "",
|
|
|
|
|
+ "actionIcon": "🔄",
|
|
|
|
|
+ "tags": [],
|
|
|
|
|
+ "executionTrackingId": "56588051-80da-4b31-8cd8-461a4566e3a9",
|
|
|
|
|
+ "datetimeFinished": "2026-11-12 11:56:31",
|
|
|
|
|
+ "executionStarted": true,
|
|
|
|
|
+ "executionFinished": true,
|
|
|
|
|
+ "blocked": false,
|
|
|
|
|
+ "datetimeIndex": "4",
|
|
|
|
|
+ "canKill": false,
|
|
|
|
|
+ "datetimeRateLimitExpires": "",
|
|
|
|
|
+ "bindingId": "restart_httpd",
|
|
|
|
|
+ "queued": false,
|
|
|
|
|
+ "queuedForGroup": "",
|
|
|
|
|
+ "justification": "",
|
|
|
|
|
+ "arguments": [
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "server",
|
|
|
|
|
+ "value": "server1"
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
----
|
|
----
|