Skip to content

Commit 400319b

Browse files
docs(http-api): document SSE events across API endpoints
- Add SSE Events section to check endpoint documentation - Add SSE Events section to update endpoint documentation - Document scan and update event broadcasting conditions in events endpoint
1 parent 6f6ff20 commit 400319b

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

docs/http-api/endpoints/check/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,15 @@ The `/v1/check` endpoint returns a JSON array of container check results:
8484
| 200 | Check completed successfully |
8585
| 401 | Invalid or missing authentication token |
8686
| 500 | Internal server error during request processing|
87+
88+
## SSE Events
89+
90+
When the [`/v1/events`](../events/index.md) SSE endpoint is also enabled, execution of the `v1/check` endpoint broadcasts the following events:
91+
92+
- `scan_started`: Broadcasted before the check begins
93+
- `scan_completed`: Broadcasted after the check finishes successfully
94+
- `scan_failed`: Broadcasted if the check encounters an error
95+
96+
!!! Note
97+
The `scan_completed` payload always reports `updated: 0` because no updates are applied.
98+
The `failed` field counts containers whose per-container check returned an error.

docs/http-api/endpoints/events/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,20 @@ The events endpoint uses a separate token from the main API token to limit blast
4848

4949
- Started
5050
- Completed
51+
- Failed
52+
53+
!!! Note
54+
Scan events are broadcasted only for updates (HTTP API or scheduled) or checks (HTTP API).
5155

5256
### Update Events
5357

5458
- Started
5559
- Completed
5660
- Failed
5761

62+
!!! Note
63+
Update events are broadcasted only for HTTP API or scheduled updates.
64+
5865
## Event Format
5966

6067
Each event is a Server-Sent Event with an event type and JSON data payload:

docs/http-api/endpoints/update/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,3 +307,12 @@ services:
307307

308308
!!! Warning
309309
Enabling the HTTP API with port mappings will automatically disable Watchtower's self-update functionality to prevent port conflicts during container recreation. See [Updating Watchtower](../../../getting-started/updating-watchtower/index.md#port_configuration_limitation) for more details.
310+
311+
## SSE Events
312+
313+
When the [`/v1/events`](../events/index.md) SSE endpoint is also enabled, the update process broadcasts the following events:
314+
315+
- `scan_started`: Broadcasted before the update scan begins
316+
- `scan_completed`: Broadcasted after the update scan finishes
317+
- `scan_failed`: Broadcasted if the update scan encounters an error
318+
- `image_cleanup`: Broadcasted after image cleanup if enabled and images were removed

0 commit comments

Comments
 (0)