Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Code rules <coderules>
Roles <roles/index>
Services <services/index>
SSE Protocol <sse>

License <license>
Authors <authors>
Expand Down
44 changes: 44 additions & 0 deletions source/sse.rst
Original file line number Diff line number Diff line change
@@ -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