ReferenceHTTP API
workload
The workload router: 8 methods of the workload capability, with tier, scope, input and output.
Capability workload · scope device · mode singleton · source packages/types/src/capabilities/workload.cap.ts:296.
Every method is called at /trpc/workload.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
getStatus | query | protected | view | yes |
start | mutation | protected | create | yes |
stop | mutation | protected | create | yes |
restart | mutation | protected | create | yes |
pause | mutation | protected | create | yes |
resume | mutation | protected | create | yes |
forceStop | mutation | admin | admin only | no |
getOptions | query | protected | view | yes |
workload.getStatus
- Kind: query —
GET /trpc/workload.getStatus(added by the framework) - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityworkload, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=workload.getStatuson your hub
Input
{ deviceId: number }Output
WorkloadStatusSchemaShapes: WorkloadStatusSchema
workload.start
- Kind: mutation —
POST /trpc/workload.start - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityworkload, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=workload.starton your hub
Input
{ deviceId: number }Output
voidworkload.stop
- Kind: mutation —
POST /trpc/workload.stop - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityworkload, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=workload.stopon your hub
Input
{ deviceId: number }Output
voidworkload.restart
- Kind: mutation —
POST /trpc/workload.restart - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityworkload, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=workload.restarton your hub
Input
{ deviceId: number }Output
voidworkload.pause
- Kind: mutation —
POST /trpc/workload.pause - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityworkload, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=workload.pauseon your hub
Input
{ deviceId: number }Output
voidworkload.resume
- Kind: mutation —
POST /trpc/workload.resume - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityworkload, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=workload.resumeon your hub
Input
{ deviceId: number }Output
voidworkload.forceStop
- Kind: mutation —
POST /trpc/workload.forceStop - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=workload.forceStopon your hub
Input
{ deviceId: number }Output
voidworkload.getOptions
- Kind: query —
GET /trpc/workload.getOptions - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityworkload, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=workload.getOptionson your hub
Input
{ deviceId: number }Output
WorkloadOptionsSchemaShapes: WorkloadOptionsSchema