2021-02-16 13:28:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class AutomationsApi extends ApiController
|
|
|
|
{
|
|
|
|
|
|
|
|
public function default()
|
|
|
|
{
|
|
|
|
//$this->requireAuth();
|
|
|
|
$response = [];
|
2021-02-17 07:37:08 +00:00
|
|
|
$response = AutomationManager::getAll(["automation_id","name","enabled"]);
|
2021-02-16 13:28:31 +00:00
|
|
|
|
|
|
|
$this->response($response);
|
|
|
|
}
|
2021-02-16 13:59:27 +00:00
|
|
|
|
|
|
|
public function detail($automationId)
|
|
|
|
{
|
|
|
|
//$this->requireAuth();
|
2021-02-17 07:37:08 +00:00
|
|
|
$response = [];
|
|
|
|
$response = AutomationManager::getById($automationId, ["automation_id", "last_execution_time", "owner_id", "conditions", "tasks"]);
|
2021-02-16 13:59:27 +00:00
|
|
|
|
|
|
|
$this->response($response);
|
|
|
|
}
|
2021-02-16 13:28:31 +00:00
|
|
|
}
|