Update daemon job run
/daemon-job-run/{id}
Your daemon process uses this to report a run's progress.
A run does not move back. A completed, failed or stopped run cannot be set to created or running, and a running run cannot be set to created (a daemon runs any created run it is given). Such a request is a 400 and changes nothing: its truto_error_code is daemon_job_run_status_transition, with the stored status in from and the one sent in to. A finished run may be set to another finished status. To run the daemon job again, create a new run.
started_at and finished_at must be ISO 8601 dates and times (or null). A body that isn't a JSON object, or a date that can't be read, is a 400 and changes nothing: fields names the dates.
Path Parameters
Request Body
createdrunningcompletedfailedstopped
Response Body
The arguments for the run, checked against the daemon job's args_schema and args_validation.
The daemon that runs it.
The daemon job this run belongs to.
The ID of the daemon job run.
The run's status. A new run is created; your daemon process updates it.
createdrunningcompletedfailedstopped
Errors
| Status | Description |
|---|---|
400 | The body is not a JSON object, started_at or finished_at is not an ISO 8601 date and time (named in fields), or status is unknown or one the run cannot move to (truto_error_code daemon_job_run_status_transition, with from and to). Nothing is changed. |
404 | Daemon job run not found |
curl -X PATCH 'https://api.truto.one/daemon-job-run/{id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"status": "created",
"started_at": "your_started_at",
"finished_at": "your_finished_at"
}'const body = {
"status": "created",
"started_at": "your_started_at",
"finished_at": "your_finished_at"
};
const response = await fetch('https://api.truto.one/daemon-job-run/{id}', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/daemon-job-run/{id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"status": "created",
"started_at": "your_started_at",
"finished_at": "your_finished_at"
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())