clients/python: SDK methods for AcknowledgeAlarm + QueryActiveAlarms (PR E.3) #107
Reference in New Issue
Block a user
Delete Branch "track-e3-python-alarm-sdk"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
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 (#105, merged).
GatewayClient.acknowledge_alarm— async unary call routed through the existing_unaryhelper.ensure_protocol_successraises typed gateway errors for non-OK protocol statuses;map_rpc_errorwrapsRpcError→MxGatewayAuthenticationError/MxGatewayAuthorizationErroron Unauthenticated / PermissionDenied.GatewayClient.query_active_alarms— async iterator overActiveAlarmSnapshot. Mirrorsstream_events_raw's cancel-on-close pattern via a dedicated_canceling_active_alarms_iterator.CLI verb (alarms subscribe / acknowledge / query-active) deferred to a follow-up — the SDK surface is what consumers depend on; the CLI port shares the JSON output shape with E.2's .NET CLI for cross-language tooling.
Test plan
tests/test_alarms.py— request shape, Unauthenticated + PermissionDenied mapping, snapshot streaming, filter prefix passthrough, cancel-on-aclose