Vpnservice models 49/16849/2
authorDeepthi V V <deepthi.v.v@ericsson.com>
Thu, 19 Mar 2015 17:58:37 +0000 (23:28 +0530)
committerDeepthi V V <deepthi.v.v@ericsson.com>
Thu, 19 Mar 2015 18:44:12 +0000 (00:14 +0530)
Added models for fib, bgp and interfaces.

Signed-off-by: Deepthi V V <deepthi.v.v@ericsson.com>
Change-Id: I602cc5bd3ae774950704411b41646d94792e9f3c

features/pom.xml
features/src/main/features/features.xml
vpnmanager-api/pom.xml
vpnmanager-api/src/main/yang/bgp-l3vpn.yang [new file with mode: 0644]
vpnmanager-api/src/main/yang/odl-l3vpn.yang

index 39c045991b5b832ccd7b570b47bc20e0fba4e893..1acacbf92b9e4f796029a8767e9c944adf7555c8 100644 (file)
@@ -53,6 +53,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>features-flow</artifactId>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>features-restconf</artifactId>
index 7861e4578f4908f5b645fc61b69893108c0a436e..e56a1b2872805e1cd30f38282cd35e6928c138b5 100644 (file)
@@ -12,9 +12,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
   <repository>mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
   <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.controller/features-flow/${mdsal.version}/xml/features</repository>
   <repository>mvn:org.opendaylight.controller/features-restconf/${mdsal.version}/xml/features</repository>
   <feature name='odl-vpnservice-api' version='${project.version}' description='OpenDaylight :: vpnservice :: api '>
     <feature version='${yangtools.version}'>odl-yangtools-models</feature>
+    <feature version='${mdsal.version}'>odl-flow-model</feature>
     <bundle>mvn:org.opendaylight.vpnservice/model-bgp/2013.07.15.7-SNAPSHOT</bundle>
     <bundle>mvn:org.opendaylight.vpnservice/vpnmanager-api/${project.version}</bundle>
   </feature>
index e849eee1146745904340f743796ae604fe5fa1e6..89dac84c643132539d48884cee934a855d028498 100644 (file)
@@ -26,6 +26,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <ietf.yang.types.version>2010.09.24.7-SNAPSHOT</ietf.yang.types.version>
     <yang.ext.version>2013.09.07.7-SNAPSHOT</yang.ext.version>
     <yangtools.version>0.7.0-SNAPSHOT</yangtools.version>
+    <mdsal.version>1.2.0-SNAPSHOT</mdsal.version>
   </properties>
 
   <dependencies>
@@ -54,6 +55,16 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>ietf-interfaces</artifactId>
       <version>2014.05.08.7-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>iana-if-type-2014-05-08</artifactId>
+      <version>2014.05.08.7-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller.model</groupId>
+      <artifactId>model-inventory</artifactId>
+      <version>${mdsal.version}</version>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.vpnservice</groupId>
       <artifactId>model-bgp</artifactId>
