Support for vni attribute in BGPVPN 05/63405/7
authorDeepthi V V <deepthi.v.v@ericsson.com>
Thu, 21 Sep 2017 07:11:24 +0000 (12:41 +0530)
committerAshik Alias <ashik.alias@ericsson.com>
Tue, 11 Dec 2018 09:10:10 +0000 (14:40 +0530)
- This change renames vnid attribute to vni
Change in openstack: https://review.openstack.org/#/c/505496/
- vni attribute was introduced during Queens release of openstack
and was not used previously. Hence this change will not impact use of ODL
with older version of networking-bgpvpn.

Change-Id: I6927b9b4a51d373d19b8a14d535611ae15c4b575
Signed-off-by: Ashik Alias <ashik.alias@ericsson.com>
Signed-off-by: Deepthi V V <deepthi.v.v@ericsson.com>
integration/test-standalone/src/main/java/org/opendaylight/neutron/e2etest/NeutronBgpvpnTests.java
model/src/main/yang/neutron-bgpvpns.yang
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronBgpvpn.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java

index a4c8b7acc01bd25e565c43341c87bf42bb8051ee..e31cf28f9c8a92e3edebd0a1fb1c0c8bab2ce7bf 100644 (file)
@@ -27,6 +27,7 @@ public class NeutronBgpvpnTests {
                 + " \"name\": \"vpn1\", \"admin_state_up\": true, "
                 + " \"tenant_id\": \"9bacb3c5d39d41a79512987f338cf177\", " + " \"route_targets\": \"64512:1\", "
                 + " \"networks\": \"3b80198d-4f7b-4f77-9ef5-774d54e17126\", "
+                + " \"vni\": 100, "
                 + " \"auto_aggregate\": true, \"id\": \"4e8e5957-649f-477b-9e5b-f1f75b21c03c\" " + " } }";
         HttpUtils.test_create(url, content, "Singleton Bgpvpn Post Failed NB");
         return content;
@@ -43,11 +44,12 @@ public class NeutronBgpvpnTests {
         String content = "{ \"bgpvpns\": [ { " + "\"status\": \"ACTIVE\", " + "\"name\": \"sample_bgpvpn1\", "
                 + "\"admin_state_up\": true, " + "\"tenant_id\": \"4fd44f30292945e481c7b8a0c8908869\", "
                 + "\"id\": \"bc1a76cb-8767-4c3a-bb95-018b822f2130\", " + "\"route_targets\": \"64512:1\", "
-                + "\"auto_aggregate\": true, " + "\"type\": \"l3\" }, { " + "\"status\": \"ACTIVE\", "
+                + " \"vni\": 100, " + "\"auto_aggregate\": true, " + "\"type\": \"l3\" }, { "
+                + "\"status\": \"ACTIVE\", "
                 + "\"name\": \"sample_bgpvpn2\", " + "\"admin_state_up\": true, "
                 + "\"tenant_id\": \"4fd44f30292945e481c7b8a0c8908869\", "
                 + "\"id\": \"af374017-c9ae-4a1d-b799-ab73111476e2\", " + "\"route_targets\": \"64512:2\", "
-                + "\"auto_aggregate\": false, " + "\"type\": \"l3\" } ] } ";
+                + " \"vni\": 100, " + "\"auto_aggregate\": false, " + "\"type\": \"l3\" } ] } ";
         HttpUtils.test_create(url, content, "Bulk Bgpvpn Post Failed");
     }
 
index 3059b025def20af7fdc123fb29fa78d3fd430748..67c506449d367ec44cbbebee20c9e21a32daa8cf 100644 (file)
@@ -78,7 +78,7 @@ module neutron-bgpvpns {
             type string;
             description "list route-distinguishers";
         }
-        leaf vnid {
+        leaf vni {
             type uint32;
             description "globally assigned VxLanId";
         }
index 7828d9724b8973775e9f234ef5eb075337d20004..ebf11b2bd142c16629d3a85f8f214c993a301c3b 100644 (file)
@@ -40,8 +40,8 @@ public final class NeutronBgpvpn extends NeutronAdminAttributes<NeutronBgpvpn> {
     @XmlElement(name = "route_distinguishers")
     List<String> routeDistinguishers;
 
-    @XmlElement(name = "vnid")
-    Long vnid;
+    @XmlElement(name = "vni")
+    Long vni;
 
     @XmlElement(defaultValue = "false", name = "auto_aggregate")
     Boolean autoAggregate;
@@ -154,12 +154,12 @@ public final class NeutronBgpvpn extends NeutronAdminAttributes<NeutronBgpvpn> {
         routeDistinguishers.remove(uuid);
     }
 
-    public Long getVnid() {
-        return vnid;
+    public Long getVni() {
+        return vni;
     }
 
-    public void setVnid(Long input) {
-        vnid = input;
+    public void setVni(Long input) {
+        vni = input;
     }
 
     public Boolean getAutoAggregate() {
@@ -229,8 +229,8 @@ public final class NeutronBgpvpn extends NeutronAdminAttributes<NeutronBgpvpn> {
             case "networks":
                 ans.setNetworks(this.getNetworks());
                 break;
-            case "vnid":
-                ans.setVnid(this.getVnid());
+            case "vni":
+                ans.setVni(this.getVni());
                 break;
             case "auto_aggregate":
                 ans.setAutoAggregate(this.getAutoAggregate());
@@ -246,7 +246,7 @@ public final class NeutronBgpvpn extends NeutronAdminAttributes<NeutronBgpvpn> {
         return "NeutronBgpvpn [bgpvpnUUID=" + uuid + ", bgpvpnName=" + name + ", adminStateUp=" + adminStateUp
                 + ", status=" + status + ", tenantID=" + getTenantID() + ", type=" + type + ", technique=" + technique
                 + ", routeTargets=" + routeTargets + ", importTargets=" + importTargets + ", exportTargets="
-                + exportTargets + ", routeDistinguishers=" + routeDistinguishers + ", vnid = " + vnid
+                + exportTargets + ", routeDistinguishers=" + routeDistinguishers + ", vni = " + vni
                 + ", autoAggregate = " + autoAggregate + ", networks = " + networks + ", routers = " + routers + "]";
     }
 }
index 8bab3a48484d97a2dc9b5c13da688b82749306ab..c0dace9c5b61341a095da7dee8b6a241e68cd03a 100644 (file)
@@ -49,8 +49,8 @@ public final class NeutronBgpvpnInterface extends AbstractNeutronInterface<Bgpvp
         final NeutronBgpvpn result = new NeutronBgpvpn();
         fromMdAdminAttributes(bgpvpn, result);
         result.setAutoAggregate(bgpvpn.isAutoAggregate());
-        if (bgpvpn.getVnid() != null) {
-            result.setVnid(bgpvpn.getVnid());
+        if (bgpvpn.getVni() != null) {
+            result.setVni(bgpvpn.getVni());
         }
         if (bgpvpn.getType() != null) {
             result.setType(BGPVPN_TYPE_MAP.get(bgpvpn.getType()));
@@ -111,8 +111,8 @@ public final class NeutronBgpvpnInterface extends AbstractNeutronInterface<Bgpvp
         if (bgpvpn.getAutoAggregate() != null) {
             bgpvpnBuilder.setAutoAggregate(bgpvpn.getAutoAggregate());
         }
-        if (bgpvpn.getVnid() != null) {
-            bgpvpnBuilder.setVnid(bgpvpn.getVnid());
+        if (bgpvpn.getVni() != null) {
+            bgpvpnBuilder.setVni(bgpvpn.getVni());
         }
         if (bgpvpn.getType() != null) {
             final ImmutableBiMap<String, Class<? extends BgpvpnTypeBase>> mapper = BGPVPN_TYPE_MAP.inverse();