niwaki v1.3.0
Native APIC object-subscription: a query becomes a live push stream instead
of a one-off read, over the same WebSocket mechanism the APIC GUI itself
uses. Purely additive — the configuration API and the query surface are
unchanged.
Added
-
Query.subscribe()/AsyncQuery.subscribe(). Any single-class query
can be subscribed instead of fetched:.initialgives the synchronous
snapshot, then the returnedSubscription/AsyncSubscriptioniterates
live push events for as long as it stays open. One shared WebSocket per
session multiplexes every subscription; refresh and reconnect run
automatically in the background — nothing here needs a caller-driven loop. -
Typed events. Each item is a
SubscriptionEvent:.kind
(EventKind.CREATED/MODIFIED/DELETED/GAP/REFRESH_FAILED),.mo
deserialised through the same readable field names a normal read uses,
with.mo.model_fields_setreporting exactly what that push carried (the
APIC sends sparse deltas onMODIFIED,dnonly onDELETED). -
Automatic recovery, never silent. The APIC has no replay mechanism at
all, so a reconnect resubscribes everything from scratch and delivers a
GAPevent rather than continuing as if nothing happened. Two consecutive
missed refreshes trigger the same kind of recovery for that one
subscription.SubscriptionLostError— with.reason— is raised only
once recovery itself has been tried and failed. -
Bulk and single-subscription tools.
aci.subscriptions.list()/
.refresh_all()/.close_all()manage every subscription open on a
session at once (close_all()stops them without tearing down the shared
socket);sub.info/sub.refresh_now()do the same for one subscription. -
Validated live against a real fabric: genuine create/modify/delete push
payloads, a realsubscriptionId, and thesubscriptionRefreshendpoint
accepting a real id.