start_action.adoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. [#api-start-action]
  2. = Starting Actions from the API
  3. There are several variants of this API call available which might be easier for scripts (or humans) to work with!
  4. include::partial$api/start_action_methods.adoc[]
  5. [#api-request-idurl]
  6. == Request type: Action ID in the URL
  7. Used by:
  8. *** xref:api/method_StartActionByGet.adoc[StartActionByGet]
  9. *** xref:api/method_StartActionByGetAndWait.adoc[StartActionByGetAndWait]
  10. 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, <<api-eg-startIdUrl,see the example>>.
  11. [#api-request-obj]
  12. == Request type: OliveTin request object
  13. Used by:
  14. *** xref:api/method_StartAction.adoc[StartAction]
  15. *** xref:api/method_StartActionAndWait.adoc[StartActionAndWait]
  16. [source,json]
  17. .OliveTin request object structure
  18. ----
  19. {
  20. "actionId": "string",
  21. "arguments": [
  22. {
  23. "name": "string",
  24. "value": "string"
  25. }
  26. ],
  27. "uniqueTrackingId": "string"
  28. }
  29. ----
  30. To find your Action ID, and understand how Action IDs work, see the xref:action_customization/ids.adoc[Action ID] documentation
  31. 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;
  32. [source,json]
  33. ----
  34. {
  35. "actionId": "Generate cryptocurrency",
  36. "arguments": [],
  37. "uniqueTrackingId": "my-tracking-id",
  38. }
  39. ----
  40. More detailed examples can be seen below.
  41. [#api-response-trackingid]
  42. == Response type: Execution Tracking ID
  43. Used by:
  44. *** xref:api/method_StartAction.adoc[StartAction]
  45. *** xref:api/method_StartActionByGet.adoc[StartActionByGet]
  46. .Example Execution Tracking ID response
  47. [source,json]
  48. ----
  49. {"executionTrackingId":"5bb4860c-bbd0-4bc9-a7d6-42240551500c"}
  50. ----
  51. [#api-response-logentry]
  52. == Response type: LogEntry
  53. Used by:
  54. *** xref:api/method_StartActionAndWait.adoc[StartActionAndWait]
  55. *** xref:api/method_StartActionByGetAndWait.adoc[StartActionByGetAndWait]
  56. .Example log entry
  57. [source,json]
  58. ----
  59. {
  60. "logEntry": {
  61. "datetimeStarted": "2024-02-27 14:14:49",
  62. "actionTitle": "Restart httpd on server1",
  63. "stdout": "",
  64. "stderr": "",
  65. "timedOut": true,
  66. "exitCode": -1,
  67. "user": "",
  68. "userClass": "",
  69. "actionIcon": "&#128260;",
  70. "tags": [
  71. ],
  72. "executionTrackingId": "b04b1e90-d457-4158-b7dc-da9e81f21568",
  73. "datetimeFinished": "2024-02-27 14:14:52",
  74. "actionId": "restart_httpd",
  75. "executionStarted": true,
  76. "executionFinished": true,
  77. "blocked": false
  78. }
  79. }
  80. ----