cli-template-string supports the following template filter construct:
in which the value of ‘parameter’ processed by ‘filter’ is substituted. The template filter can be your own customized filter defined in a callback in which the arithmetic calculations can be performed. A template filter takes ‘parameter’ in string format as input in ‘argv’ and returns a modified version of it by invoking the ‘confd_action_reply_command’. It can also take extra arguments. For example, the template filter can be defined as follows:
in which val1 is the name of your first leaf node to be added and will be passed into your callback as argv, and argv=“val3”. You can then perform the addition in your callback function. However, “val2” will be passed into your callback function as a string literal and not the value of the val2 leaf node. You will need to use a MAAPI call to fetch the value of the val2 leaf node in your callback.