From ba5221294379e6001bcb416d4d80619338dde34c Mon Sep 17 00:00:00 2001 From: Tobias Persson Date: Fri, 26 Apr 2024 08:47:23 +0200 Subject: [PATCH] Add the suggested SSE protocol to the documentation --- source/index.rst | 1 + source/sse.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 source/sse.rst diff --git a/source/index.rst b/source/index.rst index 5f963f7a..73141f1c 100644 --- a/source/index.rst +++ b/source/index.rst @@ -13,6 +13,7 @@ Code rules Roles Services + SSE Protocol License Authors diff --git a/source/sse.rst b/source/sse.rst new file mode 100644 index 00000000..7d070af3 --- /dev/null +++ b/source/sse.rst @@ -0,0 +1,44 @@ +.. _sse: + +############ +SSE protocol +############ + +ETOS communicates to clients using SSE (server sent events). For now ETOS only sends log messages using the protocol but we are adding more data about testruns into the protocol. + +.. list-table:: SSE Protocol + :widths: 25 25 25 25 + :header-rows: 1 + + * - Name + - Why + - Example + - State + * - Ping + - Keep the connection alive + - {id: None, event: Ping, data: ""} + - Implemented + * - Shutdown + - Server wants the client to shut down the connection + - {id: None, event: Shutdown, data: "ESR has shut down"} + - Implemented + * - NotFound + - The server cannot find the ESR instance, retry after a while + - {id: None, event: NotFound, data: "ESR not found"} + - Suggested + * - Error + - The server got an error. Retry may be possible + - {id: None, event: Error, data: '{"retry": bool, "reason": "Some sort of error"}} + - Suggested + * - Message + - A user log message from ETOS + - {id: 1, event: message, data: "{'message': 'a message', '@timestamp': '%Y-%m-%dT%H:%M:%S.%fZ', 'levelname': 'INFO', 'name': 'ESR'}"} + - Implemented + * - Artifact + - An artifact to download + - {id: 1, event: Artifact, data: "{'url': 'http://download.me'}"} + - Suggested + * - TestCase + - A test case execution + - {id: 1, event: TestCase, data: "{'id': 'uuid', 'triggered': True, 'started': True, 'finished': False}"} + - Suggested