Added YANG extensions module
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-ext / src / main / yang / yang-ext.yang
diff --git a/opendaylight/sal/yang-prototype/yang/yang-ext/src/main/yang/yang-ext.yang b/opendaylight/sal/yang-prototype/yang/yang-ext/src/main/yang/yang-ext.yang
new file mode 100644 (file)
index 0000000..22aa48a
--- /dev/null
@@ -0,0 +1,60 @@
+module yang-ext {
+    yang-version 1;
+    namespace "urn:opendaylight:params:ns:yang:extension:yang-ext";
+    prefix "ext";
+    
+    contact "Anton Tkacik <ttkacik@cisco.com>";
+
+    revision "2013-07-09" {
+        description "";
+    }
+
+    // Augmentation name
+
+    extension "augment-identifier" {
+        description 
+           "YANG language extension which assigns an identifier to 
+            augmentation. Augment identifier is used to identify
+            specific augment statement by name. 
+
+            The identifier syntax is defined formally defined by the rule
+            'identifier' in Section 12 of RFC 6020.
+
+            All augment identifiers defined in a namespace MUST be unique.
+            The namespace of augment identifiers is shared by module and
+            its submodules. 
+            ";
+            /*
+                Discussion:
+                This extension allows for ease of development / debug
+                of YANG modules and it is suitable for code generation,
+                where each augment statement is nicely identified by
+                unique name instead of combination of augment target
+                and when condition. 
+            */
+        argument "identifier";
+    }
+
+
+    // Context-aware RPCs
+
+    grouping rpc-context-ref {
+        description 
+           "A reference to RPC context.";
+        leaf context-instance {
+            type instance-identifier;
+            description "Pointer to the context. ";
+        }
+    }
+
+    extension "rpc-context-instance" {
+        description
+           "YANG language extension which defines enclosing (parent) 
+            schema node as referencable context for RPCs.
+
+            The argument is identity which is used to identify RPC context
+            type.";
+
+        argument "context-type";
+    }
+}
\ No newline at end of file