4
0

method_StartAction.adoc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. = API Method: StartAction
  2. This is the method the OliveTin web UI uses to start actions, and is probably the best method to use if you are writing scripts.
  3. * **HTTP Method**: `POST`
  4. * **Request Type**: OliveTin request object
  5. * **Response Type**: Execution Tracking ID
  6. There are several variants of this API call available which might be easier for scripts (or humans) to work with:
  7. include::partial$api/start_action_methods.adoc[]
  8. == Example API call: Start an action using `StartAction`
  9. [source,bash]
  10. .curl
  11. ----
  12. user@host: curl "http://olivetin.webapps.teratan.lan/api/StartAction" --json '{"bindingId": "nuclear_reactor_shutdown"}'
  13. ----
  14. [source,powershell]
  15. .Powershell
  16. ----
  17. PS C:\Users\xcons> $json = '{"bindingId": "deploy_attack_gnomes"}'
  18. PS C:\Users\xcons> Invoke-RestMethod -Method "Post" -Uri "http://olivetinServer:1337/api/StartAction" -Body $json
  19. ----
  20. == Example API call: Start an action using `StartAction` with arguments
  21. [source,bash]
  22. .curl
  23. ----
  24. user:host: curl 'http://olivetin.example.com/api/StartAction' --json '{"bindingId": "Ping_host", "arguments": [{"name": "host", "value": "example.com"},{"name": "count", "value": "1"}]}'
  25. ----