@node-net/netconf/operations/yang-library
The YANG library (RFC 8525): which YANG modules a server implements, per datastore, including YANG 1.1 modules that never appear in the hello.
import { yangLibrary, findDatastore } from '@node-net/netconf/operations/yang-library';
const client = await connect({ transport, extensions: [yangLibrary] });
const lib = await client.content.yangLibrary.load(); // cached for this client
const running = findDatastore(lib, 'running');
running?.modules.find((m) => m.name === 'ietf-interfaces')?.features;The result is plain data. To reuse it across sessions, store it keyed by the device and lib.contentId, and compare with client.content.yangLibrary.contentId from the next hello: an unchanged content-id means an unchanged library.
A server with only :yang-library:1.0 (RFC 7895) has the older /modules-state list instead; it is read and returned in the same shape, with version: '1.0', one module set and no datastores.
Each session reads its library once: this module, client.content.loadModules() and the other extensions' support checks share the read (loadYangLibrary()).
Interfaces
- ImportOnlyModule
- LibraryDatastore
- LibraryModule
- LibrarySchema
- ModuleSet
- Submodule
- YangLibrary
- YangLibraryContent
Type Aliases
Variables
Functions
- cachedYangLibrary
- findDatastore
- hasYangLibrary
- loadYangLibrary
- parseModulesState
- parseYangLibrary
- readYangLibrary
- schemaModules
References
DatastoreRef
Re-exports DatastoreRef
Identity
Re-exports Identity