-
-
Notifications
You must be signed in to change notification settings - Fork 32
Conversation
… step schema loading.
Hi @neoul, great added features. Thanks for contributing. A couple of early questions: b) When in prompt mode, is there a way to still allow the user to set some global flags? About item 3:
Great stuff, thanks again. |
Answer about early questions:a) b) It is possible now. you can see the global flags configuration if you type gnmic> --
--address comma separated gnmi targets addresses
--config config file (default is $HOME/gnmic.yaml)
--debug debug mode
--encoding one of [json bytes proto ascii json_ietf]. Ca...
--format output format, one of: [protojson, prototext,... About item 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few minor changes and questions
about a) no specific reason for --prompt over prompt command, it just keeps the commands hierarchy clear About items 1, 2 and 3, I think they can be added in future PRs If I start gnmic in prompt mode with |
I think that would be possible. |
Thanks for this awesome PR, @neoul
|
If we don't specify the
|
@neoul its strange about 1). I think goyang resolves identities when it builds the At least when I build the paths with yangpath I do not need to pass any additional modules for goyang to succesfully build the entry with
|
Try two following commands to check the difference. Find the gnmic path --dir ../gnmi/model/yang/ --file ../gnmi/model/yang/openconfig-interfaces.yang --file ../gnmi/model/yang/[email protected] --exclude ietf-interfaces --search gnmic path --dir ../gnmi/model/yang/ --file ../gnmi/model/yang/openconfig-interfaces.yang --exclude ietf-interfaces --search
The following go generate command is used for generating ygot go structure. You can find go run github.com/openconfig/ygot/generator/generator.go -include_model_data -generate_fakeroot -output_file github.com/neoul/gnxi/gnmi/model/gostruct/generated.go -package_name gostruct -exclude_modules ietf-interfaces -path github.com/openconfig/public,github.com/YangModels/yang github.com/openconfig/public/release/models/interfaces/openconfig-interfaces.yang github.com/openconfig/public/release/models/openflow/openconfig-openflow.yang github.com/openconfig/public/release/models/platform/openconfig-platform.yang github.com/openconfig/public/release/models/system/openconfig-system.yang" |
... oh.. sorry for my misclick. I'd closed it.. |
@neoul if the |
Thanks @neoul There I do path extraction out of a single module, therefore the modules that are required for type dereference or imported/included are not get in the way. The missing feature there was to understand the augmentation statements; |
to my surprise, today in goyang repo the maintainers discussed the reasoning for making namespace-unaware merge of modules in ygot. That explains the need for So now I have the following mental notes in my head:
|
That was what I expected the result of gnmic path --dir ../gnmi/model/yang/ --file ../gnmi/model/yang/openconfig-interfaces.yang --exclude ietf-interfaces --search
Yes. |
Yes. you are right. |
The path is not a problem. The data I mean YANG |
LGTM, |
I'm happy to merge.
The only outstanding piece from my end would be the missing resolved
Identity-ref that needs to be looked at in a separate issue, as I wanted it
to result either in a local fix or an issue against goyang/ygot
…On Thu, 8 Oct 2020, 08:00 Karim Radhouani, ***@***.***> wrote:
LGTM,
@hellt <https://github.com/hellt> if you don't have more questions let's
merge this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#136 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLKV5LIN6K4BFADOZ5437LSJVIQNANCNFSM4SEJ264A>
.
|
yes, let's look at it in a separate issue. this is already a big PR |
I hope that you accept my changes for gnmic prompt mode. The gnmic prompt mode is an interactive CLI to support the tab completion of the data path and enumeration values for user convenience. To use the tab completion of the gnmic prompt mode, the schema data of the user YANG data model should be generated before the prompt mode is loaded as the following examples.
The first example shows how to generate the schema data using the gnmic
path
subcommand. The schema data will be generated to$HOME/.gnmic.schema
file if you execute thepath
command with --generate-schema option. once it generated, it will be loaded every prompt mode starting. The second example shows how to load the schema data directly from the YANG modules without gnmicpath
subcommand.2020-10-05 Added prompt mode
?
key for the brief command help.Work Items remained for gnmic prompt mode
This prompt mode is still being developed. I think I can implement the first work item (The tab completion for boolean and enumeration values). But, the second and third items, they need to change the current framework. I hope that you check how to design and implement them.
set
subcommand.get
doesn't any info uponget
operation failure upon non-debug mode.)Subscribe
subcommand must be run in background and the prompt must be presented on the prompt mode. And theoutput
flag configuration should be also supported for the gNMI telemetry streaming redirection in the prompt mode.Thanks to check.!
neoul