# UPDATES FOR CONTAINER IN cdb\_diff\_iterate

**URL:** <https://dmap-community.ductus.global/t/updates-for-container-in-cdb-diff-iterate/760>\
**Category:** General\
**Created:** [October 6, 2016, 10:24pm UTC](https://dmap-community.ductus.global/t/updates-for-container-in-cdb-diff-iterate/760 "2016-10-06T22:24:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpaliwal](https://avatars.discourse-cdn.com/v4/letter/g/9dc877/32.png) [@gpaliwal](https://dmap-community.ductus.global/u/gpaliwal)\
**Post date:** [October 6, 2016, 10:24pm UTC](https://dmap-community.ductus.global/t/updates-for-container-in-cdb-diff-iterate/760/1 "2016-10-06T22:24:01Z")

</div>

Hello,  
I have yang data-model looking like:

container system {  
presence true;  
leaf A;  
leaf B;  
}

When we set the A and B,  
cdb\_diff\_iterate gets MOP\_VALUE\_SET for A and B, but I never receive MOP\_MODIFIED for the container system.  
How can i get change notification for container system?

Continuing the discussion from [How to Identify operations in application?](https://discuss.tail-f.com/t/how-to-identify-operations-in-application/199/2):

Continuing the discussion from [What is the difference between ConfD Basic and ConfD Premium?](https://discuss.tail-f.com/t/what-is-the-difference-between-confd-basic-and-confd-premium/29):

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [October 7, 2016, 10:43am UTC](https://dmap-community.ductus.global/t/updates-for-container-in-cdb-diff-iterate/760/2 "2016-10-07T10:43:46Z")

</div>

Hi,

In your example you will get a MOP\_CREATED on your “system” presence container.

---

<div class="post-metadata">

**Author:** ![gpaliwal](https://avatars.discourse-cdn.com/v4/letter/g/9dc877/32.png) [@gpaliwal](https://dmap-community.ductus.global/u/gpaliwal)\
**Post date:** [October 7, 2016, 6:34pm UTC](https://dmap-community.ductus.global/t/updates-for-container-in-cdb-diff-iterate/760/3 "2016-10-07T18:34:14Z")

</div>

hello,  
No, i am not getting the MOP\_CREATED.  
I expect MOP\_MODIFIED…container is already present. but I only get VALUE\_SET since values are changing.  
I see that for maapi api’s you can set a flag to get Container updates (ITER\_WANT\_P\_CONTAINER), but this flag doesn’t work for cdb\_diff\_iterate api’s  
This is what i am looking.

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [October 7, 2016, 8:25pm UTC](https://dmap-community.ductus.global/t/updates-for-container-in-cdb-diff-iterate/760/4 "2016-10-07T20:25:13Z")

</div>

maapi\_diff\_iterate() and cdb\_diff\_iterate() cover different use cases. maapi\_diff\_iterate() is typically used in conjunction with the notification API when we subscribe to CONFD\_NOTIF\_COMMIT\_DIFF events. It can also be used inside validation callbacks.  
After reading the subscription socket the cdb\_diff\_iterate() function can be used to iterate over the changes made in CDB data that matched the particular subscription point given by subid.  
Why does your subscriber application need a MOP\_MODIFIED for a presence container when the container presence haven’t changed?

---

<div class="post-metadata">

**Author:** ![gpaliwal](https://avatars.discourse-cdn.com/v4/letter/g/9dc877/32.png) [@gpaliwal](https://dmap-community.ductus.global/u/gpaliwal)\
**Post date:** [October 10, 2016, 6:29pm UTC](https://dmap-community.ductus.global/t/updates-for-container-in-cdb-diff-iterate/760/5 "2016-10-10T18:29:08Z")

</div>

Hi,

I suppose if the leaf in the list gets changed we get MOP\_CHANGED for list.  
Similarly if the leaf in the container gets changed we expect MOP\_CHANGED for container.

Reason is we are subscriber to /container. So when the update happens to the container, we want to construct our backend data-structure from this update. We just wait for MOP\_CREATE/DEL/MODIFY to know the list/container got changed and then we issue the query to CDB to fetch the whole container/list for the updated data.  
Without MOP\_MODIFIED we are unable to handle that check. In container case, we only get MOP\_VALUE\_SET for the leaf value. This i feel is inconsistency in the update generation. Any way we still get it?

-gopal
