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:
- Transaction Start
- Set Order Hook for "/if:interface[name=vlan1]"
- Set-Hook for "/if:interface[name=vlan1]" to add "/if:interface[name=vlan2]"
- Set Order Hook for "/if:interface[name=vlan2]"
- SIL Callback (Validate Phase) for "/if:interface[name=vlan1]"
- SIL Callback (Validate Phase) for "/if:interface[name=vlan2]"
- Transaction Complete
Edit on running datastore (after <commit>):
- Transaction Start
- SIL Callback (Validate Phase) for "/if:interface[name=vlan1]"
- SIL Callback (Validate Phase) for "/if:interface[name=vlan2]"
- Validate Complete
- SIL Callback (Apply Phase) for "/if:interface[name=vlan1]"
- SIL Callback (Apply Phase) for "/if:interface[name=vlan2]"
- Apply Complete
- SIL Callback (Commit Phase) for "/if:interface[name=vlan1]"
- SIL Callback (Commit Phase) for "/if:interface[name=vlan2]"
- Transaction Hook for "/if:interface[name=vlan1]"
- Transaction Hook for "/if:interface[name=vlan2]"
- Commit/Rollback Complete
- 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:
- Transaction Start
- Set Order Hook for "/if:interface[name=vlan1]"
- Set-Hook for "/if:interface[name=vlan1]" to add "/if:interface[name=vlan2]"
- Set Order Hook for "/if:interface[name=vlan2]"
- SIL Callback (Validate Phase) for "/if:interface[name=vlan1]"
- SIL Callback (Validate Phase) for "/if:interface[name=vlan2]"
- SIL Callback (Apply Phase) for "/if:interface[name=vlan1]"
- SIL Callback (Apply Phase) for "/if:interface[name=vlan2]"
- SIL Callback (Commit Phase) for "/if:interface[name=vlan1]"
- SIL Callback (Commit Phase) for "/if:interface[name=vlan2]"
- Transaction Hook for "/if:interface[name=vlan1]"
- Transaction Hook for "/if:interface[name=vlan2]"
- Transaction Complete