if I have the following model
devices {
device {
key id;
interfaces {
interface {
key id;
unique name;
}
}
}
}
which data is valid or invalid according to yang's key and unique specification ?
1. devices/device=1/interfaces/interface=1; name = a
2. devices/device=1/interfaces/interface=1; name = b // key violation
3. devices/device=1/interfaces/interface=2; name = a // unique violation
4. devices/device=2/interfaces/interface=1; name = a // unique violation ?
supposing I store the 'interface' objects in a relational table and mark name as unique column, I cannot have both data row 3 and 4. Is that what the spec is meaning ?
or, can I interpret the uniqueness or key constraint as , unique resource path ? If I do so, the following rows of data do not conflict because they are two different resource urls, because they belong to different devices.
devices/device=1/interfaces/interface=2; name = a
devices/device=2/interfaces/interface=2; name = a
what is the right interpretation ? globally unique vs unique within the list parent ?