ConfD User Community

How to remove elements inside a container


I have the following

  grouping config-l2vpn-config-grouping {
    container l2vpn {
        "Layer2 VPN commands";
      tailf:cli-mode-name "config-l2vpn";
      presence "true";
      container logging {....}
      container status {....}
      container router-id {....}

the problem is, when i do a NO L2VPN in the confd, nothing happens i.e.

sjc-ads-7309(config)# l2vpn 
sjc-ads-7309(config-l2vpn)# router-id
sjc-ads-7309(config-l2vpn)# logging vc-state 
sjc-ads-7309(config-l2vpn)# sho conf
 logging vc-state
sjc-ads-7309(config-l2vpn)# no l2vpn
sjc-ads-7309(config-l2vpn)# show conf
 logging vc-state

What i essentially need is if i do a no l2vpn, all containers/leaf/list inside this parent has to be removed. But seems like nothing happens. Please help


seems to work without any issue on ConfD 7.3.

It’s not visible in your pasted excerpts, whether there are other CLI annotations for l2vpn parent, so i added following artificial items to examples.confd/intro/1-2-3-start-query-model's YANG file:

@@ -80,6 +84,24 @@ module dhcpd {

+  grouping l2vpn-grouping {
+    container l2vpn {
+      tailf:cli-add-mode;
+      tailf:cli-mode-name "config-l2vpn";
+      presence "true";
+      container logging { leaf aa { type int32; } }
+      container status { leaf bb { type int32; } }
+      container router-id { leaf cc { type int32; } }
+    }
+  }
+  uses l2vpn-grouping;

   container dhcp {
     leaf default-lease-time {

And executed commands:

admin connected from using ssh on dev
dev# config
Entering configuration mode terminal
dev(config)# l2vpn
dev(config-l2vpn)# router-id cc 123
dev(config-l2vpn)# logging aa 456
dev(config-l2vpn)# sho conf
 logging aa 456
 router-id cc 123
dev(config-l2vpn)# no l2
% Invalid input detected at '^' marker.
dev(config-l2vpn)# no l2vpn
dev(config)# show conf
% No configuration changes found.

receiving the expected result.