Check for leaf modification in validation point

Hi,

I am looking for a way to determine if a certain leaf of a container has been modified as part of the commit transaction in a validation point. My yang looks like below

container A {
 valpoint A_valpoint;
 leaf A1 {
      type X;
  }
 leaf B1 {
     type Y;
   }
}

For instance in the above yang even if leaf A1 is modified or configured, the same valpoint is hit similar to when leaf B1 is configured. Is there a maapi function call to exactly determine which leaf or Xpath is being modified as part of the transaction?

There are several options:

  • maapi_diff_iterate or maapi_keypath_diff_iterate both allow you to iterate over changes in the current transaction and to check if B1 appears among changes, there are also other similar functions that can be used here;
  • start a CDB session towards running and check if the B1 value is the same as in the current transaction;
  • add a pre-commit subscriber on that leaf or run the complete validation as a pre-commit subscriber;
  • possibly others.
1 Like