Hi all,
I would like have an unique item among nested lists elements.
Let’s say userprofile 1 can have multiple users, userprofile2 can have multiple users. In my scenario, I would like to restrict different userprofiles can have same user name or id…
I know it can be done at application level but how to achieve this at yang level ? Is there any way?
container user-profile {
container user-profile-con {
list user-profile-list {
key "uuid";
unique "user-profile-name";
leaf uuid {
description
"Unique identifier of the list.";
type common-types:uuid;
}
leaf user-profile-name {
description
"Name of user profile";
mandatory true;
type string;
}
..
..
..
container user-config-con {
list user-list {
key "uuid";
unique "user-name";
leaf uuid {
description
"Unique identifier of the list.";
type common-types:uuid;
}
leaf id {
description
"user ID.";
config false;
type int;
}
leaf user-name {
description
"user name.";
mandatory true;
type string;
}
}
}
}
}
Thanks in advance,
Regards