Hooks callback interaction with EDIT2 callbacks (target=candidate)



In case there are multiple Set-Hook  callbacks  registered and the callbacks add several extra edits to the  transaction with help of add_edit() API the server will have the  following  interaction with added edits and normal edits that are coming  from PDU.  Assume we register Set-Hook callback, Set-Order-Hook,  Transaction-Hook and EDIT2 callback for the same list object, for example "ietf-interface" module and "/if:interfaces/if:interface" list object. So any time the "interface" list is getting edited the server invokes Set-Hook callback and adds up an extra "interface" in addition to the regular edit. The following callback invocation order is expected in this case:


Edit on candidate datastore:

  1. Transaction Start
  2. Set Order Hook for "/if:interface[name=vlan1]"
  3. Set-Hook for "/if:interface[name=vlan1]" to add "/if:interface[name=vlan2]"
  4. Set Order Hook for "/if:interface[name=vlan2]"
  5. SIL Callback (Validate Phase) for "/if:interface[name=vlan1]"
  6. SIL Callback (Validate Phase) for "/if:interface[name=vlan2]"
  7. Transaction Complete

Edit on running datastore (after <commit>):

  1. Transaction Start
  2. SIL Callback (Validate Phase) for "/if:interface[name=vlan1]"
  3. SIL Callback (Validate Phase) for "/if:interface[name=vlan2]"
  4. Validate Complete
  5. SIL Callback (Apply Phase) for "/if:interface[name=vlan1]"
  6. SIL Callback (Apply Phase) for "/if:interface[name=vlan2]"
  7. Apply Complete
  8. SIL Callback (Commit Phase) for "/if:interface[name=vlan1]"
  9. SIL Callback (Commit Phase) for "/if:interface[name=vlan2]"
  10. Transaction Hook for "/if:interface[name=vlan1]"
  11. Transaction Hook for "/if:interface[name=vlan2]"
  12. Commit/Rollback Complete
  13. Transaction Complete



Hooks callback interaction with EDIT2 callbacks (target=running)


Assume  the same scenario but the default target in this case is set  to  running. The callbacks invocation order is expected to be:

  1. Transaction Start
  2. Set Order Hook for "/if:interface[name=vlan1]"
  3. Set-Hook for "/if:interface[name=vlan1]" to add "/if:interface[name=vlan2]"
  4. Set Order Hook for "/if:interface[name=vlan2]"
  5. SIL Callback (Validate Phase) for "/if:interface[name=vlan1]"
  6. SIL Callback (Validate Phase) for "/if:interface[name=vlan2]"
  7. SIL Callback (Apply Phase) for "/if:interface[name=vlan1]"
  8. SIL Callback (Apply Phase) for "/if:interface[name=vlan2]"
  9. SIL Callback (Commit Phase) for "/if:interface[name=vlan1]"
  10. SIL Callback (Commit Phase) for "/if:interface[name=vlan2]"
  11. Transaction Hook for "/if:interface[name=vlan1]"
  12. Transaction Hook for "/if:interface[name=vlan2]"
  13. Transaction Complete