Subject: [YANG] more clarifications on unique-stmt

From: Andy Bierman <[email-masked]>
Date: Mon, 14 Jan 2008 10:01:54 -0800

Hi,

Sec. 7.8.3 is not entirely clear wrt/ nested objects.

It should be stated that the descendant-schema-nodeid sequence
includes choice and case names, even though these nodes are
not in the config, and are not used in Xpath expressions
which refer to a config.  This applies to augment as well.

// problem 1: choices
list a {
   unique "B/X/xx B/Y/yy";
   choice B {
     mandatory true;
     case X {
       leaf xx {type int32; }
     }
     case Y {
       leaf yy {type string; }
     }
   }
}

Is this just a garbage-in/garbage-out scenario?
Obviously, only xx or yy will be present, but never both.

// problem 2: nested lists
list c {
   config false;
   unique "d/b e";
   list d {
      key a;
      leaf a { type string; }
      leaf b { type instance-identifier; }
   }
   leaf e { type uint8; }
}

This is legal?
It means (within list c) every tuple of [d/b[a], e] must be unique, if 'e' exists,
and all instances of 'c/d/b' do not have to be unique at all if E is not present?
But within list d, b is not required to be unique at all, so this seems conflicting.

IMO, deep keys, deep unique targets, deep augment targets,
are all part of the same problem space, and one clean
solution is needed for all of them.

Andy

_______________________________________________
YANG mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/yang