Subject: [netmod] optional keys

From: Andy Bierman <[email-masked]>
Date: Fri, 29 Aug 2014 08:43:52 -0700

Hi,

My understanding of the optional keys proposal is that at least one key has
to be mandatory. Is that correct?  Consider a simple address list:

  list address {
    key "last-name first-name middle-name";

    leaf last-name {
      type string;
      mandatory false;
    }
    leaf middle-name {
      type string;
      mandatory false;
    }
    leaf first-name {
      type string;
      mandatory false;
    }
    leaf street { type string; }
    leaf city { type string; }
    leaf zipcode { type string; }
  }

What is needed in this case is that at least one key be present in any
protocol request to create this list. The number of 'mandatory false'
statements may not be the correct criteria.

Let's say I have 2 entries for "Cher" and "Cher Baker".
There does not seem to be any way in subtree or XPath filtering
to request just the "Cher" entry. The absence of a key will be interpreted
as "match all" in both cases.

How will NETCONF and RESTCONF fully manage YANG lists with
optional keys? (Perhaps an interim meeting topic?)

Andy

---

From: Ladislav Lhotka <[email-masked]>
Date: Fri, 29 Aug 2014 18:35:52 +0200

> to be mandatory. Is that correct?  Consider a simple address list:

I don’t see much difference between solutions Y09-01 and -02 but at least -02 clearly says that all key leafs can be optional. The only requirement is that each entry has a unique combination of keys.

> as "match all" in both cases.

XPath should work:

first-name='Cher' and not(last-name)

Lada

> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C