Re: [YANG] keyref

Andy Bierman <ietf@andybierman.com> Tue, 22 January 2008 02:04 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 1JH8Uw-0005tu-Qe; Mon, 21 Jan 2008 21:04:22 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JH8Uv-0005t5-VB for yang-confirm+ok@megatron.ietf.org; Mon, 21 Jan 2008 21:04:21 -0500
Received: from [10.90.34.44] (helo=chiedprmail1.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JH8Uv-0005sx-JS for yang@ietf.org; Mon, 21 Jan 2008 21:04:21 -0500
Received: from smtp120.sbc.mail.sp1.yahoo.com ([69.147.64.93]) by chiedprmail1.ietf.org with smtp (Exim 4.43) id 1JH8Uu-0001C2-Tp for yang@ietf.org; Mon, 21 Jan 2008 21:04:21 -0500
Received: (qmail 14798 invoked from network); 22 Jan 2008 02:04:19 -0000
Received: from unknown (HELO ?192.168.0.10?) (andybierman@att.net@67.126.240.103 with plain) by smtp120.sbc.mail.sp1.yahoo.com with SMTP; 22 Jan 2008 02:04:19 -0000
X-YMail-OSG: .6sHVgAVM1nZEjNrliFWRL98L_h3gdywdyUGrBfGiBdSOwAs
X-Yahoo-Newman-Property: ymail-3
Message-ID: <47954F24.905@andybierman.com>
Date: Mon, 21 Jan 2008 18:04:20 -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>
Subject: Re: [YANG] keyref
References: <4794D016.10107@andybierman.com> <20080121.230429.148337580.mbj@tail-f.com>
In-Reply-To: <20080121.230429.148337580.mbj@tail-f.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Scan-Signature: 825e642946eda55cd9bc654a36dab8c2
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

Martin Bjorklund wrote:
> Hi Andy,
> 
> Andy Bierman <ietf@andybierman.com> wrote:
>> Hi,
>>
>> The keyref builtin type is confusing.
>> It is not very clear why this needs to be a built-in type,
> 
> It's a type b/c it works as all the other types; you can have a leaf
> or leaf-list of this type etc.
> 


Why does it work the same as other types.
That's kind of a circular definition.

I don't see the use case for writable keyrefs.
When you read the object the first time, it has the value
from the ptarh target, and when you set the keyref leaf,
it has the new value and no longer is a reference to the key leaf.
Then it changes back to a reference if the manager deletes the
keyref leaf?


IMO, this should be just another documentation clause, added to a
leaf like the current 'description' and 'reference'.  I don't
understand why this is a data type.



Andy

>> or why all the various forms are needed.
>>
>> What do all these clauses within a leaf mean for a keyref?
>>    - units
> 
> Not much I think.
> 
>>    - must
> 
> Same as for other leafs.
> 
>>    - default
> 
> Same as for other leafs, although it's pretty pointless.
> 
>>    - config
> 
> Same as for other leafs, except that we don't want to allow a
> reference from config into non-config (not added to the draft yet).
> 
>>    - mandatory
> 
> Same as for other leafs.
> 
>> What does it mean for a keyref leaf to have different values of these clauses
>> than the leaf for the target of the 'path' statement?
> 
> See below.
> 
>> Does a keyref variable always contain the value of the variable
>> it points to, or not?   If not, when?
> 
> Note that in order to find "the variable it points to", you need the
> path from the schema, and the value of the keyref leaf.
> 
> So I guess I don't understand your question.
> 
> 
>> Can a keyref be status current and the path reference
>> a leaf that is deprecated or obsolete?
> 
> Good question.  I think that the answer is yes, if the keyref is to
> another module (since if there is a keyref from module A to module B,
> and B gets updated, it cannot require A to be updated.)
> 
>> What are writable keyrefs used for?
> 
> An example is 'channelIfIndex' from the RMON-MIB.  It could have been
> defined in YANG (ignoring some details about config/non-config) as:
> 
>    leaf channelIfIndex {
>      type keyref {
>        path "/if:interfaces/if:ifEntry/if:ifIndex";
>      }
>    }
> 
> The idea is that the keyref formalizes the stuff found in description
> clauses in mibs:
> 
>         The interface identified by a particular value
>         of this object is the same interface as identified by the
>         same value of the ifIndex object
> 
> So, writable keyrefs are used to configure relationships.
> 
> [...]
> 
>> IMO, this 2nd form is complicated, and I don't really see why WGs
>> need it, or why they will use it.  The simple absolute-schema-nodeid form
>> makes sense to me, as a mechanism within notifications to reference
>> config data that is copied into the notification.
> 
> As soon as the list has more than one leaf as key, you will need this
> second form.
> 
> This being said, if anyone can come up with a simpler solution to the
> problem of having references to multi-keyed lists, it will be more
> than welcome!
> 
> 
> /martin
> 
> 



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