mirror of
https://github.com/hansjone/netx.git
synced 2026-10-10 12:40:44 +08:00
Add DSH key-alarm subscribe hub for outbound netxops clients.
netx hosts /v1/integrations/dsh-alarm/ws; matched key alerts fan out to dialed-in DSH subscribers while the optional oclaw bridge remains. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
bd01440e9d
commit
5e7d14f253
4 changed files with 250 additions and 10 deletions
|
|
@ -5,17 +5,24 @@ from __future__ import annotations
|
|||
import time
|
||||
from typing import Any
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
from fastapi import APIRouter, Depends, WebSocket
|
||||
from sqlalchemy import text as sql_text
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from .config import settings
|
||||
from .db import get_db
|
||||
from .dsh_alarm_hub import dsh_alarm_ws_loop, hub_status
|
||||
from .oclaw_alarm_forwarder import forwarder_status
|
||||
|
||||
router = APIRouter(tags=["health"])
|
||||
|
||||
|
||||
@router.websocket("/v1/integrations/dsh-alarm/ws")
|
||||
async def dsh_alarm_subscribe(websocket: WebSocket) -> None:
|
||||
"""netxops dials out here to receive matched key-alert pushes."""
|
||||
await dsh_alarm_ws_loop(websocket)
|
||||
|
||||
|
||||
@router.get("/health/live", status_code=200)
|
||||
def health_live() -> dict[str, str]:
|
||||
"""Process liveness — no DB or upstream checks."""
|
||||
|
|
@ -130,4 +137,9 @@ def integrations_status(db: Session = Depends(get_db)) -> dict:
|
|||
"forwarder": fwd,
|
||||
}
|
||||
|
||||
return {"netx_api": netx_api, "db": db_status, "oclaw_bridge": oclaw_status}
|
||||
return {
|
||||
"netx_api": netx_api,
|
||||
"db": db_status,
|
||||
"oclaw_bridge": oclaw_status,
|
||||
"dsh_alarm_hub": hub_status(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue