# Extract other leaf node from get-element operational call back

**URL:** <https://dmap-community.ductus.global/t/extract-other-leaf-node-from-get-element-operational-call-back/4215>\
**Category:** NETCONF\
**Created:** [September 29, 2022, 9:33am UTC](https://dmap-community.ductus.global/t/extract-other-leaf-node-from-get-element-operational-call-back/4215 "2022-09-29T09:33:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![biswajit](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@biswajit](https://dmap-community.ductus.global/u/biswajit)\
**Post date:** [September 29, 2022, 9:33am UTC](https://dmap-community.ductus.global/t/extract-other-leaf-node-from-get-element-operational-call-back/4215/1 "2022-09-29T09:33:06Z")

</div>

Hi,  
I have a yang as below. Whenever client query for “replies-transmitted” against respective “interface” ,server need to respond.  
I have added a call point “md-data-definitions” container. Now the problem is whenever get\_element call back is getting called for “replies-transmitted” leaf node, not able to extract the “interface” leaf node details provided by the client in the get\_element call back. Is there any way i can get it from confd\_hkeypath\_t \* or anyother method through which i can get it will be really helpful.

```
+--rw md-data-definitions
 +--rw maintenance-domain* [id]
    +--rw id                         
    +--rw name?                      
    +--rw md-level?                  
    +--rw maintenance-association* [id]
       +--rw id                
       +--rw name?             
       +--rw component-list* [component-id]
          +--rw component-id                         
          +--rw name?                                
          +--rw vid*                                 
          +--rw remote-meps*                         
          +--rw maintenance-association-end-point* [mep-identifier]
             +--rw mep-identifier          
             +--rw interface               
             +--rw primary-vid             
             +--rw administrative-state    
             +--ro mac-address?            
             +--ro loopback
                +--ro replies-transmitted    

```

Regards,  
Biswajit

---

<div class="post-metadata">

**Author:** ![mvf](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mvf/32/182_2.png) [@mvf](https://dmap-community.ductus.global/u/mvf)\
**Post date:** [September 29, 2022, 2:47pm UTC](https://dmap-community.ductus.global/t/extract-other-leaf-node-from-get-element-operational-call-back/4215/2 "2022-09-29T14:47:08Z")

</div>

That should be quite straightforward, you need the following:

- have an open MAAPI socket
- using `maapi_attach`, attach the socket to the user transaction
- via MAAPI functions like `maapi_get_elem` or the like get the leaf value.

The hook example and the transform example are doing something very similiar, you may want to have a look at them.

---

<div class="post-metadata">

**Author:** ![biswajit](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@biswajit](https://dmap-community.ductus.global/u/biswajit)\
**Post date:** [September 30, 2022, 4:21am UTC](https://dmap-community.ductus.global/t/extract-other-leaf-node-from-get-element-operational-call-back/4215/3 "2022-09-30T04:21:13Z")

</div>

Hi ,  
I have subscribed confd\_register\_trans\_cb & onfd\_register\_data\_cb and provided call point at md-data-definitions.  
Is there any way i can achieve through this without using maapi will be really helpful.

Regards,  
Biswajit

---

<div class="post-metadata">

**Author:** ![mvf](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mvf/32/182_2.png) [@mvf](https://dmap-community.ductus.global/u/mvf)\
**Post date:** [September 30, 2022, 3:14pm UTC](https://dmap-community.ductus.global/t/extract-other-leaf-node-from-get-element-operational-call-back/4215/4 "2022-09-30T15:14:30Z")

</div>

I am afraid that using MAAPI is the only reasonable way. You can register a set- or or a transaction-hook on the leaf `interface` and get callback invocations when its value changes so that you can keep track of its value. With that, you are actually duplicating what ConfD’s CDB is already doing and I would advise against such approach. The problem I can immediately think of is that it may not be possible to know if the value seen in the last callback made it to the database; and the other way round, in some cases the hook callback is not necessarily invoked.
