Subject: [netmod] question about notification example

From: David Reid <[email-masked]>
Date: Mon, 29 Sep 2008 17:37:47 -0400

I'm starting to look at notifications and I have a question about 
the example in section 4.2.10. The if-index leaf does not appear 
in the XML encoding. I'm guessing if-index is not supposed to be
in the YANG part. Is that correct?

-David Reid

----

4.2.10.  Notification Definitions

   YANG allows the definition of notifications suitable for NETCONF.
   YANG data definition statements are used to model the content of the
   notification.

   YANG Example:

     notification link-failure {
         description "A link failure has been detected";
         leaf if-index {
             type int32 { range "1 .. max"; }
         }
         leaf if-name {
             type keyref {
                 path "/interfaces/interface/name";
             }
         }
     }
     
   NETCONF XML Encoding:

     <notification
         xmlns="urn:ietf:params:netconf:capability:notification:1.0">
       <eventTime>2007-09-01T10:00:00Z</eventTime>
       <link-failure xmlns="http://acme.example.com/system">
         <if-name>so-1/2/3.0</if-name>
       </link-failure>
     </notification>

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: fanhuaxiang 90002624 <[email-masked]>
Date: Tue, 30 Sep 2008 20:59:54 +0800

Hi,
 I have the same confusion.
washam
>   YANG data definition statements are used to model the content of 
> the   notification.
> 
>   YANG Example:
>

---

From: Andy Bierman <[email-masked]>
Date: Tue, 30 Sep 2008 07:10:11 -0700

>  I have the same confusion.

This is just a bug in the example -- the if-index node should be present.

This example was brought up before wrt/ leafref.

Notice how if-name is a clean definition, and conveys
the correct semantics (if-name is a pointer to the database)?

Notice how if-index is cut-and-paste, and if it had a
description clause, would say "This is a copy of the
if-index from the list entry that caused the link-failure."?

A named type (InterfaceIndex) would be a little better,
but a leafref might be better still:

       notification link-failure {
            description "A link failure has been detected";
            leaf if-index {
                type leafref {
                    path "/interfaces/interface/if-index";
                }
            }
            leaf if-name {
                type keyref {
                    path "/interfaces/interface/name";
                }
            }
       }

(IMO, YANG should have leafref instead of keyref.)

> washam

Andy

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Tue, 30 Sep 2008 16:19:42 +0200

> (IMO, YANG should have leafref instead of keyref.)

I think this should be on the open issues list.

/js

-- 
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/>
_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: David Reid <[email-masked]>
Date: Tue, 30 Sep 2008 10:31:36 -0400

I like the leafref idea a lot. 

Are you suggestion we eliminate the keyref type or support both keyref and
leafref where keyref is used to reference a list entry and leafref is used to
reference a leaf?

-David Reid

---

From: Andy Bierman <[email-masked]>
Date: Tue, 30 Sep 2008 08:24:35 -0700

> leafref where keyref is used to reference a list entry and leafref is used to

I can see the value in leaving the keyref semantics as is,
and also having a leafref with new semantics.  Sometimes
you really mean to constrain the value set to the current
key values within another list (ala SQL foreign key).
But many times you want a pointer-to-a-leaf instead of
cut-and-paste-of-a-leaf. The use-cases are very different.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 30 Sep 2008 21:10:38 +0200 (CEST)

Hi,

Andy Bierman <[email-masked]> wrote:
> a leafref might be better still:
> 

Shouldn't the leafref path be

      "/interfaces/interface[name=../if-name]/if-index";

Or would a leafref be allowed to have wildcards?  If so, what does
such a wildcard mean?

I can clearly see the use case in notifications (although using these
expressions might be a bit cumbersome - a long time ago we talked
about an alternatove syntax, I'll see if I can find it).  But do you
see any use case for leafref for something else?

/martin

---

From: Balazs Lengyel <[email-masked]>
Date: Wed, 01 Oct 2008 08:50:40 +0200

Hello,
Previously we had a basic question about leafrefs: Is a leafref
A) a pointer to a leaf  (something like the instance identifier) with a value describing the 
path to the leaf in the data tree
or
B) is it a link (like a linux soft-link) so it will actually carry the value stored in the 
referenced leaf?

I could see the use for both.
Balazs

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
TSP System Manager
ECN: 831 7320                        Fax: +36 1 4377792
Tel: +36-1-437-7320     email: [email-masked]
_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod