CORECONF Yang

VelocityDRIVE-SP supports the ietf-constrained-yang-library module, which is a standardized data model developed by the Internet Engineering Task Force (IETF) that provides information about the YANG modules, datastores, and datastore schemas used by a CORECONF server. The purpose is to enable a client to query the YANG modules implemented by the firmware, including the exact revisions and deviations that apply to those modules.

The structure and representation of the library in YANG Tree format is:

module: ietf-constrained-yang-library
  +--ro yang-library
     +--ro module-set* [index]
     |  +--ro index                 uint8
     |  +--ro module* [identifier]
     |  |  +--ro identifier    sid:sid
     |  |  +--ro revision?     revision-identifier
     |  |  +--ro deviation*    -> ../../module/identifier
     |  +--ro import-only-module* [identifier revision]
     |     +--ro identifier    sid:sid
     |     +--ro revision      union
     +--ro schema* [index]
     |  +--ro index         uint8
     |  +--ro module-set*   -> ../../module-set/index
     +--ro datastore* [identifier]
     |  +--ro identifier    ds:datastore-ref
     |  +--ro schema        -> ../../schema/index
     +--ro checksum      binary

1. Example

The entire YANG library can be queried as shown below:

FETCH request message:

- "/ietf-constrained-yang-library:yang-library"

FETCH response message:

- ? "/ietf-constrained-yang-library:yang-library"
  : module-set:
    - index: 0
      module:
      - identifier: '31149'
        revision: ICUDMQ==
        deviation: []
      - identifier: '31050'
        revision: IBgDEw==
        deviation:
        - '31149'
      - identifier: '39000'
        revision: ICUDMQ==
        deviation: []
      - identifier: '19999'
        revision: ICQEEg==
        deviation: []
      - identifier: '12999'
        revision: ICQEEg==
        deviation: []
      - identifier: '18999'
        revision: ICQEEg==
        deviation: []
      - identifier: '2999'
        revision: ICQEEg==
        deviation: []
      - identifier: '29399'
        revision: ICQEEg==
        deviation: []
      - identifier: '7999'
        revision: ICQEEg==
        deviation: []
      - identifier: '24999'
        revision: ICQEEg==
        deviation: []
      - identifier: '11999'
        revision: ICQEEg==
        deviation: []
      - identifier: '15999'
        revision: ICQEEg==
        deviation: []
      - identifier: '29300'
        revision: IBkDKA==
        deviation:
        - '29399'
      - identifier: '24000'
        revision: ICESCA==
        deviation:
        - '24999'
      - identifier: '21000'
        revision: ICQIAg==
        deviation: []
      - identifier: '20000'
        revision: ICMQGQ==
        deviation: []
      - identifier: '15000'
        revision: ICIIMA==
        deviation:
        - '15999'
      - identifier: '19000'
        revision: IBQIBg==
        deviation:
        - '19999'
      - identifier: '11000'
        revision: ICIDFQ==
        deviation:
        - '11999'
      - identifier: '7000'
        revision: ICMEFw==
        deviation:
        - '7999'
      - identifier: '2000'
        revision: IBgCIA==
        deviation:
        - '2999'
      import-only-module:
      - identifier: '31000'
        revision: ''
      - identifier: '38400'
        revision: ''
      - identifier: '38000'
        revision: ''
      - identifier: '30000'
        revision: ''
      - identifier: '29200'
        revision: ''
      - identifier: '29000'
        revision: ''
      - identifier: '29100'
        revision: ''
      - identifier: '27000'
        revision: ''
      - identifier: '26000'
        revision: ''
      - identifier: '25000'
        revision: ''
      - identifier: '24899'
        revision: ''
      - identifier: '23100'
        revision: ''
      - identifier: '23000'
        revision: ''
      - identifier: '16000'
        revision: ''
      - identifier: '18000'
        revision: ''
      - identifier: '17000'
        revision: ''
      - identifier: '14000'
        revision: ''
      - identifier: '13000'
        revision: ''
      - identifier: '10000'
        revision: ''
      - identifier: '8000'
        revision: ''
      - identifier: '6000'
        revision: ''
      - identifier: '5000'
        revision: ''
      - identifier: '4000'
        revision: ''
      - identifier: '3000'
        revision: ''
      - identifier: '9000'
        revision: ''
      - identifier: '1000'
        revision: ''
      - identifier: '950'
        revision: ''
    schema:
    - index: 0
      module-set:
      - 0
    datastore:
    - identifier: ietf-datastores:startup
      schema: 0
    - identifier: ietf-datastores:running
      schema: 0
    - identifier: ietf-datastores:operational
      schema: 0
    checksum: tC8LFMd9iiRIZlSVpWLyCA==

You will notice that the module identifiers are integers encoded as strings. The string encoding comes from RFC 7951 encoding of 64-bit integers. The integers themselves are the SIDs of the YANG modules. To accurately map the identifiers to YANG modules, the YANG and SID files used by the firmware must be retrieved.

2. Checksum

The checksum is a hash of the YANG and SID files used in a particular firmware release.

The checksum names an archive hosted at https://artifacts.microchip.com/artifactory/UNGE-generic-local/lmstax/yang-by-sha/<sha>.tar.gz where <sha> is the hash written in hex. The checksum leaf is a CBOR byte string encoded in base64, per RFC 7951. For example, a checksum of tC8LFMd9iiRIZlSVpWLyCA== corresponds to the URL https://artifacts.microchip.com/artifactory/UNGE-generic-local/lmstax/yang-by-sha/b42f0b14c77d8a2448665495a562f208.tar.gz

3. Module and deviation identifiers

One can search in the downloaded SID files and discover that e.g. 2000 is the ietf-interfaces.yang module:

grep -R '"sid": 2000$'
ietf-interfaces@2018-02-20.sid:      "sid": 2000

The deviation leaf lists the SIDs of all modules that have deviations that apply to this module.

4. Revision

The revision leaf is a date written in hex and encoded as base64. The revision IBgCIA== is 20180220 in hex, corresponding to revision 2018-02-20 of the ietf-interfaces module used by a particular firmware release.

Revision values in the import-only-module list can be empty. This means the module is imported without caring which revision is used.