...
The ietf-yang-schema-mount module defined in RFC-8528 defines structures for following entities:
...
Below is example of simple mount-point definition
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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; } container testroot-mount-rootelement { yangmnt:mount-point "root-mp"; } } |
schema-mounts
While mount-point is a part of YANG definition the schema-mounts definition is delivered as data and it's expected
the server is capable to recognize this data as a model configuration update (modification).
The schema-mounts data describes which module to be attached to which mount-point (uniquely identified by
extended module name and mount point label). The reference to mount point is (expected to be) unique combination
of module name and a label assigned to mount point. The reference to mounted model could be various (described below).
Below is example of schema-mount data set referencing model to be taken from a library:
Code Block | ||
---|---|---|
| ||
{
"ietf-yang-schema-mount:schema-mounts": {
"mount-point": [{
"module": "test-mount",
"label": "root-mp",
"shared-schema": {}
}]
}
} |
Mounted model can be addressed the one of the following ways:
Known library item
Using shared-schema empty body (as in example above) indicates the model will be referenced by data while
it's expected (assumed) the model definition (YANG) to be taken from a server library identified earlier.
So if the data looks like below (addresses test-mount module described above):
Code Block | ||
---|---|---|
| ||
{
"test-mount:root-element": {
"root-mp": { // mount point
"mounted-module:mounted-container": { // mounted module reference
// data associated to mounted module
}
}
}
} |
it assumes there is a module with name "mounted-module" (known by the server) having root level container
named "mounted-container".
In order to address a mounted module as belonging to shared "shared-schema" the server needs a configuration
instruction as described RFC-8525, the yang-library message to be like below
Code Block | ||
---|---|---|
| ||
{
"ietf-yang-library:yang-library": {
"content-id": "14e2ab5dc325f6d86f743e8d3ade233f1a61a899",
"module-set": [
{
"name": "module-set",
"module": [
{
"name": "mounted-module",
"revision": "2020-02-02",
"namespace": "urn:org:onap:cps:test:mounted-module"
}, // other modules ] } }} |
draw.io Diagram | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...