clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
215 stars 72 forks source link

show config set should be able to display entire config on referring to inner nodes in the hierarchical level instead of just displaying the config under the specified context #259

Open DeekshaBhandary opened 3 years ago

DeekshaBhandary commented 3 years ago

consider below yang spec: list l1{ leaf name { } container cont1{
container host{ leaf host-type{ } } } }

cli>set l1 test cont1 host host-type typeA 
cli>show config set
set l1 test cont1 host host-type typeA
cli> show config set l1 test cont1
set cont1 host host-type typeA    <---- 'l1 test' is missing
cli>

prefix is just 'set' in all cases. Might need to set the prefix dynamically

olofhagsand commented 3 years ago

Please supply clispec syntax of "show config set", it is not part of main example.

DeekshaBhandary commented 3 years ago

set("Show configuration as CLI commands"), cli_show_config("running", "cli", "/", 0, "set ");{ @datamodelshow, cli_show_auto("running", "cli", "set "); }

olofhagsand commented 3 years ago

Two things: 1) On my system the first show command shows the l1 test:

olof@alarik /> show configuration set              
set l1 test 
set l1 test cont1 host host-type typeA

2) The second case I would claim that the show is made in the context of the l1 test cont1 context and thus only the commands from that part of the config tree is shown:

olof@alarik /> show configuration set l1 test cont1 
set cont1 host host-type typeA

Same thing with XML: (using @datamodelshow, cli_show_auto("running", "xml");):

olof@alarik /> show configuration xml l1 test cont1 
<cont1>
   <host>
      <host-type>typeA</host-type>
   </host>
</cont1>

This is somewhat complicated by the cli_auto API, where these relations are somewhat different and needs to be better documented.

DeekshaBhandary commented 3 years ago

If this is the expected behaviour, maybe we can have flag that helps in displaying either the entire configuration or part of it accordingly . Can this be treated as a feature request?

olofhagsand commented 3 years ago

Please change the title also to reflect this.