workload
── The capability ───────────────────────────────────────────────────
── The capability ───────────────────────────────────────────────────
At a glance
| Capability | workload |
| Provided by | The device's own driver provides it: each device registers its own provider. |
| Active providers per device | one |
| Device types | workload |
| Device roles | workload: vm, app-container, lxc, app, host |
| Source | packages/types/src/capabilities/workload.cap.ts |
Methods
Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.
| Method | Kind | Required of a provider | Access |
|---|---|---|---|
start | mutation | no | protected |
stop | mutation | no | protected |
restart | mutation | no | protected |
pause | mutation | no | protected |
resume | mutation | no | protected |
forceStop | mutation | no | admin |
getOptions | query | yes | protected |
start
mutation · optional for a provider
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
workload.start | Start | state = "running" |
stop
mutation · optional for a provider
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
workload.stop | Stop | state = "stopped" |
restart
mutation · optional for a provider
Same tier as start / stop and the switch they derive: a restart is a stop and a start.
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
workload.restart | Restart |
pause
mutation · optional for a provider
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
workload.pause | Pause | state = "paused" |
resume
mutation · optional for a provider
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
workload.resume | Resume | state = "running" |
forceStop
mutation · optional for a provider
Admin: a force stop skips the orderly shutdown and can lose data.
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
workload.forceStop | Force stop | state = "stopped" |
getOptions
query
What THIS device can do, probed — the UI is derived from it.
Input
No fields besides deviceId.
Output
What this device can do, probed by its provider: a flag is true only when the platform really serves it for THIS device.
| Field | Type | Required | Description |
|---|---|---|---|
supportsStart | boolean | yes | |
supportsStop | boolean | yes | |
supportsRestart | boolean | yes | |
supportsPause | boolean | yes | Pause AND resume. |
supportsForceStop | boolean | yes | |
hasResources | boolean | yes | |
hasPorts | boolean | yes | |
hasAddresses | boolean | yes | |
hasAutostart | boolean | yes | |
hasUpdateCheck | boolean | yes |
Runtime state
The state Dominevo keeps for each device with this capability, readable without calling the provider.
| Field | Type | Required | Description |
|---|---|---|---|
state | "running" | "paused" | "stopped" | "starting" | "stopping" | "crashed" | null | yes | null = unknown, never stopped. |
since | number | null | yes | Epoch ms the current state began (uptime while running); null when unknown. |
hostDeviceId | number | null | yes | The host device this runs on, when the provider has adopted it. |
image | string | null | yes | The image a container runs (nginx:1.27). |
os | string | null | yes | The operating system (a VM, an LXC, a host). |
version | string | null | yes | The version or firmware it runs. |
autostart | boolean | null | yes | Starts with its host; null when the platform does not say. |
resources | { cpuPercent: number | null; memoryUsedBytes: number | null; memoryPercent?: number | null; memoryLimitBytes: number | null; vcpus: number | null; diskUsedBytes: number | null; diskTotalBytes: number | null; netRxKbps: n… | yes | |
ports | ({ port: number; hostPort: number | null; hostIp: string | null; protocol: "tcp" | "udp" })[] | yes | |
addresses | string[] | yes | The addresses it is reachable on (IPs or host names). |
updateAvailable | boolean | null | yes | A newer image / version exists. Installing it stays the update cap. |
lastFetchedAt | number | yes |
Events
onStarted
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
state | "running" | "paused" | "stopped" | "starting" | "stopping" | "crashed" | yes | |
previous | "running" | "paused" | "stopped" | "starting" | "stopping" | "crashed" | yes | |
since | number | null | yes |
onStopped
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
state | "running" | "paused" | "stopped" | "starting" | "stopping" | "crashed" | yes | |
previous | "running" | "paused" | "stopped" | "starting" | "stopping" | "crashed" | yes | |
since | number | null | yes |
onCrashed
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
state | "running" | "paused" | "stopped" | "starting" | "stopping" | "crashed" | yes | |
previous | "running" | "paused" | "stopped" | "starting" | "stopping" | "crashed" | yes | |
since | number | null | yes |
onRecovered
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
state | "running" | "paused" | "stopped" | "starting" | "stopping" | "crashed" | yes | |
previous | "running" | "paused" | "stopped" | "starting" | "stopping" | "crashed" | yes | |
since | number | null | yes |