"neutronvpn:createL3VPN" fails to create L3VPN for IPv6 use case.
[netvirt.git] / vpnmanager / api / src / main / yang / odl-l3vpn.yang
index 0307d1f8290457a3ae4b5c159acf54304e070f39..ef1af3baeb270a189760bdd89acd3991f44e87b2 100644 (file)
@@ -10,67 +10,20 @@ module odl-l3vpn {
         prefix nvpn;
         revision-date "2015-06-02";
     }
-
+    import l3vpn-instances-interfaces {
+        prefix nvpn-l3vpn;
+        revision-date "2020-02-04";
+    }
     revision "2013-09-11" {
         description "L3 VPN Service module";
     }
 
-    grouping adjacency-list{
-        list adjacency{
-            key "ip_address";
-            leaf-list next-hop-ip-list { type string; }
-            leaf ip_address {type string;}
-            leaf adjacency_type {
-                description "The type of adjacency";
-                type enumeration {
-                    enum "primary-adjacency" {
-                        value 1;
-                        description
-                            "Primary adjacency type.";
-                    }
-                    enum "learnt-ip" {
-                        value 2;
-                        description
-                            "Learnt ip adjacency type.";
-                    }
-                    enum "extra-route" {
-                        value 3;
-                        description
-                            "Extra route adjacency type.";
-                    }
-                }
-                default "extra-route";
-            }
-            leaf label { type uint32; config "false"; } /* optional */
-            leaf mac_address {type string;} /* optional */
-            leaf subnet_id {type yang:uuid;} /* optional */
-            leaf subnet_gateway_ip {type string;}  /* optional */
-            leaf subnet_gateway_mac_address {type string; config "false";} /* optional */
-            leaf vrf-id { type string; config "false"; }
-            leaf phys-network-func {
-                type boolean;
-                default false;
-                description "Value of True indicates this is an adjacency of a device in a provider network";
-            }
-        }
-    }
-
     grouping vpn-route-list{
         leaf-list route-entry-id{
             type uint32;
         }
     }
 
-    augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
-        ext:augment-identifier "adjacencies";
-        uses adjacency-list;
-    }
-
-    augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
-        ext:augment-identifier "opState";
-        leaf stateUp {type boolean; config false;}
-    }
-
     /* Operational DS containers for reverse lookups*/
     container prefix-to-interface {
         config false;
@@ -86,9 +39,7 @@ module odl-l3vpn {
               leaf vpn-interface-name {
                   type string;
               }
-              leaf subnet-id {
-                  type yang:uuid;
-              }
+              uses nvpn:network-attributes;
               leaf prefix-cue {
                   type enumeration {
                       enum none {
@@ -215,15 +166,15 @@ module odl-l3vpn {
             leaf dpn-id {
               type uint64;
             }
-            leaf scheduled-for-remove {
-              type boolean;
-            }
             leaf router-interface {
                 type boolean;
             }
             leaf gateway-mac-address {
                 type string;
             }
+            leaf gateway-ip-address {
+                type string;
+            }
             leaf lport-tag {
                 type uint32;
             }
@@ -254,7 +205,7 @@ module odl-l3vpn {
 
     augment "/odl-l3vpn:vpn-interface-op-data/odl-l3vpn:vpn-interface-op-data-entry" {
         ext:augment-identifier "adjacencies-op";
-        uses adjacency-list;
+        uses nvpn-l3vpn:adjacency-list;
     }
 
     container vpn-instance-op-data {
@@ -322,17 +273,22 @@ module odl-l3vpn {
                   default "active";
                }
            }
-           leaf ipv4-configured {
-              type boolean;
-              description
-                 "This VPN Instance handles IPv4 traffic";
-              default false;
-           }
-           leaf ipv6-configured {
-              type boolean;
-              description
-                 "This VPN Instance handles IPv6 traffic";
-              default false;
+           leaf ip-address-family-configured {
+              type enumeration {
+                 enum "undefined" {
+                    value "0";
+                 }
+                 enum "ipv4" {
+                    value "4";
+                 }
+                 enum "ipv6" {
+                    value "6";
+                 }
+                 enum "ipv4-and-ipv6" {
+                    value "10";
+                 }
+              }
+              default "undefined";
            }
            leaf bgpvpn-type {
               type enumeration {
@@ -689,13 +645,72 @@ module odl-l3vpn {
         }
     }
 
-    container dpid-l3vpn-lb-nexthops {
+    container l3vpn-dc-gws {
         config false;
-        list dpn-lb-nexthops {
-            key "src-dp-id dst-device-id";
-            leaf src-dp-id { type uint64; }
-            leaf dst-device-id { type string; } //dpId or ip-address
-            leaf-list nexthop-key { type string; }
+        list dc-gateway {
+            key "ip-address";
+            leaf ip-address {
+                type string;
+            }
+        }
+    }
+
+    typedef learnt-vpn-vip-to-port-event-action {
+         type enumeration {
+             enum add {
+                 value "0";
+                 description
+                 "Event to add a learnt vip to CSC FIB";
+             }
+             enum delete {
+                 value "1";
+                 description
+                 "Event to remove a learnt vip from CSC FIB";
+             }
+         }
+         description
+          "This value represents the action of an event on learnt-vpn-vip-to-port.
+           The possible actions supported are only ADD, DELETE";
+    }
+
+    container learnt-vpn-vip-to-port-event-data {
+        config false;
+        list learnt-vpn-vip-to-port-event {
+            key "learnt-vpn-vip-event-id";
+            leaf vpn-name { type string; }
+            leaf src-fixedip { type string; }
+            leaf dest-fixedip { type string; }
+            leaf port-name { type string; }
+            leaf mac-address { type string; }
+            leaf event-action { type learnt-vpn-vip-to-port-event-action; }
+            leaf learnt-vpn-vip-event-id { type string; }
+        }
+    }
+
+    /* rt to subnets map */
+    container subnets-associated-to-route-targets {
+        config false;
+        list route-target {
+            key "rt rt-type";
+            leaf rt { type string; }
+            leaf rt-type {
+                type enumeration {
+                    enum iRT {
+                        value "0";
+                    }
+                    enum eRT {
+                        value "1";
+                    }
+                }
+            }
+            list associated-subnet {
+                key cidr;
+                leaf cidr { type string; }
+                list associated-vpn {
+                    key "name";
+                    leaf name  { type string; }
+                }
+            }
         }
     }
 }