Re: [YANG] keyref

Andy Bierman <ietf@andybierman.com> Tue, 22 January 2008 14:35 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 1JHKDz-0002gg-Ed; Tue, 22 Jan 2008 09:35:39 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JHKDx-0002gI-M5 for yang-confirm+ok@megatron.ietf.org; Tue, 22 Jan 2008 09:35:37 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JHKDx-0002gA-CN for yang@ietf.org; Tue, 22 Jan 2008 09:35:37 -0500
Received: from smtp116.sbc.mail.sp1.yahoo.com ([69.147.64.89]) by ietf-mx.ietf.org with smtp (Exim 4.43) id 1JHKDv-0003jI-0t for yang@ietf.org; Tue, 22 Jan 2008 09:35:37 -0500
Received: (qmail 49804 invoked from network); 22 Jan 2008 14:35:34 -0000
Received: from unknown (HELO ?192.168.0.10?) (andybierman@att.net@67.126.240.103 with plain) by smtp116.sbc.mail.sp1.yahoo.com with SMTP; 22 Jan 2008 14:35:33 -0000
X-YMail-OSG: qVhgilwVM1kskm43P1_NLbT8O1hh9zEzQx_3YgHH3QgjbIkW
X-Yahoo-Newman-Property: ymail-3
Message-ID: <4795FECC.4090803@andybierman.com>
Date: Tue, 22 Jan 2008 06:33:48 -0800
From: Andy Bierman <ietf@andybierman.com>
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
MIME-Version: 1.0
To: Martin Bjorklund <mbj@tail-f.com>, ietf@andybierman.com, yang@ietf.org
Subject: Re: [YANG] keyref
References: <47954F24.905@andybierman.com> <20080122.091246.105352306.mbj@tail-f.com> <20080122081821.GA5210@elstar.local> <20080122.094430.48542159.mbj@tail-f.com> <20080122085918.GC5210@elstar.local>
In-Reply-To: <20080122085918.GC5210@elstar.local>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Scan-Signature: 082a9cbf4d599f360ac7f815372a6a15
Cc:
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

Juergen Schoenwaelder wrote:
> On Tue, Jan 22, 2008 at 09:44:30AM +0100, Martin Bjorklund wrote:
> 
>> That's why we don't want to allow keyrefs from config to non-config.
>>
>> Maybe this is a use case that we want to support as well.  But I don't
>> see the difference between such a ref and a InterfaceIndex type
>> solution.
> 


IMO, it is not clear what problem is being solved by keyref.
There seems to be some assumption that the purpose of all this
complexity is justified because of all the value it provides.

The InterfaceIndex approach is well-established and simple.

      leaf mgmt-interface {
          type keyref {
              path "/if:interfaces/if:interface/if:ifIndex";
          }
      }

      leaf mgmt-interface {
          type if:InterfaceIndex;
      }

Not only is the TC approach simpler, but keyref does not support
the ability to hold a 'not-set' value, such as InterfaceIndexOrZero.


YANG is also missing the ability to use key leafs from different
tables, like SMIv2.  This is where keyref/leafref (as a documentation clause)
would help:

   list myIfTable {
      key myIfIndex;

      leaf myIfIndex {
        type if:InterfaceIndex;
        leafref "/if:interfaces/if:interface/if:ifIndex";
      }

      leaf myInOctets {
        type smi:Counter32;
        leafref "/if:interfaces/if:interface/if:ifInOctets";
      }
   }



> Well, the InterfaceIndex type just says "the value identifies an
> interface" - no more no less. The keyref is much more ambitiuous.
> Despite the fact that it is only usable for keys, your aim is to bind
> things together such that value changes automatically propagate. This
> somehow sounds like you want to do several things at once with a
> single construct.
> 
> /js
> 

Andy


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