vyos vyatta cli template
Configuration mode templates
VyOS configuration CLI commands are defined in templates. Templates are text files stored in a directory tree,
where directory names define command names, and template files define command behaviour.
Configuration templates are stored in /opt/vyatta/share/vyatta-cfg-templates
Quick example: suppose we want to add a dummy option that will be set with "set system options dummy-option".
# Create the directory for the command
sudo mkdir /opt/vyatta/share/vyatta-cfg/templates/system/options/dummy-option
# Create a template file
sudo sh -c 'echo "help: Dummy option" > /opt/vyatta/share/vyatta-cfg/templates/system/options/dummy-option/node.def'
Now you can see it in Tab completion, set it, and commit it.
vyos@vyos# set system options
Possible completions:
dummy-option Dummy option
reboot-on-panic
Reboot system on kernel panic
vyos@vyos# set system options dummy-option
vyos@vyos# commit
vyos@vyos# show system options
dummy-option
Contents
1 Template fields
1.1 Node type fields
1.1.1 type:
1.1.2 multi:
1.1.3 tag:
1.2 Completion help fields
1.2.1 help:
1.2.2 comp_help:
1.2.3 val_help:
1.2.4 allowed:
1.3 Syntax check fields
1.3.1 syntax:
1.3.2 commit:
1.4 Other fields
1.4.1 priority:
1.4.2 default:
1.5 Commit action fields
1.5.1 begin:
1.5.2 end:
1.5.3 create:
1.5.4 update:
1.5.5 delete:
Template fiel