ConfD User Community

Need help to remove an element

Hi,

I have a bandwidth command which can end with a or with persistent followed by i.e.

(config-if)# bandwidth 12 ?
Possible completions:
  persistent  <cr>
(config-if)# bandwidth 12 persistent ?
Possible completions:
  <cr>

Now in my CLI, if i say

  1. initially configure bandwidth 12 persistent
  2. Now overwrite it with bandwidth 12 (removing persistent), then CLI shows only “bandwidth 12” rather than “bandwidth 12 persistent”

I want to achieve the same in my yang model. I tried doing this but it won’t work.

container bandwidth {
  tailf:cli-sequence-commands;
  tailf:cli-compact-syntax;
  when "../encapsulation-config";
  tailf:cli-diff-create-after "../encapsulation-config" {
      tailf:cli-when-target-set;
  }
  leaf bandwidth-value {
    tailf:cli-drop-node-name;
    type uint32 {
      range "1..10000000";
    }
  }
  leaf persistent {
    tailf:cli-full-command;
    type empty;
  }
}

(config-if)# bandwidth 12 persistent   
(config-if)# show conf                 
interface pseudowire12
 encapsulation mpls
 bandwidth 12 persistent
exit
(config-if)# bandwidth 12           
(config-if)# show conf   
interface pseudowire12
 encapsulation mpls
 bandwidth 12 persistent
exit

please help me model this .

I think what you need is tailf:cli-reset-siblings under tailf:cli-sequence-commands.

Thanks a lot. It works like a charm