{ "format": 1, "seat": "mesh-watchdogs", "scope": "mesh", "grain": "whole", "domain": "Health and repair", "decision": "novox/hq ADR 0564, ADR 0634, ADR 0635", "description": "The watchman's seat (ADR 0564, ADR 0433): signals that expire unless renewed, what stopped moving, who is present, the dead letters.", "verbs": [ { "name": "signals", "description": "Every watchdog of the signals table the watchman keeps, each a key that expires unless its signal renews it: its row, what renews it, its bound, the age of its newest signal, and the finding its expiry wrote.", "input": { "properties": { "row": { "description": "one row, e.g. S1", "type": "string" } }, "type": "object" }, "answer": { "type": "object", "description": "the watchdog table" } }, { "name": "stuck", "description": "Every want, build or step the watchman says stopped moving past its bound, with since when and the words of its finding.", "input": { "properties": { "machine": { "description": "only those on this machine", "type": "string" } }, "type": "object" }, "answer": { "type": "object", "description": "what stopped moving" } }, { "name": "presence", "description": "Every machine and tool runner the watchman sees connected, with its last word, and those it says silent; a machine that said it sleeps is shown as sleeping, not silent. With machine, that machine's presence alone: whether the watchman hears it and since when.", "input": { "properties": { "machine": { "description": "one machine", "type": "string" } }, "type": "object" }, "answer": { "type": "object", "description": "with machine, that machine: online and since; without, every key of the state presence", "properties": { "machine": { "type": "string", "description": "the machine asked, with machine" }, "online": { "type": "boolean", "description": "with machine: whether the watchman hears the machine now; false for a machine it holds no word of" }, "since": { "type": "string", "description": "with machine: when its presence last changed, RFC 3339; empty for a machine the watchman holds no word of" }, "state": { "type": "string", "description": "without machine: the state read, presence" }, "holds": { "type": "integer", "description": "without machine: how many keys the state holds" }, "keys": { "type": "array", "description": "without machine: each key of the state presence, or part.., with its value", "items": { "type": "object", "properties": { "key": { "type": "string", "description": " or part.." }, "value": { "type": "object", "description": "the key's value, online and its layout's version" }, "revision": { "type": "integer", "description": "the key's revision" } }, "required": [ "key", "value" ] } } } } }, { "name": "dead-letters", "description": "Every message a consumer on the bus gave up on, kept in DEAD_LETTERS: whose consumer, the subject, how often it was handed over and when it was given up, newest first. With id: that one whole. With deliver or drop, a hand act with why.", "input": { "properties": { "cause": { "description": "with deliver or drop: the cause in a word (dead-letter when absent)", "type": "string" }, "consumer": { "description": "a consumer's name, or .: only what that one gave up on", "type": "string" }, "deliver": { "description": "a dead letter's id: deliver it again to the consumer that gave it up (needs why)", "type": "string" }, "drop": { "description": "a dead letter's id: drop it for good (needs why)", "type": "string" }, "id": { "description": "a dead letter's id, as the list gives it: that one whole, with its message", "type": "string" }, "limit": { "description": "how many to list, newest first (default 50); only when listing", "type": "string" }, "why": { "description": "with deliver or drop: why, required and recorded", "type": "string" } }, "type": "object" }, "answer": { "type": "object", "description": "the dead letters, one whole, or the act done" } }, { "name": "resync", "description": "Rebuild presence from the bus's connections, and the pulses and findings from the keys the watchman watches, and take every dead-letter notice waiting: the recovery of a watchman that missed a change.", "input": { "properties": {}, "type": "object" }, "answer": { "type": "object", "description": "what was rebuilt" } } ], "events": [ { "name": "machine-away", "subject": "machine-away.", "keep": { "max-age-days": 90, "max-mib": 16 }, "body": { "type": "object", "description": "the watchman's presence key of a machine expired (ADR 0564 4); published by the holder of this seat alone for another machine (design 47 G 436)", "properties": { "v": { "type": "integer", "description": "the layout's version" }, "machine": { "type": "string", "description": "the machine whose presence changed" }, "at": { "type": "string", "format": "date-time" }, "last-heard": { "type": "string", "format": "date-time", "description": "when the machine was last heard" } }, "required": [ "v", "machine", "at", "last-heard" ] } }, { "name": "machine-back", "subject": "machine-back.", "keep": { "max-age-days": 90, "max-mib": 16 }, "body": { "type": "object", "description": "a machine is heard again after it was away", "properties": { "v": { "type": "integer", "description": "the layout's version" }, "machine": { "type": "string", "description": "the machine whose presence changed" }, "at": { "type": "string", "format": "date-time" }, "last-heard": { "type": "string", "format": "date-time", "description": "when the machine was last heard" } }, "required": [ "v", "machine", "at", "last-heard" ] } } ], "family": { "name": "mesh-watchdogs.events", "max-age-days": 7 }, "states": [ { "name": "presence", "template": "state", "key-forms": [ { "key": "", "value": { "type": "object", "description": "whether a node is online", "properties": { "v": { "type": "integer" }, "online": { "type": "boolean" } }, "required": [ "online" ] }, "description": "a node" }, { "key": "part..", "value": { "type": "object", "description": "whether a part's instance is online", "properties": { "v": { "type": "integer" }, "online": { "type": "boolean" } }, "required": [ "online" ] }, "description": "a part's instance" } ], "history": 20, "description": "who is connected; the entry's own time says since when" }, { "name": "pulse", "template": "state", "key-forms": [ { "key": ".", "value": { "type": "object", "description": "a watched key mirrored, its revision, and who owes the next move", "properties": { "v": { "type": "integer" }, "bucket": { "type": "string" }, "key": { "type": "string" }, "revision": { "type": "integer" }, "owes": { "type": "string" } }, "required": [ "bucket", "key", "revision" ] }, "description": "the move watched at a key of a state" } ], "description": "one key per watched move, living for the move's bound minus its age" }, { "name": "stuck", "template": "state", "key-forms": [ { "key": ".", "value": { "type": "object", "description": "what stopped moving", "properties": { "v": { "type": "integer" }, "bucket": { "type": "string" }, "key": { "type": "string" }, "waited": { "type": "string", "description": "what it waited for, in words" }, "since": { "type": "string", "format": "date-time" }, "moved": { "type": "boolean", "description": "it has moved again" } }, "required": [ "bucket", "key", "since" ] }, "description": "a key whose pulse expired" } ], "description": "what stopped moving; no key is removed, one that moves again is written as moved" } ] }