ConfD User Community

How to use NetconfSession.action() API in com.tailf.jnc to pass action input?


#1

I try to use function NetconfSession.action() in package com.tailf.jnc to send action rpc to confd to execute the action. I can see the API defined as

public Element action(Element data) throws JNCException, IOException`

For action in yang 1.1. In some cases it has input, e.g.:

action reset {
           input {
             leaf reset-at {
               type yang:date-and-time;
               mandatory true;
              }
            }
            output {
              leaf reset-finished-at {
                type yang:date-and-time;
                mandatory true;
              }
            }
          }

In this case, I just wonder how do I pass the input as parameter to the function action in order to encode the input to the xml rpc for confd ?

Thanks.


#2

I guess you should ask author of JNC how to use the API. https://github.com/tail-f-systems/JNC

My guess is that you fill in input as data and receive output as result.
See JavaDoc for Element how to create and read data (element sub-tree).
(https://github.com/tail-f-systems/JNC/blob/master/jnc/doc/com/tailf/jnc/Element.html)


#3

Yeah, I agree. Thank you very much for the hint.