Upgrade ietf-{inet,yang}-types to 2013-07-15
[vpnservice.git] / itm / itm-api / src / main / yang / itm-state.yang
index f39512411baa61de70701bbafdce50deb5fd3dc6..a0349ec1d5b62e32b063f0a884fe764753b5f3a1 100644 (file)
@@ -1,6 +1,6 @@
 module itm-state {
 
-      namespace "urn:opendaylight:params:xml:ns:yang:itm:op";
+      namespace "urn:opendaylight:vpnservice:itm:op";
 
       prefix itm-state;
 
@@ -14,7 +14,12 @@ module itm-state {
 
       import ietf-inet-types {
           prefix inet;
+          revision-date "2013-07-15";
       }
+      import odl-interface {
+          prefix odlif; revision-date "2015-03-31";
+      }
+    
 
       description "This YANG module defines operation part of the model.";
 
@@ -22,7 +27,28 @@ module itm-state {
 
         /* Operational state */
 
-      container tunnels {
+    identity tep-type-base {
+        description "Base TEP device type";
+    }
+    identity tep-type-internal {
+        base tep-type-base;
+        description "TEP type internal e.g. Compute OVS";
+    }
+    identity tep-type-external {
+        base tep-type-base;
+        description "TEP type external e.g. DC Gateway";
+    }
+    identity tep-type-hwvtep {
+        base tep-type-base;
+        description "TEP type Hwvtep e.g. TOR devices";
+    }
+    typedef tep-type {
+        type identityref {
+            base tep-type-base;
+        }
+        description "This type is used to refer to an TEP Device Type.";
+    }
+      container dpn-endpoints {
 
         list DPN-TEPs-info {
 
@@ -38,8 +64,8 @@ module itm-state {
 
           /* Minimum 1 port. We may for now support only two ports */
           list tunnel-end-points {
-
-               key "portname VLAN-ID ip-address"; /* Multiple tunnels on the same physical port but on different VLAN can be supported */
+                ordered-by user;
+               key "portname VLAN-ID ip-address tunnel-type"; /* Multiple tunnels on the same physical port but on different VLAN can be supported */
 
                  leaf portname {
                      type string;
@@ -63,7 +89,9 @@ module itm-state {
                           type string;
                  }
                  leaf tunnel-type {
-                      type string;
+                      type identityref {
+                          base odlif:tunnel-type-base;
+                      }
                  }
            }
 
@@ -71,10 +99,10 @@ module itm-state {
       }
 
 
-      container tunnels_state {
-             list state-tunnel-list {
+      container tunnel-list {
+             list internal-tunnel {
 
-               key  "source-DPN destination-DPN";
+               key  "source-DPN destination-DPN transport-type";
 
                leaf source-DPN {
                    type uint64;
@@ -83,41 +111,84 @@ module itm-state {
                leaf destination-DPN {
                    type uint64;
                }
+               leaf transport-type {
+                    type identityref {
+                        base odlif:tunnel-type-base;
+                    }
+               }
 
                /* logical-group interface id */
 
-               leaf logical-tunnel-group-name {
+               leaf tunnel-interface-name {
                     type string;
-                    config false;
                }
+             }
+          }
+
+      container external-tunnel-list {
+             list external-tunnel {
 
-               leaf logical-tunnel-state {
-                    type boolean;
-                    config false;
+               key  "source-device destination-device transport-type";
+
+               leaf source-device {
+                   type string; //dpnid or node-id
                }
 
-             }
-          }
+               leaf destination-device {
+                   type string; //dpn-id or node-id or ip
+               }
+
+               leaf transport-type {
+                    type identityref {
+                        base odlif:tunnel-type-base;
+                    }
+               }
+               /* logical-group interface id */
 
-          rpc get-tunnel-id {
+               leaf tunnel-interface-name {
+                    type string;
+               }
 
-             input {
-                leaf source-dpn {
-                    type uint64;
-                }
-                leaf destination-dpn {
-                    type uint64;
-                }
              }
+          }
 
-             output {
-                     leaf logical-group-name {
-                        type string;
-                     }
-             }
+        grouping tep-info-attributes {
+            leaf tep-device-type {
+                type identityref {
+                    base tep-type-base;
+                }
+            }
+            leaf tep-device-id {
+                type string; //dpnid or node-id
+            }
+            leaf tep-ip {
+                type inet:ip-address; //dpnid or node-id
+            }
+        }
 
-          }
-          
+      container tunnels_state {
+        list state-tunnel-list {
+            key  "tunnel-interface-name";
+            leaf tunnel-interface-name {
+                type string;
+            }
+            leaf tunnel-state {
+                type boolean;
+                config false;
+            }
+            container src-info {
+                uses tep-info-attributes;
+            }
+            container dst-info {
+                uses tep-info-attributes;
+            }
+            leaf transport-type {
+                type identityref {
+                    base odlif:tunnel-type-base;
+                }
+            }
+        }
+      }
           notification itm-tunnel-build-complete{
           }