Added support for resolving augmentations.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / samples / maven-code-gen-sample / src / main / yang / controller-openflow.yang
diff --git a/opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/controller-openflow.yang b/opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/controller-openflow.yang
new file mode 100644 (file)
index 0000000..62e937e
--- /dev/null
@@ -0,0 +1,79 @@
+module controller-openflow {
+
+    namespace "urn:opendaylight:controller:openflow";
+    prefix "of";
+    import controller-network {prefix cn;}
+    
+    
+    revision 2013-05-20 {
+       description "Initial demo";
+    }
+
+   
+
+
+
+    typedef datapath-id {
+        type string {
+            length 16;
+        }
+    }
+
+
+    augment "/cn:network/cn:topologies/cn:topology/cn:types" {
+        leaf openflow {type string;}
+    }
+
+    augment "/cn:network/cn:topologies/cn:topology/cn:links/cn:link/cn:source" {
+        when "../../../cn:types/of:openflow";
+
+        leaf logical-port {
+            type int32;
+        }
+    }
+
+    augment "/cn:network/cn:topologies/cn:topology/cn:links/cn:link/cn:destination" {
+        when "../../../cn:types/of:openflow";
+
+        leaf logical-port {
+            type int32;
+        }
+    }
+
+    augment "/cn:network/cn:topologies/cn:topology/cn:nodes/cn:node/" {
+        when "../../../cn:types/of:openflow";
+        leaf datapath-id {
+            type datapath-id;
+        }
+    }
+    
+    augment "/cn:network/cn:network-elements/cn:network-element" {
+        leaf datapath-id {
+            type datapath-id;
+        }
+
+        container ports {
+            list port {
+                key "logical-port-id";
+                
+                leaf logical-port-id {
+                    type int32;
+                }
+
+                // Should be replaced with ref to interface
+                leaf physical-name {
+                    type string;
+                }
+            }
+        }
+        container flow-tables {
+            list flow-table {
+                key "flow-table-id";
+                leaf flow-table-id {
+                    type string;
+                }
+
+            }
+        }
+    }
+}
\ No newline at end of file