From 8de43fbe42af2b016695d14b281f6bbe5addd4e1 Mon Sep 17 00:00:00 2001 From: Ed Warnicke Date: Wed, 10 Dec 2014 10:55:24 -0600 Subject: [PATCH] neutron now works with jetty This patch makes the feature neutron-northbound work with jetty. It also moves the adsal to port 8282, and the stock karaf jetty to port 8080 (in additional to 8181). GET, POST, and PUT for neutron network has been tested: GET: curl -u admin:admin http://127.0.0.1:8080/controller/nb/v2/neutron/networks POST: curl -u admin:admin -H "Content-Type: application/json" -d @network.post http://127.0.0.1:8080/controller/nb/v2/neutron/networks PUT: curl -u admin:admin -H "Content-Type: application/json" -d @network2.post -X PUT http://127.0.0.1:8080/controller/nb/v2/neutron/networks/d6220bbb-35f3-48ab-8eae-69c60aef3544 where: cat network.post {"network": {"status": "ACTIVE", "subnets": [], "name": "net-dedicated", "provider:physical_network": null, "admin_state_up": true, "tenant_id": "aa902936679e4ea29bfe1158e3450a13", "provider:network_type": "gre", "router:external": false, "shared": false, "id": "d6220bbb-35f3-48ab-8eae-69c60aef3544", "provider:segmentation_id": 1}} cat network2.post {"network": {"subnets": [], "name": "net-dedicated", "provider:physical_network": null, "admin_state_up": true, "provider:network_type": "gre", "router:external": true, "shared": false, "provider:segmentation_id": 1}} This patch should not be merged before 2/1/2015 to allow time for discussion. Change-Id: I6a003c2868adc5b060f05d228a56a744c092e963 Signed-off-by: Ed Warnicke --- features/neutron/pom.xml | 11 ++ .../neutron/src/main/resources/features.xml | 7 +- .../resources/configuration/tomcat-server.xml | 4 +- .../src/main/resources/etc/jetty.xml | 106 ++++++++++++++++++ karaf/opendaylight-karaf/pom.xml | 8 ++ opendaylight/commons/opendaylight/pom.xml | 9 ++ .../src/main/resources/WEB-INF/web.xml | 66 ++++++----- 7 files changed, 179 insertions(+), 32 deletions(-) create mode 100644 karaf/opendaylight-karaf-resources/src/main/resources/etc/jetty.xml diff --git a/features/neutron/pom.xml b/features/neutron/pom.xml index 642ce98351..cd7dce53d4 100644 --- a/features/neutron/pom.xml +++ b/features/neutron/pom.xml @@ -16,6 +16,17 @@ + + org.opendaylight.aaa + features-aaa + ${aaa.version} + features + xml + + + org.opendaylight.controller + networkconfig.neutron + org.osgi org.osgi.core diff --git a/features/neutron/src/main/resources/features.xml b/features/neutron/src/main/resources/features.xml index 263f907cee..b244d4d2a9 100644 --- a/features/neutron/src/main/resources/features.xml +++ b/features/neutron/src/main/resources/features.xml @@ -3,15 +3,19 @@ + mvn:org.opendaylight.aaa/features-aaa/${aaa.version}/xml/features odl-neutron-api odl-neutron-northbound odl-neutron-implementation + odl-aaa-authn + war odl-neutron-api mvn:org.eclipse.persistence/org.eclipse.persistence.moxy/${eclipse.persistence.version} mvn:org.eclipse.persistence/org.eclipse.persistence.core/${eclipse.persistence.version} + mvn:org.eclipse.persistence/org.eclipse.persistence.antlr/${eclipse.persistence.version} mvn:org.opendaylight.controller/networkconfig.neutron.northbound/${networkconfig.neutron.northbound.version} mvn:com.sun.jersey/jersey-core/${jersey.version} mvn:com.sun.jersey/jersey-server/${jersey.version} @@ -26,7 +30,8 @@ odl-neutron-api + war mvn:org.opendaylight.controller/networkconfig.neutron.implementation/${networkconfig.neutron.implementation.version} mvn:org.osgi/org.osgi.core/${osgi.core.version} - \ No newline at end of file + diff --git a/karaf/opendaylight-karaf-resources/src/main/resources/configuration/tomcat-server.xml b/karaf/opendaylight-karaf-resources/src/main/resources/configuration/tomcat-server.xml index fbcd0a4c77..5092a5eee1 100644 --- a/karaf/opendaylight-karaf-resources/src/main/resources/configuration/tomcat-server.xml +++ b/karaf/opendaylight-karaf-resources/src/main/resources/configuration/tomcat-server.xml @@ -26,9 +26,9 @@ - + redirectPort="8663" /> + + + + + + + + + + + + + + + + + + + + + 300000 + 2 + false + 8543 + 20000 + 5000 + + + + + + + + + + + + + 300000 + 2 + false + 8443 + 20000 + 5000 + + + + + + + + + + + + + + + karaf + karaf + + + org.apache.karaf.jaas.boot.principal.RolePrincipal + + + + + + + + + + default + karaf + + + org.apache.karaf.jaas.boot.principal.RolePrincipal + + + + + + + + diff --git a/karaf/opendaylight-karaf/pom.xml b/karaf/opendaylight-karaf/pom.xml index e0ea4c0edf..9bf2309b6f 100644 --- a/karaf/opendaylight-karaf/pom.xml +++ b/karaf/opendaylight-karaf/pom.xml @@ -121,6 +121,14 @@ xml + + org.opendaylight.controller + features-neutron + features + xml + runtime + + diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index 32aa9a3efc..ba5d69ac46 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -1342,6 +1342,15 @@ runtime + + org.opendaylight.controller + features-neutron + features + xml + runtime + ${networkconfig.neutron.version} + + org.openjdk.jmh diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/resources/WEB-INF/web.xml b/opendaylight/networkconfiguration/neutron/northbound/src/main/resources/WEB-INF/web.xml index dccd1332c9..08a314a42e 100644 --- a/opendaylight/networkconfiguration/neutron/northbound/src/main/resources/WEB-INF/web.xml +++ b/opendaylight/networkconfiguration/neutron/northbound/src/main/resources/WEB-INF/web.xml @@ -9,6 +9,11 @@ javax.ws.rs.Application org.opendaylight.controller.networkconfig.neutron.northbound.NeutronNorthboundRSApplication + + + com.sun.jersey.spi.container.ContainerRequestFilters + org.opendaylight.aaa.sts.TokenAuthFilter + 1 @@ -16,34 +21,37 @@ JAXRSNeutron /* - - - NB api - /* - - - System-Admin - Network-Admin - Network-Operator - Container-User - - - - - System-Admin - - - Network-Admin - - - Network-Operator - - - Container-User - - - BASIC - opendaylight - + + cross-origin-restconf + org.eclipse.jetty.servlets.CrossOriginFilter + + allowedOrigins + * + + + allowedMethods + GET,POST,OPTIONS,DELETE,PUT,HEAD + + + allowedHeaders + origin, content-type, accept, authorization + + + + cross-origin-restconf + /* + + + + NB api + /* + POST + GET + PUT + PATCH + DELETE + HEAD + + -- 2.36.6