tail-f-systems / JNC

JNC (Java NETCONF Client) is the name of a Java library for communicating with NETCONF agents, and a plugin for pyang (http://code.google.com/p/pyang/) to generate Java classes from YANG models, to be used by the JNC library.
Other
77 stars 87 forks source link

Actions not being generated #20

Open hshorter opened 11 years ago

hshorter commented 11 years ago

Action elements in the Yang are not being generated into Java objects. I would expect an object for the Action input so these can be created and passed to session.action() and one for the output which this method would return.

The Yang looks like:

tailf:action backup { tailf:info " Backs up Config database"; tailf:exec "/opt/database" { tailf:args "-c $(context) -p $(path)"; } input { leaf to { type inet:uri; mandatory true; description "Destination to which db backup file is sent"; tailf:info "Destination URL"; }
} output { list dbbackup { tailf:cli-drop-node-name; leaf response { type string; description "Response"; } } } }

joagre commented 11 years ago

AFAICS your current option is to create a plainc Element object and then use that as action input parameter. No classes are generated for actions at this time.

hshorter commented 11 years ago

Yes using Elements would be a short term workaround we are looking at, but we need generated objects (like for standard containers etc) so that we can retain type safety and compile time errors if the model changes in an incompatible way.

joagre commented 11 years ago

Hi, This is a good enhancement request but at the moment it is not on the JNC roadmap.

/Jocke

tail-f

28 maj 2013 kl. 17:06 skrev hshorter:

Yes using Elements would be a short term workaround we are looking at, but we need generated objects (like for standard containers etc) so that we can retain type safety and compile time errors if the model changes in an incompatible way.

— Reply to this email directly or view it on GitHub.