diff --git a/vpnmanager-api/src/main/yang/bgp-l3vpn.yang b/vpnmanager-api/src/main/yang/bgp-l3vpn.yang
new file mode 100644 (file)
index 0000000..423523f
--- /dev/null
@@ -0,0 +1,38 @@
+module bgp-l3vpn {
+    namespace "urn:opendaylight:l3vpn:bgp";
+    prefix bgp-l3vpn;
+    
+    import l3vpn { prefix l3vpn; revision-date "2014-08-15";}
+
+    revision "2013-09-11" {
+        description "L3 VPN Service module";
+    }
+
+    grouping bgp-neighbors {
+        description
+           "The top level container for the list of neighbours of the BGP router.";
+        list bgp-neighbor {
+            key "ip-address";
+            leaf as-number { type uint32; }
+            leaf ip-address { type string; mandatory true; }
+       }
+    }
+
+    grouping bgp-config {
+       description
+           "The top level container for BGP configuration";
+       leaf bgp-ip-address { type string; }
+       leaf bgp-router-id { type string; }
+       leaf bgp-as { type uint32; mandatory true; } 
+    }
+
+    augment "/l3vpn:vpn-instances" {
+        container bgp-config { 
+            uses bgp-config;
+        }
+        container bgp-neighbors { 
+            uses bgp-neighbors;
+        }
+    }
+}
+
index 1703bbe6edb8b563e4663086ca25417e10c7e12f..5d329a0b5c68043736c5d766053c3ad678ec22ed 100644 (file)
-
 module odl-l3vpn {
-       namespace "urn:opendaylight:l3vpn";
-       prefix odl-l3vpn;
-       
-       import l3vpn { prefix l3vpn; revision-date "2014-08-15";}
-
-       revision "2013-09-11" {
-               description "L3 VPN Service module";
-       }
-
-       grouping next-hop-list{
-               list l3-next-hops{
-                       key "ip_address";
-                       leaf nextHopId { type uint32;}
-                       leaf ip_address {type string;}
-                       leaf label {type uint32;} /* optional */
-                       leaf mac_address {type string;} /* optional */
-               }
-       }
-
-       augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
-               uses next-hop-list;
-       }
+    namespace "urn:opendaylight:l3vpn";
+    prefix odl-l3vpn;
+
+    import l3vpn { prefix l3vpn; revision-date "2014-08-15"; }
+    import ietf-interfaces { prefix if; }
+    import iana-if-type { prefix ianaift; }
+    import ietf-inet-types { prefix inet; }
+    import opendaylight-inventory { prefix inv; revision-date "2013-08-19"; }
+
+    revision "2013-09-11" {
+        description "L3 VPN Service module";
+    }
+
+    grouping next-hop-list{
+        list l3-next-hops{
+            key "ip_address";
+            leaf nextHopId { type uint32;}
+            leaf ip_address {type string;}
+            leaf label {type uint32;} /* optional */
+            leaf mac_address {type string;} /* optional */
+        }
+    }
+
+    grouping fib-list{
+        list fib-entry{
+            key "dst_prefix";
+            leaf nextHopId { type uint32;}
+            leaf dst_prefix {type inet:ipv4-prefix;}
+            leaf label {type uint32;} /* optional */
+        }
+    }
+
+    augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
+        uses next-hop-list;
+    }
+
+    augment "/l3vpn:vpn-instances/l3vpn:vpn-instance" {
+        uses fib-list;
+    }
+
+    augment "/if:interfaces/if:interface" {
+        leaf portId { type inv:node-connector-id; }
+    }
+
+    identity tunnel-type-base {
+        description "Base identity for all tunnel-types";
+    }
+
+    identity tunnel-type-vxlan {
+        description "Tunnel type for vxlan tunnels";
+        base tunnel-type-base;
+    }
+
+    identity tunnel-type-gre {
+        description "Tunnel type for gre tunnels";
+        base tunnel-type-base;
+    }
+
+    grouping tunnel-type-attributes {
+        description "Common leaf for expressing tunnel-type";
+        leaf tunnel-type {
+            type identityref {
+                base tunnel-type-base;
+            }
+        }
+    }
+
+    grouping tunnel-endpoint {
+      description
+        "Tunnel Endpoint: IP address and L4 port";
+      leaf local-ip {
+        type inet:ip-address;
+        description "Local Endpoint IP address";
+      }
+      leaf remote-ip {
+        type inet:ip-address;
+        description "Remote Endpoint IP address";
+      }
+      leaf port {
+        type inet:port-number;
+        description "Data-plane port number";
+      }
+    }
+
+    augment "/if:interfaces/if:interface" {
+        when "if:type = ianaift:tunnel";
+        uses tunnel-type-attributes;
+        uses tunnel-endpoint;
+    }
+
+    augment "/if:interfaces/if:interface" {
+        when "if:type = ianaift:l2vlan";
+        leaf vlan-id {
+          type uint16 {
+            range "1..4094";
+          }
+          description "VLAN Id to be used in VLAN Tag";
+        }
+    }
+
 }
\ No newline at end of file