|
@@ -1,7 +1,7 @@
|
|
|
[#api-start-action]
|
|
[#api-start-action]
|
|
|
= Starting Actions from the API
|
|
= 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 two API methods for starting actions: `StartAction`, which returns straight away, and `StartActionAndWait`, which waits for the action to finish.
|
|
|
|
|
|
|
|
include::partial$api/start_action_methods.adoc[]
|
|
include::partial$api/start_action_methods.adoc[]
|
|
|
|
|
|
|
@@ -13,27 +13,7 @@ All request and response field names below are the protobuf JSON names (lowerCam
|
|
|
* `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.
|
|
* `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`).
|
|
* `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`).
|
|
|
|
|
|
|
|
-NOTE: Despite its name, the `actionId` field used by `StartActionAndWait`, `StartActionByGet` and `StartActionByGetAndWait` is looked up as a binding ID. For normal actions this makes no difference, but for entity-generated actions you must send the entity's binding ID - sending the configured action `id` returns `not_found`.
|
|
|
|
|
-
|
|
|
|
|
-[#api-request-actionid]
|
|
|
|
|
-== Request type: Action ID only
|
|
|
|
|
-
|
|
|
|
|
-Used by:
|
|
|
|
|
-
|
|
|
|
|
-*** xref:api/method_StartActionByGet.adoc[StartActionByGet]
|
|
|
|
|
-*** xref:api/method_StartActionByGetAndWait.adoc[StartActionByGetAndWait]
|
|
|
|
|
-
|
|
|
|
|
-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].
|
|
|
|
|
|
|
+NOTE: Despite its name, the `actionId` field used by `StartActionAndWait` is looked up as a binding ID. For normal actions this makes no difference, but for entity-generated actions you must send the entity's binding ID - sending the configured action `id` returns `not_found`.
|
|
|
|
|
|
|
|
[#api-request-startaction]
|
|
[#api-request-startaction]
|
|
|
== Request type: StartAction request object
|
|
== Request type: StartAction request object
|
|
@@ -105,7 +85,6 @@ Note that this request selects the action with `actionId` (not `bindingId`), and
|
|
|
Used by:
|
|
Used by:
|
|
|
|
|
|
|
|
*** xref:api/method_StartAction.adoc[StartAction]
|
|
*** xref:api/method_StartAction.adoc[StartAction]
|
|
|
-*** xref:api/method_StartActionByGet.adoc[StartActionByGet]
|
|
|
|
|
|
|
|
|
|
.Example Execution Tracking ID response
|
|
.Example Execution Tracking ID response
|
|
|
[source,json]
|
|
[source,json]
|
|
@@ -119,7 +98,6 @@ Used by:
|
|
|
Used by:
|
|
Used by:
|
|
|
|
|
|
|
|
*** xref:api/method_StartActionAndWait.adoc[StartActionAndWait]
|
|
*** xref:api/method_StartActionAndWait.adoc[StartActionAndWait]
|
|
|
-*** xref:api/method_StartActionByGetAndWait.adoc[StartActionByGetAndWait]
|
|
|
|
|
|
|
|
|
|
The `output` field contains the combined stdout and stderr of the action.
|
|
The `output` field contains the combined stdout and stderr of the action.
|
|
|
|
|
|
|
@@ -158,3 +136,23 @@ The `output` field contains the combined stdout and stderr of the action.
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
----
|
|
----
|
|
|
|
|
+
|
|
|
|
|
+[#api-deprecated-byget]
|
|
|
|
|
+== Deprecated: StartActionByGet and StartActionByGetAndWait
|
|
|
|
|
+
|
|
|
|
|
+`StartActionByGet` and `StartActionByGetAndWait` are deprecated, and will be removed in a future version of OliveTin. They only accept an `actionId` (no arguments), and despite their names they no longer support `GET` requests - the OliveTin 2k style of putting the action ID in the URL returns `404`.
|
|
|
|
|
+
|
|
|
|
|
+When either method is called, OliveTin shows a warning on the xref:advanced_configuration/diagnostics.adoc[Diagnostics] page (code `deprecated_api_call`), so you can find integrations that still need updating. The warning is cleared when OliveTin restarts.
|
|
|
|
|
+
|
|
|
|
|
+[%header]
|
|
|
|
|
+|===
|
|
|
|
|
+| Deprecated method | Use instead | Change
|
|
|
|
|
+
|
|
|
|
|
+| xref:api/method_StartActionByGet.adoc[StartActionByGet]
|
|
|
|
|
+| xref:api/method_StartAction.adoc[StartAction]
|
|
|
|
|
+| Send `{"bindingId": "..."}` instead of `{"actionId": "..."}`
|
|
|
|
|
+
|
|
|
|
|
+| xref:api/method_StartActionByGetAndWait.adoc[StartActionByGetAndWait]
|
|
|
|
|
+| xref:api/method_StartActionAndWait.adoc[StartActionAndWait]
|
|
|
|
|
+| Change the method name only - the request is the same
|
|
|
|
|
+|===
|