[provide support for load config of cli format along with json and xml format as save config is supported for all 3 formats](https://github.com/clicon/clixon/issues/320)

This commit is contained in:
Olof hagsand 2022-04-01 18:05:19 +02:00
parent 3d648bc08f
commit 1a9def2f6e
4 changed files with 102 additions and 2 deletions

View file

@ -83,7 +83,7 @@ show("Show a particular state of the system"){
}
configuration("Show configuration"), cli_auto_show("datamodel", "candidate", "text", true, false);{
xml("Show configuration as XML"), cli_auto_show("datamodel", "candidate", "xml", true, false);
cli("Show configuration as CLI commands"), cli_auto_show("datamodel", "candidate", "cli", true, false, "set ");
oad cli("Show configuration as CLI commands"), cli_auto_show("datamodel", "candidate", "cli", true, false, "set ");
netconf("Show configuration as netconf edit-config operation"), cli_auto_show("datamodel", "candidate", "netconf", true, false);
text("Show configuration as text"), cli_auto_show("datamodel", "candidate", "text", true, false);
json("Show configuration as JSON"), cli_auto_show("datamodel", "candidate", "json", true, false);
@ -105,10 +105,12 @@ save("Save candidate configuration to XML file") <filename:string>("Filename (lo
}
load("Load configuration from XML file") <filename:string>("Filename (local filename)"),load_config_file("filename", "replace");{
replace("Replace candidate with file contents"), load_config_file("filename", "replace");{
cli("Replace candidate with file containing CLI commands"), load_config_file("","filename", "replace", "cli");
xml("Replace candidate with file containing XML"), load_config_file("","filename", "replace", "xml");
json("Replace candidate with file containing JSON"), load_config_file("","filename", "replace", "json");
}
merge("Merge file with existent candidate"), load_config_file("filename", "merge");{
cli("Merge candidate with file containing CLI commands"), load_config_file("","filename", "merge", "cli");
xml("Merge candidate with file containing XML"), load_config_file("","filename", "merge", "xml");
json("Merge candidate with file containing JSON"), load_config_file("","filename", "merge", "json");
}