v1/automations
Use the v1/automations API to create, update, list, and manage automations and automation run results.
Note that the v1/automations API handles Actor header but only allows a single account for the account-filter header.
URI
https://<hostname>/ws/v1/automations
Formats
HTTP method | Format | Description | Parameters |
---|---|---|---|
GET | /ws/v1/automations | Get a summary of the automations web service. | |
GET | /ws/v1/automations/inventory | Get a list of automations. | |
GET, PUT, DELETE | /ws/v1/automations/inventory/{id} | Get, update, or delete the specified automation. | |
POST | /ws/v1/automations/run | Run automations | |
POST | /ws/v1/automations/runs/cancel/{id} | Cancel the specified automation. | |
GET | /ws/v1/automations/runs/inventory | Get a list of all completed automations. | |
GET, DELETE | /ws/v1/automations/runs/inventory/{id} | Get or delete the specified automation run. | |
GET | /ws/v1/automations/runs/results/{id}/{device_id} | Get the run results for the specified automation by device ID. | |
GET | /ws/v1/automations/runs/status/{id} | Get the status for the specified automation. | |
GET | /ws/v1/automations/runs/status/{id}/{device_id} | Get the status for the specified target device in the specified run. | |
GET | /ws/v1/automations/schedules | Get a list of scheduled automations APIs. | |
GET | /ws/v1/automations/schedules/inventory | Get a list of scheduled automations. | |
GET, PUT, DELETE | /ws/v1/automations/schedules/inventory/{id} | Get, update, or delete a scheduled automation. |
For an automation containing the reboot and firmware_update steps, the default value for the wait_for_reconnect parameter is true. Other step types default to false for wait_for_reconnect.
To delete a run or schedule:
Use the DELETE ws/v1/automations/inventory/{id} web service and specify “true” for either or both delete_runs
or delete_schedules
parameters to also delete any runs or schedules associated with an automation at the same time.
To update the end time for an automation after the start time has occurred use the PUT /ws/v1/automations/schedules/inventory/ with payload such as:
{
"end_time": "2022-03-15T17:40:00.000Z"
}
To remove end_time from a schedule, set end_time to empty string.
- Automation steps are referenced by 1-based indexing, so step 1 is the first step.
- The automation step for “sleep” can sleep (or pause) or a maximum of 3 days.
- The sleep step accepts a “value” parameter of the form “2s”, “2m”, “2h” or “2d” to sleep for 2 seconds, minutes, hours or days respectively. If no suffix character is used, the sleep value is interpreted as seconds.
- The device properties step allow a subset of device properties to be managed by Automations. Device properties that can be managed by Automations: tags, description, notes, maintenance_mode, and group.