Add yang-ext:mount extension 98/96498/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 9 Jun 2021 08:54:38 +0000 (10:54 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 9 Jun 2021 09:02:43 +0000 (11:02 +0200)
We are gratiously refering to yang-ext:mount all over the place, without
the construct being actually defined. Add a proper definition so that
our data/schema processing can be correctly hooked into it.

JIRA: MDSAL-665
Change-Id: Ib6076060d693955be236d548e07fca1c88016b5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/yang-ext/src/main/yang/yang-ext.yang

index 2d89e616b5fd33ba72d0c32a10a92403032e46ef..f53148adc89eb953e0d97f0ba8091d15ca5033ae 100644 (file)
@@ -42,6 +42,39 @@ module yang-ext {
         argument "identifier";
     }
 
+    // Mount point marker
+
+    extension mount {
+        description
+           "YANG language extension which marks a place where a semantic mount
+            point can be present. This extension can only be used in a container or
+            a list statement, for example:
+
+              module foo {
+                container foo {
+                  leaf bar {
+                    type string;
+                  }
+
+                  ext:mount;
+                }
+              }
+
+            In this example, container foo can contain a local leaf bar and some
+            mounted data. From addressing perspective, the extension use acts as
+            a container with yang-ext's namespace, i.e. it looks as though as this
+            (yang-ext) module contained the following construct:
+
+              import foo { prefix foo; }
+
+              augment /foo:foo {
+                container mount;
+              }
+
+            From data lifecycle perspective, this container should never be
+            automatically included in the datastore content for 'container foo', unless
+            specifically explicitly requested.";
+    }
 
     // Context-aware RPCs