Programmatically find callpoints

Hi,

is there a way to find which callpoints a yang module has in runtime?
I want to check that my code has registered to all available callpoints and log a warning message if the yang model has defined a callpoint that the code doesn’t handle.

I’m not aware of an API-call, you can however use the confd --status command which, among a lot of other things, show callpoints and registered data providers like this:

$confd --status

user sessions:

callpoints:
id=arpe daemonId=0 daemonName=arpe_daemon

validation points:

actionpoints:

typepoints:

There is indeed no specific API, but since this information is also available in the ‘confd-state’ data tree (YANG modules tailf-confd-monitoring.yang and tailf-common-monitoring.yang), it can be traversed via MAAPI. A very useful function in this case, when you want to check for errors in registration, is maapi_xpath_eval() - a demonstration via the ‘x’ command (invokes maapi_xpath_eval()) in ‘confd_cmd’, with the intro/5-c_stats example -

  • when the daemon has not registered:

$ confd_cmd -c ‘x /confd-state/internal/callpoints/*/error’
/confd-state/internal/callpoints/callpoint{arpe}/error [NOT-REGISTERED]
$

  • and when it has registered:

$ confd_cmd -c ‘x /confd-state/internal/callpoints/*/error’
$

I.e. the ‘error’ leaf only exists when there is an error. See the confd_cmd source in $CONFD_DIR/src/confd/tools/confd_cmd.c regarding how the result above is produced.

Turns out there actually is a way. All information returned from confd --status is available in the tailf-confd-monitoring YANG-model. Specifically, information about callpoints can be found below the path /confd-state/internal/callpoints and it is available for clients using regular MAAPI calls you use to read data from CDB.

The available information looks like this:

$  netconf-console --get -x /confd-state/internal/callpoints
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <data>
    <confd-state xmlns="http://tail-f.com/yang/confd-monitoring">
      <internal>
        <callpoints>
          <callpoint>
            <id>arpe</id>
            <daemon>
              <id>0</id>
              <name>arpe_daemon</name>
            </daemon>
          </callpoint>
        </callpoints>
      </internal>
    </confd-state>
  </data>
</rpc-reply>