Re: [Rtg-yang-coord] Restrictions on list keys

Mahesh Jethanandani <mjethanandani@gmail.com> Mon, 02 March 2015 20:56 UTC

Return-Path: <mjethanandani@gmail.com>
X-Original-To: rtg-yang-coord@ietfa.amsl.com
Delivered-To: rtg-yang-coord@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4C73E1A8996 for <rtg-yang-coord@ietfa.amsl.com>; Mon, 2 Mar 2015 12:56:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6VnXVwY3vGT5 for <rtg-yang-coord@ietfa.amsl.com>; Mon, 2 Mar 2015 12:56:31 -0800 (PST)
Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EE23E1A0127 for <rtg-yang-coord@ietf.org>; Mon, 2 Mar 2015 12:56:30 -0800 (PST)
Received: by mail-oi0-f42.google.com with SMTP id h136so29346989oig.1 for <rtg-yang-coord@ietf.org>; Mon, 02 Mar 2015 12:56:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to :content-type; bh=WNhGIncIzlU1VsHj3Jh614O0wVqbiRyfZXLD6yXMlnI=; b=efYWEUs8JpBd/YwI3IUSnEQcDV4xALeCUt46Q8g5PA2GYQEO/16ru5kTS4jIbBCiTm VmmUu2AXnYUhdvUFaPLAHiMJnpVDBXabzMt1XirZktMT3Wm4j0d74vkwu3UaIfhBB7Ok YoSes/c0h5me6zGvZGx+Bi4bAaZ6TvVuNLIMhr/QXO8NjxnTdnAnDz5NuVwdomTTM0ny 0IJDOxOJ6pTspbCF+eNXevifSqvgWF39AYczfpSutK8PaMiTGppj73SDwsrENRpFn3Ys iJjNJ6vf3ODtzNvfoFiehvfOB3Mg6IYryxQB8t+HjTHbBe96l8yVOZOC97benpMzoatO 2HCQ==
X-Received: by 10.60.34.193 with SMTP id b1mr12315200oej.19.1425329790256; Mon, 02 Mar 2015 12:56:30 -0800 (PST)
MIME-Version: 1.0
References: <A722B25D-D8F2-439C-817E-BBA981DFD698@gmail.com> <20150301214345.GA38655@elstar.local> <CCDAA563-CF0A-4E0D-85F2-3693E3C74E75@gmail.com> <20150302055649.GA59539@elstar.local>
From: Mahesh Jethanandani <mjethanandani@gmail.com>
Date: Mon, 02 Mar 2015 20:56:29 +0000
Message-ID: <CAAchPMvCL9EsewZ2BH1xzf+-HyHG24vYJCBXp6F8WLxbJD3Wfg@mail.gmail.com>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, rtg-yang-coord@ietf.org
Content-Type: multipart/alternative; boundary=089e01160c04d60af90510547330
Archived-At: <http://mailarchive.ietf.org/arch/msg/rtg-yang-coord/8M-JaddYmsy3ohJoRw6Y4PvUNPk>
Subject: Re: [Rtg-yang-coord] Restrictions on list keys
X-BeenThere: rtg-yang-coord@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "\"List to discuss coordination between the Routing related YANG models\"" <rtg-yang-coord.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtg-yang-coord>, <mailto:rtg-yang-coord-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rtg-yang-coord/>
List-Post: <mailto:rtg-yang-coord@ietf.org>
List-Help: <mailto:rtg-yang-coord-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtg-yang-coord>, <mailto:rtg-yang-coord-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Mar 2015 20:56:33 -0000

Juergen,

Thanks for the responses. One additional followup question. What happens in
case of a list, with a choice statement that is mandatory (see changed
below in the module). How would (or could one) one define a key using the
parameters in the 'choice mode' statement?

On Sun, Mar 1, 2015 at 9:56 PM Juergen Schoenwaelder <
j.schoenwaelder@jacobs-university.de> wrote:

> On Sun, Mar 01, 2015 at 08:32:11PM -0800, Mahesh Jethanandani wrote:
> > Juergen,
> >
>


> <snip>
>


> > list foo {
> >       // Assuming one of these forms the key ...
>
> >       key  “mode”; // is this valid? If not, how would I define a key
> for a choice statement?
>
> YANG 1.0 does not allow to have optional elements in a key.
>
> >       leaf x {
> >            type uint16;
> >       }
> >
> >       leaf y {
> >           type uint8;
> >       }
> >
> >       leaf z {
> >            type uint8;
> >            config false;
> >       }
> >
> >       choice mode {
>
                  mandatory "true";

> >             case a {
> >                    leaf p {
> >                         type uint16;
> >                    }
> >            }
> >
> >            case b {
> >                    leaf q {
> >                          type uint8;
> >                   }
> >            }
> >       }
> > }
> >
> > > On Mar 1, 2015, at 1:43 PM, Juergen Schoenwaelder <
> j.schoenwaelder@jacobs-university.de> wrote:
> > >
> > > RFC 6020 section 7.8.2:
> > >
> > >   All key leafs in a list MUST have the same value for their "config"
> > >   as the list itself.
> > >
> > > /js
> > >
> > > On Sun, Mar 01, 2015 at 07:59:53AM -0500, Mahesh Jethanandani wrote:
> > >> Pardon if these questions have already been asked.
> > >>
> > >> Are there restrictions on the following use of keys in lists
> > >>
> > >> - a combination of rw and ro leafs
> > >> - a ro leaf
> > >> - a union of of leafs
> > >>
> > >> Mahesh Jethanandani
> > >> mjethanandani@gmail.com
> > >>
> > >> _______________________________________________
> > >> Rtg-yang-coord mailing list
> > >> Rtg-yang-coord@ietf.org
> > >> https://www.ietf.org/mailman/listinfo/rtg-yang-coord
> > >
> > > --
> > > Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> > > Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> > > Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>
> >
> > Mahesh Jethanandani
> > mjethanandani@gmail.com
> >
> >
> >
> >
> >
>
> --
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>
>