Subject: [YANG] Re: Requirement question

From: Ladislav Lhotka <[email-masked]>
Date: Thu, 17 Jan 2008 09:37:57 +0100

David Partain píše v St 16. 01. 2008 v 17:46 +0100:
> In Vancouver at the "ad hoc requirement meeting", you were a proponent of the 
> requirement that we need "deep keys" in the NETCONF data modeling language.  
> For the benefit of the design team working on the requirements, could you 
> describe what you mean by "deep keys"?  An example would be very helpful as 
> well.
> 
YANG currently requires that list keys be direct children of the
elements that are modelled as list items. In other words, the keys
cannot appear inside containers under the list statement. The following
example (borrowed from Phil Shafer) shows a natural use of deep keys:

      <flow>
        <source>
          <address>10.1.2.4</address>
          <port>22</port>
        <source>
        <destination>
          <address>10.1.2.5</address>
          <port>22000</port>
        </destination>
        <packet-count>43210</packet-count>
      </flow>
        ...

YANG declaration (currently illegal):

        list flow {
            key "source/address source/port
                 destination/address destination/port";
            container source {
                use endpoint;
            }
            container destination {
                use endpoint;
            }
            leaf packet-count {
                type uint32;
            }
        }

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

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

---

From: Ladislav Lhotka <[email-masked]>
Date: Thu, 17 Jan 2008 09:46:48 +0100

Sorry, I forgot to copy another chunk from Phils's example:

> YANG declaration (currently illegal):

grouping endpoint {
            leaf address {
                type inet:address;
            }
            leaf port {
                type inet:port;
            }
        }

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C