* Auto-CLI enhancements

* A generated clispec including state (default @datanodestate) also generated along with the config clispec tree (default @datanode)
  * New mode `GT_HIDE` set by option `CLICON_CLI_GENMODEL_TYPE` to collapse non-presence containers that only contain a single list
  * Added a prfix for cli_show_config/cli_show_auto so that it can produce parseable output
  * Thanks dcornejo@netgate.com for trying it out and suggestions
This commit is contained in:
Olof hagsand 2020-06-13 12:05:26 +02:00
parent e2d9c046af
commit e898dda016
16 changed files with 319 additions and 86 deletions

View file

@ -148,16 +148,19 @@ module clixon-config {
typedef cli_genmodel_type{
description
"How to generate CLI from YANG model,
eg list a{ key x; leaf x; leaf y;}";
eg {container c {list a{ key x; leaf x; leaf y;}}";
type enumeration{
enum NONE{
description "No extra keywords: a <x> <y>";
description "No extra keywords: c a <x> <y>";
}
enum VARS{
description "Keywords on non-key variables: a <x> y <y>";
description "Keywords on non-key variables: c a <x> y <y>";
}
enum ALL{
description "Keywords on all variables: a x <x> y <y>";
description "Keywords on all variables: c a x <x> y <y>";
}
enum HIDE{
description "Keywords on non-key variables and hide container around lists: a <x> y <y>";
}
}
}
@ -411,7 +414,9 @@ module clixon-config {
description
"If set, CLI specs can reference the
model syntax using this reference.
Example: set @datamodel, cli_set();";
Example: set @datamodel, cli_set();
A second tree called eg @datamodelstate is created that
also contains state together with config.";
}
leaf CLICON_CLI_GENMODEL_COMPLETION {
type int32;
@ -595,7 +600,8 @@ module clixon-config {
description
"If set, tag datastores with RFC 7895 YANG Module Library
info. When loaded at startup, a check is made if the system
yang modules match";
yang modules match.
See also CLICON_MODULE_LIBRARY_RFC7895";
}
leaf CLICON_XML_CHANGELOG {
type boolean;
@ -669,9 +675,11 @@ module clixon-config {
leaf CLICON_MODULE_LIBRARY_RFC7895 {
type boolean;
default true;
description "Enable RFC 7895 YANG Module library support as state
data. If enabled, module info will appear when doing
netconf get or restconf GET";
description
"Enable RFC 7895 YANG Module library support as state data. If
enabled, module info will appear when doing netconf get or
restconf GET.
See also CLICON_XMLDB_MODSTATE";
}
leaf CLICON_MODULE_SET_ID {
type string;