pyang fixes for inventory and topology models
[controller.git] / opendaylight / md-sal / model / model-inventory / src / main / yang / opendaylight-inventory.yang
diff --git a/opendaylight/md-sal/model/model-inventory/src/main/yang/opendaylight-inventory.yang b/opendaylight/md-sal/model/model-inventory/src/main/yang/opendaylight-inventory.yang
new file mode 100644 (file)
index 0000000..396206e
--- /dev/null
@@ -0,0 +1,121 @@
+module opendaylight-inventory {
+    namespace "urn:opendaylight:inventory";
+    prefix inv;
+
+    import yang-ext {prefix ext; revision-date "2013-07-09";}
+    import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
+
+
+    revision "2013-08-19" {
+        description "Initial revision of Inventory model";
+    }
+    
+    
+    typedef support-type {
+        type enumeration {
+            enum native;
+            enum emulated;
+            enum not-supported;
+        }
+    }
+
+    typedef node-id {
+        type inet:uri;
+    }
+
+    typedef node-connector-id {
+        type inet:uri;
+    }
+
+    typedef node-ref {
+        type instance-identifier;
+    }
+
+    typedef node-connector-ref {
+        type instance-identifier;
+    }
+
+    identity node-context {
+        description "Identity used to mark node context";
+    }
+
+    identity node-connector-context {
+        description "Identity used to mark node connector context";
+    }
+
+    identity node-type {
+        description "Base identity for node types";
+    }
+
+    identity node-connector-type {
+        description "Base identity for node connectors type";
+    }
+
+    grouping node {
+        leaf id {
+            type node-id;
+        }
+
+        list "node-connector" {
+            key "id";
+            ext:context-instance "node-connector-context";
+
+            uses node-connector;
+        }
+    }
+
+    grouping node-connector {
+        leaf id {
+            type node-connector-id;
+        }
+    }
+
+    grouping node-context-ref {
+        description 
+        "Helper grouping which contains a reference to node context.";
+        leaf node {
+            ext:context-reference "node-context";
+            type node-ref;
+        }
+    }
+
+    /** Base structure **/
+    container nodes {
+        list node {
+            key "id";
+            ext:context-instance "node-context";
+
+            uses node;
+        }
+    }
+
+    notification node-updated {
+        leaf node-ref {
+            ext:context-reference "node-context";
+            type node-ref;
+        }
+        uses node;
+    }
+
+    notification node-connector-updated {
+        leaf node-connector-ref {
+            ext:context-reference "node-connector-context";
+            type node-connector-ref;
+        }
+        uses node-connector;
+    }
+
+    notification node-removed {
+        leaf node-ref {
+            ext:context-reference "node-context";
+            type node-ref;
+        }
+    }
+
+    notification node-connector-removed {
+        leaf node-connector-ref {
+            ext:context-reference "node-connector-context";
+            type node-connector-ref;
+        }
+    }
+}