vpnmanager: update vpn instance families based on subnetmap updates only
[netvirt.git] / vpnservice / vpnmanager / vpnmanager-api / src / main / yang / odl-l3vpn.yang
index 926db0fc3863873c393ca0f60199573d4f399dd1..910c0d29216af74e85b4c074fa9ef96e6aab50e0 100644 (file)
@@ -6,6 +6,10 @@ module odl-l3vpn {
     import l3vpn { prefix l3vpn; revision-date "2014-08-15"; }
     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";
@@ -16,14 +20,37 @@ module odl-l3vpn {
             key "ip_address";
             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 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_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";
+            }
         }
     }
 
@@ -58,27 +85,57 @@ module odl-l3vpn {
               leaf vpn-interface-name {
                   type string;
               }
+              leaf subnet-id {
+                  type yang:uuid;
+              }
+              leaf prefix-cue {
+                  type enumeration {
+                      enum none {
+                          value "0";
+                          description "Nothing special";
+                      }
+                      enum nat {
+                          value "1";
+                          description "NAT prefix";
+                      }
+                      enum phys-net-func {
+                          value "2";
+                          description "Physical Network Function(PNF) prefix";
+                      }
+                      enum subnet-route {
+                          value "3";
+                          description "Subnet Route prefix";
+                      }
+                  }
+                  default "none";
+              }
            }
         }
     }
 
-    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-list nexthop-ip-list {
+           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;
+                  }
+               }
            }
         }
     }
@@ -126,17 +183,16 @@ module odl-l3vpn {
            }
     }
 
-    container vpn-to-pseudo-port-tag-data {
-        description "Makes a correspondence between VRFs and their corresponding VpnPseudoPort";
-        list vpn-to-pseudo-port-tag {
-            key vrf-id;
-            leaf vrf-id {
-                type string;
-            }
-            leaf lport-tag {
-                description "Vpn Pseudo Logical Port Tag";
-                type uint32;
-            }
+    container evpn-rd-to-networks {
+        description "Holds the networks to which given evpn is attached";
+        list evpn-rd-to-network {
+           key rd;
+           leaf rd {
+             type string;
+           }
+           leaf network-id {
+             type string;
+           }
         }
     }
 
@@ -174,27 +230,69 @@ module odl-l3vpn {
                list ip-addresses {
                    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";
-                  }
+                  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 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 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
@@ -257,33 +355,57 @@ module odl-l3vpn {
                  }
               }
            }
+           leaf vpn-state {
+              description
+                 "Represents a stage in this VpnInstance's lifecycle.";
+              type enumeration {
+                 enum created {
+                    value "0";
+                    description
+                    "VPNInstance is successfully created";
+                 }
+                 enum pending_delete {
+                    value "3";
+                    description
+                    "VpnInstance marked for deletion.";
+                 }
+              }
+              default "created";
+           }
+           leaf-list rd {
+              type string;
+           }
         }
     }
 
 
     typedef task-state {
-         type enumeration {
-           enum na {
-             value "0";
-             description
-              "Task not applicable";
-           }
-           enum pending {
-             value "1";
-             description
-              "Task is in pending state";
-           }
-           enum done {
-             value "2";
-             description
-              "Task has been completed";
-           }
-         }
-         description
-          "This value the status of any task.
-           The possible values are NA, PENDING or DONE.
-           ";
-           }
+        type enumeration {
+            enum idle {
+                value "0";
+                description "Task in idle state";
+            }
+            enum pending_advertise {
+                value "1";
+                description "Task is pending advertisement state";
+            }
+            enum pending_withdraw {
+                value "2";
+                description "Task is pending withdrawal state";
+            }
+            enum advertised {
+                value "3";
+                description "Task is in advertised state";
+            }
+            enum withdrawn {
+                value "4";
+                description "Task is in withdrawn state";
+            }
+        }
+        description
+            "This value the status of any task.
+             The possible values are IDLE, PENDING_ADVERTISE, PENDING_WITHDRAW, ADVERTISED, WITHDRAWN.";
+    }
 
 
     container subnet-op-data {
@@ -311,9 +433,13 @@ module odl-l3vpn {
             }
             leaf route-adv-state {
                 type task-state;
-                description "The status of the subnet route advertisement. Route advertisement could be in a NA, PENDING or DONE state.";
+                description "The status of the subnet route advertisement/withdrawal";
+            }
+            leaf last-adv-state {
+                type task-state;
+                description "The previous status of the subnet route advertisement/withdrawal.";
             }
-            leaf elan-tag{
+            leaf elan-tag {
                 type uint32;
             }
             list subnet-to-dpn {
@@ -328,6 +454,13 @@ module odl-l3vpn {
                     }
                 }
             }
+            leaf label {
+                type uint32;
+            }
+            leaf l3vni {
+                type uint32;
+            }
+            uses nvpn:network-attributes;
 
         }
     }
@@ -369,6 +502,22 @@ module odl-l3vpn {
         }
     }
 
+    notification add-interface-to-dpn-on-vpn-event {
+        container add-interface-event-data {
+           uses dpn-in-vpn-event;
+           leaf interface-name { type string; }
+           leaf vpn-id { type uint32; }
+        }
+    }
+
+    notification remove-interface-from-dpn-on-vpn-event {
+        container remove-interface-event-data {
+           uses dpn-in-vpn-event;
+           leaf interface-name { type string; }
+           leaf vpn-id { type uint32; }
+        }
+    }
+
     /*
      * Configured Transport Type for l3vpn service.
      */
@@ -401,6 +550,18 @@ 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 {
@@ -409,4 +570,55 @@ module odl-l3vpn {
             leaf router-name { type string; }
         }
     }
+
+    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";
+            }
+            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; }
+        }
+    }
 }