ConfD User Community

Small question about cdb_subscribe()


#1

When using cdb_subscribe() to receive notifications about configuration changes, the user needs to specify a path which describes the portions of the data tree he’s interested in. According to the user guide, this path can refer to single leafs, lists or entire subtrees.

In my case what I’m trying to do is to subscribe to entire YANG modules. Is it possible to do that without having to specify the top-level node(s) of each YANG module?

Since cdb_subscribe() has a nspace parameter, I was expecting that the path given to the ftm parameter would be constrained to the particular module/namespace, but that’s not the case. If I subscribe to / I’ll be notified about changes from the entire data tree (e.g. /aaa:aaa/*). The nspace parameter doesn’t seem to serve any particular purpose (the documentation doesn’t mention anything about it). I tried subscribing to /mymodulename: but that didn’t filter data from other modules too.

I’m under the impression that what I want to do is not possible, but I’d confirm here before giving up :slight_smile:

Regards,
Renato


#2

The purpose of the namespace parameter for cdb_subscribe( ) is to disambiguate between
equally-named toplevel nodes.

I.e. if you have /foo in both the bar and baz namespaces,

cdb_subscribe(s, 3, bar__ns, &spoint, "/foo")

is equivalent to

cdb_subscribe(s, 3, <any valid namespace hash>, &spoint, "/bar:foo")

.

But it doesn’t do anything for “/”, since there can only be one root.


#3

@waitai Thanks a lot for the clarification :slight_smile: