Subject: [Netmod-ver-dt] YANG package module updates

From: "Rob Wilton (rwilton)" <[email-masked]>
Date: Wed, 11 Sep 2019 10:44:39 +0000

Hi,

I've updated YANG packages YANG modules based on the discussions and further thoughts.

  1.  I've kept separate definitions for the instance data file vs YANG library.
  2.  An instance-data document can now define multiple packages ... although a bit of me is now wondering whether this might be a mistake (particularly from the checksuming aspect).
  3.  I've changed the unique "version" identifier for a package to "rev:revision-label" (which disallows revision-date)
  4.  Modules revisions are now identified just using "rev:revision-date-or-label".  Submodules continue to be identified only by their revision-date.
  5.  I've changed package "revision-date" to "timestamp" and it is uses yang:date-and-time.  (But thinking about this some more, the instance data document already contains a timestamp, so I'm wondering whether we need this field at all).
  6.  I've added "checksum" leaves (defined to use SHA-256, propose defining new checksum-sha512 in future, if required) whenever location appears.  (For a module, it will be SHA-256 over the file containing the module definition, for a package, it will be a SHA-256 over an instance-data document containing just the package definition.  Might need to think a bit more about how this works with a single instance-data document containing multiple packages.
  7.  I've reordered and renamed a few fields
  8.  Imported packages can now indicate package versions that are replaced by the import.  This might still need some further thought as to whether this is the right thing to do, and what the exact semantics should be.

Updates are pushed to https://github.com/rgwilton/YANG-Packages-Draft/

Comments, etc, welcome.

Cheers,
Rob

module: ietf-yang-package
  +--ro packages
     +--ro package* [name version]
        +--ro name                      yang:yang-identifier
        +--ro version                   rev:revision-label
        +--ro timestamp?                yang:date-and-time
        +--ro description?              string
        +--ro reference?                string
        +--ro referentially-complete?   boolean
        +--ro previous-version?         rev:revision-label
        +--ro tag*                      tags:tag
        +--ro mandatory-feature*        string
        +--ro imported-packages* [name version]
        |  +--ro name                yang:yang-identifier
        |  +--ro version             rev:revision-label
        |  +--ro replaces-version*   rev:revision-label
        |  +--ro modified?           boolean
        |  +--ro location*           inet:uri
        |  +--ro checksum?           string
        +--ro module* [name]
        |  +--ro name         yang:yang-identifier
        |  +--ro revision?    rev:revision-date-or-label
        |  +--ro namespace    inet:uri
        |  +--ro location*    inet:uri
        |  +--ro checksum?    string
        |  +--ro submodule* [name]
        |     +--ro name        yang:yang-identifier
        |     +--ro revision    yanglib:revision-identifier
        |     +--ro location*   inet:uri
        |     +--ro checksum?   string
        +--ro import-only-module* [name revision]
           +--ro name                 yang:yang-identifier
           +--ro revision             rev:revision-date-or-label
           +--ro replaces-revision*   rev:revision-date-or-label
           +--ro namespace            inet:uri
           +--ro location*            inet:uri
           +--ro checksum?            string
           +--ro submodule* [name]
              +--ro name        yang:yang-identifier
              +--ro revision    yanglib:revision-identifier
              +--ro location*   inet:uri
              +--ro checksum?   string

module: ietf-yl-packages
  augment /yanglib:yang-library:
    +--ro package* [name version]
       +--ro name                      yang:yang-identifier
       +--ro version                   rev:revision-label
       +--ro timestamp?                yang:date-and-time
       +--ro description?              string
       +--ro reference?                string
       +--ro referentially-complete?   boolean
       +--ro previous-version?         rev:revision-label
       +--ro tag*                      tags:tag
       +--ro mandatory-feature*        string
       +--ro imported-packages* [name version]
       |  +--ro name                yang:yang-identifier
       |  +--ro version             rev:revision-label
       |  +--ro replaces-version*   rev:revision-label
       |  +--ro modified?           boolean
       |  +--ro location*           inet:uri
       |  +--ro checksum?           string
       +--ro module-set*               -> /yanglib:yang-library/module-set/name
       +--ro location*                 inet:uri
       +--ro checksum?                 string
  augment /yanglib:yang-library/yanglib:schema:
    +--ro package
       +--ro name?      -> /yanglib:yang-library/package/name
       +--ro version?   -> /yanglib:yang-library/package[name = current()/../name]/version
  augment /yanglib:yang-library/yanglib:module-set/yanglib:import-only-module:
    +--ro replaces-revision*   rev:revision-date-or-label