Skip to content

@node-net/netconf/operations/subscriptions ​

RFC 8639 subscribed notifications over NETCONF (RFC 8640), with RFC 8641 YANG-Push datastore subscriptions.

ts
import { subscriptions } from '@node-net/netconf/operations/subscriptions';

const client = await connect({ transport, extensions: [subscriptions] });

// An event stream.
await using events = await client.ops.subscriptions.establish({ stream: 'NETCONF' });
for await (const update of events) if (update.type === 'event') console.log(update.notification.event?.name);

// YANG-Push: the selected part of operational, every 10 seconds (periods are in centiseconds).
const telemetry = await client.ops.subscriptions.establish({
  datastore: 'operational',
  filter: subtree(x('interfaces', { xmlns: IF })),
  periodic: { period: 1000 },
});

A session can hold one stream subscription and any number of datastore subscriptions. Stream event records carry no subscription id, so a second stream subscription on the same session would make them ambiguous; it is refused locally. Datastore updates and state changes carry an id and are routed by it, including the ones a server sends before the reply that tells us the id.

<create-subscription> (RFC 5277) and <establish-subscription> are refused locally on a session that already used the other.

The YANG modules are YANG 1.1, so the hello doesn't list them: support is read from the YANG library on first use (support()).

See RFC 8639 subscriptions and YANG-Push.

Classes ​

Interfaces ​

Type Aliases ​

Variables ​

Functions ​

References ​

DatastoreRef ​

Re-exports DatastoreRef


PatchEdit ​

Re-exports PatchEdit


StreamInfo ​

Re-exports StreamInfo


SubscriptionError ​

Re-exports SubscriptionError


SubscriptionOverflowError ​

Re-exports SubscriptionOverflowError

Released under the MIT Licence.