BUG 6839: Fixes for import/export RT and router dissociation in L3Vpn
[netvirt.git] / vpnservice / vpnmanager / vpnmanager-api / src / main / yang / odl-l3vpn.yang
index 77d1bf19fb2e5a99f8331d3ddecb057d61413a80..f046595b7963dab4281f5d9e8144e562083f5224 100644 (file)
@@ -4,7 +4,7 @@ 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"; }
 
     revision "2013-09-11" {
@@ -14,7 +14,7 @@ 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 label { type uint32; config "false"; } /* optional */
             leaf mac_address {type string;} /* optional */
@@ -70,7 +70,7 @@ module odl-l3vpn {
            list extraroute {
               key prefix;
               leaf prefix {type string;}
-              leaf nexthop-ip {
+              leaf-list nexthop-ip-list {
                   type string;
               }
            }
@@ -97,6 +97,43 @@ 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 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 vpn-instance-op-data {
         config false;
         list vpn-instance-op-data-entry {
@@ -110,6 +147,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 {
@@ -124,15 +166,95 @@ module odl-l3vpn {
                   }
                }
                list ip-addresses {
-                  key ip-address;
-                  leaf ip-address {
-                      type string;
-                  }
+                   key ip-address;
+                   leaf ip-address { type string; }
                }
+               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";
+                  }
+           }
+           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 {
@@ -155,10 +277,11 @@ module odl-l3vpn {
           "This value the status of any task.
            The possible values are NA, PENDING or DONE.
            ";
-    }
+           }
 
 
     container subnet-op-data {
+        config false;
         list subnet-op-data-entry {
             key subnet-id;
             leaf subnet-id {
@@ -204,6 +327,7 @@ module odl-l3vpn {
     }
 
     container port-op-data {
+        config false;
         list port-op-data-entry {
             key port-id;
             leaf port-id {
@@ -220,48 +344,43 @@ module odl-l3vpn {
         }
     }
 
-    container rd-to-elan-op{
-        list rd-to-elan-op-entry{
-            key "rd subnet-ip";
-            leaf rd {
-                type string;
-            }
-            leaf subnet-ip {
-                type string;
-            }
-            leaf next-hop-ip {
-                type string;
-            }
-            leaf vpn-name {
-                type string;
-            }
-            leaf elan-tag{
-                type uint32;
-            }
-        }
-    }
 
     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 {
+        config false;
         list router-dpn-list {
             key router-id;
             leaf router-id { type string;}
@@ -276,6 +395,7 @@ module odl-l3vpn {
         }
     }
 
+
     container router-interfaces {
         list router-interface {
             key interface-name;
@@ -283,19 +403,4 @@ module odl-l3vpn {
             leaf router-name { type string; }
         }
     }
-
-    /*
-     * 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.";
-        }
-    }
 }