chart/app/notify/ntfy.py

13 lines
435 B
Python

import httpx
async def send_ntfy(server: str, topic: str, message: str) -> None:
if not topic:
return
async with httpx.AsyncClient(timeout=10) as client:
response = await client.post(
f"{server.rstrip('/')}/{topic}",
content=message,
headers={"Title": "/ES confluence", "Priority": "high", "Tags": "chart_with_upwards_trend"},
)
response.raise_for_status()