/api/v1/campaign-runsList runs#
List campaign executions.
Returns every recorded campaign execution, finished or not, with its position in the campaign, its step attempts and its verdict. Execution state is persistent and survives a restart of the device.
Responses
200OKapplication/json
array of CampaignStateDRO
idrequiredstring
campaignrequiredstring
statusrequiredstring
cursorrequiredinteger
total_steps requiredinteger
verdictboolean · nullable
true / false / null. null until the campaign has finished: a campaign
that did not run to completion has no verdict.
pause_requested requiredboolean
A pause is asked for and has not yet taken effect.
attemptsrequiredarray of AttemptDRO
AttemptDRO · 5 fields
steprequiredstring
outcomerequiredstring
run_id string · nullable
detailrequiredstring
at_uptime_ms requiredinteger · int64
Milliseconds since the daemon started, not since the epoch. The device has no real-time clock, so this is not a wall-clock time.
started_at_uptime_ms requiredinteger · int64
Request
curl "http://192.168.2.1:8080/api/v1/campaign-runs"import requests
BASE_URL = "http://192.168.2.1:8080"
response = requests.get(f"{BASE_URL}/api/v1/campaign-runs")
response.raise_for_status()
print(response.json())let base_url = "http://192.168.2.1:8080";
let response = reqwest::Client::new()
.get(format!("{base_url}/api/v1/campaign-runs"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
[
{
"id": "string",
"campaign": "string",
"status": "string",
"cursor": 0,
"total_steps": 0,
"verdict": true,
"pause_requested": true,
"attempts": [
{
"step": "string",
"outcome": "string",
"run_id": "string",
"detail": "string",
"at_uptime_ms": 0
}
],
"started_at_uptime_ms": 0
}
]/api/v1/campaign-runs/{id}Get run#
Get a campaign execution.
verdict is null until the campaign has finished: a campaign that did not run
to completion has no verdict. Attempt times count from daemon start, not
wall-clock time.
Path parameters
idrequiredstring
Execution id
Responses
200OKapplication/json
idrequiredstring
campaignrequiredstring
statusrequiredstring
cursorrequiredinteger
total_steps requiredinteger
verdictboolean · nullable
true / false / null. null until the campaign has finished: a campaign
that did not run to completion has no verdict.
pause_requested requiredboolean
A pause is asked for and has not yet taken effect.
attemptsrequiredarray of AttemptDRO
AttemptDRO · 5 fields
steprequiredstring
outcomerequiredstring
run_id string · nullable
detailrequiredstring
at_uptime_ms requiredinteger · int64
Milliseconds since the daemon started, not since the epoch. The device has no real-time clock, so this is not a wall-clock time.
started_at_uptime_ms requiredinteger · int64
404Not foundapplication/json
Request
curl "http://192.168.2.1:8080/api/v1/campaign-runs/<id>"import requests
BASE_URL = "http://192.168.2.1:8080"
id = "<id>" # Execution id
response = requests.get(f"{BASE_URL}/api/v1/campaign-runs/{id}")
response.raise_for_status()
print(response.json())let base_url = "http://192.168.2.1:8080";
let id = "<id>"; // Execution id
let response = reqwest::Client::new()
.get(format!("{base_url}/api/v1/campaign-runs/{id}"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
{
"id": "string",
"campaign": "string",
"status": "string",
"cursor": 0,
"total_steps": 0,
"verdict": true,
"pause_requested": true,
"attempts": [
{
"step": "string",
"outcome": "string",
"run_id": "string",
"detail": "string",
"at_uptime_ms": 0
}
],
"started_at_uptime_ms": 0
}{}/api/v1/campaign-runs/{id}/pausePause#
Pause a campaign execution.
The pause takes effect at the next step boundary: the step in progress runs to
completion. Returns 202 with pause_requested: true until the pause has taken
effect.
Path parameters
idrequiredstring
Execution id
Responses
202Pause requested — it takes effect at the next step boundaryapplication/json
idrequiredstring
campaignrequiredstring
statusrequiredstring
cursorrequiredinteger
total_steps requiredinteger
verdictboolean · nullable
true / false / null. null until the campaign has finished: a campaign
that did not run to completion has no verdict.
pause_requested requiredboolean
A pause is asked for and has not yet taken effect.
attemptsrequiredarray of AttemptDRO
AttemptDRO · 5 fields
steprequiredstring
outcomerequiredstring
run_id string · nullable
detailrequiredstring
at_uptime_ms requiredinteger · int64
Milliseconds since the daemon started, not since the epoch. The device has no real-time clock, so this is not a wall-clock time.
started_at_uptime_ms requiredinteger · int64
404Not foundapplication/json
Request
curl -X POST "http://192.168.2.1:8080/api/v1/campaign-runs/<id>/pause"import requests
BASE_URL = "http://192.168.2.1:8080"
id = "<id>" # Execution id
response = requests.post(f"{BASE_URL}/api/v1/campaign-runs/{id}/pause")
response.raise_for_status()
print(response.json())let base_url = "http://192.168.2.1:8080";
let id = "<id>"; // Execution id
let response = reqwest::Client::new()
.post(format!("{base_url}/api/v1/campaign-runs/{id}/pause"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
{
"id": "string",
"campaign": "string",
"status": "string",
"cursor": 0,
"total_steps": 0,
"verdict": true,
"pause_requested": true,
"attempts": [
{
"step": "string",
"outcome": "string",
"run_id": "string",
"detail": "string",
"at_uptime_ms": 0
}
],
"started_at_uptime_ms": 0
}{}/api/v1/campaign-runs/{id}/resumeResume#
Resume a campaign execution.
Continues the execution in the background from the step where it stopped, and returns 202. Refused with 409 when the execution has already finished or another campaign is running.
Path parameters
idrequiredstring
Execution id
Responses
202Acceptedapplication/json
idrequiredstring
campaignrequiredstring
statusrequiredstring
cursorrequiredinteger
total_steps requiredinteger
verdictboolean · nullable
true / false / null. null until the campaign has finished: a campaign
that did not run to completion has no verdict.
pause_requested requiredboolean
A pause is asked for and has not yet taken effect.
attemptsrequiredarray of AttemptDRO
AttemptDRO · 5 fields
steprequiredstring
outcomerequiredstring
run_id string · nullable
detailrequiredstring
at_uptime_ms requiredinteger · int64
Milliseconds since the daemon started, not since the epoch. The device has no real-time clock, so this is not a wall-clock time.
started_at_uptime_ms requiredinteger · int64
409Finished, or another campaign is runningapplication/json
Request
curl -X POST "http://192.168.2.1:8080/api/v1/campaign-runs/<id>/resume"import requests
BASE_URL = "http://192.168.2.1:8080"
id = "<id>" # Execution id
response = requests.post(f"{BASE_URL}/api/v1/campaign-runs/{id}/resume")
response.raise_for_status()
print(response.json())let base_url = "http://192.168.2.1:8080";
let id = "<id>"; // Execution id
let response = reqwest::Client::new()
.post(format!("{base_url}/api/v1/campaign-runs/{id}/resume"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
{
"id": "string",
"campaign": "string",
"status": "string",
"cursor": 0,
"total_steps": 0,
"verdict": true,
"pause_requested": true,
"attempts": [
{
"step": "string",
"outcome": "string",
"run_id": "string",
"detail": "string",
"at_uptime_ms": 0
}
],
"started_at_uptime_ms": 0
}{}/api/v1/campaign-runs/{id}/steps/{step}/rerunRerun step#
Re-run one step of a campaign execution.
Runs the named step again and waits for it to finish; the reply carries the new attempt appended to the execution. Refused with 409 while the campaign is running.
Path parameters
idrequiredstring
Execution id
steprequiredstring
Step id, as the campaign names it
Responses
200OKapplication/json
idrequiredstring
campaignrequiredstring
statusrequiredstring
cursorrequiredinteger
total_steps requiredinteger
verdictboolean · nullable
true / false / null. null until the campaign has finished: a campaign
that did not run to completion has no verdict.
pause_requested requiredboolean
A pause is asked for and has not yet taken effect.
attemptsrequiredarray of AttemptDRO
AttemptDRO · 5 fields
steprequiredstring
outcomerequiredstring
run_id string · nullable
detailrequiredstring
at_uptime_ms requiredinteger · int64
Milliseconds since the daemon started, not since the epoch. The device has no real-time clock, so this is not a wall-clock time.
started_at_uptime_ms requiredinteger · int64
409The campaign is runningapplication/json
Request
curl -X POST "http://192.168.2.1:8080/api/v1/campaign-runs/<id>/steps/<step>/rerun"import requests
BASE_URL = "http://192.168.2.1:8080"
id = "<id>" # Execution id
step = "<step>" # Step id, as the campaign names it
response = requests.post(f"{BASE_URL}/api/v1/campaign-runs/{id}/steps/{step}/rerun")
response.raise_for_status()
print(response.json())let base_url = "http://192.168.2.1:8080";
let id = "<id>"; // Execution id
let step = "<step>"; // Step id, as the campaign names it
let response = reqwest::Client::new()
.post(format!("{base_url}/api/v1/campaign-runs/{id}/steps/{step}/rerun"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
{
"id": "string",
"campaign": "string",
"status": "string",
"cursor": 0,
"total_steps": 0,
"verdict": true,
"pause_requested": true,
"attempts": [
{
"step": "string",
"outcome": "string",
"run_id": "string",
"detail": "string",
"at_uptime_ms": 0
}
],
"started_at_uptime_ms": 0
}{}/api/v1/campaignsList#
List campaigns.
Returns every campaign loaded on the device, with its step count, tags and schedule when it has one. Campaign routes return 501 when the device has no persistent storage configured for campaigns.
Responses
200OKapplication/json
array of CampaignSummaryDRO
namerequiredstring
display_name string · nullable
descriptionrequiredstring
stepsrequiredinteger
cronstring · nullable
The cron expression, when this campaign schedules itself.
tagsrequiredarray of string
Request
curl "http://192.168.2.1:8080/api/v1/campaigns"import requests
BASE_URL = "http://192.168.2.1:8080"
response = requests.get(f"{BASE_URL}/api/v1/campaigns")
response.raise_for_status()
print(response.json())let base_url = "http://192.168.2.1:8080";
let response = reqwest::Client::new()
.get(format!("{base_url}/api/v1/campaigns"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
[
{
"name": "string",
"display_name": "string",
"description": "string",
"steps": 0,
"cron": "string",
"tags": [
"string"
]
}
]/api/v1/campaigns/activeActive#
Get the active campaign.
Returns the campaign execution in progress, or active: null when none is,
together with a description of who would carry out a board action (such as a
power cycle) requested by a campaign step.
Responses
200OKapplication/json
activeActiveDRO · nullable
ActiveDRO · 5 fields
idrequiredstring
campaignrequiredstring
cursorrequiredinteger
totalrequiredinteger
pausingrequiredboolean
board_provider requiredstring
Who would perform a board action (such as a power cycle) requested by a campaign step, in words.
Request
curl "http://192.168.2.1:8080/api/v1/campaigns/active"import requests
BASE_URL = "http://192.168.2.1:8080"
response = requests.get(f"{BASE_URL}/api/v1/campaigns/active")
response.raise_for_status()
print(response.json())let base_url = "http://192.168.2.1:8080";
let response = reqwest::Client::new()
.get(format!("{base_url}/api/v1/campaigns/active"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
{
"active": {
"id": "string",
"campaign": "string",
"cursor": 0,
"total": 0,
"pausing": true
},
"board_provider": "string"
}/api/v1/campaigns/{name}Get one#
Get a campaign.
Returns the full campaign document: metadata, steps, pass criteria and schedule.
Path parameters
namerequiredstring
Campaign identifier
Responses
404Not foundapplication/json
Request
curl "http://192.168.2.1:8080/api/v1/campaigns/<name>" \
-o response.binimport requests
BASE_URL = "http://192.168.2.1:8080"
name = "<name>" # Campaign identifier
response = requests.get(f"{BASE_URL}/api/v1/campaigns/{name}")
response.raise_for_status()
data = response.contentlet base_url = "http://192.168.2.1:8080";
let name = "<name>"; // Campaign identifier
let response = reqwest::Client::new()
.get(format!("{base_url}/api/v1/campaigns/{name}"))
.send()
.await?
.error_for_status()?;
let bytes = response.bytes().await?;Response
{}/api/v1/campaigns/{name}/runRun#
Start a campaign.
Starts the named campaign in the background and returns its execution state with
202. Only one campaign runs at a time: a start while another campaign is running
is refused with 409. Follow progress with GET /api/v1/campaign-runs/{id}.
Path parameters
namerequiredstring
Campaign to run
Responses
202Acceptedapplication/json
idrequiredstring
campaignrequiredstring
statusrequiredstring
cursorrequiredinteger
total_steps requiredinteger
verdictboolean · nullable
true / false / null. null until the campaign has finished: a campaign
that did not run to completion has no verdict.
pause_requested requiredboolean
A pause is asked for and has not yet taken effect.
attemptsrequiredarray of AttemptDRO
AttemptDRO · 5 fields
steprequiredstring
outcomerequiredstring
run_id string · nullable
detailrequiredstring
at_uptime_ms requiredinteger · int64
Milliseconds since the daemon started, not since the epoch. The device has no real-time clock, so this is not a wall-clock time.
started_at_uptime_ms requiredinteger · int64
404Not foundapplication/json
409Another campaign is runningapplication/json
Request
curl -X POST "http://192.168.2.1:8080/api/v1/campaigns/<name>/run"import requests
BASE_URL = "http://192.168.2.1:8080"
name = "<name>" # Campaign to run
response = requests.post(f"{BASE_URL}/api/v1/campaigns/{name}/run")
response.raise_for_status()
print(response.json())let base_url = "http://192.168.2.1:8080";
let name = "<name>"; // Campaign to run
let response = reqwest::Client::new()
.post(format!("{base_url}/api/v1/campaigns/{name}/run"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
{
"id": "string",
"campaign": "string",
"status": "string",
"cursor": 0,
"total_steps": 0,
"verdict": true,
"pause_requested": true,
"attempts": [
{
"step": "string",
"outcome": "string",
"run_id": "string",
"detail": "string",
"at_uptime_ms": 0
}
],
"started_at_uptime_ms": 0
}{}{}