Transaction hook

Hello Experts,

I was new in confd, I was need to know about transaction hook.

can anyone help me how to create an transaction hook.

Thanks,
Manish

Hi,

I suggest you start with the UG chapter “Transformations, Hooks and Hidden Data”->“Hooks”, the tailf_yang_extensions(5) man page under “tailf:transaction-hook”, and the examples.confd/intro/11-c_hooks example.

There are other examples that implement a transaction hook in the ConfD example set:

$ find . -name "*.yang" |xargs grep "transaction-hook"
./intro/python/11-hooks/hooks.yang:            tailf:transaction-hook subtree {
./intro/11-c_hooks/hooks.yang:            tailf:transaction-hook subtree {
./intro/java/11-hooks/hooks.yang:            tailf:transaction-hook subtree {
./snmpa/11-different-keys/servers.yang:          tailf:transaction-hook subtree;
./snmpa/11-different-keys/servers.yang:            tailf:transaction-hook subtree;
./snmpa/7-transform/ospf.yang:        tailf:transaction-hook subtree;
./snmpa/7-transform/interface.yang:      tailf:transaction-hook subtree;

Note that the use-case for transaction-hooks is often misunderstood, where users are actually looking for a subscriber that subscribe to the prepare and commit phases of the transaction.

2 Likes