Subject: [Netconf] YANGLIB #5: how to list protocol-specific modules: Solution YL5-01

From: Andy Bierman <[email-masked]>
Date: Thu, 19 Nov 2015 17:40:20 -0800

Hi,

The following solution is proposed for the ietf-yang-library module,
to address issue #5:

1) Add to global level:

typedef yang-protocol {
   type identityref { base yang-protocol; }
}

identity yang-protocol;
identity netconf-1.0 { base yang-protocol; }
identity netconf-1.1 { base yang-protocol; }
identity restconf-1.0 { base yang-protocol; }

2) Add to container modules:

  leaf-list yang-protocol {
     type yang-protocol;
     description "list all protocols using the YANG library";
  }

3) Add to grouping module, list module:

  leaf-list restricted-protocol {
      type yang-protocol;
       description
          "Identifies a protocol found in /modules/yang-protocol
           that does not support this module";
  }

Andy

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Fri, 20 Nov 2015 09:37:30 +0100

> identity restconf-1.0 { base yang-protocol; }

Is the idea to revise the ietf-yang-library whenever a new protocol or
protocol version comes along? Or would we be better served if the list
of identities is maintained by IANA?
 
>            that does not support this module";

Not sure whether 'restricted-protocol' is a good name. This is really
'not-supported-by'.

/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/>

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 23 Nov 2015 13:14:43 +0100 (CET)

Juergen Schoenwaelder <[email-masked]> wrote:
> protocol version comes along?

No.

> Or would we be better served if the list

Probably.  OTOH, since these are identities, they can be defined in
any module...

> Not sure whether 'restricted-protocol' is a good name. This is really

Yes.

BUT maybe this solution is not the best after all.  The most common
operation in this module is a client that wants to get a list of all
modules supported in protocol X.  With the proposed design, a NETCONF
client cannot construct a subtree filter to retrieve just the modules
for NETCONF.  An XPath filter would look like this:

   /modules/module[not derived-from-or-self(restricted-protocol,
                                            "ietf-yang-library",
                                            "netconf-1.1")]

But XPath is optional...

OTOH, it may be ok to retrieve everything, and filter in the client,
since we expect most modules to be available over all protocols.

[Side note: I just realized a flaw in the definition of
'derived-from'; I will bring this up on the netmod ML.]

/martin