sync.member
Sent by the gateway for a sync group when one of its member devices changes standing: it joined or left the group, the bulk-delete guard paused it, it was resumed, its package now declares something different for it, its labels changed, or a member that left was forgotten. Sent once per change. GET /api/tenants/{tenant}/sync/{name}/members shows where each member is with the group’s rows. The envelope has endpoint “sync:
Schema id: urn:houradvantage:events:3:sync.member
Fields
| Field | Type | Required | Description |
|---|---|---|---|
change | "joined" \ | "left" \ | "paused" \ |
endpoint | string | yes | The member’s endpoint. |
device | string | yes | The member device’s id. |
reason | string | Only with paused and forgotten. With paused: why the guard stopped it, in words (“the device cleared its users”, “the device reported data cleared”, “the device deleted more than 20 rows within 10 minutes”). With forgotten: only when the member was forgotten because it left more than retention_days ago, which says so; a member forgotten by DELETE has none. | |
declaration | object | Only with joined and declaration_changed: what the device takes and reports, as its package declares it for this device, with one key per domain it takes part in (people, access, lists, settings, punches). The keys inside follow the package’s sync declaration. | |
labels | object | Only with joined and placement_changed: the member’s labels, name to value (its endpoint’s labels with the device’s own over them), which the group’s placement rules select members by. Empty where the group does not keep people. |
Examples
{ "change": "paused", "endpoint": "office", "device": "CG0001", "reason": "the device reported data cleared"}{ "change": "placement_changed", "endpoint": "office", "device": "CG0001", "labels": { "building": "a", "area": "warehouse" }}JSON Schema
sync.member.json
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "urn:houradvantage:events:3:sync.member", "title": "sync.member: data", "description": "Sent by the gateway for a sync group when one of its member devices changes standing: it joined or left the group, the bulk-delete guard paused it, it was resumed, its package now declares something different for it, its labels changed, or a member that left was forgotten. Sent once per change. GET /api/tenants/{tenant}/sync/{name}/members shows where each member is with the group's rows. The envelope has endpoint \"sync:<group>\", device \"\" and package \"houradvantage-connect\"; the event goes to the sinks the group names.", "type": "object", "properties": { "change": { "enum": [ "joined", "left", "paused", "resumed", "declaration_changed", "placement_changed", "forgotten" ], "description": "joined: an allowed device of an endpoint in the group became a member; it is sent what it takes. left: the device is no longer a member (blocked, forgotten as a device, or its endpoint left the group); nothing is deleted from it, and it is remembered until it confirms the deletes it missed or is forgotten. paused: the bulk-delete guard stopped it (see sync.paused); what it reports is not taken in, and nothing is sent to it, until it is resumed (POST /api/tenants/{tenant}/sync/{name}/members/{endpoint}/{device}/resume). resumed: it is taken in and sent to again. declaration_changed: what its package declares it takes and reports changed (after a firmware upgrade, say); its rows are looked at again. placement_changed: its labels, or the group's placement rules, changed; the people placed on it are looked at again. forgotten: a member that left is no longer remembered (DELETE /api/tenants/{tenant}/sync/{name}/members/{endpoint}/{device}, or retention_days after it left); deletes it never confirmed no longer wait for it." }, "endpoint": { "type": "string", "description": "The member's endpoint." }, "device": { "type": "string", "description": "The member device's id." }, "reason": { "type": "string", "description": "Only with paused and forgotten. With paused: why the guard stopped it, in words (\"the device cleared its users\", \"the device reported data cleared\", \"the device deleted more than 20 rows within 10 minutes\"). With forgotten: only when the member was forgotten because it left more than retention_days ago, which says so; a member forgotten by DELETE has none." }, "declaration": { "type": "object", "description": "Only with joined and declaration_changed: what the device takes and reports, as its package declares it for this device, with one key per domain it takes part in (people, access, lists, settings, punches). The keys inside follow the package's sync declaration." }, "labels": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Only with joined and placement_changed: the member's labels, name to value (its endpoint's labels with the device's own over them), which the group's placement rules select members by. Empty where the group does not keep people." } }, "required": [ "change", "endpoint", "device" ], "examples": [ { "change": "paused", "endpoint": "office", "device": "CG0001", "reason": "the device reported data cleared" }, { "change": "placement_changed", "endpoint": "office", "device": "CG0001", "labels": { "building": "a", "area": "warehouse" } } ]}