clixon/example/routing_cli.cli
Olof hagsand 7f0b9909b3 Library functions in clixon_cli_api.h (e.g cli_commit) is rewritten in new
for (eg cli_commitv). See clixon_cli_api.h for new names.
Use restconf format for internal xmldb keys. Eg /a/b=3,4
Changed example to use multiple cli callbacks
2017-01-31 22:36:14 +01:00

44 lines
2.3 KiB
Text

# Common CLI syntax for both server and PMNode operatio mode
CLICON_MODE="routing";
CLICON_PROMPT="%U@%H> ";
CLICON_PLUGIN="routing_cli";
# Note, when switching to PT, change datamodel to only @datamodel
set @datamodel:ietf-ip, cli_mergev();
#delete("Delete a configuration item") @datamodel:ietf-ipv4-unicast-routing, cli_del();
delete("Delete a configuration item") @datamodel:ietf-ip, cli_delv();
validate("Validate changes"), cli_validatev();
commit("Commit the changes"), cli_commitv((int32)0); # snapshot
quit("Quit Hello"), cli_quitv();
delete("Delete a configuration item") all("Delete whole candidate configuration"), delete_allv("candidate");
no("Negate or remove") debug("Debugging parts of the system"), cli_debug_cliv((int32)0);
debug("Debugging parts of the system"), cli_debug_cliv((int32)1);{
level("Set debug level: 1..n") <level:int32>("Set debug level (0..n)"), cli_debug_cliv();
}
discard("Discard edits (rollback 0)"), discard_changesv();
show("Show a particular state of the system"){
xpath("Show configuration") <xpath:string>("XPATH expression"), show_confv_xpath("candidate");
compare("Compare candidate and running databases"), compare_dbsv((int32)0);{
xml("Show comparison in xml"), compare_dbsv((int32)0);
text("Show comparison in text"), compare_dbsv((int32)1);
}
configuration("Show configuration"), show_confv_as_text("candidate","/");{
xml("Show configuration as XML"), show_confv_as_xml("candidate","/");
netconf("Show configuration as netconf edit-config operation"), show_confv_as_netconf("candidate","/");
text("Show configuration as text"), show_confv_as_text("candidate","/");
cli("Show configuration as cli commands"), show_confv_as_cli("candidate","/");
json("Show configuration as cli commands"), show_confv_as_json("candidate","/");
}
}
save("Save candidate configuration to XML file") <filename:string>("Filename (local filename)"), save_config_filev("candidate","filename");
load("Load configuration from XML file") <filename:string>("Filename (local filename)"),load_config_filev("filename","replace");{
replace("Replace candidate with file contents"), load_config_filev("filename","replace");
merge("Merge file with existent candidate"), load_config_filev("filename","merge");
}
example("This is a comment") <var:int32>("Just a random number"), mycallback("myarg");