diff --git a/netx_api/ume_alarm_ws_consumer.py b/netx_api/ume_alarm_ws_consumer.py index 4181db9..862dd2e 100644 --- a/netx_api/ume_alarm_ws_consumer.py +++ b/netx_api/ume_alarm_ws_consumer.py @@ -29,6 +29,8 @@ from .ume_alarm_ws_subscription import ( from .ume_client import UMEClient from .ume_sync_service import ( _alarm_key, + _utc_now_naive, + apply_alarm_to_current, extract_alarm_from_notification, normalize_yang_alarm, ) diff --git a/netx_api/ume_alarm_ws_log.py b/netx_api/ume_alarm_ws_log.py index a71b7ae..2506573 100644 --- a/netx_api/ume_alarm_ws_log.py +++ b/netx_api/ume_alarm_ws_log.py @@ -23,6 +23,9 @@ _SUBSCRIPTION_MISSING_MARKERS: tuple[str, ...] = ( "status-code: 404", "status-reason: subscription not found", "non-101 status: 503", + "non-101 status: 404", + "handshake status 404", + "handshake status 503", ) diff --git a/netx_api/ume_client.py b/netx_api/ume_client.py index f526a0c..30dfbf7 100644 --- a/netx_api/ume_client.py +++ b/netx_api/ume_client.py @@ -656,10 +656,11 @@ class UMEClient: def ws_auth_headers(self) -> dict[str, str]: """ - Headers for WSS handshake — same fields as REST (_headers). + Headers for WSS handshake — accessToken only (no REST content-type). Does not login/renew; relies on shared token store (token_keepalive / other sync paths). """ self._sync_token_from_store() if not self.has_valid_token(): raise RuntimeError("ume_ws_no_valid_token") - return self._headers(include_token=True) + token = self._token_value.strip() + return {self.auth_header: token} diff --git a/netx_api/ume_sync_common.py b/netx_api/ume_sync_common.py index 5a523b2..a0ae207 100644 --- a/netx_api/ume_sync_common.py +++ b/netx_api/ume_sync_common.py @@ -4,6 +4,7 @@ from __future__ import annotations from datetime import datetime from typing import Any +from sqlalchemy import text as sql_text from sqlalchemy.orm import Session from .models import UmeAlarmCurrent, UmeAlarmHistory, UmeInventoryNE