# Delete element callbacks

**URL:** <https://dmap-community.ductus.global/t/delete-element-callbacks/862>\
**Category:** CDB and CDB API\
**Created:** [November 30, 2016, 12:51pm UTC](https://dmap-community.ductus.global/t/delete-element-callbacks/862 "2016-11-30T12:51:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![InbalAmram](https://avatars.discourse-cdn.com/v4/letter/i/0ea827/32.png) [@InbalAmram](https://dmap-community.ductus.global/u/InbalAmram)\
**Post date:** [November 30, 2016, 12:51pm UTC](https://dmap-community.ductus.global/t/delete-element-callbacks/862/1 "2016-11-30T12:51:15Z")

</div>

Hi,

we are working with external DB.  
our yang contains few levels of sub containers:

```auto
container X
{
    Container Y
    {
        Container Z
    }
}

```

when we want to create element, we configure each container with its leafs and call commit. the commit cause create callbacks for each container (X, Y and Z) and set for the configured leafs.  
when we want to delete element, we configure for each container its “no” command and then try to commit.  
unlike the create callbacks for each container, the delete cause only 1 callback “delete” for the root container X.

Is it the right behavior of Confd?  
Is there a way to cause callbacks to the sub containers?

thanks  
Inbal

---

<div class="post-metadata">

**Author:** ![jjohansson](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jjohansson](https://dmap-community.ductus.global/u/jjohansson)\
**Post date:** [November 30, 2016, 6:01pm UTC](https://dmap-community.ductus.global/t/delete-element-callbacks/862/2 "2016-11-30T18:01:52Z")

</div>

> [@InbalAmram](#):
>
> Is it the right behavior of Confd?

Yes it is. ConfD decides that one callback is sufficient to delete everything below X.

> [@InbalAmram](#):
>
> Is there a way to cause callbacks to the sub containers?

To get a separate callback for each container you would have to individually delete the containers in reverse order with commits between the “no”-commands. This is, of course, a lot of pain for the operator and you really should handle delete of sub-list/containers.
