Tailf:confirm-text anything similar for config?

Hi All!

We want like a warning /confirmation from user when a particular config is modified. Please let me know if similar to confirm text in action, do we have similar for config ?.

rgds
Balaji Kamal Kannadassan

You can search for the confirmText element in the clispec section of the ConfD User Guide on how to add a confirmation prompt to a CLI command.

Thanks, I tried the same…

 > 41   <configureMode>
>  42                  <cmd name="dhcp">
>  43                    <help>Configuration wizards</help>
>  44                    <info>Configuration wizards</info>
>  45                  <cmd name="SharedNetworks">
>  46                    <help>Configuration wizards</help>
>  47                    <info>Configuration wizards</info>
>  48                  <cmd name="sharedNetwork">
>  49                    <help>Configuration wizards</help>
>  50                    <info>Configuration wizards</info>
>  51                       <confirmText>Do you really want to switch-over to the peer?</confirmText>
>  52                  </cmd>
>  53                  </cmd>
>  54                  </cmd>
>  55   </configureMode>

above works fine and asks when I press enter after shared network but it doesn’ work when I give leaf value next to sharednetwork and enter…

i.e
dhcp SharedNetwork sharednetwork ==> enter it asks…

dhcp SharedNetwork sharednetwork balaji ==> with the next leaf string enter it doesn’t work

I gave regexp along with sharednetwork it failed compiling. Please let me know how can I make it work… To be more precise writing here more looks like implementing a new command. I want to add a confirm text of a config existing in yang model.

rgds
Balaji Kamal Kannadassan

Looks like I can’t have the confirmtext alone in clispec and rest with the yang like the callpoint getting called and all. The moment I write into the clispec then further command execution all will stay with clispec looks like. What I wanted is only confirmtext from clispec and if the user says yes it should call the subscription function for config…

rgds
Balaji Kamal Kannadassan

hi, where you able to find a solution for your use case? “I wanted confirmtext from clispec and if the user says yes it should call the subscription function for config”

thanks,
priya madhu

Hi,
Instead of trying to do that from the clispec I suggest that you use a validation point in the YANG model, see “tailf:validate”, and write a validation function that prompt the user.
See ConfD UG “Validating Data in C” and look for “CONFD_VALIDATION_WARN”

See also confd.conf(3) man page under “/confdConfig/cli/cWarningPrefix”

Thanks for your reply. I am still not able to come up with a solution, as my use case is a little different. I am trying to invoke similar kind of prompt for delete. If a user try to delete an entire list leaf, the prompt should come up. And since it is for delete command, tailf:validate does not seems to solve the issue. Please let me know your suggestions. Thanks.

tailf:validate will trigger your validation point callback if any changes (regardless of if you add, delete or modify) are done over any northbound interfaces. Validation is done in the validation phase of the transaction towards the database. If you delete something that exists in the config, then yes, your validation point callback will be called by ConfD when the configuration is committed. If you delete something that does not exist, then no validation is necessary.

Hi,
Thanks for your input. I tried this out and looks like, if the validation call point is placed on the list, it is not invoked when delete is called on it. For example, in the yang file, if I have
tailf:annotate “/if:interfaces/if:interface” {
tailf:validate delete-list-validation {
}
}
and in the CLI I pass, %delete interfaces interface
%comm

then the delete-list-validation is not invoked.

I have to place the callpoint at the parent node, to invoke the validation for delete.
For example,
tailf:annotate “/if:interfaces” {
tailf:validate delete-list-validation {
}
}
and in the CLI I pass, %delete interfaces interface
%comm

then the delete-list-validation is invoked.

But I do not want this. Because it would validate for all operations on all nodes inside the parent node. What can I do for this?