Subject: [Netmod-ver-dt] Package file format

From: "Rob Wilton (rwilton)" <[email-masked]>
Date: Thu, 17 Oct 2019 11:01:54 +0000

The package file format examples (e.g. taken from the draft appendix are still a bit verbose for my liking).

I'm proposing make two changes:

  1.  Leaving out the URI for standard YANG models, where any reasonable tooling should be able to retrieve the YANG models.  (E.g., unless a URI is provided, it can be assumed that all modules that start with "ietf-" or "iana-" are available at: https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC, and hence do not need to be explicitly stated.  Another alternative here would be for the package definition to define default search paths, along with the prefixes to use for those searches.
  2.  The definition currently includes the full 64 characters of the SHA-256 hash.  I think that this should be allowed, but not required.  I.e. it should be OK to just use a prefix of the SHA-256 hash, perhaps a minimum of 8 characters, but would probably use 16 characters as a compromise between uniqueness and readability.

E.g. this is what the example looks like in the current draft.

{
  "ietf-yang-instance-data:instance-data-set": {
    "name": "example-ietf-network-device-pkg",
    "pkg-schema": {
       package: "[email-masked]"
    },
    "description": "YANG package definition",
    "content-data": {
      "ietf-yang-package:yang-package": {
        "name": "example-ietf-network-device-pkg",
        "version": "1.1.2",
        "timestamp": "2018-12-13T17:00:00Z",
        "organization": "IETF NETMOD Working Group",
        "contact" : "WG Web:   <http://tools.ietf.org/wg/netmod/>, \
                     WG List:  <mailto:[email-masked]>",
        "description": "Example IETF network device YANG package.\
           \
           This package defines a small sample set of \
           YANG modules that could represent the basic set of \
           modules that a standard network device might be expected \
           to support.",
        "reference": "XXX, draft-rwilton-netmod-yang-packages",
        "location": [ "file://example.org/yang/packages/\
                                  [email-masked]" ],
        "module": [
          {
            "name": "iana-crypt-hash",
            "revision": "2014-08-06",
            "location": [ "https://tiny.cc/ietf-yang/\
                                iana-crypt-hash%402014-08-06.yang" ],
            "checksum": "fa9fde408ddec2c16bf2c6b9e4c2f80b\
                         813a2f9e48c127016f3fa96da346e02d"
          },
          {
            "name": "ietf-system",
            "revision": "2014-08-06",
            "location": [ "https://tiny.cc/ietf-yang/\
                                    ietf-system%402014-08-06.yang" ],
            "checksum": "8a692ee2521b4ffe87a88303a61a1038\
                         79ee26bff050c1b05a2027ae23205d3f"
          },
          {
            "name": "ietf-interfaces",
            "revision": "2018-02-20",
            "location": [ "https://tiny.cc/ietf-yang/\
                                ietf-interfaces%402018-02-20.yang" ],
            "checksum": "f6faea9938f0341ed48fda93dba9a69a\
                         a32ee7142c463342efec3d38f4eb3621"
          },
          {
            "name": "ietf-netconf-acm",
            "revision": "2018-02-14",
            "location": [ "https://tiny.cc/ietf-yang/\
                               ietf-netconf-acm%402018-02-14.yang" ],
            "checksum": "e03f91317f9538a89296e99df3ff0c40\
                         03cdfea70bf517407643b3ec13c1ed25"
          },
          {
            "name": "ietf-key-chain",
            "revision": "2017-06-15",
            "location": [ "https://tiny.cc/ietf-yang/\
                                   [email-masked]" ],
            "checksum": "6250705f59fc9ad786e8d74172ce90d5\
                         8deec437982cbca7922af40b3ae8107c"
          },
          {
            "name": "ietf-ip",
            "revision": "2018-02-22",
            "location": [ "https://tiny.cc/ietf-yang/\
                                        ietf-ip%402018-02-22.yang" ],
            "checksum": "b624c84a66c128ae69ab107a5179ca8e\
                         20e693fb57dbe5cb56c3db2ebb18c894"
        }
        ],
        "import-only-module": [
          {
            "name": "ietf-yang-types",
            "revision": "2013-07-15",
            "location": [ "https://tiny.cc/ietf-yang/\
                                ietf-yang-types%402013-07-15.yang" ],
            "checksum": "a04cdcc875764a76e89b7a0200c6b9d8\
                         00b10713978093acda7840c7c2907c3f"
          },
          {
            "name": "ietf-inet-types",
            "revision": "2013-07-15",
            "location": [ "https://tiny.cc/ietf-yang/\
                                ietf-inet-types%402013-07-15.yang" ],
            "checksum": "12d98b0143a5ca5095b36420f9ebc1ff\
                         a61cfd2eaa850080244cadf01b86ddf9"
          }
        ]
      }
    }
  }
}

After, my proposed changes:

{
  "ietf-yang-instance-data:instance-data-set": {
    "name": "example-ietf-network-device-pkg",
    "pkg-schema": {
       package: "[email-masked]"
    },
    "description": "YANG package definition",
    "content-data": {
      "ietf-yang-package:yang-package": {
        "name": "example-ietf-network-device-pkg",
        "version": "1.1.2",
        "timestamp": "2018-12-13T17:00:00Z",
        "organization": "IETF NETMOD Working Group",
        "contact" : "WG Web:   <http://tools.ietf.org/wg/netmod/>, \
                     WG List:  <mailto:[email-masked]>",
        "description": "Example IETF network device YANG package.\
           \
           This package defines a small sample set of \
           YANG modules that could represent the basic set of \
           modules that a standard network device might be expected \
           to support.",
        "reference": "XXX, draft-rwilton-netmod-yang-packages",
        "location": [ "file://example.org/yang/packages/\
                                  [email-masked]" ],
        "module": [
          {
            "name": "iana-crypt-hash",
            "revision": "2014-08-06",
            "checksum": "fa9fde408ddec2c1"
          },
          {
            "name": "ietf-system",
            "revision": "2014-08-06",
            "checksum": "8a692ee2521b4ffe"
          },
          {
            "name": "ietf-interfaces",
            "revision": "2018-02-20",
            "checksum": "f6faea9938f0341e"
          },
          {
            "name": "ietf-netconf-acm",
            "revision": "2018-02-14",
            "checksum": "e03f91317f9538a8"
          },
          {
            "name": "ietf-key-chain",
            "revision": "2017-06-15",
            "checksum": "6250705f59fc9ad7"
          },
          {
            "name": "ietf-ip",
            "revision": "2018-02-22",
            "checksum": "b624c84a66c128ae"
        }
        ],
        "import-only-module": [
          {
            "name": "ietf-yang-types",
            "revision": "2013-07-15",
            "checksum": "a04cdcc875764a76"
          },
          {
            "name": "ietf-inet-types",
            "revision": "2013-07-15",
            "checksum": "12d98b0143a5ca50"
          }
        ]
      }
    }
  }
}