# Programmatically find callpoints

**URL:** <https://dmap-community.ductus.global/t/programmatically-find-callpoints/558>\
**Category:** CDB and CDB API\
**Created:** [June 28, 2016, 1:22pm UTC](https://dmap-community.ductus.global/t/programmatically-find-callpoints/558 "2016-06-28T13:22:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kackola](https://avatars.discourse-cdn.com/v4/letter/k/ccd318/32.png) [@Kackola](https://dmap-community.ductus.global/u/Kackola)\
**Post date:** [June 28, 2016, 1:22pm UTC](https://dmap-community.ductus.global/t/programmatically-find-callpoints/558/1 "2016-06-28T13:22:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jjohansson](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jjohansson](https://dmap-community.ductus.global/u/jjohansson)\
**Post date:** [June 28, 2016, 1:48pm UTC](https://dmap-community.ductus.global/t/programmatically-find-callpoints/558/2 "2016-06-28T13:48:45Z")

</div>

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:  
> …

---

<div class="post-metadata">

**Author:** ![per](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@per](https://dmap-community.ductus.global/u/per)\
**Post date:** [June 28, 2016, 2:33pm UTC](https://dmap-community.ductus.global/t/programmatically-find-callpoints/558/3 "2016-06-28T14:33:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jjohansson](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jjohansson](https://dmap-community.ductus.global/u/jjohansson)\
**Post date:** [June 28, 2016, 2:36pm UTC](https://dmap-community.ductus.global/t/programmatically-find-callpoints/558/4 "2016-06-28T14:36:50Z")

</div>

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>
```
