This manual page describes the syntax and semantics of a ConfD CLI specification file (from now on called "clispec"). A clispec is an XML configuration file describing commands to be added to the automatically rendered Juniper and Cisco style ConfD CLI. It also makes it possible to modify the behavior of standard/built-in commands, using move/delete operations and customizable confirmation prompts. In Cisco style custom mode-specific commands can be added by specifying a mount point relating to the specified mode.
In the ConfD distribution there is an Emacs mode suitable for clispec editing.
A clispec file (with a .cli suffix) is to be compiled using the confdc compiler into an internal representation (with a .ccl suffix), ready to be loaded by the ConfD daemon on startup. Like this:
$ confdc -c commands.cli $ ls commands.ccl commands.ccl
The .ccl file should be put in the ConfD daemon loadPath as described in confd.conf(5) When the ConfD daemon is started the clispec is loaded accordingly.
The ConfD daemon loads all .ccl files it finds on startup. Ie, you can have one or more clispec files for Cisco XR (C) style CLI emulation, one or more for Cisco IOS (I), and one or more for Juniper (J) style emulation. If you drop several .ccl files in the loadPath all will be loaded. The standard commands are defined in confd.cli (available in the ConfD distribution). The intention is that we use confd.cli as a starting point, i.e. first we delete, reorder and replace built-in commands (if needed) and we then proceed to add our own custom commands.
The confd-light.cli example is a light version of the standard confd.cli. It adds one operational mode command and one configure mode command, implemented by two OS executables, it also removes the 'save' command from the pipe commands.
Example 153. confd-light.cli
<clispec xmlns="http://tail-f.com/ns/clispec/1.0" style="j"> <operationalMode> <modifications> <delete src="file"/> <confirmText src="quit"> Are you really sure you want to quit? </confirmText> <help src="configure private">Edit a private copy of the configuration</help> <info src="configure private">Edit a private copy of the configuration</info> </modifications> <cmd name="copy" mount="file"> <info>Copy a file</info> <help>Copy a file in the file system.</help> <callback> <exec> <osCommand>cp</osCommand> <options> <uid>confd</uid> </options> </exec> </callback> <params> <param> <type><file/></type> <info><source file></info> </param> <param> <type><file/></type> <info><destination></info> </param> </params> </cmd> </operationalMode> <configureMode> <cmd name="adduser" mount="wizard"> <info>Create a user</info> <help>Create a user and assign him/her to a group.</help> <callback> <exec> <osCommand>adduser.sh</osCommand> </exec> </callback> </cmd> </configureMode> <pipeCmds> <modifications> <delete src="save"/> </modifications> </pipeCmds> </clispec>
confd-light.cli achieves the following:
Adds a confirmation prompt to the standard operation "delete" command.
Deletes the standard "file" command.
Adds the operational mode command "copy" and mounts it under the standard "file" command.
The "copy" command is implemented using the OS executable "/usr/bin/cp".
The executable is called with parameters as defined by the "params" element.
The executable runs as the same user id as ConfD as defined by the "uid" element.
Adds the configure command "adduser" and mounts it under the standard "wizard" command.
Below we present the gory details when it comes to constructs in a clispec.
This section lists all clispec elements and their attributes including their type (within parentheses) and default values (within square brackets). Elements are written using a path notation to make it easier to see how they relate to each other.
Note: $MODE is either "operationalMode", "configureMode" or "pipeCmds".
/clispec
This is the top level element which contains (in order) zero or more "operationalMode" elements, zero or more "configureMode" element, and zero or more "pipeCmds" elements.
It has a style attribute which can have the value "j", "i" or "c". If no style attribute is specified it defaults to "j".
/clispec/$MODE
The $MODE ("operationalMode", "configureMode", or "pipeCmds") element contains (in order) zero or one "modifications" elements, zero or more "start" elements, zero or more "show" elements, and zero or more "cmd" elements.
The "show" elements are only used in the C-style CLI.
It has a name attribute which is used to create a named custom mode. A custom command can be defined for entering custom modes. See the cmd/callback/mode elements below.
/clispec/$MODE/modifications
The "modifications" element describes which operations to apply to the built-in commands. It contains (in any order) zero or more "delete", "move", "paginate", "info", "paraminfo", "help", "paramhelp", "confirmText", "defaultConfirmOption", "dropElem", "compactElem", "compactStatsElem", "columnStats", "multiValue", "columnWidth", "columnAlign", "defaultColumnAlign", "noKeyCompletion", "noMatchCompletion", "modeName", "suppressMode", "suppressTable", "enforceTable", "showTemplate", "showTemplateLegend", "showTemplateEnter", "showTemplateFooter", "runTemplate", "runTemplateLegend", "runTemplateEnter", "runTemplateFooter", "addMode", "autocommitDelay", "keymap", "pipeFlags", "addPipeFlags", "negPipeFlags", "legend", "footer", "suppressKeyAbbrev", "allowKeyAbbrev", "hasRange", "suppressRange", "allowWildcard", "suppressWildcard", "suppressValidationWarningPrompt", "displayEmptyConfig", "displayWhen", "customRange", "completion", "keepKeyOrder" and "simpleType" elements.
/clispec/$MODE/modifications/paginate
The "paginate" element can be used to change the default paginate behavior for a built-in command.
Attributes:
- path (cmdpathType)
The "path" attribute is mandatory. It specifies which command to change. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- value (true|false)
The "value" attribute is mandatory. It specifies whether the paginate attribute should be enabled or disabled by default.
/clispec/$MODE/modifications/displayWhen
The "displayWhen" element can be used to add a displayWhen xpath condition to a command.
Attributes:
- path (cmdpathType)
The "path" attribute is mandatory. It specifies which command to change. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- exrp (xpath expression)
The "expr" attribute is mandatory. It specifies an xpath expression. If the expression evaluates to true then the command is available, otherwise not.
- ctx (path)
The "ctx" attribute is optional. If not specified the current editpath/mode-path is used as context node for the xpath evaluation. Note that the xpath expression will automatically evaluate to false if a display when expression is used for a top-level command and no ctx is specified. The path may contain variables defined in the dict.
/clispec/$MODE/modifications/move
The "move" element can be used to move (rename) a built-in command.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to move. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- dest (cmdpathType)
The "dest" attribute is mandatory. It specifies where to move the command specified by the "src" attribute. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- inclSubCmds (xs:boolean)
The "inclSubCmds" attribute is optional. If specified and set to true then all commands to which the 'src' command is a prefix command will be included in the move operation.
An example:
<configureMode> <modifications> <move src="load" dest="xload" inclSubCmds="true"/> </modifications> </configureMode>would in the C-style CLI move 'load', 'load merge', 'load override' and 'load replace' to 'xload', 'xload merge', 'xload override' and 'xload replace', respectively.
/clispec/$MODE/modifications/copy
The "copy" element can be used to copy a built-in command.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to copy. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- dest (cmdpathType)
The "dest" attribute is mandatory. It specifies where to copy the command specified by the "src" attribute. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- inclSubCmds (xs:boolean)
The "inclSubCmds" attribute is optional. If specified and set to true then all commands to which the 'src' command is a prefix command will be included in the copy operation.
An example:
<configureMode> <modifications> <copy src="load" dest="xload" inclSubCmds="true"/> </modifications> </configureMode>would in the C-style CLI copy 'load', 'load merge', 'load override' and 'load replace' to 'xload', 'xload merge', 'xload override' and 'xload replace', respectively.
/clispec/$MODE/modifications/delete
The "delete" element makes it possible to delete a built-in command. Note that commands that are auto-rendered from the data model cannot be removed using this modification. To remove an auto-rendered command use the 'tailf:hidden' element in the data model.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to delete. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
/clispec/$MODE/modifications/pipeFlags
The "pipeFlags" element makes it possible to modify the pipe flags of the builtin commands. The argument is a space separated list of pipe flags. It will replace the builtin list.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to modify. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
/clispec/$MODE/modifications/addPipeFlags
The "addPipeFlags" element makes it possible to add pipe flags to the existing list of pipe flags for a builtin command. The argument is a space separated list of pipe flags.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to modify. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
/clispec/$MODE/modifications/negPipeFlags
The "negPipeFlags" element makes it possible to modify the neg pipe flags of the builtin commands. The argument is a space separated list of neg pipe flags. It will replace the builtin list.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to modify. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
/clispec/$MODE/modifications/dropElem
The "dropElem" element makes it possible to drop node in the data model from paths in the Cisco style CLIs. If you drop a child node to a list node we recommend that you also use suppressMode on that list node, otherwise the CLI will be very confusing. For example, for the alias command in the CLI. If we only dropped the expansion node but did not suppress the automatic mode creation for the alias node, when you typed the alias command you would end up in the alias submode, but since you have dropped the expansion node you end up specifying the expansion directly without typing any command. Quite confusing.
Note that dropped nodes to not appear in match completions.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to drop. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-drop-node-name YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/compactElem
The "compactElem" element tells the C- and I-style CLIs 'show running-configuration' command to use the compact representation for this path. The compact representation means that all leaf elements are shown on a single line.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to make compact. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-compact-syntax YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/compactStatsElem
The "compactStatsElem" element tells the show command in the C- and I-style CLIs to use the compact representation for this path. The compact representation means that all leaf elements are shown on a single line.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to make compact. pathType is a space-separated list of elements, pointing out a specific element.
- wrap (xs:boolean)
The "wrap" attribute is optional. It specified whether the line should be wrapped at screen-width or not.
- delimiter (xs:string)
The "delimiter" attribute is optional. It specified which string to use between the element name and the value when displaying leaf values.
- prettify(xs:boolean)
The "prettify" attribute is optional. If set to 'true' then dash:es and underscores will be replaced by spaces in leaf element names.
- spacer (xs:string)
The "spacer" attribute is optional. It specified which string to use between the elements when displayed in compact format.
- width (xs:positiveInteger)
The "width" attribute is optional. It specified a fixed terminal width to use before wrapping line. It is only used when wrap is set to 'true'. If width is not specified the line is wrapped when the terminal width is reached.
Note that the tailf:cli-compact-stats YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/columnWidth
The "columnWidth" element can be used to set fixed widths for specific columns in auto-rendered tables.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to set the column width for. pathType is a space-separated list of node names, pointing out a specific data model node.
- width (xs:positiveInteger)
The "width" attribute is mandatory. It specified a fixed column width.
Note that the tailf:cli-column-width YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/columnAlign
The "columnAlign" element can be used to specify the alignment of the data in specific columns in auto-rendered tables.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to set the column alignment for. pathType is a space-separated list of node names, pointing out a specific data model node.
- align (left|right|center)
The "align" attribute is mandatory.
Note that the tailf:cli-column-align YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/defaultColumnAlign
The "defaultColumnAlign" element can be used to specify a default alignment of a simpletype when used in auto-rendered tables.
Attributes:
- namespace (xs:string)
The "namespace" attribute is required. It specifies in which namespace the type is found. It can be either the namespace URI or the namespace prefix.
- name (xs:string)
The "name" attribute is required. It specifies the name of the type in the given namespace.
- align (left|right|center)
The "align" attribute is mandatory.
/clispec/$MODE/modifications/multiLinePrompt
The "multiLinePrompt" element can be used to specify that the CLI should automatically enter multi-line prompt mode when prompting for values of the given type.
Attributes:
- namespace (xs:string)
The "namespace" attribute is required. It specifies in which namespace the type is found. It can be either the namespace URI or the namespace prefix.
- name (xs:string)
The "name" attribute is required. It specifies the name of the type in the given namespace.
/clispec/$MODE/modifications/columnStats
The "columnStats" element tells the Cisco style CLIs show command to display elements in a container as a column, ie to not repeat the name of the container element on each line but instead indent each leaf under the container.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to make display as a column. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-column-stats YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/showTemplate
The "showTemplate" element is used for specifying a template to use by the show command in the J-, C- and I-style CLIs.
Show templates are associated with YANG nodes and are used by the CLI when the 'show' command is given for a path in operational mode. It is primarily intended for displaying "config false" data but "config true" data may be included in the template as well.
The template may contain a mix of text and expandable entries. Expandable entries all start with $( and end with a matching ). Parentheses and dollar signes needs to be quoted in plain-text.
Expansion:
Parameter is either a relative or absolute path to a leaf (eg /foo/bar, foo/bar), or one of the builtin variables: .selected, .entered, .legend_shown, .user, .groups, .ip, .display_groups, .path, .ipath or .licounter. In addition the variables "spath" and "ispath" are available when a command is executed from a show path.
- .selected
The .selected variable contains the list of selected paths to be shown. The show template can inspect this element to determine if a given element should be displayed or not. For example:
$(.selected~=hwaddr?HW Address)- .entered
The .entered variable is true if the "entered" text has been displayed (either the auto generated text or a showTemplateEnter). This is useful when having a non-table template where each instance should have a text.
$(.entered?:host $(name))- .legend_shown
The .legend_shown variable is true if the "legend" text has been displayed (either the auto generated table header or a showTemplateLegend). This is useful to inspect when displaying a table row. If the user enteres the path to a specific instance the builtin table header will not be displayed and the showTemplateLegend will not be invoked and it may be useful to render the legend specifically for this instance.
$(.legend_shown!=true?Address Interface)- .user
The .user variable contains the name of the current user. This can be used for differentiating the content displayed for a specific user, or in paths. For example:
$(user{$(.user)}/settings)- .groups
The .groups variable contains the a list of groups that the user belongs to.
- .display_groups
The .display_groups variable contains a list of selected display groups. This can be used to display different content depending on the selected display group. For example:
$(.display_groups~=details?details...)- .ip
The .ip variable contains the ip address that the user connected from.
- .path
The .path variable contains the path to the entry, formatted in CLI style.
- .ipath
The .ipath variable contains the path to the entry, formatted in template style.
- .spath
The .spath variable contains the show path, formatted in CLI style.
- .ispath
The .ipath variable contains the show path, formatted in template style.
- .licounter
The .licounter variable contains a counter that is incremented for each instance in a list. This means that it will be 0 in the legend, contain the total number of list instances in the footer and something in between in the basic show template.
$(parameter)
The value of parameter is substituted.
$(cond?word1:word2)
The expansion of word1 is substituted if the value of cond evaluates to true, otherwise the expansion of word2 is substituted.
cond may be one of
parameter
Evaluates to true if the node exists.
parameter == <value>
Evaluates to true if the value of the parameter equals <value>
parameter != <value>
Evaluates to true if the value of the parameter does not equal <value>
parameter ~= <value>
Provided that parameters value is a list then this expression evaluates to true if <value> is a member of the list.
$(parameter|filter)
The value of parameter processed by filter is substituted. Filters may be either one of the built-ins or a customized filter defined in a callback. See /confdConfig/cli/templateFilter. A built-in filter may be one of
capfirst
Capitalizes the first character of the value.
filesizeformat
Format the value in a 'human-readable' format (i.e. '13 KB', '4.1 MB' '102 bytes' etc), where K means 1024, M means 1024*1024 etc.
When used without argument the default number of decimals displayed is 2. When used with a numeric integer argument, filesizeformat will display the given number of decimal places.
humanreadable
Similar to filesizeformat except no bytes suffix is added. (i.e. '13.13 k', '4.2 M' '102' etc), where k means 1000, M means 1000*1000 etc.
When used without argument the default number of decimals displayed is 2. When used with a numeric integer argument, humanreadable will display the given number of decimal places.
commasep
Separate the numerical values into groups of three digits using a comma (e.g., 1234567 -> 1,234,567)
hex
Display integer as hex number. An argument can be used to indicate how many digits should be used in the output. If the hex number is too long it will be truncated at the front, if it is too short it will be padded with zeros at the front. If the width is a negative number then at most that number of digits will be used, but short numbers will not be padded with zeroes. For example:
value Template Output
12345 {{ value|hex }} 3039
12345 {{ value|hex:2 }} 39
12345 {{ value|hex:8 }} 00003039
hexlist
Display integer as hex number with : between pairs. An argument can be used to indicate how many digits should be used in the output. If the hex number is too long it will be truncated at the front, if it is too short it will be padded with zeros at the front. If the width is a negative number then at most that number of digits will be used, but short numbers will not be padded with zeroes.For example:
value Template Output
12345 {{ value|hexlist }} 30:39
12345 {{ value|hexlist:2 }} 39
12345 {{ value|hexlist:8 }} 00:00:30:39
floatformat
Used for type 'float' in tailf-xsd-types. We recommend that the YANG built-in type 'decimal64' is used instead of 'float'.
When used without an argument, rounds a floating-point number to one decimal place -- but only if there's a decimal part to be displayed. For example:
value Template Output
34.23234 {{ value|floatformat }} 34.2
34.00000 {{ value|floatformat }} 34
34.26000 {{ value|floatformat }} 34.3
If used with a numeric integer argument, floatformat rounds a number to that many decimal places. For example:
value Template Output
34.23234 {{ value|floatformat:3 }} 34.232
34.00000 {{ value|floatformat:3 }} 34.000
34.26000 {{ value|floatformat:3 }} 34.260
If the argument passed to floatformat is negative, it will round a number to that many decimal places -- but only if there's a decimal part to be displayed. For example:
value Template Output
34.23234 {{ value|floatformat:-3 }} 34.232
34.00000 {{ value|floatformat:-3 }} 34
34.26000 {{ value|floatformat:-3 }} 34.260
Using floatformat with no argument is equivalent to using floatformat with an argument of -1.
ljust:width
Left-align the value given a width.
rjust:width
Right-align the value given a width.
trunc:width
Truncate value to a given width.
lower
Convert the value into lowercase.
upper
Convert the value into uppercase.
show:<dictionary>
Substitutes the result of invoking the default display function for the parameter. The dictionary can be used for introducing own variables that can be accessed in the same manner as builtin variables. The user defined variables overrides builtin variables. The dictionary is specified as a string on the following form:
(key=value)(:key=value)*For example, with the following expression:
$(foo|show:myvar1=true:myvar2=Interface)the user defined variables can be accessed like this:
$(.myvar1!=true?Address) $(.myvar2)
dict:<dictionary>
Translate the value using the dictionary. Can for example be used for displaying on/off instead of true/false.
For example
$(foo|dict:true=on:false=off)Nested invocations are allowed, ie it is possible to have expressions like $((state|dict:yes=Yes:no=No)|rjust:14), or $(/foo{$(../bar)}).
An example:
<modifications> <showTemplate path="interfaces">$(name) is administratively $(status), line protocol is $(line/status) Hardware is $(hw), address is $(port_address) (bia $(bia)) Internet address is $(address) MTU $(mtu) bytes, BW $(bw|humanreadable)bit, DLY $(dly) usec, reliability $(reliability), txload $(txload), rxload $(rxload) Encapsulation $(encapsulation|upper), $(loopback?:loopback not set) Keepalive $(keepalive?set to \($(keepalive) sec\):not set) ARP type: $(arpType), ARP Timeout $(arpTimeout) Last input $(lastInput), output $(output), output hang $(outputHang) Last clearing of "show interface" counters $(lastClear) Queuing strategy: $(queingSrategy) Output queue $(output/queue), $(output/drops) drops; input queue $(input/queue), $(input/drops) drops 5 minute input rate $(input/rate) bits/sec, $(input/packetRate) packets/sec 5 minute output rate $(output/rate) bits/sec, $(output/packetRate) packets/sec $(input/packets) packets input, $(input/bytes) bytes, $(input/buffer) no buffer Received $(input/receivedBroadcasts) broadcasts, $(input/runts) runts, $(input/giants) giants, $(input/throttle) throttles $(input/errors) input errors, $(input/crc) CRC, $(input/frame) frame, $(input/overrun) overrun, $(input/ignore) ignored $(input/dribble) input packets with dribble condition detected $(output/packets) packets output, $(output/bytes) bytes, $(output/underruns) underruns $(output/errors) output errors, $(output/collisions) collisions, $(output/resets) interface resets $(output/babbles) babbles, $(output/lateCollision) late collision, $(output/deferred) deferred $(lostCarrier) lost carrier, $(noCarrier) no carrier $(output/bufferFails) output buffer failures, $(output/bufferSwapped) output buffers swapped out </showTemplate> </modifications>Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to apply the show template. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-show-template YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/showTemplateLegend
The "showTemplateLegend" element is used for specifying a template to use by the show command in the J-, C- and I-style CLIs when displaying a set of list nodes as a legend.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to apply the show template. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-show-template-legend YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/showTemplateEnter
The "showTemplateEnter" element is used for specifying a template to use by the show command in the J-, C- and I-style CLIs when displaying a set of list element nodes before displaying each instance.
In addition to the builtin variables in ordinary templates there are two additional variables available: .prefix_str and .key_str.
- .prefix_str
The .prefix_str variable contains the text displayed before the key values when auto-rendering an enter text.
- .key_str
The .key_str variable contains the keys as a text
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to apply the show template. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-show-template-enter YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/showTemplateFooter
The "showTemplateFooter" element is used for specifying a template to use by the show command in the J-, C- and I-style CLIs after a set of list nodes has been displayed as a table.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to apply the show template. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-show-template-footer YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/runTemplate
The "run" element is used for specifying a template to use by the "show running-config" command in the C- and I-style CLIs. The syntax is the same as for the showTemplate above. The template is only used if it is associated with a leaf element. Containers and lists cannot have runTemplates.
Note that extreme care must be taken when using this feature if the result should be paste:able into the CLI again.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to apply the show running-config template. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-run-template YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/runTemplateLegend
The "runTemplateLegend" element is used for specifying a template to use by the show running-config command in the C- and I-style CLIs when displaying a set of list nodes as a legend.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to apply the show running-config template. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-run-template-legend YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/runTemplateEnter
The "runTemplateEnter" element is used for specifying a template to use by the show running-config command in the C- and I-style CLIs when displaying a set of list element nodes before displaying each instance.
In addition to the builtin variables in ordinary templates there are two additional variables available: .prefix_str and .key_str.
- .prefix_str
The .prefix_str variable contains the text displayed before the key values when auto-rendering an enter text.
- .key_str
The .key_str variable contains the keys as a text
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to apply the show running-config template. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-run-template-enter YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/runTemplateFooter
The "runTemplateFooter" element is used for specifying a template to use by the show running-config command in the C- and I-style CLIs after a set of list nodes has been displayed as a table.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to apply the show running-config template. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-run-template-footer YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/hasRange
The "hasRange" element is used for specifying that a given non-integer key element should allow range expressions
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to allow range expressions. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-allow-range YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/suppressRange
The "suppressRange" element is used for specifying that a given integer key element should not allow range expressions
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to suppress range expressions. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-suppress-range YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/customRange
The "customRange" element is used for specifying that a given list element should support ranges. A type matching the range expression must be supplied, as well as a callback to use to determine if a given instance is covered by a given range expression. It contains one or more "rangeType" elements and one "callback" element.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to apply the custom range. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-custom-range YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/customRange/callback
The "callback" element is used for specifying which callback to invoke for checking if a list element instance belongs to a range. It contains a "capi" element.
Note that the tailf:cli-custom-range-actionpoint YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/customRange/callback/capi
The "capi" element is used for specifying the name of the callback to invoke for checking if a list element instance belongs to a range.
Attributes:
- id (string)
The "id" attribute is optional. It specifies a string which is passed to the callback when invoked to check if a value belongs in a range. This makes it possible to use the same callback at several locations and still keep track of which point it is invoked from.
/clispec/$MODE/modifications/customRange/rangeType
The "rangeType" element is used for specifying which key element of a list element should support range expressions. It is also used for specifying a matching type. All range expressions must belong to the specified type, and a valid key element must not be a valid element of this type.
Attributes:
- key (string)
The "key" attribute is mandatory. It specifies which key element of the list that the rangeType applies to.
- namespace (string)
The "namespace" attribute is mandatory. It specifies which namespace the type belongs to.
- name (string)
The "name" attribute is mandatory. It specifies the name of the range type.
Note that the tailf:cli-range-type YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/allowWildcard
The "allowWildcard" element is used for specifying that a given list element should allow wildcard expressions in the show pattern
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to allow wildcard expressions. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-allow-wildcard YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/suppressWildcard
The "suppressWildcard" element is used for specifying that a given list element should not allow wildcard expressions in the show pattern
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to suppress wildcard expressions. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-suppress-wildcard YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/suppressValidationWarningPrompt
The "suppressValidationWarningPrompt" element is used for specifying that for a given path a validate warning should not result in a prompt to the user. The warning is displayed but without blocking the commit operation.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies on which path to suppress the validation warning prompt. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-suppress-validate-warning-prompt YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/errorMessageRewrite
The "errorMessageRewrite" element is used for specifying that a callback should be invoked for possibly rewriting error messages before displaying them.
/clispec/$MODE/modifications/errorMessageRewrite/callback
The "callback" element is used for specifying which callback to invoke for rewriting a message. It contains a "capi" element.
/clispec/$MODE/modifications/errorMessageRewrite/callback/capi
The "capi" element is used for specifying the name of the callback to invoke for rewriting a message.
/clispec/$MODE/modifications/showPathRewrite
The "showPathRewrite" element is used for specifying that a callback should be invoked for possibly rewriting the show path before executing a show command. The callback is invoked by the builtin show command.
/clispec/$MODE/modifications/showPathRewrite/callback
The "callback" element is used for specifying which callback to invoke for rewriting the show path. It contains a "capi" element.
/clispec/$MODE/modifications/showPathRewrite/callback/capi
The "capi" element is used for specifying the name of the callback to invoke for rewriting the show path.
/clispec/$MODE/modifications/noKeyCompletion
The "noKeyCompletion" element tells the CLI to not perform completion for key elements for a given path. This is to avoid querying the data provider for all existing keys.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to make not do completion for. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-no-key-completion extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/noMatchCompletion
The "noMatchCompletion" element tells the CLI to not provide match completion for a given element path for show commands.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to make not do match completion for. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-no-match-completion YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/incompleteShowPath
The "incompleteShowPath" element makes it possible to specify that a path to the show command in the C and I-style CLIs is considered incomplete. It can also be used to specify that a minimum number of keys needs to be specified.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to consider incomplete. pathType is a space-separated list of elements, pointing out a specific list element.
- minKeys (positiveInteger)
The "minKeys" attribute is optional. For paths leading to a list element it is possible to specify the minimum number of required keys.
Note that the tailf:cli-incomplete-show-path YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/suppressShowPath
The "suppressShowPath" element makes it possible to specify that a path to the show command should not be available. This only applies to I- and C- style CLI.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to suppress. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-suppress-show-path YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/suppressShowMatch
The "suppressShowMatch" element makes it possible to specify that a specific completion match (ie a filter match that appear at list element nodes as an alternative to specifying a single instance) to the show command should not be available.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to suppress. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-suppress-show-match YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/incompleteCommand
The "incompleteCommand" element makes it possible to specify that an auto-rendered command in C- and I-mode should be considered incomplete. It can be used to prevent <cr> from appearing in the completion list for optional internal nodes.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to consider incomplete. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-incomplete-command YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/sequenceCommands
The "sequenceCommands" element makes it possible to specify that an auto-rendered command in C- and I-mode should only accept arguments in the same order as they are specified in the YANG module. This, in combination with dropElem, can be used to create CLI commands for setting multiple leafs in a container without having to specify the leaf names.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to make into an argument sequence. pathType is a space-separated list of elements, pointing out a specific container element.
Note that the tailf:cli-sequence-commands YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/fullCommand
The "fullCommand" element makes it possible to specify that an auto-rendered command in C- and I-mode should be considered full. It can be used to prevent further command stacking.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to consider full. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-full-command YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/fullShowPath
The "fullShowPath" element makes it possible to specify that a path to the show command in the C and I-style CLIs is considered complete. No further elements can be added to the path.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to consider complete. pathType is a space-separated list of elements, pointing out a specific list element.
- maxKeys (positiveInteger)
The "maxKeys" attribute is optional. For paths leading to a list element it is possible to specify the maximum number of allowed keys.
Note that the tailf:cli-full-show-path YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/multiValue
The "multiValue" element tells the parser for the C- and I- style CLIs that a specific leaf element should get its value from the rest of the command line. If this modification is used for a given leaf it will not be possible to enter any more leaf values on the same command line.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to make a multiline input item by default. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-multi-value YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/enforceTable
The "enforceTable" element makes it possible to force the generation of a table for a list element node regardless of whether the table will be too wide or not. This applies to the tables generated by the auto-rendered show commands for config="false" data in the C- and I- style CLIs.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to enforce. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-enforce-table YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/suppressTable
The "suppressTable" element makes it possible to suppress an automatically generated table in the C- and I- style CLIs when using the show command.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to suppress. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-suppress-table YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/preformatted
The "preformatted" element makes it possible to suppress quoting of stats elements when displaying them. Newlines will be preserved in strings etc
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to consider preformatted. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-preformatted YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/exposeKeyName
The "exposeKeyName" element makes it possible to force the C- and I-style CLIs to expose the key name to the CLI user. The user will be required to enter the name of the key and the key name will be displayed when showing the configuration.
Attributes:
- path (pathType)
The "src" attribute is mandatory. It specifies which leaf to expose. pathType is a space-separated list of elements, pointing out a specific list key element.
Note that the tailf:cli-expose-key-name YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/displayEmptyConfig
The "displayEmptyConfig" element makes it possible to tell confd to display empty configuration list elements when displaying stats data in J-style CLI, provided that the list element has at least one optional config="false" element.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to apply the mod to. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-display-empty-config YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/suppressKeyAbbrev
The "suppressKeyAbbrev" element makes it possible to suppress the use of abbreviations for specific key elements.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to suppress. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-suppress-key-abbreviation YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/allowKeyAbbrev
The "allowKeyAbbrev" element makes it possible to allow the use of abbreviations for specific key elements.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to suppress. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:allow-key-abbreviation YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/suppressMode
The "suppressMode" element makes it possible to suppress an automatically generated mode in C- and I- style CLI.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies which path to suppress. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-suppress-mode YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/addMode
The "addMode" element makes it possible to create a mode at a non-list element. Only applicable in C- and I- style CLI.
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies for which path to create the mode. pathType is a space-separated list of elements, pointing out a specific non-list, non-leaf element.
Note that the tailf:cli-add-mode YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/modeName
The "modeName" element makes it possible to specify a custom mode name in the C- and I- style CLI. It contains one of the elements "fixed" or "capi".
Attributes:
- src (pathType)
The "src" attribute is mandatory. It specifies for which path the custom mode name should apply. pathType is a space-separated list of elements, pointing out a path to a mode.
/clispec/$MODE/modifications/modeName/fixed (xs:string)
Specifies a fixed mode name.
Note that the tailf:cli-mode-name YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/modeName/capi
Specifies that the mode name should be calculated through a callback function. It contains exactly one "cmdpoint" element.
Note that the tailf:cli-mode-name-actionpoint YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/modeName/capi/cmdpoint (xs:string)
Specifies the callpoint name of the mode name function.
/clispec/$MODE/modifications/autocommitDelay
The "autocommitDelay" element makes it possible to enable transactions while in a specific submode (or submode of that mode). The modifications performed in that mode will not take effect until the user exits that submode.
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to delay autocommit for. pathType is a space-separated list of elements, pointing out a specific non-list, non-leaf element.
Note that the tailf:cli-delayed-auto-commit YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/simpleType
The "simpleType" element makes it possible to customize the handling of a type. A type is typically attached to each leaf in a YANG module or to command parameters. The "simpleType" element makes it possible to customize both builtin and derived types. For now the only handling that can be customized is how CLI completion is to be performed.
The "simpleType" element contains a single element "capi".
Attributes:
- namespace (string)
The "namespace" attribute is mandatory. It specifies the namespace URI whereas the type to be modified has been defined.
- name (string)
The "name" attribute is mandatory. It specifies the name of the type to be customized
/clispec/$MODE/modifications/simpleType/capi
Specifies that the simpleType customization should be calculated through a callback function. It contains exactly one "completionpoint" element.
/clispec/$MODE/modifications/simpleType/capi/completionpoint (xs:string)
Specifies the callpoint name of the completion function.
/clispec/$MODE/modifications/completion
The "completion" element makes it possible to customize the completion of a specific path.
The "completion" element contains a single element "capi" enclosed in the "callback" element.
Attributes:
- path (cmdpathType)
The "path" attribute is mandatory. It specifies for which path the completion callback should be applied to. cmdpathType is a space-separated list of commands.
Note that the tailf:cli-completion-actionpoint YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/completion/callback/capi
Specifies that the completion customization should be calculated through a callback function. It contains exactly one "completionpoint" element.
/clispec/$MODE/modifications/completion/callback/capi/completionpoint (xs:string)
Specifies the callpoint name of the completion function.
Attributes:
- id (string)
The "id" attribute is optional. It specifies a string which is passed to the callback when invoked. This makes it possible to use the same callback at several locations and still keep track of which point it is invoked from.
/clispec/$MODE/modifications/suppressKeySort
The "suppressKeySort" element makes it possible to suppress sorting of key-values in the completion list. Instead the values will be displayed in the same order as they are provided by the data-provider (external or CDB).
Attributes:
- path (pathType)
The "path" attribute is mandatory. It specifies which path to not sort. pathType is a space-separated list of elements, pointing out a specific list element.
Note that the tailf:cli-suppress-key-sort YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/legend
(xs:string)
The "legend" element makes it possible to add a custom legend to be displayed when before printing a table. The legend is specified as a template string.
Attributes:
- path (cmdpathType)
The "path" attribute is mandatory. It specifies for which path the legend should be printed. cmdpathType is a space-separated list of commands.
Note that the tailf:cli-legend YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/footer
(xs:string)
The "footer" element makes it possible to specify a template that will be displayed after printing a table.
Attributes:
- path (cmdpathType)
The "path" attribute is mandatory. It specifies for which path the footer should be printed. cmdpathType is a space-separated list of commands.
Note that the tailf:cli-footer YANG extension can be used to the same effect directly in YANG file.
/clispec/$MODE/modifications/help
(xs:string)
The "help" element makes it possible to add a custom help text to the specified built-in command.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to add the text to. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
/clispec/$MODE/modifications/paramhelp
(xs:string)
The "paramhelp" element makes it possible to add a custom help text to a parameter to a specified built-in command.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to add the text to. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- nr (positiveInteger)
The "nr" attribute is mandatory. It specifies which parameter of the command to add the text to.
/clispec/$MODE/modifications/typehelp
(xs:string)
The "typehelp" element makes it possible to add a custom help text for the built-in primitive types, e.g. to change the default type name in the CLI. For example, to display "<integer>" instead of "<unsignedShort>".
The built-in primitive types are: string, atom, normalizedString, boolean, float, decimal, double, hexBinary, base64Binary, anyURI, anySimpleType, QName, NOTATION, token, integer, nonPositiveInteger, negativeInteger, long, int, short, byte, nonNegativeInteger, unsignedLong, positiveInteger, unsignedInt, unsignedShort, unsignedByte, dateTime, date, gYearMonth, gDay, gYear, time, gMonthDay, gMonth, duration, inetAddress, inetAddressIPv4, inetAddressIP, inetAddressIPv6, inetAddressDNS, inetPortNumber, size, MD5DigestString, DES3CBCEncryptedString, AESCFB128EncryptedString, objectRef, bits_type_32, bits_type_64, hexValue, hexList, octetList, Gauge32, Counter32, Counter64, and oid.
Attributes:
- type (xs:Name)
The "type" attribute is mandatory. It specifies which primitive type to modify.
/clispec/$MODE/modifications/info
(xs:string)
The "info" element makes it possible to add a custom info text to the specified built-in command.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to hide. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
/clispec/$MODE/modifications/paraminfo
(xs:string)
The "paraminfo" element makes it possible to add a custom info text to a parameter to a specified built-in command.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to add the text to. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- nr (positiveInteger)
The "nr" attribute is mandatory. It specifies which parameter of the command to add the text to.
/clispec/$MODE/modifications/timeout
(xs:integer|infinity)
The "timeout" element makes it possible to add a custom command timeout (in seconds) to the specified built-in command.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to add the timeout to. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
/clispec/$MODE/modifications/hide
The "hide" element makes it possible to hide a built-in command
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to hide. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
An example:
<modifications> <hide src="file show"/> </modifications>
/clispec/$MODE/modifications/hideGroup
The "hideGroup" element makes it possible to hide a built-in command under a hide group.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to hide. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- name (xs:string)
The "name" attribute is mandatory. It specifies which hide group to hide the command.
An example:
<modifications> <hideGroup src="file show" name="debug"/> </modifications>
/clispec/$MODE/modifications/submodeCommand
The "submodeCommand" element makes it possible to make a command visible in the completion lists of all submodes.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to make available. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
An example:
<modifications> <submodeCommand src="clear"/> </modifications>
/clispec/$MODE/modifications/confirmText
(xs:string)
The "confirmText" element makes it possible to add a confirmation text to the specified command, i.e. the CLI user is prompted whenever this command is executed. The prompt to be used is given as a body to the element as seen in confd-light.cli above. The valid answers are "yes" and "no" - the text " [yes, no]" will automatically be added to the given confirmation text.
Attributes:
- src (cmdpathType)
The "src" attribute is mandatory. It specifies which command to add a confirmation prompt to. cmdpathType is a space-separated list of commands, pointing out a specific sub-command.
- defaultOption (yes|no)
The "defaultOption" attribute is optional. It makes it possible to customize if "yes" or "no" should be the default option, i.e. if the user just hits ENTER. If this element is not defined it defaults to whatever is specified by the /clispec/$MODE/modifications/defaultConfirmOption element.
/clispec/$MODE/modifications/defaultConfirmOption
(yes|no)
The "defaultConfirmOption" element makes it possible to customize if "yes" or "no" should be the default option, i.e. if the user just hits ENTER, for the confirmation text added by the "confirmText" element.
If this element is not defined it defaults to "yes".
This element affects both /clispec/$MODE/modifications/confirmText and /clispec/$MODE/cmd/confirmText if they have not defined their "defaultOption" attributes.
/clispec/$MODE/modifications/keymap
The "keymap" element makes it possible to modify the key bindings in the command line editor.
Attributes:
- key (xs:string)
The "key" attribute is mandatory. It specifies which sequence of keystrokes to modify.
- action (keymapActionType)
The "action" attribute is mandatory. It specifies what should happen when the specified key sequence is executed. Possible values are: "unset", "new", "exist", "start_of_line", "back", "abort", "tab", "delete_forward", "delete_forward_no_eof", "end_of_line", "forward", "kill_rest", "redraw", "redraw_clear", "newline", "insert(chars)", "history_next", "history_prev", "isearch_back", "transpose", "kill_line", "quote", "word_delete_back", "yank", "end_mode", "delete", "word_delete_forward", "beginning_of_line", "delete", "end_of_line", "word_forward", "word_back", "end_of_line", "beginning_of_line", "word_back", "word_forward", "word_capitalize", "word_lowercase", "word_uppercase", "word_delete_back", "word_delete_forward", "multiline_mode", "yank_killring", and "quot". To remove a default binding use the action "remove_binding".
The default keymap is:
<keymap key="\^A" action="start_of_line"/> <keymap key="\^B" action="back"/> <keymap key="\^C" action="abort"/> <keymap key="\^D" action="delete_forward"/> <keymap key="\^E" action="end_of_line"/> <keymap key="\^F" action="forward"/> <keymap key="\^J" action="newline"/> <keymap key="\^K" action="kill_rest"/> <keymap key="\^L" action="redraw_clear"/> <keymap key="\^M" action="newline"/> <keymap key="\^N" action="history_next"/> <keymap key="\^P" action="history_prev"/> <keymap key="\^R" action="isearch_back"/> <keymap key="\^T" action="transpose"/> <keymap key="\^U" action="kill_line"/> <keymap key="\^V" action="quote"/> <keymap key="\^W" action="word_delete_back"/> <keymap key="\^X" action="kill_line"/> <keymap key="\^Y" action="yank"/> <keymap key="\^Z" action="end_mode"/> <keymap key="\d" action="delete"/> <keymap key="\t" action="tab"/> <keymap key="\b" action="delete"/> <keymap key="\ed" action="word_delete_forward"/> <keymap key="\e[Z" action="tab"/> <keymap key="\e[A" action="history_prev"/> <keymap key="\e[1~" action="beginning_of_line"/> <keymap key="\e[3~" action="delete"/> <keymap key="\e[4~" action="end_of_line"/> <keymap key="\eOA" action="history_prev"/> <keymap key="\eOB" action="history_next"/> <keymap key="\eOC" action="forward"/> <keymap key="\eOD" action="back"/> <keymap key="\eOM" action="newline"/> <keymap key="\eOp" action="insert(0)"/> <keymap key="\eOq" action="insert(1)"/> <keymap key="\eOr" action="insert(2)"/> <keymap key="\eOs" action="insert(3)"/> <keymap key="\eOt" action="insert(4)"/> <keymap key="\eOu" action="insert(5)"/> <keymap key="\eOv" action="insert(6)"/> <keymap key="\eOw" action="insert(7)"/> <keymap key="\eOx" action="insert(8)"/> <keymap key="\eOy" action="insert(9)"/> <keymap key="\eOm" action="insert(-)"/> <keymap key="\eOl" action="insert(*)"/> <keymap key="\eOn" action="insert(.)"/> <keymap key="\e[5C" action="word_forward"/> <keymap key="\e[5D" action="word_back"/> <keymap key="\e[1;5C" action="word_forward"/> <keymap key="\e[1;5D" action="word_back"/> <keymap key="\e[B" action="history_next"/> <keymap key="\e[C" action="forward"/> <keymap key="\e[D" action="back"/> <keymap key="\e[F" action="end_of_line"/> <keymap key="\e[H" action="beginning_of_line"/> <keymap key="\eb" action="word_back"/> <keymap key="\ef" action="word_forward"/> <keymap key="\ec" action="word_capitalize"/> <keymap key="\el" action="word_lowercase"/> <keymap key="\eu" action="word_uppercase"/> <keymap key="\e\b" action="word_delete_back"/> <keymap key="\e\d" action="word_delete_back"/> <keymap key="\ed" action="word_delete_forward"/> <keymap key="\em" action="multiline_mode"/> <keymap key="\ey" action="yank_killring"/> <keymap key="\eq" action="quote"/>The default keymap for I-style differs with the following mapping:
<keymap key="\^D" action="delete_forward_no_eof"/>
/clispec/$MODE/show
The "show" element overrides the built-in show command, in the C-style CLI, for a givenpath defined by the "path" attribute. It contains (in order) zero or one "callback" elements, and zero or one "options" elements.
Attributes:
- path (showpathType) []
The "path" attribute is required. It specifies for which path the command should be invoked.
An example:
<show path="aaa authentication users user"> <callback> <exec> <osCommand>./show_aaa_auth.sh</osCommand> </exec> </callback> </show>
/clispec/$MODE/show/callback
The "callback" element specifies how the command is implemented, e.g. as a OS executable or a CAPI callback. It contains one of the elements "capi", and "exec".
/clispec/$MODE/show/callback/mode
The "mode" element specifies that the command is used for entering a custom mode. It contains one "name" and one "datastore" element.
An example:
<callback> <mode> <name>debug</name> <datastore>private</name> </mode> </callback>
/clispec/$MODE/show/callback/mode/name
(xs:NCName)
The "name" element specifies the name of the custom mode. For this to work, a custom mode with that name must be declared.
/clispec/$MODE/show/callback/mode/datastore
[private]
The "datastore" element must be one of "private", "shared" and "exclusive". It is ignored for operational custom modes and when entering a configure mode from within another configure mode. It is only used when going from operational mode to configure mode.
/clispec/$MODE/show/callback/capi
The "capi" element specifies that the command is implemented using C-API using the same API as for actions. It contains one "cmdpoint" element and one or zero "args" element.
An example:
<callback> <capi> <cmdpoint>adduser</cmdpoint> </capi> </callback>
/clispec/$MODE/show/callback/capi/args
(argsType)
The "args" element specifies the arguments to use when executing the command specified by the "callpoint" element. argsType is a space-separated list of argument strings.
The string may contain a number of built-in variables which are expanded on execution. The built-in variables are: "cwd", "user", "groups", "ip", "maapi", "uid", "gid", "tty", "ssh_connection", "opaque", "path", "cpath", "ipath" and "licounter". In addition the variables "spath" and "ispath" are available when a command is executed from a show path. For example:
<args>$(user)</args>Will expand to the username.
/clispec/$MODE/show/callback/capi/cmdpoint
(xs:NCName)
The "cmdpoint" element specifies the name of the C-API action to be called. For this to work, a actionpoint must be registered with the ConfD daemon at startup.
/clispec/$MODE/show/callback/exec
The "exec" element specifies how the command is implemented using an executable or a shell script. It contains (in order) one "osCommand" element, zero or one "args" elements and zero or one "options" elements.
An example:
<callback> <exec> <osCommand>cp</osCommand> <options> <uid><phrase condition="confd">confd</phrase><phrase condition="ncs">ncs</phrase></uid> <wd>/var/tmp</wd> ... </options> </exec> </callback>
/clispec/$MODE/show/callback/exec/osCommand
(xs:token)
The "osCommand" element specifies the path to the executable or shell script to be called. If the command is in the $PATH (as specified when we start the ConfD daemon) the path may just be the name of the command.
The "osCommand" and "args" for "show" differs a bit from the ones for "cmd". For "show" there are a few built-in arguments that always are given to the "osCommand". These are appended to "args". The built-in arguments are "0", the keypath (ispath) and an optional filter. Like this: "0 /prefix:keypath *".
The command is not paginated by default in the CLI and will only do so if it is piped to more.
joe@io> example_os_command | moreThe command is invoked as if it had been executed by exec(3), i.e. not in a shell environment such as "/bin/sh -c ...".
/clispec/$MODE/show/callback/exec/args
(argsType)
The "args" element specifies additional arguments to use when executing the command specified by the "osCommand" element. The "args" arguments are prepended to the mandatory ones listed in "osCommand". argsType is a space-separated list of argument strings.
The string may contain a number of built-in variables which are expanded on execution. The built-in variables are: "cwd", "user", "groups", "ip", "maapi", "uid", "gid", "tty", "ssh_connection", "opaque", "path", "cpath", "ipath" and "licounter". In addition the variables "spath" and "ispath" are available when a command is executed from a show path. For example:
<args>$(user)</args>Will expand to the username and the three built-in arguments. For example: "admin 0 /prefix:keypath *".
/clispec/$MODE/show/callback/exec/options
The "options" element specifies how the command is be executed. It contains (in any order) zero or one "uid" elements, zero or one "gid" elements, zero or one "wd" elements, zero or one "batch" elements, zero or one "pty" element, zero or one of "interrupt" elements, zero or one of "noInput", and zero or one "ignoreExitValue" elements.
/clispec/$MODE/show/callback/exec/options/uid
(idType) [confd]
The "uid" element specifies which user id to use when executing the command. Possible values are:
- confd (default)
The command is run as the same user id as the ConfD daemon.
- user
The command is run as the same user id as the user logged in to the CLI, i.e. we have to make sure that this user id exists as an actual user id on the device.
- root
The command is run as root.
- <uid> (the numerical user <uid>)
The command is run as the user id <uid>.
Note: If uid is set to either "user", "root" or "<uid>" the the ConfD daemon must have been started as root (or setuid), or the showptywrapper must have setuid root permissions.
/clispec/$MODE/show/callback/exec/options/gid
(idType) [confd]
The "gid" element specifies which group id to use when executing the command. Possible values are:
- confd (default)
The command is run as the same group id as the ConfD daemon.
- user
The command is run as the same group id as the user logged in to the CLI, i.e. we have to make sure that this group id exists as an actual group on the device.
- root
The command is run as root.
- <gid> (the numerical group <gid>)
The command is run as the group id <gid>.
Note: If gid is set to either "user", "root" or "<gid>" the the ConfD daemon must have been started as root (or setuid), or the showptywrapper must have setuid root permissions.
/clispec/$MODE/show/callback/exec/options/wd
(xs:token)
The "wd" element specifies which working directory to use when executing the command. If not given, the command is executed from the location of the CLI.
/clispec/$MODE/show/callback/exec/options/pty
(xs:boolean)
The "pty" element specifies weather a pty should be allocated when executing the command. The default is to allocate a pty for operational and configure osCommands, but not for osCommands executing as a pipe command. This behavior can be overridden with this parameter.
/clispec/$MODE/show/callback/exec/options/interrupt
(interruptType) [sigkill]
The "interrupt" element specifies what should happen when the user enters ctrl-c in the CLI. Possible values are:
- sigkill (default)
The command is terminated by sending the sigkill signal.
- sigint
The command is interrupted by the sigint signal.
- sigterm
The command is interrupted by the sigterm signal.
- ctrlc
The command is sent the ctrl-c character which is interpreted by the pty.
/clispec/$MODE/show/callback/exec/options/ignoreExitValue
The "ignoreExitValue" element specifies that the CLI engine should ignore the fact that the command returns a non-zero value. Normally it signals an error on stdout if a non-zero value is returned.
/clispec/$MODE/show/callback/exec/options/globalNoDuplicate
(xs:token)
The "globalNoDuplicate" element specifies that only one instance with the same name can be run at any one time in the system. The command can be started either from the CLI, the Web UI or through NETCONF.
/clispec/$MODE/show/callback/exec/options/noInput
(xs:token)
The "noInput" element specifies that the command should not grab the input stream and consume freely from that. This option should be used if the command should not consume input characters. If not used then the command will eath all data from the input stream and cut-and-paste may not work as intended.
/clispec/$MODE/show/options
The "options" element specifies under what circumstances the CLI command should execute. It contains (in any order) zero or one "notInterruptible" elements, zero or one of "displayWhen" elements, and zero or one "paginate" elements.
/clispec/$MODE/show/options/notInterruptible
The "notInterruptible" element disables <ctrl-c> and the execution of the CLI command can thus not be interrupted.
/clispec/$MODE/show/options/paginate
The "paginate" element enables a filter for paging through CLI command output text one screen at a time.
/clispec/$MODE/show/options/displayWhen
The "displayWhen" element can be used to add a displayWhen xpath condition to a command.
Attributes:
- exrp (xpath expression)
The "expr" attribute is mandatory. It specifies an xpath expression. If the expression evaluates to true then the command is available, otherwise not.
- ctx (path)
The "ctx" attribute is optional. If not specified the current editpath/mode-path is used as context node for the xpath evaluation. Note that the xpath expression will automatically evaluate to false if a display when expression is used for a top-level command and no ctx is specified. The path may contain variables defined in the dict.
/clispec/operationalMode/start
The "start" command is executed when the CLI is started. It can be used to, for example, remind the user to change an expired password. It contains (in order) zero or one "callback" elements, and zero or one "options" elements.
This element must occur after the <modifications> section and before any <cmd> entries.
An example:
<start> <callback> <exec> <osCommand>./startup.sh</osCommand> </exec> </callback> </start>
/clispec/operationalMode/start/callback
The "callback" element specifies how the command is implemented, e.g. as a OS executable or an API callback. It contains one of the elements "capi", and "exec".
/clispec/operationalMode/start/callback/capi
The "capi" element specifies that the command is implemented using C-API using the same API as for actions. It contains one "cmdpoint" element.
An example:
<callback> <capi> <cmdpoint>adduser</cmdpoint> </capi> </callback>
/clispec/operationalMode/start/callback/capi/cmdpoint
(xs:NCName)
The "cmdpoint" element specifies the name of the C-API action to be called. For this to work, a actionpoint must be registered with the ConfD daemon at startup.
/clispec/operationalMode/start/callback/exec
The "exec" element specifies how the command is implemented using an executable or a shell script. It contains (in order) one "osCommand" element, zero or one "args" elements and zero or one "options" elements.
An example:
<callback> <exec> <osCommand>cp</osCommand> <options> <uid>confd</uid> <wd>/var/tmp</wd> ... </options> </exec> </callback>
/clispec/operationalMode/start/callback/exec/osCommand
(xs:token)
The "osCommand" element specifies the path to the executable or shell script to be called. If the command is in the $PATH (as specified when we start the ConfD daemon) the path may just be the name of the command.
The command is invoked as if it had been executed by exec(3), i.e. not in a shell environment such as "/bin/sh -c ...".
/clispec/operationalMode/start/callback/exec/args
(argsType)
The "args" element specifies the arguments to use when executing the command specified by the "osCommand" element. argsType is a space-separated list of argument strings. The built-in variables are: "cwd", "user", "groups", "ip", "maapi", "uid", "gid", "tty", "ssh_connection", "opaque", "path", "cpath", "ipath" and "licounter". In addition the variables "spath" and "ispath" are available when a command is executed from a show path. For example:
<args>$(user)</args>Will expand to the username.
/clispec/operationalMode/start/callback/exec/options
The "options" element specifies how the command is be executed. It contains (in any order) zero or one "uid" elements, zero or one "gid" elements, zero or one "wd" elements, zero or one "batch" elements, zero or one of "interrupt" elements, and zero or one "ignoreExitValue" elements.
/clispec/operationalMode/start/callback/exec/options/uid
(idType) [confd]
The "uid" element specifies which user id to use when executing the command. Possible values are:
- confd (default)
The command is run as the same user id as the ConfD daemon.
- user
The command is run as the same user id as the user logged in to the CLI, i.e. we have to make sure that this user id exists as an actual user id on the device.
- root
The command is run as root.
- <uid> (the numerical user <uid>)
The command is run as the user id <uid>.
Note: If uid is set to either "user", "root" or "<uid>" the the ConfD daemon must have been started as root (or setuid), or the startptywrapper must have setuid root permissions.
/clispec/operationalMode/start/callback/exec/options/gid
(idType) [confd]
The "gid" element specifies which group id to use when executing the command. Possible values are:
- confd (default)
The command is run as the same group id as the ConfD daemon.
- user
The command is run as the same group id as the user logged in to the CLI, i.e. we have to make sure that this group id exists as an actual group on the device.
- root
The command is run as root.
- <gid> (the numerical group <gid>)
The command is run as the group id <gid>.
Note: If gid is set to either "user", "root" or "<gid>" the the ConfD daemon must have been started as root (or setuid), or the startptywrapper must have setuid root permissions.
/clispec/operationalMode/start/callback/exec/options/wd
(xs:token)
The "wd" element specifies which working directory to use when executing the command. If not given, the command is executed from the location of the CLI.
/clispec/operationalMode/start/callback/exec/options/globalNoDuplicate
(xs:token)
The "globalNoDuplicate" element specifies that only one instance with the same name can be run at any one time in the system. The command can be started either from the CLI, the Web UI or through NETCONF.
/clispec/operationalMode/start/callback/exec/options/interrupt
(interruptType) [sigkill]
The "interrupt" element specifies what should happen when the user enters ctrl-c in the CLI. Possible values are:
- sigkill (default)
The command is terminated by sending the sigkill signal.
- sigint
The command is interrupted by the sigint signal.
- sigterm
The command is interrupted by the sigterm signal.
- ctrlc
The command is sent the ctrl-c character which is interpreted by the pty.
/clispec/operationalMode/start/callback/exec/options/ignoreExitValue
(xs:boolean) [false]
The "ignoreExitValue" element specifies if the CLI engine should ignore the fact that the command returns a non-zero value. Normally it signals an error on stdout if a non-zero value is returned.
/clispec/operationalMode/start/options
The "options" element specifies under what circumstances the CLI command should execute. It contains (in any order) zero or one "notInterruptible" elements, and zero or one "paginate" elements.
/clispec/operationalMode/start/options/notInterruptible
The "notInterruptible" element disables <ctrl-c> and the execution of the CLI command can thus not be interrupted.
/clispec/operationalMode/start/options/paginate
The "paginate" element enables a filter for paging through CLI command output text one screen at a time.
/clispec/$MODE/cmd
The "cmd" element adds a new command to the CLI hierarchy as defined by its "mount" and "mode" attributes. It contains (in order) one "info" element, one "help" element, zero or one "confirmText" element, zero or one "callback" elements, zero or one "params" elements, zero or one "options" elements and finally zero or more "cmd" elements (recursively).
Attributes:
- name (xs:NCName)
The "name" attribute is mandatory. It specifies the name of the command.
- mode (cmdpathType) []
The "mode" attribute is optional. It specifies that the command should be mounted in a specific submode. The attribute is only applicable in the C- and I-style CLIs. If no "mode" attribute is given the command is mounted in the topmost mode.
- extend (xs:boolean) [false]
The "extend" attribute is optional. It specifies that the command should be mounted on top of an existing command, ie with the exact same name as an existing command but with different parameters. Which command is executed depends on which parameters are supplied when the command is invoked. This can be used to overlay an existing command.
- mount (cmdpathType) []
The "mount" attribute is optional. It specifies where in the command hierarchy of built-in commands this command should be mounted. If no mount attribute is given, or if it is empty (""), the command is mounted on the top-level of the CLI hierarchy.
An example:
<cmd name="copy" mount="file"> <info>Copy a file</info> <help>Copy a file from in the file system.</help> <callback> <exec> <osCommand>cp</osCommand> <options> <uid>confd</uid> </options> </exec> </callback> <params> <param> <type><file/></type> <info>&lt;source file&gt;</info> </param> <param> <type><file/></type> <info>&lt;destination&gt;</info> </param> </params> <cmd ...> ... <cmd ...> ... </cmd> </cmd> <cmd ...> ... </cmd> </cmd>
/clispec/$MODE/cmd/info (xs:string)
The "info" element is a single text line describing the command.
An example:
<cmd name="start"> <info>Start displaying the system log or trace a file</info> ...and when we do the following in the CLI we get:
joe@xev> monitor st<TAB> Possible completions: start - Start displaying the system log or trace a file stop - Stop displaying the system log or trace a file joe@xev> monitor st
/clispec/$MODE/cmd/help (xs:string)
The "help" element is a multi-line text string describing the command. This text is shown when we use the "help" command.
An example:
joe@xev> help monitor start Help for command: monitor start Start displaying the system log or trace a file in the background. We can abort the logging using the "monitor stop" command. joe@xev>
/clispec/$MODE/cmd/timeout (xs:integer|infinity)
The "timeout" element is a timeout for the command in seconds. Default is infinity.
/clispec/$MODE/cmd/confirmText
See /clispec/$MODE/modifications/confirmText
/clispec/$MODE/cmd/callback
The "callback" element specifies how the command is implemented, e.g. as a OS executable or a CAPI callback. It contains one of the elements "capi", "exec", "table" or "execStop".
Note: A command which has a callback defined may not have recursive sub-commands. Likewise, a command which has recursive sub-commands may not have a callback defined. A command without sub-commands must have a callback defined.
/clispec/$MODE/cmd/callback/table
The "table" element specifies that the command should display parts of the configuration in the form of a table.
An example:
<callback> <table> <root>/all:config/hosts/host</root> <item> <width>20</width> <header>NAME</header> <path>name</path> <align>lefg</align> </item> <item> <header>DOMAIN</header> <path>domain</path> </item> <item> <header>IP</header> <path>interfaces/interface/ip</path> <align>right</align> </item> </table> </callback>
/clispec/$MODE/cmd/callback/table/root
(xs:string)
Should be a path to a list element. All item paths in the table are relative to this path.
/clispec/$MODE/cmd/callback/table/legend
(xs:string)
Should be a legend template to display before showing the table.
/clispec/$MODE/cmd/callback/table/footer
(xs:string)
Should be a footer template to display after showing the table.
/clispec/$MODE/cmd/callback/table/item
Specifies a column in the table. It contains a "header" element and a "path" element, and optionally a "width" element.
/clispec/$MODE/cmd/callback/table/item/header
(xs:string)
Header of this column in the table.
/clispec/$MODE/cmd/callback/table/item/path
(xs:string)
Path to the element in this column.
/clispec/$MODE/cmd/callback/table/item/width
(xs:integer)
The width in characters of this column.
/clispec/$MODE/cmd/callback/table/item/align
(left|right|center)
The data alignment of this column.
/clispec/$MODE/cmd/callback/capi
The "capi" element specifies that the command is implemented using C-API using the same API as for actions. It contains one "cmdpoint" element.
An example:
<callback> <capi> <cmdpoint>adduser</cmdpoint> </capi> </callback>
/clispec/$MODE/cmd/callback/capi/cmdpoint
(xs:NCName)
The "cmdpoint" element specifies the name of the C-API action to be called. For this to work, a actionpoint must be registered with the ConfD daemon at startup.
/clispec/$MODE/cmd/callback/exec
The "exec" element specifies how the command is implemented using an executable or a shell script. It contains (in order) one "osCommand" element, zero or one "args" elements and zero or one "options" elements.
An example:
<callback> <exec> <osCommand>cp</osCommand> <options> <uid>confd</uid> <wd>/var/tmp</wd> ... </options> </exec> </callback>
/clispec/$MODE/cmd/callback/exec/osCommand
(xs:token)
The "osCommand" element specifies the path to the executable or shell script to be called. If the command is in the $PATH (as specified when we start the ConfD daemon) the path may just be the name of the command.
The command is invoked as if it had been executed by exec(3), i.e. not in a shell environment such as "/bin/sh -c ...".
/clispec/$MODE/cmd/callback/exec/args
(argsType)
The "args" element specifies the arguments to use when executing the command specified by the "osCommand" element. argsType is a space-separated list of argument strings. The built-in variables are: "cwd", "user", "groups", "ip", "maapi", "uid", "gid", "tty", "ssh_connection", "opaque", "path", "cpath", "ipath" and "licounter". The variable "pipecmd_XYZ" can be used to determine whether a certain builtin pipe command has been run together with the command. Here XYZ is the name of the pipe command. An example of such a variable is "pipecmd_include". In addition the variables "spath" and "ispath" are available when a command is executed from a show path. For example:
<args>$(user)</args>Will expand to the username.
/clispec/$MODE/cmd/callback/exec/options
The "options" element specifies how the command is be executed. It contains (in any order) zero or one "uid" elements, zero or one "gid" elements, zero or one "wd" elements, zero or one "batch" elements, zero or one of "interrupt" elements, and zero or one "ignoreExitValue" elements.
/clispec/$MODE/cmd/callback/exec/options/uid
(idType) [confd]
The "uid" element specifies which user id to use when executing the command. Possible values are:
- confd (default)
The command is run as the same user id as the ConfD daemon.
- user
The command is run as the same user id as the user logged in to the CLI, i.e. we have to make sure that this user id exists as an actual user id on the device.
- root
The command is run as root.
- <uid> (the numerical user <uid>)
The command is run as the user id <uid>.
Note: If uid is set to either "user", "root" or "<uid>" the the ConfD daemon must have been started as root (or setuid), or the cmdptywrapper must have setuid root permissions.
/clispec/$MODE/cmd/callback/exec/options/gid
(idType) [confd]
The "gid" element specifies which group id to use when executing the command. Possible values are:
- confd (default)
The command is run as the same group id as the ConfD daemon.
- user
The command is run as the same group id as the user logged in to the CLI, i.e. we have to make sure that this group id exists as an actual group on the device.
- root
The command is run as root.
- <gid> (the numerical group <gid>)
The command is run as the group id <gid>.
Note: If gid is set to either "user", "root" or "<gid>" the the ConfD daemon must have been started as root (or setuid), or the cmdptywrapper must have setuid root permissions.
/clispec/$MODE/cmd/callback/exec/options/wd
(xs:token)
The "wd" element specifies which working directory to use when executing the command. If not given, the command is executed from the location of the CLI.
/clispec/$MODE/cmd/callback/exec/options/pty
(xs:boolean)
The "pty" element specifies weather a pty should be allocated when executing the command. The default is to allocate a pty for operational and configure osCommands, but not for osCommands executing as a pipe command. This behavior can be overridden with this parameter.
/clispec/$MODE/cmd/callback/exec/options/globalNoDuplicate
(xs:token)
The "globalNoDuplicate" element specifies that only one instance with the same name can be run at any one time in the system. The command can be started either from the CLI, the Web UI or through NETCONF.
/clispec/$MODE/cmd/callback/exec/options/noInput
(xs:token)
The "noInput" element specifies that the command should not grab the input stream and consume freely from that. This option should be used if the command should not consume input characters. If not used then the command will eath all data from the input stream and cut-and-paste may not work as intended.
/clispec/$MODE/cmd/callback/exec/options/batch
The "batch" element makes it possible to specify that a command returns immediately but still runs in the background, optionally generating output on stdout. An example of such a command is the standard "monitor start" command, which prints additional data appended to a (log) file:
joe@io> monitor start /var/log/messages joe@io> log: Apr 10 11:59:32 earth ntpd[530]: kernel time sync enabled 2001Ten seconds later...
log: Apr 12 01:59:02 earth sshd[26847]: error: PAM: auth error for cathy joe@io> monitor stop /var/log/messages joe@io>The "batch" element contains (in order) one "group" element, an optional "prefix" element, and an optional "noDuplicate" element. The prefix defaults to the empty string.
An example from confd .cli implementing the monitor functionality:
<cmd name="start"> ... <callback> <exec> <osCommand>tail</osCommand> <args>-f -n 0</args> <options> ... <batch> <group>monitor_file</group> <prefix>log:</prefix> <noDuplicate/> </batch> </options> </exec> </callback> ... </cmd>The batch group is used to kill the command as exemplified in the "execStop" element description below. "noDuplicate" indicates that a specific file is not allowed to be monitored by several commands in parallel.
/clispec/$MODE/cmd/callback/exec/options/batch/group
(xs:NCName)
The "group" element attaches a group label to the command. The group label is used when defining a "stop" command whose job it is to kill the background command. Take a look at the monitor example above for better understanding.
The stop command is defined using a "execStop" element as described below.
/clispec/$MODE/cmd/callback/exec/options/batch/prefix
(xs:NCName)
The "prefix" element specifies a string to prepend to all lines printed by the background command. In the monitor example above, "log:" is the chosen prefix.
/clispec/$MODE/cmd/callback/exec/options/batch/noDuplicate
The "noDuplicate" element specifies that only a single instance of this batch command, including the given/specified parameters, can run in the background.
/clispec/$MODE/cmd/callback/exec/options/interrupt
(interruptType) [sigkill]
The "interrupt" element specifies what should happen when the user enters ctrl-c in the CLI. Possible values are:
- sigkill (default)
The command is terminated by sending the sigkill signal.
- sigint
The command is interrupted by the sigint signal.
- sigterm
The command is interrupted by the sigterm signal.
- ctrlc
The command is sent the ctrl-c character which is interpreted by the pty.
/clispec/$MODE/cmd/callback/exec/options/ignoreExitValue
(xs:boolean) [false]
The "ignoreExitValue" element specifies if the CLI engine should ignore the fact that the command returns a non-zero value. Normally it signals an error on stdout if a non-zero value is returned.
/clispec/$MODE/cmd/callback/execStop
The "execStop" element specifies that a command defined by an "exec" element is to be killed.
Attributes:
- batchGroup (xs:NCName)
The "batchGroup" attribute is mandatory. It specifies a background command to kill. It corresponds to a group label defined by another "exec" command using the "batch" element.
An example from confd.cli which kills a background monitor session:
<cmd name="stop"> ... <callback> <execStop batchGroup="monitor_file"/> </callback> ... </cmd>
/clispec/$MODE/cmd/params
The "params" element lists which parameters the CLI should prompt for. These parameters are then used as arguments to either the CAPI callback or the OS executable command (as specified by the "capi" element or the "exec" element, respectively). If an "args" element as well as a "params" element has been specified, all of them are used as arguments: first the "args" arguments and then the "params" values are passed to the CAPI callback or executable.
The "params" element contains (in order) zero or more "param" elements and zero or one "any" elements.
Attributes:
- mode (list|choice)
This is an optional attribute. If it is "choice" then at least "min" and at most "max" params must be given by the user. If it is "list" then all non-optional parameters must be given the command in the order they appear in the list.
- min (xs:nonNegativeInteger)
This optional attribute defines the minumun number of parameters from the body of the "params" element that the user must supply with the command. It is only applicable if the mode attribute has been set to "choice". The default value is "1".
- max (xs:nonNegativeInteger | unlimited)
This optional attribute defines the maximum number of parameters from the body of the "params" element that the user may supply with the command. It is only applicable if the mode attribute has been set to "choice". The default value is "1" unless multi is specified, in which case the default is "unlimited".
- multi (xs:boolean)
This optional attribute controls if each parameters should be allowed to be entered more than once. If set to "true" then each parameter may occur multiple times. The default is "false".
An example from confd.cli which copies one file to another:
<params> <param> <type><file/></type> ... </param> <param> <type><file/></type> ... </param> ... </params>
/clispec/$MODE/cmd/params/param
The "param" element defines the nature of a single parameter which the CLI should prompt for. It contains (in any order) zero or one "type" element, zero or one "info" element, zero or one "help" element, zero or one "optional" element, zero or one "name" element, zero or one "params" element, zero or one "auditLogHide" element, zero or one "prefix" element, zero or one "flag" element, zero or one "id" element, zero or one "hideGroup" element, and zero or one "simpleType" element and zero or one "completionId" element.
/clispec/$MODE/cmd/params/param/type
The "type" element is optional and defines the parameter type. It contains either a "enums", "enumerate", "void", "keypath", "file", "url_file", "simpleType", "xpath", "url_directory_file", "directory_file", "url_directory" or a "directory" element. If the "type" element is not present, the value entered by the user is passed unmodified to the callback.
/clispec/$MODE/cmd/params/param/type/enums
(enumsType)
The "enums" element defines a list of allowed enum values for the parameter. enumsType is a space-separated list of string enums.
An example:
<enums>for bar baz</enums>
/clispec/$MODE/cmd/params/param/type/enumerate
The "enumerate" is used to define a set of values with info text. It can contain one of more of the element "elem".
/clispec/$MODE/cmd/params/param/type/enumerate/enum
The "enum" is used to define an enumeration value with help text. It must contain the element "name" and optionally an "info" element and a "hideGroup" element.
/clispec/$MODE/cmd/params/param/type/enumerate/enum/name
(xs:token)
The "name" is used to define the name of an enumeration.
/clispec/$MODE/cmd/params/param/type/enumerate/enum/info
(xs:string)
The "info" is used to define the info that is displayed during completion in the CLI. The element is optional.
/clispec/$MODE/cmd/params/param/type/enumerate/enum/hideGroup
(xs:string)
The "hideGroup" element makes an enum value invisible and it cannot be used even if a user knows about its existence. The enum value will become visible when the hide group is 'unhidden' using the unhide command.
/clispec/$MODE/cmd/params/param/type/void
The "void" element is used to indicate that this parameter should not prompt for a value. It can only be used when the "name" element is used.
/clispec/$MODE/cmd/params/param/type/keypath
(keypathType)
The "keypath" element specifies that the parameter must be a keypath pointing to a configuration value. Valid keypath values are: new or exist:
- new
The keypath is either an already existing configuration value or an instance value to be created.
- exist
The keypath must be an already existing configuration value.
/clispec/$MODE/cmd/params/param/type/key
(path)
The "key" element specifies that the parameter is an instance identifier, either an existing instance or a new. If the list has multiple key elements then they will be entered with a space in between.
The path should point to a list element, not the actual key leaf. If the list has multiple keys then they user will be requested to enter all keys of an instance. The path may be either absolute or relative to the current submode path. Also variables referring to key elements in the current submode path may be used, where the closes key is named $(key-1-1), $(key-1-2) etc. Eg
/foo{key-2-1,key-2-2}/bar{key-1-1,key-1-2}/...Attributes:
- mode (keypathType)
The "mode" attribute is mandatory. It specifies if the parameter refers to an existing (exist) instance or a new (new) instance.
/clispec/$MODE/cmd/params/param/type/pattern
(patternType)
The "pattern" element specifies that the parameter must be a show command pattern. Valid pattern values are: stats or config or all:
- stats
The pattern is only related to "config false" nodes in the data model. Note that CLI modifications such as fullShowPath, incompleteShowPath etc are applied to this pattern.
- config
The pattern is only related to "config true" elements in the data model.
- all
The pattern spans over all visible nodes in the data model.
/clispec/$MODE/cmd/params/param/type/file
The "file" element specifies that the parameter is a file on disk. The CLI automatically enables tab completion to help the user to choose the correct file.
Attributes:
- wd (xs:token)
The "wd" attribute is optional. It specifies a working directory to be used as the root for the tab completion algorithm. If no "wd" attribute is specified, the working directory is as defined for the "/clispec/$MODE/cmd/callback/exec/options/wd" element.
An example:
<file wd="/var/log/"/>
/clispec/$MODE/cmd/params/param/type/url_file
The "url_file" element specifies that the parameter is a file on disk or an URL. The CLI automatically enables tab completion to help the user to choose the correct file.
Attributes:
- wd (xs:token)
The "wd" attribute is optional. It specifies a working directory to be used as the root for the tab completion algorithm. If no "wd" attribute is specified, the working directory is as defined for the "/clispec/$MODE/cmd/callback/exec/options/wd" element.
An example:
<file wd="/var/log/"/>
/clispec/$MODE/cmd/params/param/type/simpleType
The "simpleType" element specifies that the parameter should conform to some specific simpleType specified in a namespace. It can contain zero or one "info" element
Attributes:
- namespace (xs:string)
The "namespace" attribute is required. It specifies in which namespace the type is found. It can be either the namespace URI or the namespace prefix.
- name (xs:string)
The "name" attribute is required. It specifies the name of the type in the given namespace.
- disallowValue (xs:string)
The "disallowValue" attribute is optional. It specifies a regular expression of unaccepted values.
An example:
<simpleType namespace="<ulink url='http://tail-f.com/ns/confd/1.0'>http://tail-f.com/ns/confd/1.0</ulink>" name="inetAddressIP"/>
/clispec/$MODE/cmd/params/param/type/simpleType/info
The "info" element contains a single line describing the simpleType that will appear during auto-completion. Note that this will override any other info texts provided by this type.
/clispec/$MODE/cmd/params/param/type/xpath
The "xpath" element specifies that the parameter should conform to one of the values returned by the xpath expression given as attribute.
Attributes:
- expr (xs:string)
The "expr" attribute is required. It specifies an xpath expression that returns a set of valid values for this parameter. The expression may contain variables defined in the dict.
- ctx (xs:string)
The "ctx" attribute is optional. It specifies the context for the evaluation of the xpath expression. The path may contain variables defined in the dict.
- lax (xs:boolean)
The "lax" attribute is optional. It specifies if the given value should be checked against the values given by the xpath expression. The default is "true" which means that tab completion will present the values given by the xpath expression but the parser will accept any value. This makes parsing a bit faster. When lax is set to "false" a syntax error will be generated if an unexisting value is given as parameter.
An example:
<params> <param> <name>host</name> <type> <xpath expr="/simpleObjects/hosts/host/name" lax="false" /> </type> <flag>--host</flag> <id>hostname</id> </param> <param> <name>server</name> <type> <xpath expr="servers/server/name" ctx="/simpleObjects/hosts/host{$(hostname)}"/> </type> <flag>--server</flag> </param> </params>
/clispec/$MODE/cmd/params/param/type/directory
The "directory" element specifies that the parameter is a directory on disk. The CLI automatically enables tab completion to help the user choose the correct directory.
Attributes:
- wd (xs:token)
The "wd" attribute is optional. It specifies a working directory to be used as the root for the tab completion algorithm. If no "wd" attribute is specified, the working directory is as defined for the "wd" element.
An example:
<directory wd="/var/log/"/>
/clispec/$MODE/cmd/params/param/type/url_directory
The "url_directory" element specifies that the parameter is a directory on disk or an URL. The CLI automatically enables tab completion to help the user choose the correct directory.
Attributes:
- wd (xs:token)
The "wd" attribute is optional. It specifies a working directory to be used as the root for the tab completion algorithm. If no "wd" attribute is specified, the working directory is as defined for the "wd" element.
An example:
<directory wd="/var/log/"/>
/clispec/$MODE/cmd/params/param/type/directory_file
The "directory_file" element specifies that the parameter is a directory or a file on disk. The CLI automatically enables tab completion to help the user choose the correct directory or file.
An example:
<directory_file/>
/clispec/$MODE/cmd/params/param/type/url_directory_file
The "url_directory_file" element specifies that the parameter is a directory or a file on disk or an URL. The CLI automatically enables tab completion to help the user choose the correct directory or file.
An example:
<directory_file/>
/clispec/$MODE/cmd/params/param/info (xs:string)
The "info" element is a single text line describing the parameter.
An example:
<cmd name="id" mount=""> <info>Find uid and groups of a user</info> <help>Find uid and groups of a user, using the id program</help> <callback> <exec> <osCommand>id</osCommand> </exec> </callback> <params> <param> <info>User name</info> <help>User name</help> </param> </params> </cmd>and when we do the following in the CLI we get:
joe@x15> id <TAB> User name joe@x15> id snmp uid=108(snmp) gid=65534(nogroup) groups=65534(nogroup) [ok][2006-08-30 14:51:28]Note: This description is only shown if the "type" element is left out.
/clispec/$MODE/cmd/params/param/help (xs:string)
The "help" element is a multi-line text string describing the parameter. This text is shown when we use the '?' character.
/clispec/$MODE/cmd/params/param/hideGroup (xs:string)
The "hideGroup" element makes a CLI parameter invisible and it cannot be used even if a user knows about its existence. The parameter will become visible when the hide group is 'unhidden' using the unhide command.
This mechanism correspond to the 'tailf:hidden' statement in a YANG module.
/clispec/$MODE/cmd/params/param/name (xs:token)
The "name" element is a token which has to be entered by the user before entering the actual parameter value. It is used to get named parameters.
An example:
<cmd name="copy" mount="file"> <info>Copy a file</info> <help>Copy a file from one location to another in the file system</help> <callback> <exec> <osCommand>cp</osCommand> <options> <uid>user</uid> </options> </exec> </callback> <params> <param> <type><file/></type> <info>&lt;source file&gt;</info> <help>source file</help> <name>from</name> </param> <param> <type><file/></type> <info>&lt;destination file&gt;></info> <help>destination file</help> <name>to</name> </param> </params> </cmd>The result is that the user has to enter
file copy from /tmp/orig to /tmp/copy
/clispec/$MODE/cmd/params/param/prefix (xs:string)
The "prefix" element is a string that is prepended to the argument before calling the osCommand. This can be used to add Unix style command flags in front of the supplied parameters.
An example:
<cmd name="ssh"> <info>Open a secure shell on another host</info> <help>Open a secure shell on another host</help> <callback> <exec> <osCommand>ssh</osCommand> <options> <uid>user</uid> <interrupt>ctrlc</interrupt> </options> </exec> </callback> <params> <param> <info>&lt;login&gt;</info> <help>Users login name on host</help> <name>user</name> <prefix>--login=</prefix> </param> <param> <info>&lt;host&gt;</info> <help>host name or IP</help> <name>host</name> </param> </params> </cmd>The user would enter for example
ssh user joe host router.intranet.netand the resulting call to the ssh executable would become
ssh --login=joe router.intranet.net
/clispec/$MODE/cmd/params/param/flag (xs:string)
The "flag" element is a string that is prepended to the argument before calling the osCommand. In contrast to the prefix element it will not be appended to the current parameter, but instead appear as a separate argument, ie instead of adding a unix style flag as "--foo=" (prefix) you add arguments in the style of "-f <param>" where -f is one arg and <param> is another. Both <prefix> and <flag> can be used at the same time.
An example:
<cmd name="ssh"> <info>Open a secure shell on another host</info> <help>Open a secure shell on another host</help> <callback> <exec> <osCommand>ssh</osCommand> <options> <uid>user</uid> <interrupt>ctrlc</interrupt> </options> </exec> </callback> <params> <param> <info>&lt;login&gt;</info> <help>Users login name on host</help> <name>user</name> <flag>-l</flag> </param> <param> <info>&lt;host&gt;</info> <help>host name or IP</help> <name>host</name> </param> </params> </cmd>The user would enter for example
ssh user joe host router.intranet.netand the resulting call to the ssh executable would become
ssh -l joe router.intranet.net
/clispec/$MODE/cmd/params/param/id (xs:string)
The "id" is used for identifying the value of the parameter and can be used as a variable in the value of a key parameter.
An example:
<cmd name="test"> <info/> <help/> <callback> <exec> <osCommand>/bin/echo</osCommand> </exec> </callback> <params> <param> <name>host</name> <id>h</id> <type><key mode="exist">/host</key></type> </param> <param> <name>interface</name> <type><key mode="exist">/host{$(h)}/interface</key></type> </param> </params> </cmd>There are also three builtin variables: user, uid and gid. The id and the builtin variables can be used in when specifying the path value of a key parameter, and also when specifying the wd attribute of the file, url_file, directory, and url_directory.
/clispec/$MODE/cmd/params/param/callback/capi
Specifies that the parameter completion should be calculated through a callback function. It contains exactly one "completionpoint" element.
/clispec/$MODE/cmd/params/param/callback/capi/completionpoint
(xs:string)
Specifies the callpoint name of the completion function.
/clispec/$MODE/cmd/params/param/auditLogHide
The "auditLogHide" element specifies that the parameter should be obfuscated in the audit log. This is suitable when clear text passwords are passed as command parameters.
/clispec/$MODE/cmd/params/param/optional
The "optional" element specifies that the parameter is optional and not required. It contains zero or one "default" element. It cannot be used inside a params of type "choice".
/clispec/$MODE/cmd/params/param/optional/default
The "default" element makes it possible to specify a default value, should the parameter be left out.
An example:
<optional> <default>42</default> </optional>
/clispec/$MODE/cmd/params/param/completionId
xs:string
The "completionId" element makes it possible to identify a specific parameter whenever it is referred to from a completion callback, i.e. a completion callback takes an optional completion ID parameter as input. Read more about completion callbacks in the confd_lib_dp(3) manual page and in the "The CLI agent" User Guide chapter.
/clispec/$MODE/cmd/params/any
The "any" element specifies that any number of parameters are allowed. It contains (in any order) one "info" element and one "help" element.
/clispec/$MODE/cmd/params/any/info (xs:string)
The "info" element is a single text line describing the parameter(s) expected.
An example:
<cmd name="evaluate" mount=""> <info>Evaluate an arithmetic expression</info> <help>Evaluate an arithmetic expression, using the expr program</help> <callback> <exec> <osCommand>expr</osCommand> </exec> </callback> <params> <any> <info>Arithmetic expression</info> <help>Arithmetic expression</help> </any> </params> </cmd>and when we do the following in the CLI we get:
joe@xev> eva<TAB> joe@xev> evaluate <TAB> Arithmetic expression joe@xev> evaluate 2 + 5 7 [ok][2006-08-30 14:47:17]
/clispec/$MODE/cmd/params/any/help (xs:string)
The "help" element is a multi-line text string describing these anonymous parameters. This text is shown we use the '?' character.
/clispec/$MODE/cmd/options
The "options" element specifies under what circumstances the CLI command should execute. It contains (in any order) zero or one "hidden" element, zero or one "hideGroup" element, zero or one "denyRunAccess" element, zero or one "notInterruptible" element, zero or one "pipeFlags" element, zero or one "negPipeFlags" element, zero or one of "submodeCommand" and "topModeCommand", zero or one of "displayWhen" element, and zero or one "paginate" element.
/clispec/$MODE/cmd/options/hidden
The "hidden" element makes a CLI command invisible even though it can be evaluated if we know about its existence. This comes handy for commands which are used for debugging or are in pre-release state.
/clispec/$MODE/cmd/options/hideGroup (xs:string)
The "hideGroup" element makes a CLI command invisible and it cannot be used even if a user knows about its existence. The command will become visible when the hide group is 'unhidden' using the unhide command.
This mechanism correspond to the 'tailf:hidden' statement in a YANG module.
/clispec/operationalMode/cmd/options/denyRunAccess
The "denyRunAccess" element is used to restrict the possibility to run an operational mode command from configure mode.
Comment: The built-in "run" command is used to execute operational mode commands from configure mode.
/clispec/$MODE/cmd/options/displayWhen
The "displayWhen" element can be used to add a displayWhen XPath condition to a command.
Attributes:
- exrp (xpath expression)
The "expr" attribute is mandatory. It specifies an xpath expression. If the expression evaluates to true then the command is available, otherwise not.
- ctx (path)
The "ctx" attribute is optional. If not specified the current editpath/mode-path is used as context node for the xpath evaluation. Note that the xpath expression will automatically evaluate to false if a display when expression is used for a top-level command and no ctx is specified. The path may contain variables defined in the dict.
/clispec/$MODE/cmd/options/notInterruptible
The "notInterruptible" element disables <ctrl-c> and the execution of the CLI command can thus not be interrupted.
/clispec/$MODE/cmd/options/submodeCommand
The "submodeCommand" element makes a CLI command visible in all submodes.
/clispec/$MODE/cmd/options/topModeCommand
The "topModeCommand" element prevents a command mounted under a top mode command from being visible in all submodes.
/clispec/$MODE/cmd/options/pipeFlags
The "pipeFlags" element is used to signal that certain pipe commands should be made available if this command is entered.
/clispec/$MODE/cmd/options/negPipeFlags
The "negPipeFlags" element is used to signal that certain pipe commands should not be made available if this command is entered, ie it is used to block out specific pipe commands.
/clispec/$MODE/cmd/options/paginate
The "paginate" element enables a filter for paging through CLI command output text one screen at a time.