[YANGTOOLS-194] Milestone: Datastore/Code generation from Yang must enforce constraints across modules as per RFC6020 Created: 26/Jun/14 Updated: 18/Jan/24 |
|
| Status: | Confirmed |
| Project: | yangtools |
| Component/s: | data-impl |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Epic | Priority: | Highest |
| Reporter: | Reinaldo Penno | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Mac OS |
||
| Issue Links: |
|
||||||||||||
| Epic Name: | Complete DataTree enforcement | ||||||||||||
| Description |
|
" When datastore processing is complete, the final contents MUST obey o Any "must" constraints MUST evaluate to "true". o Any referential integrity constraints defined via the "path" o Any "unique" constraints on lists MUST be satisfied. o The "min-elements" and "max-elements" constraints are enforced for More concrete problem I've just stumbled on a RESTConf problem that I'm having a hard problem finding a clean way out. In a nutshell: I have an ACL module that import interfaces module so that ACLs can be attached to interfaces. Normally in a router you can not delete an interface without removing the ACL first. This is to ensure consistency. Anyway, I'm sure most people can relate to this issue and find their own example. Now, if my Yang models are compiled and loaded, there is nothing stopping the admin from deleting everything, everywhere. By the time I get onDataChanged() all changes are done. I just tested and I can go and remove an interface and indirectly stopping, ACL, QoS, packet forwarding, etc and putting the system in a state where ACL is attached to an interface that does not exist. In my ACL model interface is a leafref, meaning it is a reference to an interface that should exist in the system but that not enforced by RESTConf/datastore. If datastore can not provide such functionality, we need:
or Go back to JAX-RS decorators in order to provide consistency and do not rely in automatic RESTconf operations. or something else |
| Comments |
| Comment by Tony Tkacik [ 16/Jun/15 ] |
|
Partially fixed in Lithium: The "min-elements" and "max-elements" constraints are enforced for |
| Comment by Robert Varga [ 01/Jun/16 ] |
|
MUST/WHEN validation requires Xpath evaluation |
| Comment by Peter Kajsa [ 18/Oct/16 ] |
|
leafref validation (beta quality): https://git.opendaylight.org/gerrit/#/c/14891/19 |