Re: [YANG] 7.8.3 unique statement

Martin Bjorklund <mbj@tail-f.com> Thu, 10 January 2008 15:14 UTC

Return-path: <yang-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1JCz7H-0007lq-Sz; Thu, 10 Jan 2008 10:14:47 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JCz7G-0007ll-RT for yang-confirm+ok@megatron.ietf.org; Thu, 10 Jan 2008 10:14:46 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JCz7G-0007ld-HU for yang@ietf.org; Thu, 10 Jan 2008 10:14:46 -0500
Received: from [213.180.94.162] (helo=mail.tail-f.com) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1JCz7F-0000VD-VI for yang@ietf.org; Thu, 10 Jan 2008 10:14:46 -0500
Received: from localhost (138.162.241.83.in-addr.dgcsystems.net [83.241.162.138]) by mail.tail-f.com (Postfix) with ESMTP id 760531B80C3; Thu, 10 Jan 2008 16:14:40 +0100 (CET)
Date: Thu, 10 Jan 2008 16:15:34 +0100 (CET)
Message-Id: <20080110.161534.170913919.mbj@tail-f.com>
To: ietf@andybierman.com
Subject: Re: [YANG] 7.8.3 unique statement
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <47860FBA.6090600@andybierman.com>
References: <47860FBA.6090600@andybierman.com>
X-Mailer: Mew version 5.1.51 on Emacs 22.1 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Scan-Signature: d8ae4fd88fcaf47c1a71c804d04f413d
Cc: yang@ietf.org
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/yang>
List-Post: <mailto:yang@ietf.org>
List-Help: <mailto:yang-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=subscribe>
Errors-To: yang-bounces@ietf.org

Hi,

Andy Bierman <ietf@andybierman.com> wrote:
> Hi,
> 
> There seem to be many details left out for the unique-stmt (within a list)
> that need to be in a standard:

Ok.

>    - what if not all the leafs listed in the unique-stmt are mandatory?
>        - is the unique-stmt ignored?
>        - Is NULL-value treated as one of the unique values?

One use case is that you have a single optional leaf in your unique
stmt.   That means that if the leaf exists, it's value has to be
unique.

Another case is that you have multiple optional leafs, and the
combination must be unique.  For example, the combination of 'name'
and 'address' in a list of persons is unique.  If you have to persons
with the same name, but no address, that would violate the uniqueness.

So, the set of existing leafs must be unique within all list entries
(if the set is non-empty).

We'll have to try to find the right wording.

>        - what if some missing leafs have defaults (ensuring they will not be unique)?

I think we should say that the leaf MUST NOT have a default.

>    - where are the detailed specifications of the canonical formats
>      for each YANG datatype (especially bits, anyxml, string) so that
>      every implementation will come up with the same answer when evaluating
>      uniqueness?

Do we need a specification of a canonical format for this?

Do we need a specification of a canonical format also in order to
handle edit-config delete?


>    - what is the exact behavior required for a NETCONF agent wrt/ <edit-config>
>      processing and unique-stmt enforcement?

It is not checked during edit-config specifically.  The text says that
the unique constraints have to be met in a valid configuration.  So
you might have temporary violations of these constraints in the
candidate e.g.

>    - Is there any significance to the order of node identifiers?
>        unique "addr port";
>        unique "port addr";

No.

>    - Are the target nodes limited to direct definitions and expanded uses?
>      (I.e., unique clauses that include leafs expanded from augment not allowed)

Yes.  This follows from the general rule that each definition must be
completely defined within itself.


One more thing that we have talked about adding, is to allow 'unique'
in an augment.  For example:

   augment /interface {
      unique "ifName";
      leaf ifName { ... }
      ...
   }


/martin


_______________________________________________
YANG mailing list
YANG@ietf.org
https://www1.ietf.org/mailman/listinfo/yang