Dominevo
ReferenceHTTP API

zoneRules

The zoneRules router: 2 methods of the zone-rules capability, with tier, scope, input and output.

Capability zone-rules · scope device · mode singleton · source packages/types/src/capabilities/zone-rules.cap.ts:36.

Every method is called at /trpc/zoneRules.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.

MethodKindTierToken scopeViewer
listRulesqueryprotectedviewyes
setRulesmutationadminadmin onlyno

zoneRules.listRules

  • Kind: query — GET /trpc/zoneRules.listRules
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability zone-rules, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=zoneRules.listRules on your hub

Input

{ deviceId: number; stage: ZoneRuleStageEnum }

Output

ZoneRuleSchema[]

Shapes: ZoneRuleStageEnum · ZoneRuleSchema

zoneRules.setRules

  • Kind: mutation — POST /trpc/zoneRules.setRules
  • 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=zoneRules.setRules on your hub

Input

{ deviceId: number; stage: ZoneRuleStageEnum; rules: ZoneRuleSchema[] }

Output

void

Shapes: ZoneRuleStageEnum · ZoneRuleSchema