Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import statements and schema is not properly converted from yang model. #63

Closed
vishwaraths opened this issue Mar 1, 2016 · 5 comments
Closed

Comments

@vishwaraths
Copy link

Hi,
I tried to convert yang file in java using your suggested way, but in java file import statements are not proper so i manually changed import statement and schema file.
But i think there is something missing in java file b'coz request message differs while executing same yang file from CLI using netconf-console and from JAVA.

@klacke
Copy link

klacke commented Mar 1, 2016

Hi I've said it before - and say it again - the yang->java converter part of JNC isn't actively maintained by anyone. The code is clearly looking for a maintainer. I guess it's kind of working, for some yang files, but probably not for all. OTOH, now with free (as in beer) ConfD available, it's more than possible for someone to step up as JNC pyang plugin maintainer.

@klacke klacke closed this as completed Mar 1, 2016
@vishwaraths
Copy link
Author

Hi,
Thanks for your response.
Can you suggest me any other way to convert yang model in java model or you can suggest some other library other than pyang.

@klacke
Copy link

klacke commented Mar 2, 2016

If you share your Yang model with me (maybe offline if you prefer) I can
have a look at it.

OTOH, I'm not really in favour of the whole approach here, the idea of
turning the yang models into Java classes sound better than it is.

Try to use the JNC lib as it is - the text based DOM that is used
by the client lib itself is pretty nice.

/klacke

On 02/03/16 05:10, vishwaraths wrote:

Hi,
Thanks for your response.
Can you suggest me any other way to convert yang model in java model or
you can suggest some other library other than pyang.


Reply to this email directly or view it on GitHub
#63 (comment).

@vishwaraths
Copy link
Author

Hi,
This is my Yang file
`module arpe {
namespace "http://tail-f.com/ns/example/arpe";
prefix arpe;

import ietf-inet-types {
prefix inet;
}
import tailf-common {
prefix tailf;
}

container arpentries {
config false;
tailf:callpoint arpe;
list arpe {
key "ip ifname";
max-elements 1024;
leaf ip {
type inet:ip-address;
}
leaf ifname {
type string;
}
leaf hwaddr {
type string;
mandatory true;
}
leaf permanent {
type boolean;
mandatory true;
}
leaf published {
type boolean;
mandatory true;
}
}
}
}
`

@klacke
Copy link

klacke commented Mar 3, 2016

Ok, I haven't tried with your module here, what I did try though
was the code in examples/0-intro

Try to add your module to that example, that seems to work just
fine.
What didn't work for me, where I got bad import statements was
the code in e.g tests/1-test-union

There are slightly different flags given to the jnc plugin
in those two examples. Seems as if the tests dir is broken.

As I've said before - the jnc.py plugin isn't properly
maintained, whereas the JNC lib under jnc/src/com/tailf/jnc/
is.

/klacke

On 02/03/16 12:03, vishwaraths wrote:

Hi,
This is my Yang file
`module arpe {
namespace "http://tail-f.com/ns/example/arpe";
prefix arpe;

import ietf-inet-types {
prefix inet;
}
import tailf-common {
prefix tailf;
}

container arpentries {
config false;
tailf:callpoint arpe;
list arpe {
key "ip ifname";
max-elements 1024;
leaf ip {
type inet:ip-address;
}
leaf ifname {
type string;
}
leaf hwaddr {
type string;
mandatory true;
}
leaf permanent {
type boolean;
mandatory true;
}
leaf published {
type boolean;
mandatory true;
}
}
}
}
`


Reply to this email directly or view it on GitHub
#63 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants