submodule tailf-cli-extensions { belongs-to tailf-common { prefix tailf; } include tailf-meta-extensions { revision-date 2013-11-07; } organization "Tail-f Systems"; description "This module defines all Tail-f YANG extensions statements related to CLI customization. See also the 'display-' statements and the 'alt-name' statement in tailf-common.yang."; revision 2015-03-19 { description "Released as part of ConfD-5.4 / NCS-3.4. Added cli-show-obu-comments. Added cli-batch-confirm-default."; } revision 2014-11-13 { description "Released as part of ConfD-5.3 / NCS-3.3. Added cli-strict-leafref. Added cli-trigger-on-*. Allow cli-boolean-no in typedef."; } revision 2013-11-07 { description "Released as part of ConfD-5.0. Added cli-disabled-info. Added cli-suppress-shortenabled. Added cli-no-keyword. Added cli-case-sensitive and cli-case-insensitive."; } revision 2012-11-08 { description "Released as part of ConfD-4.1. Added cli-delete-when-empty. Added cli-diff-dependency. Added cli-ignore-modified."; } revision 2012-08-23 { description "Released as part of ConfD-4.0.1. Allow tailf:cli-operational-mode and tailf:cli-configure-mode in rpc."; } revision 2012-06-14 { description "Released as part of ConfD-4.0. Do not allow tailf:cli-drop-node-name and tailf:cli-sequence-commands inside tailf:action. Added tailf:cli-configure-mode. Added tailf:cli-operational-mode."; } revision 2012-05-24 { description "Released as part of ConfD-3.9.2. Added tailf:cli-no-value-on-delete. Added tailf:cli-no-name-on-delete. Added tailf:cli-replace-all. Allow tailf:cli-remove-before-change in leaf."; } revision 2012-03-08 { description "Released as part of ConfD-3.9. Allow tailf:cli-range-list-syntax in lists with one integer based key."; } revision 2011-12-08 { description "Released as part of ConfD-3.8. Added tailf:cli-min-column-with."; } revision 2011-09-22 { description "Released as part of ConfD-3.7. Added tailf:cli-disallow-value. Added tailf:cli-multi-word. Added tailf:cli-before-key. Allow tailf:cli-flatten-container in list."; } revision 2011-08-25 { description "Released as part of ConfD-3.6.2. Added cli-suppress-silent-no. Added cli-range-delimiters. Removed duplicate tailf:use-in statement from cli-show-config."; } revision 2011-06-30 { description "Released as part of ConfD-3.6.1. Added cli-reversed. Added cli-range-list-syntax."; } revision 2011-05-26 { description "Released as part of ConfD-3.6. Added cli-allow-join-with-key. Added cli-display-joined."; } revision 2011-02-24 { description "Released as part of ConfD-3.5. Added cli-boolean-no. Added cli-exit-command. Added cli-custom-range-enumerator. Added cli-reset-siblings. Added cli-reset-all-siblings. Added cli-reset-container. Added cli-hide-in-submode. Added cli-prefix-key. Added cli-show-with-default. Added 'commasep' and 'show:' filter in cli-template-string. Removed deprecated tailf:cli-default-order."; } revision 2010-12-02 { description "Released as part of ConfD-3.4.1. Added cli-flatten-container."; } revision 2010-11-04 { description "Released as part of ConfD-3.4. Added cli-key-format. Added cli-list-syntax. Added cli-flat-list-syntax. The following statements were added in ConfD-3.3.3: Added cli-suppress-list-no. Added cli-suppress-no. Added cli-full-no. Added cli-incomplete-no."; } revision 2010-09-16 { description "Released as part of ConfD-3.3.2. Added cli-autowizard. Added cli-multi-word-key. Added cli-no-match-completion."; } revision 2010-08-19 { description "Released as part of ConfD-3.3.1. Added cli-show-template-footer. Added cli-run-template-footer. Added cli-table-footer. Changed cli-table-legend to be a template."; } revision 2010-06-17 { description "Released as part of ConfD-3.3. Added cli-display-empty-config. Added cli-expose-key-name. Added cli-value-display-template. Added cli-run-template. Added cli-run-template-legend. Added cli-run-template-enter. Added cli-suppress-key-sort. Added cli-suppress-validation-warning-prompt. Added 'hex' and 'hexlist' as display parameters in the type cli-template-string. Deprecated tailf:cli-default-order."; } revision 2010-03-18 { description "Released as part of ConfD-3.2."; } extension cli-show-no { tailf:use-in "leaf"; tailf:use-in "list"; tailf:use-in "leaf-list"; tailf:use-in "refine"; tailf:use-in "tailf:symlink"; tailf:use-in "container"; description "Specifies that an optional leaf node or presence container should be displayed as 'no ' when it does not exist. For example, if a leaf 'shutdown' has this property and does not exist, 'no shutdown' is displayed. Used in I- and C-style CLIs."; } extension cli-disallow-value { argument value { tailf:arg-type { type string; } } tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "refine"; tailf:use-in "tailf:symlink"; description "Specifies that a pattern for invalid values. Used in I- and C-style CLIs."; } extension cli-boolean-no { tailf:use-in "typedef"; tailf:use-in "leaf"; tailf:use-in "refine"; tailf:use-in "tailf:symlink"; tailf:substatement "tailf:cli-reversed"; description "Specifies that a leaf of type boolean should be displayed as '' if set to true, and 'no ' if set to false. Cannot be used in conjunction with tailf:cli-hide-in-submode or tailf:cli-compact-syntax. Used in I- and C-style CLIs."; } extension cli-reversed { tailf:use-in "tailf:cli-boolean-no"; description "Specified that true should be displayed as 'no ' and false as 'name'. Used in I- and C-style CLIs."; } extension cli-autowizard { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the autowizard should include this leaf even if the leaf is optional. One use case is when implementing pre-configuration of devices. A config false node can be defined for showing if the configuration is active or not (preconfigured). Used in J-, I- and C-style CLIs."; } extension cli-show-config { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "refine"; tailf:use-in "tailf:symlink"; description "Specifies that the node will be included when doing a 'show running-configuration', even if it is a non-config node. Used in I- and C-style CLIs."; } extension cli-display-empty-config { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the node will be included when doing a 'show stats', even if it is a non-config node, provided that the list contains at least one non-config node. Used in J-style CLI."; } extension cli-mode-name { argument value { tailf:arg-type { type string; } } tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a custom mode name, instead of the default which is the name of the list or container node. Can be used in config nodes only. If used in a container, the container must also have a tailf:cli-add-mode statement, and if used in a list, the list must not also have a tailf:cli-suppress-mode statement. Variables for the list keys in the current mode are available. For examples, 'config-foo-xx$(name)' (privided the key leaf is called 'name'). Used in I- and C-style CLIs."; } extension cli-show-order-taglist { argument value { tailf:arg-type { type string; } } tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a custom display order for nodes with the tailf:cli-show-order-tag attribute. Nodes will be displayed in the order indicated in the list. Nodes without a tag will be displayed after all nodes with a tag have been displayed. The scope of a taglist is until a new taglist is encountered. Used in I- and C-style CLIs."; } extension cli-show-order-tag { argument value { tailf:arg-type { type string; } } tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a custom display order for nodes with the tailf:cli-show-order-tag attribute. Nodes will be displayed in the order indicated by a cli-show-order-taglist attribute in a parent node. The scope of a tag reaches until a new taglist is encountered. Used in I- and C-style CLIs."; } extension cli-mode-name-actionpoint { argument value { tailf:arg-type { type string; } } tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "refine"; description "Specifies that a custom function will be invoked to find out the mode name, instead of using the default with is the name of the list or container node. The argument is the name of an actionpoint, which must be implemented by custom code. In the actionpoint, the command() callback function will be invoked, and it must return a string with the mode name. See confd_lib_dp(3) for details. Can be used in config nodes only. If used in a container, the container must also have a tailf:cli-add-mode statement, and if used in a list, the list must not also have a tailf:cli-suppress-mode statement. Used in I- and C-style CLIs."; } extension cli-add-mode { tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Creates a mode of the container. Can be used in config nodes only. Used in I- and C-style CLIs."; } extension cli-flatten-container { tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Allows the CLI to exit the container and continue to input from the parent container when all leaves in the current container has been set. Can be used in config nodes only. Used in I- and C-style CLIs."; } extension cli-suppress-mode { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Instructs the CLI engine to not make a mode of the list node. Can be used in config nodes only. Used in I- and C-style CLIs."; } extension cli-delete-when-empty { tailf:use-in "list"; tailf:use-in "container"; description "Instructs the CLI engine to delete the list when the last list instance is deleted'. Requires that cli-suppress-mode is set. The behavior is recursive. If all optional leafs in a list instance are deleted the list instance itself is deleted. If that list instance happens to be the last list instance in a list it is also deleted. And so on. Used in I- and C-style CLIs."; } extension cli-remove-before-change { tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Instructs the CLI engine to generate a no-commnd before modifying an existing instance. It only applies when generating diffs, eg 'show configuration' in C-style."; } extension cli-no-value-on-delete { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "When displaying the deleted version of this leaf do not include the old value. Applies to C-style"; } extension cli-no-name-on-delete { tailf:use-in "leaf"; tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "When displaying the deleted version of this element do not include the name. Applies to C-style"; } extension cli-embed-no-on-delete { tailf:use-in "leaf"; tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Embed no in front of the element name insead of at the beginning of the line. Applies to C-style"; } extension cli-recursive-delete { tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "When generating configuration diffs delete all contents of a container or list before deleting the node. Applies to C-style"; } extension cli-diff-dependency { argument path { tailf:arg-type { type string; } } tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:xpath-root"; tailf:substatement "tailf:cli-trigger-on-set"; tailf:substatement "tailf:cli-trigger-on-delete"; tailf:substatement "tailf:cli-trigger-on-all"; tailf:occurence "*"; description "Tells the 'show configuration' command, and the diff generator that this node depends on another node. When removing the node with this declaration, it should be removed before the node it depends on is removed, ie the declaration controlls the ordering of the commands in the 'show configuration' output. Applies to C-style"; } extension cli-trigger-on-set { tailf:use-in "tailf:cli-diff-dependency"; description 'Specify that the dependency should trigger on set/modify of the target path, but deletion of the target will trigger the current node to be placed in front of the target. The annotation can be used to get the diff behavior where one leaf is first deleted before the other leaf is set. For example, having the data model below: container X { leaf A { tailf:cli-diff-dependency "../B" { tailf:cli-trigger-on-set; } type empty; } leaf B { tailf:cli-diff-dependency "../A" { tailf:cli-trigger-on-set; } type empty; } } produces the following diffs when setting one leaf and deleting the other no X A X B and no X B X A this can also be done with list instances, for example list a { key id; leaf id { tailf:cli-diff-dependency "/c[id=current()/../id]" { tailf:cli-trigger-on-set; } type string; } } list c { key id; leaf id { tailf:cli-diff-dependency "/a[id=current()/../id]" { tailf:cli-trigger-on-set; } type string; } } we get no a foo c foo ! and no c foo a foo ! In the above case if we have the same id in list "a" and "c" and we delete the instance in one list, and add it in the other, then the deletion will always preceed the create. '; } extension cli-trigger-on-delete { tailf:use-in "tailf:cli-diff-dependency"; description "This annotation can be used togeter with tailf:cli-trigger-on-set to also get the behavior that when deleting the target display changes to this node first. For exmaple: container settings { tailf:cli-add-mode; leaf opmode { tailf:cli-no-value-on-delete; type enumeration { enum nat; enum transparent; } } leaf manageip { when \"../opmode = 'transparent'\"; mandatory true; tailf:cli-no-value-on-delete; tailf:cli-diff-dependency '../opmode' { tailf:cli-trigger-on-set; tailf:cli-trigger-on-delete; } type string; } } What we are trying to achieve here is that if manageip is deleted, it should be displayed before opmode, but if we configure both opmode and manageip, we should display opmode first, ie get the diffs: settings opmode transparent manageip 1.1.1.1 ! and settings no manageip opmode nat ! and settings no manageip no opmode ! The cli-trigger-on-set annotation will cause the 'no manageip' command to be displayed before setting opmode. The tailf:cli-trigger-on-delete will cause 'no manageip' to be placed before 'no opmode' when both are deleted. In the first diff where both are created, opmode will come first due to the diff-dependency setting, regardless of the cli-trigger-on-delete and cli-trigger-on-set. "; } extension cli-trigger-on-all { tailf:use-in "tailf:cli-diff-dependency"; description "Specify that the dependency should always trigger. It is the same as placing one element before another in the data model. For example, given the data model: container X { leaf A { tailf:cli-diff-dependency '../B' { tailf:cli-trigger-on-all; } type empty; } leaf B { type empty; } } We get the diffs X B X A and no X B no X A "; } extension cli-ignore-modified { tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Tells the cdb_cli_diff_iterate system call to not generate a CLI string when this container is modified. The string will instead be generated for the modified sub-element. Applies to C-style and I-style"; } extension cli-show-long-obu-diffs { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Instructs the CLI engine to not generate 'insert' comments when displaying configuration changes of ordered-by user lists, but instead explicitly remove old instances with 'no' and then add the instances following a newly inserted instance. Should not be used together with tailf:cli-show-obu-comments"; } extension cli-show-obu-comments { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Enforces the CLI engine to generate 'insert' comments when displaying configuration changes of ordered-by user lists. Should not be used together with tailf:cli-show-long-obu-diffs"; } extension cli-allow-join-with-key { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-display-joined"; description "Indicates that the list name may be written together with the first key, without requiring a whitespace in between, ie allowing both interface ethernet1/1 and interface ethernet 1/1 Used in I- and C-style CLIs."; } extension cli-allow-join-with-value { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-display-joined"; description "Indicates that the leaf name may be written together with the value, without requiring a whitespace in between, ie allowing both interface ethernet1/1 and interface ethernet 1/1 Used in I- and C-style CLIs."; } extension cli-display-joined { tailf:use-in "tailf:cli-allow-join-with-key"; tailf:use-in "tailf:cli-allow-join-with-value"; description "Specifies that the joined version should be used when displaying the configuration in C- and I- mode."; } extension cli-exit-command { argument value { yin-element true; tailf:arg-type { type string; } } tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "refine"; tailf:use-in "tailf:symlink"; tailf:substatement "tailf:info"; description "Tells the CLI to add an explicit exit-from-submode command. The tailf:info substatement can be used for adding a custom info text for the command. Used in I- and C-style CLIs."; } extension cli-explicit-exit { tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "refine"; tailf:use-in "tailf:symlink"; description "Tells the CLI to add an explicit exit command when displaying the configuration. It will not be added if cli-exit-command is defined as well. The annotation is inherited by all sub-modes. Used in I- and C-style CLIs."; } extension cli-key-format { argument value { yin-element true; tailf:arg-type { type string; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "The format string is used when parsing a key value and when generating a key value for an existing configuration. The key items are numbered from 1-N and the format string should indicate how they are related by using $(X) (where X is the key number). For example: tailf:cli-key-format '$(1)-$(2)' means that the first key item is concatenated with the second key item by a '-'. Used in J-, I- and C-style CLIs."; } extension cli-suppress-key-sort { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Instructs the CLI engine to not sort the keys in alphabetical order when presenting them to the user during TAB completion. Used in J-, I- and C-style CLIs."; } extension cli-suppress-table { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Instructs the CLI engine to not print the list as a table in the 'show' command. Can be used in non-config nodes only. Used in I- and C-style CLIs."; } extension cli-suppress-validation-warning-prompt { tailf:use-in "list"; tailf:use-in "leaf"; tailf:use-in "container"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Instructs the CLI engine to not prompt the user whether to proceed or not if a warning is generated for this node. Used in I- and C-style CLIs."; } extension cli-suppress-key-abbreviation { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Key values cannot be abbreviated. The user must always give complete values for keys. In the J-style CLI this is relevant when using the commands 'delete' and 'edit'. In the I- and C-style CLIs this is relevant when using the commands 'no', 'show configuration' and for commands to enter submodes. See also /confdConfig/cli/allowAbbrevKeys in confd.conf(5)."; } extension cli-allow-key-abbreviation { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Key values can be abbreviated. In the J-style CLI this is relevant when using the commands 'delete' and 'edit'. In the I- and C-style CLIs this is relevant when using the commands 'no', 'show configuration' and for commands to enter submodes. See also /confdConfig/cli/allowAbbrevKeys in confd.conf(5)."; } extension cli-table-legend { argument value { yin-element true; tailf:arg-type { type string; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a template string to be printed before all list entries are printed. Used in J-, I- and C-style CLIs."; } extension cli-table-footer { argument value { yin-element true; tailf:arg-type { type string; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a template string to be printed after all list entries are printed. Used in J-, I- and C-style CLIs."; } extension cli-completion-actionpoint { argument value { tailf:arg-type { type tailf:identifier; } } tailf:use-in "leaf-list"; tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-completion-id"; description "Specifies that completion for the leaf values is done through a callback function. The argument is the name of an actionpoint, which must be implemented by custom code. In the actionpoint, the completion() callback function will be invoked. See confd_lib_dp(3) for details. Used in J-, I- and C-style CLIs."; } extension cli-completion-id { argument value { tailf:arg-type { type tailf:identifier; } } tailf:use-in "tailf:cli-completion-actionpoint"; tailf:use-in "tailf:cli-custom-range-actionpoint"; description "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."; } extension cli-allow-caching { tailf:use-in "tailf:cli-custom-range-actionpoint"; tailf:use-in "tailf:cli-custom-range-enumerator"; description "Allow caching of the evaluation results between different parent paths."; } extension cli-multi-line-prompt { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Tells the CLI to automatically enter multi-line mode when prompting the user for a value to this leaf. Used in J-, I- and C-style CLIs."; } extension cli-multi-word-key { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-max-words"; description "Specifies that the key should allow multiple tokens for the value. Proper type restrictions needs to be used to limit the range of the leaf value. Can be used in key leafs only. Note: This extension isn't applicable in actions Used in J-, I- and C-style CLIs."; } extension cli-max-words { argument value { tailf:arg-type { type uint32; } } tailf:use-in "tailf:cli-multi-word-key"; tailf:use-in "tailf:cli-multi-word"; tailf:use-in "tailf:cli-multi-value"; description "Specifies the maximum number of allowed words for the key or value."; } extension cli-allow-range { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Means that the non-integer key should allow range expressions. Can be used in key leafs only. Used in J-, I- and C-style CLIs."; } extension cli-range-delimiters { argument value { tailf:arg-type { type string; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Allows for custom delimiters to be defined for range expressions. By default only / is considered a delimiter, ie when processing a key like 1/2/3 then each of 1, 2 and 3 will be matched separately agains range expressions, ie given the expression 1-3/5-6/7,8 1 will be matched with 1-3, 2 with 5-6, and 3 with 7,8. If, for example, the delimiters value is set to '/.' then both '/' and '.' will be considered delimiters and an key such as 1/2/3.4 will consist of the enteties 1,2,3,4, all matched separately. Used in J-, I- and C-style CLIs."; } extension cli-suppress-range { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Means that the integer key should not allow range expressions. Can be used in key leafs only. Used in J-, I- and C-style CLIs."; } extension cli-custom-range { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-range-type" { tailf:occurence "1"; } description "Specifies that the key should support ranges. A type matching the range expression must be supplied. Can be used in key leafs only. Used in J-, I- and C-style CLIs."; } extension cli-custom-range-actionpoint { argument value { tailf:arg-type { type tailf:identifier; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-completion-id"; tailf:substatement "tailf:cli-allow-caching"; description "Specifies that the list supports range expressions and that a custom function will be invoked to determine if an instance belong in the range or not. At least one key element needs a cli-custom-range statement. The argument is the name of an actionpoint, which must be implemented by custom code. In the actionpoint, the completion() callback function will be invoked. See confd_lib_dp(3) for details. When a range expression value which matches the type is given in the CLI, the CLI engine will invoke the callback with each existing list entry instance. If the callback returns CONFD_OK, it matches the range expression, and if it returns CONFD_ERR, it doesn't match. Used in J-, I- and C-style CLIs."; } extension cli-custom-range-enumerator { argument value { tailf:arg-type { type tailf:identifier; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-completion-id"; tailf:substatement "tailf:cli-allow-caching"; description "Specifies a callback to invoke to get an array of instances matching a regular expression. This is used when instances should be allowed to be created using a range expression in set. The callback is not used for delete or show operations. The callback is allowed to return a superset of all matching instances since the instances will be filtered using the range expression afterwards. Used in J-, I- and C-style CLIs."; } extension cli-range-type { argument value { tailf:arg-type { type string; } } tailf:use-in "tailf:cli-custom-range"; description "This statement contains the name of a derived type, possibly with a prefix. If no prefix is given, the type must be defined in the local module. For example: cli-range-type p:my-range-type; All range expressions must match this type, and a valid key value must not match this type."; } extension cli-allow-wildcard { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Means that the list allows wildcard expressions in the 'show' pattern. See also /confdConfig/cli/allowWildcard in confd.conf(5). Used in J-, I- and C-style CLIs."; } extension cli-suppress-wildcard { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Means that the list does not allow wildcard expressions in the 'show' pattern. See also /confdConfig/cli/allowWildcard in confd.conf(5). Used in J-, I- and C-style CLIs."; } extension cli-configure-mode { tailf:use-in "tailf:action"; tailf:use-in "rpc"; description "An action or rpc with this attribute will be available in configure mode, but not in operational mode. The default is that the action or rpc is available in both configure and operational mode. Used in J-, I- and C-style CLIs."; } extension cli-operational-mode { tailf:use-in "tailf:action"; tailf:use-in "rpc"; description "An action or rpc with this attribute will be available in operational mode, but not in configure mode. The default is that the action or rpc is available in both configure and operational mode. Used in J-, I- and C-style CLIs."; } extension cli-mount-point { argument value { tailf:arg-type { type string; } } tailf:use-in "tailf:action"; tailf:use-in "rpc"; description "By default actions are mounted under the 'request' command in the J-style CLI and at the top-level in the I- and C-style CLIs. This annotation allowes the action to be mounted under other top level commands"; } extension cli-batch-confirm-default { argument name { tailf:arg-type { type boolean; } } tailf:use-in "tailf:confirm-text"; description "Specifies if the default is to proceed or abort the action during batch processing in the CLI (e.g. non-interactive mode) when a confirm-text is set. If this value is not specified, the default value may instead be provdied by tailf:confirm-default or by the ConfD global default if specified in a clispec(5)."; } extension cli-delayed-auto-commit { tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Enables 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. Can be used in config nodes only. If used in a container, the container must also have a tailf:cli-add-mode statement, and if used in a list, the list must not also have a tailf:cli-suppress-mode statement. Used in I- and C-style CLIs."; } extension cli-preformatted { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Suppresses quoting of non-config elements when displaying them. Newlines will be preserved in strings etc. Used in J-, I- and C-style CLIs."; } extension cli-disabled-info { argument value { tailf:arg-type { type string; } } tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies an info string that will be used as a descriptive text for the value 'disable' (false) of boolean-typed leafs when the confd.conf(5) setting /confdConfig/cli/useShortEnabled is set to 'true'. Used in J-, I- and C-style CLIs."; } extension cli-suppress-shortenabled { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Suppresses the confd.conf(5) setting /confdConfig/cli/useShortEnabled. Used in J-, I- and C-style CLIs."; } extension cli-trim-default { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Do not display value if it is same as default. Used in I- and C-style CLIs."; } extension cli-expose-key-name { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Force the user to enter the name of the key and display the key name when displaying the running-configuration. Used in J-, I- and C-style CLIs."; } extension cli-enforce-table { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Forces 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-rendred show commands for non-config data. Used in I- and C-style CLIs."; } extension cli-drop-node-name { tailf:use-in "leaf"; tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the name of a node is not present in the CLI. If tailf:cli-drop-node-name is given on a child to a list node, we recommend that you also use tailf:cli-suppress-mode on that list node, otherwise the CLI will be very confusing. For example, consider this data model, from the tailf-aaa module: list alias { key name; leaf name { type string; } leaf expansion { type string; mandatory true; tailf:cli-drop-node-name; } } If you type 'alias foo' in the CLI, you would end up in the 'alias' submode. But since the expansion is dropped, you would end up specifying the expansion value without typing any command. If, on the other hand, the 'alias' list had a tailf:cli-suppress-mode statement, you would set an expansion 'bar' by typing 'alias foo bar'. tailf:cli-drop-node-name cannot be used inside tailf:action. Used in I- and C-style CLIs."; } extension cli-no-keyword { tailf:use-in "leaf"; tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the name of a node is not present in the CLI. Note that is must be used with some care, just like tailf:cli-drop-node-name. The resulting data model must still be possible to parse deterministically. For example, consider the data model container interfaces { list traffic { tailf:cli-no-keyword; key id; leaf id { type string; } leaf mtu { type uint16; } } list management { tailf:cli-no-keyword; key id; leaf id { type string; } leaf mtu { type uint16; } } } In this case it is impossible to determine if the config interfaces { eth0 { mtu 1400; } } Means that there should be an traffic interface instance named 'eth0' or a management interface instance maned 'eth0'. If, on the other hand, a restriction on the type was used, for example container interfaces { list traffic { tailf:cli-no-keyword; key id; leaf id { type string; pattern 'eth.*'; } leaf mtu { type uint16; } } list management { tailf:cli-no-keyword; key id; leaf id { type string; pattern 'lo.*';} leaf mtu { type uint16; } } } then the problem would disappear. Used in the J-style CLIs."; } extension cli-compact-syntax { tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Instructs the CLI engine to use the compact representation for this node in the 'show running-configuration' command. The compact representation means that all leaf elements are shown on a single line. Cannot be used in conjunction with tailf:cli-boolean-no. Used in I- and C-style CLIs."; } extension cli-compact-stats { tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-wrap"; tailf:substatement "tailf:cli-width"; tailf:substatement "tailf:cli-delimiter"; tailf:substatement "tailf:cli-prettify"; tailf:substatement "tailf:cli-spacer"; description "Instructs the CLI engine to use the compact representation for this node. The compact representation means that all leaf elements are shown on a single line. Used in J-, I- and C-style CLIs."; } extension cli-wrap { tailf:use-in "tailf:cli-compact-stats"; description "If present, the line will be wrapped at screen width."; } extension cli-width { argument value { tailf:arg-type { type uint32; } } tailf:use-in "tailf:cli-compact-stats"; description "Specifies a fixed terminal width to use before wrapping line. It is only used when tailf:cli-wrap is present. If a width is not specified the line is wrapped when the terminal width is reached."; } extension cli-delimiter { argument value { tailf:arg-type { type string; } } tailf:use-in "tailf:cli-compact-stats"; description "Specifies a string to print between the leaf name and its value when displaying leaf values."; } extension cli-prettify { tailf:use-in "tailf:cli-compact-stats"; description "If present, dashes (-) and underscores (_) in leaf names are replaced with spaces."; } extension cli-spacer { argument value { tailf:arg-type { type string; } } tailf:use-in "tailf:cli-compact-stats"; description "Specifies a string to print between the nodes."; } extension cli-column-stats { tailf:use-in "container"; tailf:use-in "refine"; tailf:use-in "tailf:symlink"; description "Display leafs in the container as columns, i.e., do not repeat the name of the container on each line, but instead indent each leaf under the container. Used in I- and C-style CLIs."; } extension cli-column-width { argument value { tailf:arg-type { type uint32; } } tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Set a fixed width for the column in the auto-rendered tables. Used in J-, I- and C-style CLIs."; } extension cli-min-column-width { argument value { tailf:arg-type { type uint32; } } tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Set a minimum width for the column in the auto-rendered tables. Used in J-, I- and C-style CLIs."; } extension cli-column-align { argument value { tailf:arg-type { type enumeration { enum left; enum center; enum right; } } } tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies the alignment of the data in the column in the auto-rendered tables. Used in J-, I- and C-style CLIs."; } extension cli-list-syntax { tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-multi-word"; description "Specifies that each entry in a leaf-list should be displayed as a separate element. Used in J-, I- and C-style CLIs."; } extension cli-multi-word { tailf:use-in "tailf:cli-list-syntax"; tailf:substatement "tailf:cli-max-words"; description "Specifies that a multi-word value may be entered without quotes."; } extension cli-flat-list-syntax { tailf:use-in "leaf-list"; tailf:substatement "tailf:cli-replace-all"; tailf:use-in "refine"; description "Specifies that elements in a leaf-list should be entered without surrounding brackets. Also, multiple elements can be added to a list or deleted from a list. Used in J-, I- and C-style CLIs."; } extension cli-replace-all { tailf:use-in "leaf-list"; tailf:use-in "tailf:cli-flat-list-syntax"; tailf:use-in "refine"; description "Specifies that the new leaf-list value(s) should replace the old, as opposed to be added to the old leaf-list."; } extension cli-range-list-syntax { tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "refine"; description "Specifies that elements in a leaf-list or a list should be entered without surrounding brackets and presented as ranges. The element in the list should be separated by a comma. For example: vlan 1,3,10-20,30,32,300-310 When this statement is used for lists, the list must have a single key. The elements are be presented as ranges as above. The type of the list key, or the leaf-list, must be integer based. Used in J-, I- and C-style CLIs."; } extension cli-incomplete-command { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "refine"; description "Specifies that an auto-rendered command should be considered incomplete. Can be used to prevent from appearing in the completion list for optional internal nodes, for example, or to ensure that the user enters all leaf values in a container (if used in combination with cli-sequence-commands). Used in I- and C-style CLIs."; } extension cli-full-command { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "container"; tailf:use-in "refine"; description "Specifies that an auto-rendered command should be considered complete, ie, no additional leaves or containers can be entered on the same command line. Used in I- and C-style CLIs."; } extension cli-sequence-commands { tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-reset-siblings"; tailf:substatement "tailf:cli-reset-all-siblings"; description "Specifies that an auto-rendered command should only accept arguments in the same order as they are specified in the YANG model. This, in combination with tailf:cli-drop-node-name, can be used to create CLI commands for setting multiple leafs in a container without having to specify the leaf names. In almost all cases this annotation should be accompanied by the tailf:cli-compact-syntax annotation. Otherwise the output from 'show running-config' will not be correct, and the sequence 'save xx' 'load override xx' will not work. Used in I- and C-style CLIs."; } extension cli-reset-siblings { tailf:use-in "tailf:cli-sequence-commands"; description "Specifies that all sibling leaves in the sequence should be reset whenever the first leaf in the sequence is set."; } extension cli-reset-all-siblings { tailf:use-in "tailf:cli-sequence-commands"; description "Specifies that all sibling leaves in the container should be reset whenever the first leaf in the sequence is set."; } extension cli-reset-container { tailf:use-in "leaf"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that all sibling leaves in the container should be reset when this element is set. When used on a container its content is cleared when set."; } extension cli-display-separated { tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Tells CLI engine to display this container as a separate line item even when it has children. Only applies to presence containers. Applicable for optional containers in the C- and I- style CLIs."; } extension cli-delete-container-on-delete { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the parent container should be deleted when . this leaf is deleted."; } extension cli-break-sequence-commands { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "refine"; description "Specifies that previous cli-sequence-command declaration should stop at this point. Only applicable when a cli-sequence-command declaration has been used in the parent container. Used in I- and C-style CLIs."; } extension cli-strict-leafref { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the leaf should only be allowed to be assigned references to existing instances when the command is executed. Without this annotation the requirement is that the instance exists on commit time. Used in I- and C-style CLIs."; } extension cli-optional-in-sequence { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "refine"; description "Specifies that this element is optional in the sequence. If it is set it must be set in the right sequence but may be skipped. Used in I- and C-style CLIs."; } extension cli-incomplete-show-path { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "refine"; tailf:substatement "tailf:cli-min-keys"; description "Specifies that a path to the show command is considered incomplete, i.e., it needs more elements added to the path. It can also be used to specify a minimum number of keys to be given for lists. Used in J-, I- and C-style CLIs."; } extension cli-min-keys { argument value { tailf:arg-type { type uint32; } } tailf:use-in "tailf:cli-incomplete-show-path"; description "Specifies the minimum number of required keys for the show command."; } extension cli-hide-in-submode { tailf:use-in "leaf"; tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Hide leaf when submode has been entered. Mostly useful when leaf has to be entered in order to enter a submode. Also works for flattened containers. Cannot be used in conjunction with tailf:cli-boolean-no. Used in I- and C-style CLIs."; } extension cli-expose-ns-prefix { tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "When used force the CLI to display namespace prefix of all children."; } extension cli-prefix-key { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:use-in "leaf-list"; tailf:substatement "tailf:cli-before-key"; description "This leaf has to be given as a prefix before entering the actual list keys. Very backwards but a construct that exists in some Cisco CLIs. The construct can be used also for leaf-lists but only when then tailf:cli-range-list-syntax is also used. Used in I- and C-style CLIs."; } extension cli-before-key { argument value { tailf:arg-type { type uint32; } } tailf:use-in "tailf:cli-prefix-key"; description "Specifies before which key the prefix element should be inserted. The first key has number 1."; } extension cli-show-with-default { tailf:use-in "leaf"; tailf:use-in "refine"; tailf:use-in "tailf:symlink"; description "This leaf will be displayed even when it has its default value. Note that this will somewhat result in a slightly different behaviour when you save a config and then load it again. With this setting in place a leaf that has not been configured will be configured after the load. Used in I- and C-style CLIs."; } extension cli-oper-info { argument text { yin-element true; tailf:arg-type { type string; } } tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "rpc"; tailf:use-in "identity"; tailf:use-in "tailf:action"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "This statement works exactly as tailf:info, with the exception that it is used when displaying the element info in the context of stats. Both tailf:info and tailf:cli-oper-info can be present at the same time."; } extension cli-case-sensitive { tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "leaf"; description "Specifies that this node is case-sensitive. If applied to a container or a list, any nodes below will also be case-sensitive. This negates the cli-case-insensitive extension (see below). Note that this will override any case-sensitivity settings configured in confd.conf"; } extension cli-case-insensitive { tailf:use-in "container"; tailf:use-in "list"; tailf:use-in "leaf"; description "Specifies that node is case-insensitive. If applied to a container or a list, any nodes below will also be case-insensitive. Node names are discovered without care of the case. Also affect matching of key values in lists. However it doesn't affect the storing of a leaf value. E.g. a modification of a leaf value from upper case to lower case is still considered a modification of data. Note that this will override any case-insensitivity settings configured in confd.conf"; } extension cli-custom-error { argument text { yin-element true; tailf:arg-type { type string; } } tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "This statement specifies a custom error message to be displayed when the user enters an invalid value."; } extension cli-full-show-path { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-max-keys"; description "Specifies that a path to the show command is considered complete, i.e., no more elements can be added to the path. It can also be used to specify a maximum number of keys to be given for lists. Used in J-, I- and C-style CLIs."; } extension cli-max-keys { argument value { tailf:arg-type { type uint32; } } tailf:use-in "tailf:cli-full-show-path"; description "Specifies the maximum number of allowed keys for the show command."; } extension cli-suppress-show-path { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "container"; tailf:use-in "refine"; description "Specifies that the show command cannot be invoked with the path, ie the path is suppressed when auto-rendering show commands for config='false' data. Used in J-, I- and C-style CLIs."; } extension cli-suppress-show-match { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "container"; tailf:use-in "refine"; description "Specifies that a specific completion match (i.e., a filter match that appear at list nodes as an alternative to specifying a single instance) to the show command should not be available. Used in J-, I- and C-style CLIs."; } extension cli-suppress-list-no { tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the CLI should not accept deletion of the entire list or leaf-list. Only specific instances should be deletable not the entire list in one command. ie, 'no foo ' should be allowed but not 'no foo'. Used in I- and C-style CLIs."; } extension cli-suppress-no { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "container"; tailf:use-in "refine"; description "Specifies that the CLI should not auto-render 'no' commands for this element. An element with this annotation will not appear in the completion list to the 'no' command. Used in I- and C-style CLIs."; } extension cli-suppress-silent-no { argument value { tailf:arg-type { type string; } } tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "container"; tailf:use-in "refine"; description "Specifies that the confd.cnof directive cSilentNo should be suppressed for a leaf and that a custom error message should be displayed when the user attempts to delete a non-existing element. Used in I- and C-style CLIs."; } extension cli-full-no { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "container"; tailf:use-in "refine"; description "Specifies that an auto-rendered 'no'-command should be considered complete, ie, no additional leaves or containers can be entered on the same command line. Used in I- and C-style CLIs."; } extension cli-incomplete-no { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that an auto-rendered 'no'-command should not be considered complete, ie, additional leaves or containers must be entered on the same command line. Used in I- and C-style CLIs."; } extension cli-no-match-completion { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the CLI engine should not provide match completion for the key leafs in the list. Used in J-, I- and C-style CLIs."; } extension cli-suppress-show-conf-path { tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the show running-config command cannot be invoked with the path, ie the path is suppressed when auto-rendering show running- config commands for config='true' data. Used in J-, I- and C-style CLIs."; } extension cli-no-key-completion { tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies that the CLI engine should not perform completion for key leafs in the list. This is to avoid querying the data provider for all existing keys. Used in J-, I- and C-style CLIs."; } extension cli-instance-info-leafs { argument value { tailf:arg-type { type string; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "This statement is used to specifiy how list entries are displayed when doing completion in the CLI. By default, a list entry is displayed by listing its key values, and the value of a leaf called 'description', if such a leaf exists in the list entry. The 'cli-instance-info-leafs' statement takes as its argument a space separated string of leaf names. When a list entry is displayed, the values of these leafs are concatenated with a space character as separator and shown to the user. For example, when asked to specify an interface the CLI will display a list of possible interface instances, say 1 2 3 4. If the cli-instance-info-leafs property is set to 'description' then the CLI might show: Possible completions: 1 - internet 2 - lab 3 - dmz 4 - wlan Used in J-, I- and C-style CLIs."; } extension cli-multi-value { tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; tailf:substatement "tailf:cli-max-words"; description "Specifies that all remaining tokens on the command line should be considered a value for this leaf. This prevents the need for quoting values containing spaces, but also prevents multiple leaves from being set on the same command line once a multi-value leaf has been given on a line. If the tailf:cli-max-words substatements is used then additional leaves may be entered. Note: This extension isn't applicable in actions Used in I- and C-style CLIs."; } extension cli-value-display-template { argument value { yin-element true; tailf:arg-type { type tailf:cli-template-string; } } tailf:use-in "leaf"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a template string to be used when formating the value of a leaf for display. Note that other leaves cannot be referenced from a display template of one leaf. The only value accessible is the leaf's own value, accessed through $(.). See the defintion of cli-template-string for more info. Used in J-, I- and C-style CLIs."; } extension cli-show-template { argument value { yin-element true; tailf:arg-type { type tailf:cli-template-string; } } tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "container"; tailf:use-in "refine"; tailf:substatement "tailf:cli-auto-legend"; description "Specifies a template string to be used by the 'show' command in operational mode. It is primarily intended for displaying non-config data but config data may be included in the template as well. See the defintion of cli-template-string for more info. Some restrictions includes not applying templates on a leaf that is the key in a list. It is recommended to use the template directly on the list to format the whole list instead. Used in J-, I- and C-style CLIs."; } extension cli-auto-legend { tailf:use-in "tailf:cli-show-template"; description "Specifies that the legend should be automatically rendered if not " +"already displayed. Useful when using templates for rendering " +"tables."; } extension cli-show-template-legend { argument value { yin-element true; tailf:arg-type { type tailf:cli-template-string; } } tailf:use-in "list"; tailf:use-in "refine"; description "Specifies a template string to be printed before all list entries are printed. See the defintion of cli-template-string for more info. Used in J-, I- and C-style CLIs."; } extension cli-show-template-enter { argument value { yin-element true; tailf:arg-type { type tailf:cli-template-string; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a template string to be printed before each list entry is printed. See the defintion of cli-template-string for more info. Used in J-, I- and C-style CLIs."; } extension cli-show-template-footer { argument value { yin-element true; tailf:arg-type { type tailf:cli-template-string; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a template string to be printed after all list entries are printed. See the defintion of cli-template-string for more info. Used in J-, I- and C-style CLIs."; } extension cli-run-template { argument value { yin-element true; tailf:arg-type { type tailf:cli-template-string; } } tailf:use-in "leaf"; tailf:use-in "leaf-list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a template string to be used by the 'show running-config' command in operational mode. It is primarily intended for displaying config data but non-config data may be included in the template as well. See the defintion of cli-template-string for more info. Used in I- and C-style CLIs."; } extension cli-run-template-legend { argument value { yin-element true; tailf:arg-type { type tailf:cli-template-string; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a template string to be printed before all list entries are printed. See the defintion of cli-template-string for more info. Used in I- and C-style CLIs."; } extension cli-run-template-enter { argument value { yin-element true; tailf:arg-type { type tailf:cli-template-string; } } tailf:use-in "list"; tailf:use-in "container"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a template string to be printed before each list entry is printed. When used on a container it only has effect when the container also has a tailf:cli-add-mode, and when tailf:cli-show-no isn't used on the container. See the defintion of cli-template-string for more info. The variable .reenter is set to 'true' when the 'show configuration' command is executed and the list or container isn't created. This allow, for example, to display create foo when an instance is created edit foo when something inside the instance is modified. Used in I- and C-style CLIs."; } extension cli-run-template-footer { argument value { yin-element true; tailf:arg-type { type tailf:cli-template-string; } } tailf:use-in "list"; tailf:use-in "tailf:symlink"; tailf:use-in "refine"; description "Specifies a template string to be printed after all list entries are printed. See the defintion of cli-template-string for more info. Used in I- and C-style CLIs."; } typedef cli-template-string { type string; description "A template is a text string which is expanded by the CLI engine, and then displayed to the user. The template may contain a mix of text and expandable entries. Expandable entries all start with $( and end with a matching ). Parentheses and dollar signs need to be quoted in plain text. The template is expanded as follows: A parameter is either a relative or absolute path to a leaf element (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 exapmle: $(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, formated in CLI style. .ipath The .ipath variable contains the path to the entry, formated in template style. .spath The .spath variable contains the show path, formated in CLI style. .ispath The .ispath variable contains the show path, formated 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 '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 == Evaluates to true if the value of the parameter equals . parameter != Evalutes to true if the value of the parameter does not equal parameter ~= Provided that the value of the parameter is a list (i.e., the node that the parameter refers to is a leaf-list), this expression evaluates to true if 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. lower Converts the value into lowercase. upper Converts the value into uppercase. filesizeformat Formats the value in a human-readable format (e.g., '13 KB', '4.10 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 (e.g., '13.00 k', '4.10 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. Another argument can be given to indicate if the hex numbers should be written with lower or upper case. For example: value Template Output 12345 {{ value|hex }} 3039 12345 {{ value|hex:2 }} 39 12345 {{ value|hex:8 }} 00003039 12345 {{ value|hex:-8 }} 3039 14911 {{ value|hex:-8:upper }} 3A3F 14911 {{ value|hex:-8:lower }} 3a3f 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. Another argument can be given to indicate if the hex numbers should be written with lower or upper case. For example: value Template Output 12345 {{ value|hexlist }} 30:39 12345 {{ value|hexlist:2 }} 39 12345 {{ value|hexlist:8 }} 00:00:30:39 12345 {{ value|hexlist:-8 }} 30:39 14911 {{ value|hexlist:-8:upper }} 3A:3F 14911 {{ value|hexlist:-8:lower }} 3a:3f 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 is 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: 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) A special case is the dict variable 'indent'. It controls the indentation level of the displayed path. The current indent level can be incremented and decremented using =+ and =-. For example: $(foobar|show:indent=+2) $(foobar|show:indent=-1) $(foobar|show:indent=10) Another special case is he dict variable 'noalign'. It may be used to suppress the default aligning that may occur when displaying an element. For example: $(foobar|show:noalign) dict: Translates the value using the dictionary. Can for example be used for displaying on/off instead of true/false. The dictionary is specified as a string on the following form: (key=value)(:key=value)* For example, with the following expression: $(foo|dict:true=on:false=off) if the leaf 'foo' has value 'true', it is displayed as 'on', and if its value is 'false' it is displayed as 'off'. Nested invocations are allowed, ie it is possible to have expressions like $((state|dict:yes=Yes:no=No)|rjust:14), or $(/foo{$(../bar)}) For example: list interface { key name; leaf name { ... } leaf status { ... } container line { leaf status { ... } } leaf mtu { ... } leaf bw { ... } leaf encapsulation { ... } leaf loopback { ... } tailf:cli-show-template '$(name) is administratively $(status),' + ' line protocol is $(line/status)\\n' + 'MTU $(mtu) bytes, BW $(bw|humanreadable)bit, \\n' + 'Encap $(encapsulation|upper), $(loopback?:loopback not set)\\n'; }"; } }