Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

draw.io Diagram
borderfalse
diagramNamecps-yang-mount-dependencies-diagram
simpleViewerfalse
linksauto
tbstyleinline
lboxfalse
diagramWidth631
revision2

...


Inline (data embedded) reference

The reference to mounted module could be embedded directly into mount point and delivered together with a data.
The mounted module reference is expected to be described as ietf-yang-library component

...

Code Block
titledata-referencing-mounted-module-inline.json
{
  "test-mount:root-element": { 
    "root-mp": { // mount point
	   "ietf-yang-library:modules-state": { // mounted module (and dependencies) descriptor
          "module-set-id": "some-id",
          "module": [{
               "name": "mounted-module",
               "revision": "2020-02-02",
               "namespace": "urn:org:onap:cps:test:mounted-module",
               "conformance-type": "import"
            }
            // other modules
            ]
	    },
        "mounted-module:mounted-container": { // actual mounted module data
			// data associated to mounted module
		}
    }
  }
}


Reference by xpath

If the parent (extendable) module already contains references to mountable modules (i.e. other module imports) 
then the required module(s) can be mounted via xpath reference.

Code Block
themeMidnight
titletest-mount.yang
module test-mount {
    yang-version 1.1;
    namespace "org:onap:cps:test-mount";
    prefix tmount;
    revision "2020-02-02";

    import ietf-yang-schema-mount {
         prefix yangmnt;
    }
	import mounted-module {
		prefix mntm;
    }

    container root-element {
        yangmnt:mount-point "root-mp";
	}
}

The schema-mount  

Code Block
titleschema-mount.json
{
  "ietf-yang-schema-mount:schema-mounts": {
	 "namespace": [{
             "prefix": "mntm",
             "uri": "urn:org:onap:cps:test:mounted-module"
      }],
     "mount-point": [{
        "module": "test-mount",
        "label": "root-mp",
        "shared-schema": {
             "parent-reference": ["/mntm:mounted-container"]
           }
      }]
   }
}


Implementation Approach in a Context of CPS

...