diff --git a/docs/streaming.md b/docs/streaming.md index 38c71b5..e20336a 100644 --- a/docs/streaming.md +++ b/docs/streaming.md @@ -38,7 +38,9 @@ for each OP below. They are not stored inside of a `d` object, like Discord's ga |1|`SUBSCRIBED`|Received| |2|`UNSUBSCRIBED`|Received| |3|`DATA`|Received| - +|4|`INCIDENT_NEW`|Received| +|5|`INCIDENT_UPDATE`|Received| +|6|`INCIDENT_CLOSE`|Received| ## OP Payloads @@ -58,6 +60,13 @@ for each OP below. They are not stored inside of a `d` object, like Discord's ga - The first element of `d` is an integer, encoding an UNIX timestamp with millisecond precision. - The second element of `d` is described on *`Channel types`* + - `INCIDENT_NEW` + - data: `d` (`dict`), an incident payload + - `INCIDENT_UPDATE` + - data: `d` (`dict`), an incident payload. + - `INCIDENT_CLOSE` + - data: `d` (`dict`), an incident payload, containing at least the `id` field. + ## Channel names @@ -66,6 +75,10 @@ are formatted like: `:` e.g `status:elixire` and `graph:elixire` +**There is a special channel for incident reporting(OP codes 4, 5 and 6): `incidents`** + +***TODO: incident types, stage types, etc.*** + ### Channel types - `status` channel - Returns a boolean, representing the status of the service @@ -78,3 +91,4 @@ e.g `status:elixire` and `graph:elixire` - Connect a websocket to `/api/streaming`. - Send a `SUBSCRIBE` payload, receive `SUBSCRIBED` back - Listen to `DATA` payloads and update local state as needed. + - Optionally: listen to `INCIDENT_{NEW|UPDATE|CLOSE}` diff --git a/elstat/blueprints/streaming.py b/elstat/blueprints/streaming.py index 4d1b778..049044b 100644 --- a/elstat/blueprints/streaming.py +++ b/elstat/blueprints/streaming.py @@ -20,7 +20,7 @@ class OP: # incident specific INCIDENT_NEW = 4 INC_UPDATE = 5 - INCIDENT_CLOSE = 7 + INCIDENT_CLOSE = 6 class ErrorCodes: