-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotifier_protocol.py
More file actions
32 lines (20 loc) · 1.29 KB
/
Copy pathnotifier_protocol.py
File metadata and controls
32 lines (20 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from typing import Protocol, runtime_checkable
from models import ContainerUpdateInfo, ExecutionPlan
@runtime_checkable
class Notifier(Protocol):
"""Contract for all notification backends (Discord, Slack, ntfy, Telegram, …)."""
def notify_scan_started(self, total_containers: int, run_mode: str) -> None: ...
def notify_update_started(self, name: str, image: str, old_short_id: str, new_short_id: str, current_status: str, dependents: list[str]) -> None: ...
def notify_update_success(self, info: ContainerUpdateInfo) -> None: ...
def notify_update_failure(self, info: ContainerUpdateInfo) -> None: ...
def notify_dependents_restarted(
self,
restarted: list[str],
failures: list[tuple[str, str]],
) -> None: ...
def notify_rollback(self, name: str, status: str, detail: str = "") -> None: ...
def notify_summary_report(self, summary: dict, infos: list[ContainerUpdateInfo] = None, duration_sec: float = 0.0) -> None: ...
def notify_execution_plan(self, plan: ExecutionPlan, next_run: str = None) -> None: ...
def notify_summary(self, title: str, message: str) -> None: ...
def notify_startup(self, config: dict, hostname: str) -> None: ...
def notify_shutdown(self, reason: str = "Stopped by user (Ctrl+C).") -> None: ...