ConfD User Community

How to write RPC callback without callpoint defined in yang


#1

I know that in Example of cond, we can define: tailf:actionpoint activate-point in an RPC YANG definition, in that way, we can create:

@ActionCallback(callPoint = "activate-point", callType =
                ActionCBType.ACTION)

to reply that RPC call.

BUT some yang files RPC does not set this tailf:actionpoint element, how we define our ActionCallback method [JAVA]??

e,g.

rpc software-activate {
     input {
      leaf slot-name {
       ....
    }
    output {
      leaf status {
      ...........

in examples.confd\intro\java\12-maapi, there are :

@ActionCallback(callPoint = "show_items_with_value_cp", callType =
                ActionCBType.COMMAND)

===> where “show_items_with_value_cp” was defined, what is COMMAND

   @DataCallback(callPoint = maapi_example.callpoint_items,
                callType = DataCBType.GET_NEXT) 

===> what is DataCallback

where we can find document on these , not ound in usage doc or example.


#2

In example examples.confd\intro\java\12-maapi the callpoint is not YANG action callpoint, but clispec callpoint, found in commands-c.cli.

Example how to use actions is in examples.confd/intro/java/7-actions/config.yang. The tailf:action is present inside YANG file. If you have yang file that cannot be modified, you can write action into separate annotation file and annotate it. See ConfD user guide, YNAG chapter - Using a YANG annotation file and tailf:annotation statement.


#3

Thanks mnovak, basically I got what you mean, but could you give a little more description on clispec callpoint,

also where I can find doc on actionCB or dataCB.


#4

Clispec action point is described in ConfD User guide - chapter clispec - /clispec/$MODE/cmd/callback/capi.

For action callback and data callback see examples 7-actions and 4-stats + corresponding JAVA DOC (part of ConfD Premium package).