Bug 8165 - Learnt IP route does not reappear on DC-GW after OVSRestart
[netvirt.git] / vpnservice / vpnmanager / vpnmanager-api / src / main / yang / odl-l3vpn.yang
index cec1e7c5abcf343ad1aaa350f3c3d9bbfaf63b06..cb2908e81677da1b06bbf0f57dd1fd16b8ed02be 100644 (file)
@@ -4,8 +4,12 @@ module odl-l3vpn {
 
     import yang-ext {prefix ext; revision-date "2013-07-09";}
     import l3vpn { prefix l3vpn; revision-date "2014-08-15"; }
-    import ietf-yang-types { prefix "yang"; }
+    import ietf-yang-types { prefix "yang"; revision-date "2013-07-15"; }
     import odl-interface { prefix odlif; revision-date "2016-04-06"; }
+    import neutronvpn {
+        prefix nvpn;
+        revision-date "2015-06-02";
+    }
 
     revision "2013-09-11" {
         description "L3 VPN Service module";
@@ -14,10 +18,22 @@ module odl-l3vpn {
     grouping adjacency-list{
         list adjacency{
             key "ip_address";
-            leaf nextHopIp { type string; }
+            leaf-list next-hop-ip-list { type string; }
             leaf ip_address {type string;}
+            leaf primary-adjacency {
+                type boolean;
+                default false;
+                description "Value of True indicates this is a primary adjacency";
+            }
             leaf label { type uint32; config "false"; } /* optional */
             leaf mac_address {type string;} /* optional */
+            leaf subnet_id {type yang:uuid;} /* 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";
+            }
         }
     }
 
@@ -52,27 +68,40 @@ module odl-l3vpn {
               leaf vpn-interface-name {
                   type string;
               }
+              leaf subnet-id {
+                  type yang:uuid;
+              }
+              leaf nat-prefix {
+                  type boolean;
+                  default false;
+              }
            }
         }
     }
 
-    container vpn-to-extraroute {
+    container vpn-to-extraroutes {
         config false;
         list vpn {
-           key vrf-id;
-           leaf vrf-id {
-              description
-                 "The vrf-id command configures a route distinguisher (RD)
-                  for the IPv4 or IPv6 address family of a VPN instance or
-                  vpn instance name for internal vpn case.";
-              type string;
+           key vpn-name;
+           leaf vpn-name {
+               type string;
+               description "VPN Instance name";
            }
-           list extraroute {
-              key prefix;
-              leaf prefix {type string;}
-              leaf nexthop-ip {
+           list extra-routes {
+               key vrf-id;
+               leaf vrf-id {
+                  description
+                     "The vrf-id configures unique route distinguisher (RD) for each ipv4
+                      or ipv6 prefix when its nexthop-ip-list connected to same compute node";
                   type string;
-              }
+               }
+               list routes {
+                  key prefix;
+                  leaf prefix {type string;}
+                  leaf-list nexthop-ip-list {
+                      type string;
+                  }
+               }
            }
         }
     }
@@ -97,14 +126,48 @@ module odl-l3vpn {
        }
     }
 
+    container vpn-id-to-vpn-instance {
+           list vpn-ids {
+              key vpn-id;
+              leaf vpn-id {
+                 type uint32;
+              }
+              leaf vpn-instance-name {
+                 type string;
+              }
+              leaf vrf-id {
+                  description
+                     "The vrf-id command configures a route distinguisher (RD)
+                      for the IPv4 or IPv6 address family of a VPN instance or
+                      vpn instance name for internal vpn case.";
+                  type string;
+              }
+              leaf external-vpn {
+                  type boolean;
+                  description "The VPN is external?";
+              }
+           }
+    }
+
+    container evpn-rd-to-networks {
+        config false;
+        description "Holds the networks to which given evpn is attached";
+        list evpn-rd-to-network {
+           key vrf-id;
+           leaf vrf-id {
+             type string;
+           }
+           leaf network-id {
+             type string;
+           }
+        }
+    }
+
     container vpn-instance-op-data {
         config false;
         list vpn-instance-op-data-entry {
            key vrf-id;
            leaf vpn-id { type uint32;}
-           leaf vpn-instance-name {
-              type string;
-           }
            leaf vrf-id {
               description
                  "The vrf-id command configures a route distinguisher (RD)
@@ -113,6 +176,11 @@ module odl-l3vpn {
               type string;
            }
 
+           leaf vpn-instance-name {
+               description "Typical the VPN Uuid";
+               type string;
+           }
+
            leaf vpn-interface-count { type uint32; }
            uses vpn-route-list;
            list vpn-to-dpn-list {
@@ -127,16 +195,125 @@ module odl-l3vpn {
                   }
                }
                list ip-addresses {
-                  key ip-address;
-                  leaf ip-address {
-                      type string;
+                   key ip-address;
+                   leaf ip-address { type string; }
+                   leaf ip-address-source {
+                        description
+                         "This field indicates whether the IP address here is an External-Fixed-Ip(Owned by Router).
+                          or Floating-Ip(Used by Ports).";
+                        type enumeration {
+                            enum "ExternalFixedIP";
+                            enum "FloatingIP";
+                        }
+                   }
+               }
+               leaf dpn-state {
+                  description
+                  "This flag indicates the state of the DPN.
+                   Active state indicates atleast one vpn interface present on that DPN for the vpn.
+                   Inactive state indicates no vpn interface present on that DPN for this vpn.";
+
+                  type enumeration {
+                     enum active {
+                        value "0";
+                        description
+                        "Active state";
+                     }
+                     enum inactive {
+                        value "1";
+                        description
+                        "Inactive state";
+                     }
                   }
+                  default "active";
                }
            }
-           leaf cleanup_complete { type boolean;}
+           leaf type {
+              description
+                 "The type of the VPN Instance.
+                  L3 indicates it is an L3VPN.
+                  L2 indicates it is an EVPN";
+
+              type enumeration {
+                 enum l3 {
+                    value "0";
+                    description “L3VPN";
+                 }
+                 enum l2{
+                    value "1";
+                    description "EVPN";
+                 }
+              }
+              default "l3";
+           }
+           leaf l3vni {
+              type uint32;
+           }
+           container vpnTargets {
+              description
+                "The vpn-target command configures the export or import VPN target
+                 extended community attribute for the VPN instance IPv4/IPv6 address
+                 family.
+                 Format is ASN:nn or IP-address:nn.";
+
+              list vpnTarget {
+                 key "vrfRTValue";
+                 max-elements "unbounded";
+                 min-elements "0";
+                 description
+                    "L3vpn vpntarget configure class";
+
+                 leaf vrfRTValue {
+                    description
+                       "Vpn-target: adds VPN target extended community attribute to the
+                        export or import VPN target extended community list. The
+                        vpn-target can be expressed in either of the following formats:
+                        (1)16-bit AS number:32-bit user-defined number
+                           For example, 1:3. The AS number ranges from 0 to 65535. The
+                           user-defined number ranges from 0 to 4294967295. The AS number
+                           and the user-defined number cannot be 0s at the same time.
+                           That is, a VPN target cannot be 0:0.
+                        (2)32-bit IP address:16-bit user-defined number
+                           For example, 192.168.122.15:1. The IP address ranges from
+                           0.0.0.0 to 255.255.255.255. The user-defined number ranges from
+                           0 to 65535.
+                        (3)32-bit IP address:16-bit user-defined number
+                           For example, 192.168.122.15:1. An IP address ranges from
+                           0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0
+                           to 65535.";
+                    type string {
+                       length "3..21";
+                    }
+                 }
+
+                 leaf vrfRTType {
+                    description
+                       "Specifies the vpn target type, export-extcommunity:
+                        specifies the extended community attributes carried in routing
+                        information to be sent. import-extcommunity: receives routing
+                        information carrying specified extended community attributes.";
+
+                    type enumeration {
+                       enum export_extcommunity {
+                          value "0";
+                          description "export-extcommunity:";
+                       }
+                       enum import_extcommunity {
+                          value "1";
+                          description "import-extcommunity:";
+                       }
+                       enum both {
+                          value "2";
+                          description "export-extcommunity & import-extcommunity:";
+                       }
+                    }
+                 }
+              }
+           }
         }
     }
 
+
     typedef task-state {
          type enumeration {
            enum na {
@@ -159,7 +336,7 @@ module odl-l3vpn {
           "This value the status of any task.
            The possible values are NA, PENDING or DONE.
            ";
-    }
+           }
 
 
     container subnet-op-data {
@@ -205,6 +382,8 @@ module odl-l3vpn {
                 }
             }
 
+            uses nvpn:network-attributes;
+
         }
     }
 
@@ -226,24 +405,39 @@ module odl-l3vpn {
         }
     }
 
+
     grouping dpn-in-vpn-event {
-            leaf dpn-id { type uint64; }
-            leaf vpn-name { type string; }
-            leaf rd { type string; }
+        leaf dpn-id { type uint64; }
+        leaf vpn-name { type string; }
+        leaf rd { type string; }
+    }
+
+    notification add-dpn-event {
+        container add-event-data {
+           uses dpn-in-vpn-event;
         }
+    }
 
-        notification add-dpn-event {
-            container add-event-data {
-               uses dpn-in-vpn-event;
-            }
+    notification remove-dpn-event {
+        container remove-event-data {
+           uses dpn-in-vpn-event;
         }
+    }
 
-        notification remove-dpn-event {
-            container remove-event-data {
-               uses dpn-in-vpn-event;
+    /*
+     * Configured Transport Type for l3vpn service.
+     */
+    container conf-transport-type-l3vpn {
+        leaf transport-type {
+            mandatory "true";
+            type identityref {
+                base odlif:tunnel-type-base;
             }
+            description
+                "L3VPN service will use this config to setup
+                the transport type for tunnels between DPNs.";
         }
-
+    }
 
     /* container to maintain mapping between neutron router and DPN(s) on which vpn-interfaces for router are present */
     container neutron-router-dpns {
@@ -262,6 +456,19 @@ module odl-l3vpn {
         }
     }
 
+    /* container to maintain mapping between DPN(s) and the routers */
+    container dpn-routers {
+        config false;
+        list dpn-routers-list {
+            key dpn-id;
+            leaf dpn-id { type uint64;}
+            list routers-list {
+                key router;
+                leaf router { type string;}
+            }
+        }
+    }
+
     container router-interfaces {
         list router-interface {
             key interface-name;
@@ -270,18 +477,54 @@ module odl-l3vpn {
         }
     }
 
-    /*
-     * Configured Transport Type for l3vpn service.
-     */
-    container conf-transport-type-l3vpn {
-        leaf transport-type {
-            mandatory "true";
-            type identityref {
-                base odlif:tunnel-type-base;
+    container learnt-vpn-vip-to-port-data {
+        config false;
+        list learnt-vpn-vip-to-port {
+            key "vpn-name port-fixedip";
+            leaf vpn-name { type string; }
+            leaf port-fixedip { type string; }
+            leaf port-name { type string; }
+            leaf mac-address { type string; }
+            leaf creation-time { type string; }
+        }
+    }
+
+    container evpn-config {
+        config true;
+        leaf multi-homing-mode {
+            type enumeration {
+                enum "none";
+                enum "all-active";
+                enum "single-active";
             }
-            description
-                "L3VPN service will use this config to setup
-                the transport type for tunnels between DPNs.";
+            default "none";
+        }
+        leaf irb-mode {
+            type enumeration {
+                enum "symmetric";
+                enum "asymmetric";
+            }
+            default "symmetric";
+        }
+    }
+
+    container l3vpn-lb-nexthops {
+        config false;
+        list nexthops {
+            key "nexthop-key";
+            leaf nexthop-key { type string; }
+            leaf group-id { type string; }
+            leaf-list target-device-id { type string; } //dpId or ip-address
+        }
+    }
+
+    container dpid-l3vpn-lb-nexthops {
+        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; }
         }
     }
 }