NeutronIpSecSiteConnectionTests.runTests(baseURL);
NeutronIKEPoliciesTests.runTests(baseURL);
NeutronBgpvpnTests.runTests(baseURL);
+ NeutronBgpvpnNetworkAssociationTests.runTests(baseURL);
+ NeutronBgpvpnRouterAssociationTests.runTests(baseURL);
NeutronL2GatewayTests.runTests(baseURL);
NeutronL2GatewayConnectionTests.runTests(baseURL);
NeutronQosPolicyTests.runTests(baseURL);
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.e2etest;
+
+public class NeutronBgpvpnNetworkAssociationTests {
+ String base;
+
+ public NeutronBgpvpnNetworkAssociationTests(String base) {
+ this.base = base;
+ }
+
+ public void bgpvpn_netasso_collection_get_test() {
+ String url = base + "/bgpvpn/networkassociations";
+ HttpUtils.test_fetch(url, "BGPVPN network association collection GET failed");
+ }
+
+ public String singleton_bgpvpn_netasso_create_test() {
+ String url = base + "/bgpvpn/networkassociations";
+ String content = "{ \"bgpvpn_network_association\" : { \"id\": \"7326ef73-378d-4981-bfa2-51cb80de78e0\","
+ + " \"bgpvpn-id\": \"b472f6eb-3ff1-4c4b-8f1b-e1032e10c372\", "
+ + "\"network-id\": \"3ad0e6c3-80da-421e-8733-254e62adad16\" } }";
+ HttpUtils.test_create(url, content, "Singleton Bgpvpn network association Post Failed NB");
+ return content;
+ }
+
+ public void singleton_bgpvpn_netasso_get_with_one_query_item_test(String createJsonString) {
+ String url = base + "/bgpvpn/networkassociations";
+ HttpUtils.test_fetch_with_one_query_item(url, createJsonString, "bgpvpn_network_associations");
+ }
+
+ public void bgpvpn_netasso_element_get_test() {
+ String url = base + "/bgpvpn/networkassociations/7326ef73-378d-4981-bfa2-51cb80de78e0";
+ HttpUtils.test_fetch(url, true, "Bgpvpn network association Element Get Failed");
+ }
+
+ public void bgpvpn_netasso_element_get_test_with_added_query() {
+ String url = base + "/bgpvpn/networkassociations/7326ef73-378d-4981-bfa2-51cb80de78e0"
+ + "?fields=id&fields=bgpvpn-id&fields=network-id";
+ HttpUtils.test_fetch(url, true, "Bgpvpn network association Element Get Failed");
+ }
+
+ public void bgpvpn_netasso_element_negative_get_test() {
+ String url = base + "/bgpvpn/networkassociations/7326ef73-378d-4981-bfa2-51cb80de78e0";
+ HttpUtils.test_fetch(url, false, "Bgpvpn network association Element Negative Get Failed");
+ }
+
+ public void bgpvpn_netasso_delete_test() {
+ String url = base + "/bgpvpn/networkassociations/7326ef73-378d-4981-bfa2-51cb80de78e0";
+ HttpUtils.test_delete(url, "Bgpvpn network association Element Delete Failed");
+ }
+
+ public static void runTests(String base) {
+ NeutronBgpvpnNetworkAssociationTests bgpvpnNetAssoTester = new NeutronBgpvpnNetworkAssociationTests(base);
+ bgpvpnNetAssoTester.bgpvpn_netasso_collection_get_test();
+ String createJsonString = bgpvpnNetAssoTester.singleton_bgpvpn_netasso_create_test();
+ bgpvpnNetAssoTester.singleton_bgpvpn_netasso_get_with_one_query_item_test(createJsonString);
+ bgpvpnNetAssoTester.bgpvpn_netasso_element_get_test();
+ bgpvpnNetAssoTester.bgpvpn_netasso_element_get_test_with_added_query();
+ bgpvpnNetAssoTester.bgpvpn_netasso_delete_test();
+ bgpvpnNetAssoTester.bgpvpn_netasso_element_negative_get_test();
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.e2etest;
+
+public class NeutronBgpvpnRouterAssociationTests {
+ String base;
+
+ public NeutronBgpvpnRouterAssociationTests(String base) {
+ this.base = base;
+ }
+
+ public void bgpvpn_routerasso_collection_get_test() {
+ String url = base + "/bgpvpn/routerassociations";
+ HttpUtils.test_fetch(url, "BGPVPN router association collection GET failed");
+ }
+
+ public String singleton_bgpvpn_routerasso_create_test() {
+ String url = base + "/bgpvpn/routerassociations";
+ String content = "{ \"bgpvpn_router_association\" : { \"id\": \"8d819a7e-2f1b-4bb5-bbce-af476b237bc1\","
+ + " \"bgpvpn-id\": \"b472f6eb-3ff1-4c4b-8f1b-e1032e10c372\","
+ + " \"router-id\": \"3bbe9f3a-9c54-429f-8489-0611dbc99901\" } }";
+ HttpUtils.test_create(url, content, "Singleton Bgpvpn router association Post Failed NB");
+ return content;
+ }
+
+ public void singleton_bgpvpn_routerasso_get_with_one_query_item_test(String createJsonString) {
+ String url = base + "/bgpvpn/routerassociations";
+ HttpUtils.test_fetch_with_one_query_item(url, createJsonString, "bgpvpn_router_associations");
+ }
+
+ public void bgpvpn_routerasso_element_get_test() {
+ String url = base + "/bgpvpn/routerassociations/8d819a7e-2f1b-4bb5-bbce-af476b237bc1";
+ HttpUtils.test_fetch(url, true, "Bgpvpn router association Element Get Failed");
+ }
+
+ public void bgpvpn_routerasso_element_get_test_with_added_query() {
+ String url = base + "/bgpvpn/routerassociations/8d819a7e-2f1b-4bb5-bbce-af476b237bc1"
+ + "?fields=id&fields=bgpvpn-id&fields=router-id";
+ HttpUtils.test_fetch(url, true, "Bgpvpn router association Element Get Failed");
+ }
+
+ public void bgpvpn_routerasso_element_negative_get_test() {
+ String url = base + "/bgpvpn/routerassociations/8d819a7e-2f1b-4bb5-bbce-af476b237bc1";
+ HttpUtils.test_fetch(url, false, "Bgpvpn router association Element Negative Get Failed");
+ }
+
+ public void bgpvpn_routerasso_delete_test() {
+ String url = base + "/bgpvpn/routerassociations/8d819a7e-2f1b-4bb5-bbce-af476b237bc1";
+ HttpUtils.test_delete(url, "Bgpvpn router association Element Delete Failed");
+ }
+
+ public static void runTests(String base) {
+ NeutronBgpvpnRouterAssociationTests bgpvpnRouterAssoTester = new NeutronBgpvpnRouterAssociationTests(base);
+ bgpvpnRouterAssoTester.bgpvpn_routerasso_collection_get_test();
+ String createJsonString = bgpvpnRouterAssoTester.singleton_bgpvpn_routerasso_create_test();
+ bgpvpnRouterAssoTester.singleton_bgpvpn_routerasso_get_with_one_query_item_test(createJsonString);
+ bgpvpnRouterAssoTester.bgpvpn_routerasso_element_get_test();
+ bgpvpnRouterAssoTester.bgpvpn_routerasso_element_get_test_with_added_query();
+ bgpvpnRouterAssoTester.bgpvpn_routerasso_delete_test();
+ bgpvpnRouterAssoTester.bgpvpn_routerasso_element_negative_get_test();
+ }
+
+}
String content = "{ \"bgpvpn\": {" + " \"status\": \"ACTIVE\", \"type\": \"l3\", "
+ " \"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");
import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractConcurrentDataBrokerTest;
import org.opendaylight.neutron.northbound.api.WebInitializer;
import org.opendaylight.neutron.spi.INeutronBgpvpnCRUD;
+import org.opendaylight.neutron.spi.INeutronBgpvpnNetworkAssociationCRUD;
+import org.opendaylight.neutron.spi.INeutronBgpvpnRouterAssociationCRUD;
import org.opendaylight.neutron.spi.INeutronFirewallCRUD;
import org.opendaylight.neutron.spi.INeutronFirewallPolicyCRUD;
import org.opendaylight.neutron.spi.INeutronFirewallRuleCRUD;
import org.opendaylight.neutron.spi.INeutronVpnIpSecSiteConnectionsCRUD;
import org.opendaylight.neutron.spi.INeutronVpnServiceCRUD;
import org.opendaylight.neutron.transcriber.NeutronBgpvpnInterface;
+import org.opendaylight.neutron.transcriber.NeutronBgpvpnNetworkAssociationInterface;
+import org.opendaylight.neutron.transcriber.NeutronBgpvpnRouterAssociationInterface;
import org.opendaylight.neutron.transcriber.NeutronFirewallInterface;
import org.opendaylight.neutron.transcriber.NeutronFirewallPolicyInterface;
import org.opendaylight.neutron.transcriber.NeutronFirewallRuleInterface;
import org.opendaylight.neutron.transcriber.NeutronVpnIpSecSiteConnectionsInterface;
import org.opendaylight.neutron.transcriber.NeutronVpnServiceInterface;
+
/**
* Dependency Injection wiring for Neutron.
*
bind(INeutronLoadBalancerListenerCRUD.class).to(NeutronLoadBalancerListenerInterface.class);
bind(INeutronLoadBalancerPoolCRUD.class).to(NeutronLoadBalancerPoolInterface.class);
bind(INeutronBgpvpnCRUD.class).to(NeutronBgpvpnInterface.class);
+ bind(INeutronBgpvpnRouterAssociationCRUD.class).to(NeutronBgpvpnRouterAssociationInterface.class);
+ bind(INeutronBgpvpnNetworkAssociationCRUD.class).to(NeutronBgpvpnNetworkAssociationInterface.class);
bind(INeutronL2gatewayCRUD.class).to(NeutronL2gatewayInterface.class);
bind(INeutronL2gatewayConnectionCRUD.class).to(NeutronL2gatewayConnectionInterface.class);
bind(INeutronLoadBalancerHealthMonitorCRUD.class).to(NeutronLoadBalancerHealthMonitorInterface.class);
--- /dev/null
+/*
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module neutron-bgpvpn-network-association {
+
+ yang-version 1;
+
+ namespace "urn:opendaylight:neutron-bgpvpn-network-association";
+
+ prefix neutron-bgpvpn-network-association;
+
+ import ietf-yang-types { prefix "yang"; }
+ import neutron-attrs { prefix "attrs"; }
+
+ organization "OpenDaylight Neutron Group";
+
+ contact "Manjunath N P <manjupayala@gmail.com>";
+
+ description "This YANG module defines Openstack Liberty Neutron BGPVPN Network Association model";
+
+ revision "2019-05-02" {
+ description
+ "Initial version of Openstack Neutron Liberty BGPVPN Network Association model.";
+ }
+
+ grouping bgpvpn-network-association-attributes {
+ leaf bgpvpn-id {
+ type yang:uuid;
+ }
+ leaf network-id {
+ type yang:uuid;
+ description "Network associated to this VPN.";
+ }
+ }
+
+ grouping bgpvpn-network-associations-attributes {
+ container bgpvpn-network-associations {
+ list bgpvpn-network-association {
+ key "uuid";
+ uses attrs:base-attributes;
+ uses attrs:admin-attributes;
+ uses bgpvpn-network-association-attributes;
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module neutron-bgpvpn-router-association {
+
+ yang-version 1;
+
+ namespace "urn:opendaylight:neutron-bgpvpn-router-association";
+
+ prefix neutron-bgpvpn-router-association;
+
+ import ietf-yang-types { prefix "yang"; }
+ import neutron-attrs { prefix "attrs"; }
+
+ organization "OpenDaylight Neutron Group";
+
+ contact "Manjunath N P <manjupayala@gmail.com>";
+
+ description "This YANG module defines Openstack Liberty Neutron BGPVPN Router Association model";
+
+ revision "2019-05-02" {
+ description
+ "Initial version of Openstack Neutron Liberty BGPVPN Router Association model.";
+ }
+
+ grouping bgpvpn-router-association-attributes {
+ leaf bgpvpn-id {
+ type yang:uuid;
+ }
+ leaf router-id {
+ type yang:uuid;
+ description "Router associated to this VPN.";
+ }
+ }
+
+ grouping bgpvpn-router-associations-attributes {
+ container bgpvpn-router-associations {
+ list bgpvpn-router-association {
+ key "uuid";
+ uses attrs:base-attributes;
+ uses attrs:admin-attributes;
+ uses bgpvpn-router-association-attributes;
+ }
+ }
+ }
+}
import neutron-vpnaas { prefix "vpnaas"; }
import neutron-fwaas { prefix "fwaas"; }
import neutron-bgpvpns { prefix "bgpvpns"; }
+ import neutron-bgpvpn-network-association { prefix "bgpvpn-network-associations"; }
+ import neutron-bgpvpn-router-association { prefix "bgpvpn-router-associations"; }
import neutron-hostconfig { prefix "hostconfig"; }
import neutron-qos { prefix "qos"; }
import neutron-sfc-flow-classifier { prefix "sfc-flow-classifier"; }
uses vpnaas:ipsecpolicies-attributes;
uses vpnaas:ipsecconnections-attributes;
uses bgpvpns:bgpvpns-attributes;
+ uses bgpvpn-network-associations:bgpvpn-network-associations-attributes;
+ uses bgpvpn-router-associations:bgpvpn-router-associations-attributes;
uses l2gateways:l2gateways-attributes;
uses l2gateways:l2gateway-connections-attributes;
uses hostconfig:hostconfig-attributes;
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.spi;
+
+public interface INeutronBgpvpnNetworkAssociationCRUD extends INeutronCRUD<NeutronBgpvpnNetworkAssociation> {
+ // Nothing Here.
+ // This class is defined to use reflection like INeutronBgpvpnNetworkAssociationCRUD.class
+}
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+
+package org.opendaylight.neutron.spi;
+
+public interface INeutronBgpvpnRouterAssociationCRUD extends INeutronCRUD<NeutronBgpvpnRouterAssociation> {
+ // Nothing Here.
+ // This class is defined to use reflection like INeutronBgpvpnRouterAssociationCRUD.class
+}
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.neutron.spi;
+
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "bgpvpn_network_association")
+@XmlAccessorType(XmlAccessType.NONE)
+public final class NeutronBgpvpnNetworkAssociation extends NeutronAdminAttributes<NeutronBgpvpnNetworkAssociation>
+ implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @XmlElement(name = "bgpvpn_id")
+ String bgpvpnId;
+
+ @XmlElement(name = "network_id")
+ String networkIds;
+
+ @Override
+ public void initDefaults() {
+ }
+
+ public String getBgpvpnId() {
+ return bgpvpnId;
+ }
+
+ public void setBgpvpnId(String bgpvpnId) {
+ this.bgpvpnId = bgpvpnId;
+ }
+
+ public String getNetworkIds() {
+ return networkIds;
+ }
+
+ public void setNetworkIds(String networkIds) {
+ this.networkIds = networkIds;
+ }
+
+ @Override
+ protected boolean extractField(String field, NeutronBgpvpnNetworkAssociation ans) {
+ switch (field) {
+ case "bgpvpn_id":
+ ans.setBgpvpnId(this.getBgpvpnId());
+ break;
+ case "network_id":
+ ans.setNetworkIds(this.getNetworkIds());
+ break;
+ default:
+ return super.extractField(field, ans);
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "NeutronBgpvpnNetworkAssociation [bgpvpnNetworkAssociationUUID=" + uuid + ", bgpvpnId=" + bgpvpnId
+ + ", networkId=" + networkIds + "]";
+ }
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.spi;
+
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "bgpvpn_router_association")
+@XmlAccessorType(XmlAccessType.NONE)
+public final class NeutronBgpvpnRouterAssociation extends NeutronAdminAttributes<NeutronBgpvpnRouterAssociation>
+ implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @XmlElement(name = "bgpvpn_id")
+ String bgpvpnId;
+
+ @XmlElement(name = "router_id")
+ String routerId;
+
+ @Override
+ public void initDefaults() {
+ }
+
+ public String getBgpvpnId() {
+ return bgpvpnId;
+ }
+
+ public void setBgpvpnId(String bgpvpnId) {
+ this.bgpvpnId = bgpvpnId;
+ }
+
+ public String getRouterId() {
+ return routerId;
+ }
+
+ public void setRouterId(String routerId) {
+ this.routerId = routerId;
+ }
+
+ @Override
+ protected boolean extractField(String field, NeutronBgpvpnRouterAssociation ans) {
+ switch (field) {
+ case "bgpvpn_id":
+ ans.setBgpvpnId(this.getBgpvpnId());
+ break;
+ case "router_id":
+ ans.setRouterId(this.getRouterId());
+ break;
+ default:
+ return super.extractField(field, ans);
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "NeutronBgpvpnRouterAssociation [bgpvpnRouterAssociationUUID=" + uuid + ", bgpvpnId=" + bgpvpnId
+ + ", routerId=" + routerId + "]";
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.northbound.api;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opendaylight.neutron.spi.NeutronBgpvpnNetworkAssociation;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.NONE)
+public class NeutronBgpvpnNetworkAssociationRequest implements INeutronRequest<NeutronBgpvpnNetworkAssociation> {
+
+ @XmlElement(name = "bgpvpn_network_association")
+ NeutronBgpvpnNetworkAssociation singleton;
+
+ @XmlElement(name = "bgpvpn_network_associations")
+ List<NeutronBgpvpnNetworkAssociation> bulkRequest;
+
+ NeutronBgpvpnNetworkAssociationRequest() {
+ }
+
+ @edu.umd.cs.findbugs.annotations.SuppressWarnings("URF_UNREAD_FIELD")
+ NeutronBgpvpnNetworkAssociationRequest(NeutronBgpvpnNetworkAssociation bgpvpnNetworkAssociation) {
+ this.singleton = bgpvpnNetworkAssociation;
+ }
+
+ @edu.umd.cs.findbugs.annotations.SuppressWarnings("URF_UNREAD_FIELD")
+ NeutronBgpvpnNetworkAssociationRequest(List<NeutronBgpvpnNetworkAssociation> bulk) {
+ this.bulkRequest = bulk;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.northbound.api;
+
+import com.webcohesion.enunciate.metadata.rs.ResponseCode;
+import com.webcohesion.enunciate.metadata.rs.StatusCodes;
+import com.webcohesion.enunciate.metadata.rs.TypeHint;
+import java.net.HttpURLConnection;
+import java.util.ArrayList;
+import java.util.List;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import org.apache.aries.blueprint.annotation.service.Reference;
+import org.opendaylight.neutron.spi.INeutronBgpvpnNetworkAssociationCRUD;
+import org.opendaylight.neutron.spi.NeutronBgpvpnNetworkAssociation;
+
+/**
+ * Neutron Northbound REST APIs for BgpvpnNetworkAssociation.<br>
+ * This class provides REST APIs for managing neutron BgpvpnNetworkAssociations
+ *
+ * <br>
+ * <br>
+ * Authentication scheme : <b>HTTP Basic</b><br>
+ * Authentication realm : <b>opendaylight</b><br>
+ * Transport : <b>HTTP and HTTPS</b><br>
+ * <br>
+ * HTTPS Authentication is disabled by default. Administrator can enable it in
+ * tomcat-server.xml after adding a proper keystore / SSL certificate from a
+ * trusted authority.<br>
+ * More info :
+ * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
+ *
+ */
+@Singleton
+@Path("/bgpvpn/networkassociations")
+public final class NeutronBgpvpnNetworkAssociationsNorthbound
+ extends AbstractNeutronNorthbound<NeutronBgpvpnNetworkAssociation ,
+ NeutronBgpvpnNetworkAssociationRequest, INeutronBgpvpnNetworkAssociationCRUD> {
+
+ @Context
+ UriInfo uriInfo;
+
+ private static final String RESOURCE_NAME = "Bgpvpn Network Associations";
+
+ @Inject
+ public NeutronBgpvpnNetworkAssociationsNorthbound(@Reference INeutronBgpvpnNetworkAssociationCRUD neutronCRUD) {
+ super(neutronCRUD);
+ }
+
+ @Override
+ protected String getResourceName() {
+ return RESOURCE_NAME;
+ }
+
+ /**
+ * Returns a list of all BgpvpnNetworkAssociations.
+ */
+
+ @GET
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response listBgpvpnNetworkAssociations(
+ // return fields
+ @QueryParam("fields") List<String> fields,
+ @QueryParam("id") String queryID,
+ @QueryParam("bgpvpn_id") String queryBgpvpnId,
+ @QueryParam("network_id") String queryNetworkId,
+ // pagination
+ @QueryParam("limit") Integer limit,
+ @QueryParam("marker") String marker,
+ @DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
+ ) {
+ INeutronBgpvpnNetworkAssociationCRUD neutronBgpvpnNetworkAssociation = getNeutronCRUD();
+ List<NeutronBgpvpnNetworkAssociation> allBgpvpnNetAssos = neutronBgpvpnNetworkAssociation.getAll();
+ List<NeutronBgpvpnNetworkAssociation> ans = new ArrayList<>();
+ for (NeutronBgpvpnNetworkAssociation bgpvpnNetAsso : allBgpvpnNetAssos) {
+ //match filters:
+ if ((queryID == null || queryID.equals(bgpvpnNetAsso.getID()))
+ && (queryBgpvpnId == null || queryBgpvpnId.equals(bgpvpnNetAsso.getBgpvpnId()))
+ && (queryNetworkId == null || queryNetworkId.equals(bgpvpnNetAsso.getNetworkIds()))) {
+ if (fields.size() > 0) {
+ ans.add(bgpvpnNetAsso.extractFields(fields));
+ } else {
+ ans.add(bgpvpnNetAsso);
+ }
+ }
+ }
+
+ if (limit != null && ans.size() > 1) {
+ // Return a paginated request
+ NeutronBgpvpnNetworkAssociationRequest request = (NeutronBgpvpnNetworkAssociationRequest)
+ PaginatedRequestFactory.createRequest(limit, marker, pageReverse, uriInfo, ans,
+ NeutronBgpvpnNetworkAssociation.class);
+ return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
+ }
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronBgpvpnNetworkAssociationRequest(ans))
+ .build();
+ }
+
+ /**
+ * Returns a specific BgpvpnNetworkAssociation.
+ */
+
+ @Path("{networkassociationUUID}")
+ @GET
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response showBgpvpnNetworkAssociation(
+ @PathParam("networkassociationUUID") String bgpvpnNetworkAssociationUUID,
+ // return fields
+ @QueryParam("fields") List<String> fields) {
+ return show(bgpvpnNetworkAssociationUUID, fields);
+ }
+
+ /**
+ * Creates new BgpvpnNetworkAssociations.
+ */
+ @POST
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @TypeHint(NeutronBgpvpnNetworkAssociation.class)
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response createBgpvpnNetworkAssociations(final NeutronBgpvpnNetworkAssociationRequest input) {
+ return create(input);
+ }
+
+ /**
+ * Updates a BgpvpnNetworkAssociation.
+ */
+
+ @Path("{networkassociationUUID}")
+ @PUT
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response updateBgpvpnNetworkAssociation(@PathParam("networkassociationUUID")
+ String bgpvpnNetworkAssociationUUID,
+ final NeutronBgpvpnNetworkAssociationRequest input) {
+ return update(bgpvpnNetworkAssociationUUID, input);
+ }
+
+ /**
+ * Deletes a Bgpvpn.
+ */
+
+ @Path("{networkassociationUUID}")
+ @DELETE
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response deleteBgpvpnNetworkAssociation(
+ @PathParam("networkassociationUUID") String bgpvpnNetworkAssociationUUID) {
+ return delete(bgpvpnNetworkAssociationUUID);
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.northbound.api;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opendaylight.neutron.spi.NeutronBgpvpnRouterAssociation;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.NONE)
+public class NeutronBgpvpnRouterAssociationRequest implements INeutronRequest<NeutronBgpvpnRouterAssociation> {
+
+ @XmlElement(name = "bgpvpn_router_association")
+ NeutronBgpvpnRouterAssociation singleton;
+
+ @XmlElement(name = "bgpvpn_router_associations")
+ List<NeutronBgpvpnRouterAssociation> bulkRequest;
+
+ NeutronBgpvpnRouterAssociationRequest() {
+ }
+
+ @edu.umd.cs.findbugs.annotations.SuppressWarnings("URF_UNREAD_FIELD")
+ NeutronBgpvpnRouterAssociationRequest(NeutronBgpvpnRouterAssociation bgpvpnRouterAssociation) {
+ singleton = bgpvpnRouterAssociation;
+ }
+
+ @edu.umd.cs.findbugs.annotations.SuppressWarnings("URF_UNREAD_FIELD")
+ NeutronBgpvpnRouterAssociationRequest(List<NeutronBgpvpnRouterAssociation> bulk) {
+ bulkRequest = bulk;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.northbound.api;
+
+import com.webcohesion.enunciate.metadata.rs.ResponseCode;
+import com.webcohesion.enunciate.metadata.rs.StatusCodes;
+import com.webcohesion.enunciate.metadata.rs.TypeHint;
+import java.net.HttpURLConnection;
+import java.util.ArrayList;
+import java.util.List;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import org.apache.aries.blueprint.annotation.service.Reference;
+import org.opendaylight.neutron.spi.INeutronBgpvpnRouterAssociationCRUD;
+import org.opendaylight.neutron.spi.NeutronBgpvpnRouterAssociation;
+
+/**
+ * Neutron Northbound REST APIs for BgpvpnRouterAssociation.<br>
+ * This class provides REST APIs for managing neutron BgpvpnRouterAssociations
+ *
+ * <br>
+ * <br>
+ * Authentication scheme : <b>HTTP Basic</b><br>
+ * Authentication realm : <b>opendaylight</b><br>
+ * Transport : <b>HTTP and HTTPS</b><br>
+ * <br>
+ * HTTPS Authentication is disabled by default. Administrator can enable it in
+ * tomcat-server.xml after adding a proper keystore / SSL certificate from a
+ * trusted authority.<br>
+ * More info :
+ * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
+ *
+ */
+@Singleton
+@Path("/bgpvpn/routerassociations")
+public final class NeutronBgpvpnRouterAssociationsNorthbound extends
+ AbstractNeutronNorthbound<NeutronBgpvpnRouterAssociation,
+ NeutronBgpvpnRouterAssociationRequest, INeutronBgpvpnRouterAssociationCRUD> {
+
+ @Context
+ UriInfo uriInfo;
+
+ @Inject
+ public NeutronBgpvpnRouterAssociationsNorthbound(@Reference INeutronBgpvpnRouterAssociationCRUD neutronCRUD) {
+ super(neutronCRUD);
+ }
+
+ private static final String RESOURCE_NAME = "Bgpvpn Router Associations";
+
+ @Override
+ protected String getResourceName() {
+ return RESOURCE_NAME;
+ }
+
+ /**
+ * Returns a list of all BgpvpnRouterAssociations.
+ */
+
+ @GET
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response listBgpvpnRouterAssociations(
+ // return fields
+ @QueryParam("fields") List<String> fields,
+
+ @QueryParam("id") String queryID,
+ @QueryParam("bgpvpn_id") String queryBgpvpnId,
+ @QueryParam("router_id") String queryRouterId,
+ // pagination
+ @QueryParam("limit") Integer limit,
+ @QueryParam("marker") String marker,
+ @DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
+ ) {
+ INeutronBgpvpnRouterAssociationCRUD neutronBgpvpnRouterAssociation = getNeutronCRUD();
+ List<NeutronBgpvpnRouterAssociation> allBgpvpnRouteAssos = neutronBgpvpnRouterAssociation.getAll();
+ List<NeutronBgpvpnRouterAssociation> ans = new ArrayList<>();
+ for (NeutronBgpvpnRouterAssociation bgpvpnRouteAsso : allBgpvpnRouteAssos) {
+ //match filters:
+ if ((queryID == null || queryID.equals(bgpvpnRouteAsso.getID()))
+ && (queryBgpvpnId == null || queryBgpvpnId.equals(bgpvpnRouteAsso.getBgpvpnId()))
+ && (queryRouterId == null || queryRouterId.equals(bgpvpnRouteAsso.getRouterId()))) {
+ if (fields.size() > 0) {
+ ans.add(bgpvpnRouteAsso.extractFields(fields));
+ } else {
+ ans.add(bgpvpnRouteAsso);
+ }
+ }
+ }
+
+ if (limit != null && ans.size() > 1) {
+ // Return a paginated request
+ NeutronBgpvpnRouterAssociationRequest request = (NeutronBgpvpnRouterAssociationRequest)
+ PaginatedRequestFactory.createRequest(limit, marker, pageReverse, uriInfo, ans,
+ NeutronBgpvpnRouterAssociation.class);
+ return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
+ }
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronBgpvpnRouterAssociationRequest(ans))
+ .build();
+ }
+
+ /**
+ * Returns a specific BgpvpnRouterAssociation.
+ */
+
+ @Path("{routerassociationUUID}")
+ @GET
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response showBgpvpnRouterAssociation(
+ @PathParam("routerassociationUUID") String bgpvpnRouterAssociationUUID,
+ // return fields
+ @QueryParam("fields") List<String> fields) {
+ return show(bgpvpnRouterAssociationUUID, fields);
+ }
+
+ /**
+ * Creates new BgpvpnRouterAssociations.
+ */
+ @POST
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @TypeHint(NeutronBgpvpnRouterAssociation.class)
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response createBgpvpnRouterAssociations(final NeutronBgpvpnRouterAssociationRequest input) {
+ return create(input);
+ }
+
+ /**
+ * Updates a BgpvpnRouterAssociation.
+ */
+
+ @Path("{routerassociationUUID}")
+ @PUT
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response updateBgpvpnRouterAssociation(
+ @PathParam("routerassociationUUID") String bgpvpnRouterAssociationUUID,
+ final NeutronBgpvpnRouterAssociationRequest input) {
+ return update(bgpvpnRouterAssociationUUID, input);
+ }
+
+ /**
+ * Deletes a BgpvpnRouterAssociation.
+ */
+
+ @Path("{routerassociationUUID}")
+ @DELETE
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response deleteBgpvpn(@PathParam("routerassociationUUID") String bgpvpnRouterAssociationUUID) {
+ return delete(bgpvpnRouterAssociationUUID);
+ }
+
+}
import javax.ws.rs.core.UriInfo;
import org.apache.aries.blueprint.annotation.service.Reference;
import org.opendaylight.neutron.spi.INeutronBgpvpnCRUD;
+import org.opendaylight.neutron.spi.INeutronBgpvpnNetworkAssociationCRUD;
+import org.opendaylight.neutron.spi.INeutronBgpvpnRouterAssociationCRUD;
import org.opendaylight.neutron.spi.NeutronBgpvpn;
+import org.opendaylight.neutron.spi.NeutronBgpvpnNetworkAssociation;
+import org.opendaylight.neutron.spi.NeutronBgpvpnRouterAssociation;
+
/**
* Neutron Northbound REST APIs for Bgpvpn.
@Context
UriInfo uriInfo;
+
+ INeutronBgpvpnNetworkAssociationCRUD neutronBgpvpnNetworkAssociation;
+ INeutronBgpvpnRouterAssociationCRUD neutronBgpvpnRouterAssociation;
+
@Inject
- public NeutronBgpvpnsNorthbound(@Reference INeutronBgpvpnCRUD neutronCRUD) {
+ public NeutronBgpvpnsNorthbound(@Reference INeutronBgpvpnCRUD neutronCRUD,
+ INeutronBgpvpnNetworkAssociationCRUD neutronBgpvpnNetworkAssociation,
+ INeutronBgpvpnRouterAssociationCRUD neutronBgpvpnRouterAssociation) {
super(neutronCRUD);
+ this.neutronBgpvpnNetworkAssociation = neutronBgpvpnNetworkAssociation;
+ this.neutronBgpvpnRouterAssociation = neutronBgpvpnRouterAssociation;
+
}
@Override
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response deleteBgpvpn(@PathParam("bgpvpnUUID") String bgpvpnUUID) {
+ NeutronBgpvpnNetworkAssociationsNorthbound netAssoNorthBound =
+ new NeutronBgpvpnNetworkAssociationsNorthbound(neutronBgpvpnNetworkAssociation);
+ List<NeutronBgpvpnNetworkAssociation> allBgpvpnNetAssos = neutronBgpvpnNetworkAssociation.getAll();
+ for (NeutronBgpvpnNetworkAssociation bgpvpnNetAsso : allBgpvpnNetAssos) {
+ if (bgpvpnUUID != null && bgpvpnUUID.equals(bgpvpnNetAsso.getBgpvpnId())) {
+ netAssoNorthBound.delete(bgpvpnNetAsso.getID());
+ }
+ }
+
+ NeutronBgpvpnRouterAssociationsNorthbound routeAssoNorthBound =
+ new NeutronBgpvpnRouterAssociationsNorthbound(neutronBgpvpnRouterAssociation);
+ List<NeutronBgpvpnRouterAssociation> allBgpvpnRouteAssos = neutronBgpvpnRouterAssociation.getAll();
+ for (NeutronBgpvpnRouterAssociation bgpvpnRouteAsso : allBgpvpnRouteAssos) {
+ if (bgpvpnUUID != null && bgpvpnUUID.equals(bgpvpnRouteAsso.getBgpvpnId())) {
+ routeAssoNorthBound.delete(bgpvpnRouteAsso.getID());
+ }
+ }
return delete(bgpvpnUUID);
}
}
private final NeutronTrunksNorthbound neutronTrunksNorthbound;
private final NeutronTapServiceNorthbound neutronTapServiceNorthbound;
private final NeutronTapFlowNorthbound neutronTapFlowNorthbound;
+ private final NeutronBgpvpnNetworkAssociationsNorthbound neutronBgpvpnNetworkAssociationsNorthbound;
+ private final NeutronBgpvpnRouterAssociationsNorthbound neutronBgpvpnRouterAssociationsNorthbound;
@Inject
public NeutronNorthboundRSApplication(
NeutronQosPolicyNorthbound neutronQosPolicyNorthbound,
NeutronTrunksNorthbound neutronTrunksNorthbound,
NeutronTapServiceNorthbound neutronTapServiceNorthbound,
- NeutronTapFlowNorthbound neutronTapFlowNorthbound) {
+ NeutronTapFlowNorthbound neutronTapFlowNorthbound,
+ NeutronBgpvpnNetworkAssociationsNorthbound neutronBgpvpnNetworkAssociationsNorthbound,
+ NeutronBgpvpnRouterAssociationsNorthbound neutronBgpvpnRouterAssociationsNorthbound) {
this.neutronNetworksNorthbound = neutronNetworksNorthbound;
this.neutronSubnetsNorthbound = neutronSubnetsNorthbound;
this.neutronTrunksNorthbound = neutronTrunksNorthbound;
this.neutronTapServiceNorthbound = neutronTapServiceNorthbound;
this.neutronTapFlowNorthbound = neutronTapFlowNorthbound;
+ this.neutronBgpvpnNetworkAssociationsNorthbound = neutronBgpvpnNetworkAssociationsNorthbound;
+ this.neutronBgpvpnRouterAssociationsNorthbound = neutronBgpvpnRouterAssociationsNorthbound;
}
@Override
@Override
public Set<Object> getSingletons() {
- return ImmutableSet.builderWithExpectedSize(32)
+ return ImmutableSet.builderWithExpectedSize(34)
.add(getMOXyJsonProvider())
// Northbound URIs JAX RS Resources:
.add(neutronNetworksNorthbound)
.add(neutronVpnIpSecPoliciesNorthbound)
.add(neutronVpnIpSecSiteConnectionsNorthbound)
.add(neutronBgpvpnsNorthbound)
+ .add(neutronBgpvpnNetworkAssociationsNorthbound)
+ .add(neutronBgpvpnRouterAssociationsNorthbound)
.add(neutronL2gatewayNorthbound)
.add(neutronL2gatewayConnectionNorthbound)
.add(neutronSFCFlowClassifiersNorthbound)
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.transcriber;
+
+import java.util.Collection;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import org.apache.aries.blueprint.annotation.service.Service;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.neutron.spi.INeutronBgpvpnNetworkAssociationCRUD;
+import org.opendaylight.neutron.spi.NeutronBgpvpnNetworkAssociation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpn.network.association.rev190502.bgpvpn.network.associations.attributes.BgpvpnNetworkAssociations;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpn.network.association.rev190502.bgpvpn.network.associations.attributes.bgpvpn.network.associations.BgpvpnNetworkAssociation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpn.network.association.rev190502.bgpvpn.network.associations.attributes.bgpvpn.network.associations.BgpvpnNetworkAssociationBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpn.network.association.rev190502.bgpvpn.network.associations.attributes.bgpvpn.network.associations.BgpvpnNetworkAssociationKey;
+
+@Singleton
+@Service(classes = INeutronBgpvpnNetworkAssociationCRUD.class)
+public final class NeutronBgpvpnNetworkAssociationInterface extends AbstractNeutronInterface<BgpvpnNetworkAssociation,
+ BgpvpnNetworkAssociations, BgpvpnNetworkAssociationKey, NeutronBgpvpnNetworkAssociation>
+ implements INeutronBgpvpnNetworkAssociationCRUD {
+
+ @Inject
+ public NeutronBgpvpnNetworkAssociationInterface(DataBroker db) {
+ super(BgpvpnNetworkAssociationBuilder.class, db);
+ }
+
+ @Override
+ protected Collection<BgpvpnNetworkAssociation> getDataObjectList(
+ BgpvpnNetworkAssociations bgpvpnNetworkAssociations) {
+ return bgpvpnNetworkAssociations.nonnullBgpvpnNetworkAssociation().values();
+ }
+
+ @Override
+ protected NeutronBgpvpnNetworkAssociation fromMd(BgpvpnNetworkAssociation bgpvpnNetworkAssociation) {
+ final NeutronBgpvpnNetworkAssociation result = new NeutronBgpvpnNetworkAssociation();
+ fromMdBaseAttributes(bgpvpnNetworkAssociation, result);
+ fromMdAdminAttributes(bgpvpnNetworkAssociation, result);
+ if (bgpvpnNetworkAssociation.getBgpvpnId() != null) {
+ result.setBgpvpnId(bgpvpnNetworkAssociation.getBgpvpnId().getValue());
+ }
+ if (bgpvpnNetworkAssociation.getNetworkId() != null) {
+ result.setNetworkIds(bgpvpnNetworkAssociation.getNetworkId().getValue());
+ }
+ return result;
+ }
+
+ @Override
+ protected BgpvpnNetworkAssociation toMd(NeutronBgpvpnNetworkAssociation bgpvpnNetworkAssociation) {
+ final BgpvpnNetworkAssociationBuilder bgpvpnNetworkAssociationBuilder = new BgpvpnNetworkAssociationBuilder();
+ toMdBaseAttributes(bgpvpnNetworkAssociation, bgpvpnNetworkAssociationBuilder);
+ toMdAdminAttributes(bgpvpnNetworkAssociation, bgpvpnNetworkAssociationBuilder);
+ if (bgpvpnNetworkAssociation.getBgpvpnId() != null) {
+ bgpvpnNetworkAssociationBuilder.setBgpvpnId(toUuid(bgpvpnNetworkAssociation.getBgpvpnId()));
+ }
+ if (bgpvpnNetworkAssociation.getNetworkIds() != null) {
+ bgpvpnNetworkAssociationBuilder.setNetworkId(toUuid(bgpvpnNetworkAssociation.getNetworkIds()));
+ }
+ return bgpvpnNetworkAssociationBuilder.build();
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.transcriber;
+
+import java.util.Collection;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import org.apache.aries.blueprint.annotation.service.Service;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.neutron.spi.INeutronBgpvpnRouterAssociationCRUD;
+import org.opendaylight.neutron.spi.NeutronBgpvpnRouterAssociation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpn.router.association.rev190502.bgpvpn.router.associations.attributes.BgpvpnRouterAssociations;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpn.router.association.rev190502.bgpvpn.router.associations.attributes.bgpvpn.router.associations.BgpvpnRouterAssociation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpn.router.association.rev190502.bgpvpn.router.associations.attributes.bgpvpn.router.associations.BgpvpnRouterAssociationBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpn.router.association.rev190502.bgpvpn.router.associations.attributes.bgpvpn.router.associations.BgpvpnRouterAssociationKey;
+
+@Singleton
+@Service(classes = INeutronBgpvpnRouterAssociationCRUD.class)
+public final class NeutronBgpvpnRouterAssociationInterface extends AbstractNeutronInterface<BgpvpnRouterAssociation,
+ BgpvpnRouterAssociations, BgpvpnRouterAssociationKey, NeutronBgpvpnRouterAssociation>
+ implements INeutronBgpvpnRouterAssociationCRUD {
+
+ @Inject
+ public NeutronBgpvpnRouterAssociationInterface(DataBroker db) {
+ super(BgpvpnRouterAssociationBuilder.class, db);
+ }
+
+ @Override
+ protected Collection<BgpvpnRouterAssociation> getDataObjectList(BgpvpnRouterAssociations bgpvpnRouterAssociations) {
+ return bgpvpnRouterAssociations.nonnullBgpvpnRouterAssociation().values();
+ }
+
+ @Override
+ protected NeutronBgpvpnRouterAssociation fromMd(BgpvpnRouterAssociation bgpvpnRouterAssociation) {
+ final NeutronBgpvpnRouterAssociation result = new NeutronBgpvpnRouterAssociation();
+ fromMdBaseAttributes(bgpvpnRouterAssociation, result);
+ fromMdAdminAttributes(bgpvpnRouterAssociation, result);
+ if (bgpvpnRouterAssociation.getBgpvpnId() != null) {
+ result.setBgpvpnId(bgpvpnRouterAssociation.getBgpvpnId().getValue());
+ }
+ if (bgpvpnRouterAssociation.getRouterId() != null) {
+ result.setRouterId(bgpvpnRouterAssociation.getRouterId().getValue());
+ }
+ return result;
+ }
+
+ @Override
+ protected BgpvpnRouterAssociation toMd(NeutronBgpvpnRouterAssociation bgpvpnRouterAssociation) {
+ final BgpvpnRouterAssociationBuilder bgpvpnRouterAssociationBuilder = new BgpvpnRouterAssociationBuilder();
+ toMdBaseAttributes(bgpvpnRouterAssociation, bgpvpnRouterAssociationBuilder);
+ toMdAdminAttributes(bgpvpnRouterAssociation, bgpvpnRouterAssociationBuilder);
+ if (bgpvpnRouterAssociation.getBgpvpnId() != null) {
+ bgpvpnRouterAssociationBuilder.setBgpvpnId(toUuid(bgpvpnRouterAssociation.getBgpvpnId()));
+ }
+ if (bgpvpnRouterAssociation.getRouterId() != null) {
+ bgpvpnRouterAssociationBuilder.setRouterId(toUuid(bgpvpnRouterAssociation.getRouterId()));
+ }
+ return bgpvpnRouterAssociationBuilder.build();
+ }
+
+}