Joseph Doherty
|
168bb9a39a
|
clients/python: SDK methods for AcknowledgeAlarm + QueryActiveAlarms (PR E.3)
Eighth PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface
on the Python async SDK. Depends on PR E.1 (regen, merged).
- GatewayClient.acknowledge_alarm — async unary call routed through
the existing _unary helper. ensure_protocol_success raises typed
gateway errors for non-OK protocol statuses; map_rpc_error wraps
RpcError → MxGatewayAuthenticationError /
MxGatewayAuthorizationError on Unauthenticated /
PermissionDenied responses.
- GatewayClient.query_active_alarms — async iterator over
ActiveAlarmSnapshot. Mirrors stream_events_raw's cancel-on-close
pattern via a dedicated _canceling_active_alarms_iterator (typed
for ActiveAlarmSnapshot).
Tests:
- 6 new tests in test_alarms.py — request shape, Unauthenticated +
PermissionDenied mapping, snapshot streaming, filter prefix
passthrough, cancel-on-aclose semantics.
- Full Python test suite: 39 passed (was 33; 6 new).
CLI verb (alarms subscribe / acknowledge / query-active) deferred —
the SDK surface is what lmxopcua consumes; CLI follow-up shares the
JSON output shape with E.2's .NET CLI for cross-language tooling.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-04-30 16:50:31 -04:00 |
|