From 600b62a8769c68a89fc2f253016e90029783676a Mon Sep 17 00:00:00 2001 From: Deepthi V V Date: Thu, 21 Sep 2017 12:41:24 +0530 Subject: [PATCH] Support for vni attribute in BGPVPN - 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 Signed-off-by: Deepthi V V --- .../neutron/e2etest/NeutronBgpvpnTests.java | 6 ++++-- model/src/main/yang/neutron-bgpvpns.yang | 2 +- .../neutron/spi/NeutronBgpvpn.java | 18 +++++++++--------- .../transcriber/NeutronBgpvpnInterface.java | 8 ++++---- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/integration/test-standalone/src/main/java/org/opendaylight/neutron/e2etest/NeutronBgpvpnTests.java b/integration/test-standalone/src/main/java/org/opendaylight/neutron/e2etest/NeutronBgpvpnTests.java index a4c8b7acc..e31cf28f9 100644 --- a/integration/test-standalone/src/main/java/org/opendaylight/neutron/e2etest/NeutronBgpvpnTests.java +++ b/integration/test-standalone/src/main/java/org/opendaylight/neutron/e2etest/NeutronBgpvpnTests.java @@ -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"); } diff --git a/model/src/main/yang/neutron-bgpvpns.yang b/model/src/main/yang/neutron-bgpvpns.yang index 3059b025d..67c506449 100644 --- a/model/src/main/yang/neutron-bgpvpns.yang +++ b/model/src/main/yang/neutron-bgpvpns.yang @@ -78,7 +78,7 @@ module neutron-bgpvpns { type string; description "list route-distinguishers"; } - leaf vnid { + leaf vni { type uint32; description "globally assigned VxLanId"; } diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronBgpvpn.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronBgpvpn.java index 7828d9724..ebf11b2bd 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronBgpvpn.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronBgpvpn.java @@ -40,8 +40,8 @@ public final class NeutronBgpvpn extends NeutronAdminAttributes { @XmlElement(name = "route_distinguishers") List 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 { 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 { 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 { 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 + "]"; } } diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java index 8bab3a484..c0dace9c5 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java @@ -49,8 +49,8 @@ public final class NeutronBgpvpnInterface extends AbstractNeutronInterface> mapper = BGPVPN_TYPE_MAP.inverse(); -- 2.36.6