Separated OpenstackInterface feature from OpenstackNetworking application.
Change-Id: I4766de7e93c5b432c50a2167b9a9d9d4605b1ad2
diff --git a/apps/cordvtn/app.xml b/apps/cordvtn/app.xml
index 26e6839..4efb8a4 100644
--- a/apps/cordvtn/app.xml
+++ b/apps/cordvtn/app.xml
@@ -18,7 +18,7 @@
category="default" url="http://onosproject.org"
featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
features="${project.artifactId}"
- apps="org.onosproject.ovsdb-base,org.onosproject.openstacknetworking,org.onosproject.dhcp">
+ apps="org.onosproject.ovsdb-base,org.onosproject.openstackinterface,org.onosproject.dhcp">
<description>${project.description}</description>
<artifact>mvn:${project.groupId}/onos-app-cordvtn/${project.version}</artifact>
</app>
diff --git a/apps/cordvtn/pom.xml b/apps/cordvtn/pom.xml
index 560bdc0..b5c572e 100644
--- a/apps/cordvtn/pom.xml
+++ b/apps/cordvtn/pom.xml
@@ -103,7 +103,7 @@
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
- <artifactId>onos-app-openstacknetworking-api</artifactId>
+ <artifactId>onos-app-openstackinterface-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordService.java b/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordService.java
index d661966..49ed560 100644
--- a/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordService.java
+++ b/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordService.java
@@ -19,8 +19,8 @@
import org.onlab.packet.IpAddress;
import org.onlab.packet.IpPrefix;
import org.onosproject.net.Host;
-import org.onosproject.openstacknetworking.OpenstackNetwork;
-import org.onosproject.openstacknetworking.OpenstackSubnet;
+import org.onosproject.openstackinterface.OpenstackNetwork;
+import org.onosproject.openstackinterface.OpenstackSubnet;
import java.util.Map;
import java.util.Objects;
diff --git a/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtn.java b/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtn.java
index a06564a..39a5e69 100644
--- a/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtn.java
+++ b/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtn.java
@@ -62,10 +62,10 @@
import org.onosproject.net.packet.PacketService;
import org.onosproject.net.provider.AbstractProvider;
import org.onosproject.net.provider.ProviderId;
-import org.onosproject.openstacknetworking.OpenstackNetworkingService;
-import org.onosproject.openstacknetworking.OpenstackNetwork;
-import org.onosproject.openstacknetworking.OpenstackPort;
-import org.onosproject.openstacknetworking.OpenstackSubnet;
+import org.onosproject.openstackinterface.OpenstackInterfaceService;
+import org.onosproject.openstackinterface.OpenstackNetwork;
+import org.onosproject.openstackinterface.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackSubnet;
import org.slf4j.Logger;
import java.util.List;
@@ -123,7 +123,7 @@
protected GroupService groupService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected OpenstackNetworkingService openstackService;
+ protected OpenstackInterfaceService openstackService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected DhcpService dhcpService;
diff --git a/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java b/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java
index f6c23b4..4c67587 100644
--- a/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java
+++ b/apps/cordvtn/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java
@@ -71,8 +71,8 @@
import org.onosproject.net.group.GroupDescription;
import org.onosproject.net.group.GroupKey;
import org.onosproject.net.group.GroupService;
-import org.onosproject.openstacknetworking.OpenstackNetwork;
-import org.onosproject.openstacknetworking.OpenstackSubnet;
+import org.onosproject.openstackinterface.OpenstackNetwork;
+import org.onosproject.openstackinterface.OpenstackSubnet;
import org.slf4j.Logger;
import java.util.ArrayList;
diff --git a/apps/openstackinterface/api/pom.xml b/apps/openstackinterface/api/pom.xml
new file mode 100644
index 0000000..0cb43e3
--- /dev/null
+++ b/apps/openstackinterface/api/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2016 Open Networking Laboratory
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-app-openstackinterface</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>onos-app-openstackinterface-api</artifactId>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-core-serializers</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
+
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackExternalGateway.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackExternalGateway.java
similarity index 98%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackExternalGateway.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackExternalGateway.java
index 4005f88..ee4c59e 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackExternalGateway.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackExternalGateway.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackFloatingIP.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackFloatingIP.java
similarity index 98%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackFloatingIP.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackFloatingIP.java
index 569c885..4726254 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackFloatingIP.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackFloatingIP.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import org.onlab.packet.Ip4Address;
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackNetworkingService.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackInterfaceService.java
similarity index 81%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackNetworkingService.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackInterfaceService.java
index 6bd6bf8..f565fb2 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackNetworkingService.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackInterfaceService.java
@@ -13,17 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import org.onosproject.net.Port;
import java.util.Collection;
-import java.util.Map;
/**
* Handles port management REST API from Openstack for VMs.
*/
-public interface OpenstackNetworkingService {
+public interface OpenstackInterfaceService {
/**
* Returns port information list for the network ID given.
@@ -101,23 +100,6 @@
OpenstackRouter router(String routerId);
/**
- * Retruns OpenstackPortInfo map.
- *
- * @return OpenstackPortInfo map
- */
- Map<String, OpenstackPortInfo> openstackPortInfo();
-
- /**
- * Sets configurations specified by net-config.xml file.
- *
- * @param neutronUrl neutron server url
- * @param keystoneUrl keystone server url
- * @param userName horizon user name
- * @param pass horizon passowrd
- */
- void setConfigurations(String neutronUrl, String keystoneUrl, String userName, String pass);
-
- /**
* Returns Security Group information of the security groupd id given.
*
* @param id security group id
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackNetwork.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackNetwork.java
similarity index 98%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackNetwork.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackNetwork.java
index 23a0674..e36ef42 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackNetwork.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackNetwork.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import java.util.Collection;
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackNetworkingConfig.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackNetworkingConfig.java
similarity index 82%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackNetworkingConfig.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackNetworkingConfig.java
index 37e9c06..042112d 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackNetworkingConfig.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackNetworkingConfig.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.config.Config;
@@ -23,7 +23,6 @@
* Handles configuration for OpenstackSwitching app.
*/
public class OpenstackNetworkingConfig extends Config<ApplicationId> {
- public static final String DONOTPUSH = "do_not_push_flows";
public static final String NEUTRON_SERVER = "neutron_server";
public static final String KEYSTONE_SERVER = "keystone_server";
public static final String USER_NAME = "user_name";
@@ -31,16 +30,6 @@
public static final String PHYSICAL_ROUTER_MAC = "physicalRouterMac";
/**
- * Returns the flag whether the app pushes flows or not.
- *
- * @return the flag or false if not set
- */
- public boolean doNotPushFlows() {
- String flag = get(DONOTPUSH, "false");
- return Boolean.valueOf(flag);
- }
-
- /**
* Returns the Neutron server IP address.
*
* @return Neutron server IP
@@ -84,15 +73,6 @@
public String physicalRouterMac() {
return get(PHYSICAL_ROUTER_MAC, "");
}
- /**
- * Sets the flag whether the app pushes flows or not.
- *
- * @param flag the flag whether the app pushes flows or not
- * @return self
- */
- public BasicElementConfig doNotPushFlows(boolean flag) {
- return (BasicElementConfig) setOrClear(DONOTPUSH, flag);
- }
/**
* Sets the neutron server IP address.
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackPort.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackPort.java
similarity index 99%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackPort.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackPort.java
index 13bcb0e..68fa3c9 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackPort.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackPort.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import com.google.common.collect.Maps;
import org.onlab.packet.Ip4Address;
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRouter.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackRouter.java
similarity index 98%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRouter.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackRouter.java
index 5230c18..b5e081e 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRouter.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackRouter.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import java.util.Objects;
import static com.google.common.base.Preconditions.checkNotNull;
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRouterInterface.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackRouterInterface.java
similarity index 98%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRouterInterface.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackRouterInterface.java
index 78ab815..37e3478 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRouterInterface.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackRouterInterface.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import java.util.Objects;
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSecurityGroup.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackSecurityGroup.java
similarity index 98%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSecurityGroup.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackSecurityGroup.java
index 358b92b..47a30a4 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSecurityGroup.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackSecurityGroup.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import java.util.Collection;
import java.util.Collections;
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSecurityGroupRule.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackSecurityGroupRule.java
similarity index 98%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSecurityGroupRule.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackSecurityGroupRule.java
index 8b9da8f..42a4a44 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSecurityGroupRule.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackSecurityGroupRule.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import java.util.Objects;
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSubnet.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackSubnet.java
similarity index 98%
rename from apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSubnet.java
rename to apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackSubnet.java
index 8223711..9162916 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSubnet.java
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/OpenstackSubnet.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking;
+package org.onosproject.openstackinterface;
import org.onlab.packet.Ip4Address;
diff --git a/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/package-info.java b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/package-info.java
new file mode 100644
index 0000000..0507571
--- /dev/null
+++ b/apps/openstackinterface/api/src/main/java/org/onosproject/openstackinterface/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Application for OpenstackRouting.
+ */
+package org.onosproject.openstackinterface;
\ No newline at end of file
diff --git a/apps/openstackinterface/app/pom.xml b/apps/openstackinterface/app/pom.xml
new file mode 100644
index 0000000..77715be
--- /dev/null
+++ b/apps/openstackinterface/app/pom.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2015-2016 Open Networking Laboratory
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-app-openstackinterface</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>onos-app-openstackinterface-app</artifactId>
+ <packaging>bundle</packaging>
+
+
+ <properties>
+ <onos.app.name>org.onosproject.openstackinterface</onos.app.name>
+ <onos.app.category>default</onos.app.category>
+ <onos.app.url>http://onosproject.org</onos.app.url>
+ <onos.app.readme>Openstack Interface Application.</onos.app.readme>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-app-openstackinterface-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onlab-rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-servlet</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-app-dhcp-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>1.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-core</artifactId>
+ <version>1.19</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onlab-misc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+
+</project>
diff --git a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackNetworkingManager.java b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/OpenstackInterfaceManager.java
similarity index 78%
rename from apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackNetworkingManager.java
rename to apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/OpenstackInterfaceManager.java
index 5cfc784..9b99b81 100644
--- a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackNetworkingManager.java
+++ b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/OpenstackInterfaceManager.java
@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking.web;
+package org.onosproject.openstackinterface;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
@@ -30,26 +31,30 @@
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.net.Port;
-import org.onosproject.net.driver.DriverService;
-import org.onosproject.openstacknetworking.OpenstackNetwork;
-import org.onosproject.openstacknetworking.OpenstackNetworkingService;
-import org.onosproject.openstacknetworking.OpenstackPort;
-import org.onosproject.openstacknetworking.OpenstackPortInfo;
-import org.onosproject.openstacknetworking.OpenstackRouter;
-import org.onosproject.openstacknetworking.OpenstackSecurityGroup;
-import org.onosproject.openstacknetworking.OpenstackSubnet;
-import org.onosproject.openstacknetworking.OpenstackSwitchingService;
+import org.onosproject.net.config.ConfigFactory;
+import org.onosproject.net.config.NetworkConfigEvent;
+import org.onosproject.net.config.NetworkConfigListener;
+import org.onosproject.net.config.NetworkConfigRegistry;
+import org.onosproject.openstackinterface.web.OpenstackNetworkCodec;
+import org.onosproject.openstackinterface.web.OpenstackPortCodec;
+import org.onosproject.openstackinterface.web.OpenstackRouterCodec;
+import org.onosproject.openstackinterface.web.OpenstackSecurityGroupCodec;
+import org.onosproject.openstackinterface.web.OpenstackSubnetCodec;
import org.slf4j.Logger;
import javax.ws.rs.core.MediaType;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
import java.util.stream.Collectors;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.net.MediaType.JSON_UTF_8;
+import static org.onlab.util.Tools.groupedThreads;
+import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY;
import static org.slf4j.LoggerFactory.getLogger;
/**
@@ -58,7 +63,7 @@
*/
@Service
@Component(immediate = true)
-public class OpenstackNetworkingManager implements OpenstackNetworkingService {
+public class OpenstackInterfaceManager implements OpenstackInterfaceService {
private static final String URI_NETWORKS = "networks";
private static final String URI_PORTS = "ports";
@@ -91,20 +96,39 @@
protected CoreService coreService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected DriverService driverService;
+ protected NetworkConfigRegistry cfgService;
- protected OpenstackSwitchingService openstackSwitchingService;
+ private InternalConfigListener internalConfigListener = new InternalConfigListener();
+ private ExecutorService networkEventExcutorService =
+ Executors.newSingleThreadExecutor(groupedThreads("onos/openstackinterface", "config-event"));
+
+ private final Set<ConfigFactory> factories = ImmutableSet.of(
+ new ConfigFactory<ApplicationId, OpenstackNetworkingConfig>(APP_SUBJECT_FACTORY,
+ OpenstackNetworkingConfig.class,
+ "openstackinterface") {
+ @Override
+ public OpenstackNetworkingConfig createConfig() {
+ return new OpenstackNetworkingConfig();
+ }
+ }
+ );
+
@Activate
protected void activate() {
appId = coreService
- .registerApplication("org.onosproject.openstacknetworking");
+ .registerApplication("org.onosproject.openstackinterface");
+
+ factories.forEach(cfgService::registerConfigFactory);
+ cfgService.addListener(internalConfigListener);
log.info("started");
}
@Deactivate
protected void deactivate() {
+ cfgService.removeListener(internalConfigListener);
+ factories.forEach(cfgService::unregisterConfigFactory);
log.info("stopped");
}
@@ -355,16 +379,31 @@
.findAny().orElse(null);
}
- @Override
- public Map<String, OpenstackPortInfo> openstackPortInfo() {
- return openstackSwitchingService.openstackPortInfo();
- }
+ private class InternalConfigListener implements NetworkConfigListener {
- @Override
- public void setConfigurations(String neutronUrl, String keystoneUrl, String userName, String pass) {
- this.neutronUrl = checkNotNull(neutronUrl);
- this.keystoneUrl = checkNotNull(keystoneUrl);
- this.userName = checkNotNull(userName);
- this.pass = checkNotNull(pass);
+ public void configureNetwork() {
+ OpenstackNetworkingConfig cfg =
+ cfgService.getConfig(appId, OpenstackNetworkingConfig.class);
+ if (cfg == null) {
+ log.error("There is no openstack server information in config.");
+ return;
+ }
+
+ neutronUrl = checkNotNull(cfg.neutronServer());
+ keystoneUrl = checkNotNull(cfg.keystoneServer());
+ userName = checkNotNull(cfg.userName());
+ pass = checkNotNull(cfg.password());
+ }
+
+ @Override
+ public void event(NetworkConfigEvent event) {
+ if (((event.type() == NetworkConfigEvent.Type.CONFIG_ADDED ||
+ event.type() == NetworkConfigEvent.Type.CONFIG_UPDATED)) &&
+ event.configClass().equals(OpenstackNetworkingConfig.class)) {
+
+ log.info("Network configuration changed");
+ networkEventExcutorService.execute(this::configureNetwork);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/package-info.java b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/package-info.java
new file mode 100644
index 0000000..0507571
--- /dev/null
+++ b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Application for OpenstackRouting.
+ */
+package org.onosproject.openstackinterface;
\ No newline at end of file
diff --git a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackNetworkCodec.java b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackNetworkCodec.java
similarity index 95%
rename from apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackNetworkCodec.java
rename to apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackNetworkCodec.java
index 8e5d3af..18c73a6 100644
--- a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackNetworkCodec.java
+++ b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackNetworkCodec.java
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking.web;
+package org.onosproject.openstackinterface.web;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onosproject.codec.CodecContext;
import org.onosproject.codec.JsonCodec;
-import org.onosproject.openstacknetworking.OpenstackNetwork;
+import org.onosproject.openstackinterface.OpenstackNetwork;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortCodec.java b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackPortCodec.java
similarity index 97%
rename from apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortCodec.java
rename to apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackPortCodec.java
index 1ac3127..1c107ac 100644
--- a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortCodec.java
+++ b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackPortCodec.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking.web;
+package org.onosproject.openstackinterface.web;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
@@ -25,7 +25,7 @@
import org.onlab.packet.MacAddress;
import org.onosproject.codec.CodecContext;
import org.onosproject.codec.JsonCodec;
-import org.onosproject.openstacknetworking.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackPort;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackRouterCodec.java b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackRouterCodec.java
similarity index 95%
rename from apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackRouterCodec.java
rename to apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackRouterCodec.java
index 60600bf..6a1750e 100644
--- a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackRouterCodec.java
+++ b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackRouterCodec.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking.web;
+package org.onosproject.openstackinterface.web;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
@@ -22,8 +22,8 @@
import org.onlab.packet.Ip4Address;
import org.onosproject.codec.CodecContext;
import org.onosproject.codec.JsonCodec;
-import org.onosproject.openstacknetworking.OpenstackExternalGateway;
-import org.onosproject.openstacknetworking.OpenstackRouter;
+import org.onosproject.openstackinterface.OpenstackExternalGateway;
+import org.onosproject.openstackinterface.OpenstackRouter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static com.google.common.base.Preconditions.checkNotNull;
diff --git a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackRouterInterfaceCodec.java b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackRouterInterfaceCodec.java
similarity index 94%
rename from apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackRouterInterfaceCodec.java
rename to apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackRouterInterfaceCodec.java
index 5be664f..01e8d7e 100644
--- a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackRouterInterfaceCodec.java
+++ b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackRouterInterfaceCodec.java
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking.web;
+package org.onosproject.openstackinterface.web;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onosproject.codec.CodecContext;
import org.onosproject.codec.JsonCodec;
-import org.onosproject.openstacknetworking.OpenstackRouterInterface;
+import org.onosproject.openstackinterface.OpenstackRouterInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static com.google.common.base.Preconditions.checkNotNull;
diff --git a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackSecurityGroupCodec.java b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackSecurityGroupCodec.java
similarity index 95%
rename from apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackSecurityGroupCodec.java
rename to apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackSecurityGroupCodec.java
index c9519a7..b2b0105 100644
--- a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackSecurityGroupCodec.java
+++ b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackSecurityGroupCodec.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking.web;
+package org.onosproject.openstackinterface.web;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
@@ -21,8 +21,8 @@
import com.google.common.collect.Lists;
import org.onosproject.codec.CodecContext;
import org.onosproject.codec.JsonCodec;
-import org.onosproject.openstacknetworking.OpenstackSecurityGroup;
-import org.onosproject.openstacknetworking.OpenstackSecurityGroupRule;
+import org.onosproject.openstackinterface.OpenstackSecurityGroup;
+import org.onosproject.openstackinterface.OpenstackSecurityGroupRule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackSubnetCodec.java b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackSubnetCodec.java
similarity index 96%
rename from apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackSubnetCodec.java
rename to apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackSubnetCodec.java
index 4bcb494..70ccb96 100644
--- a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackSubnetCodec.java
+++ b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/OpenstackSubnetCodec.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.openstacknetworking.web;
+package org.onosproject.openstackinterface.web;
import com.fasterxml.jackson.databind.JsonNode;
@@ -24,7 +24,7 @@
import org.onlab.packet.Ip4Address;
import org.onosproject.codec.CodecContext;
import org.onosproject.codec.JsonCodec;
-import org.onosproject.openstacknetworking.OpenstackSubnet;
+import org.onosproject.openstackinterface.OpenstackSubnet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/package-info.java b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/package-info.java
new file mode 100644
index 0000000..cca89f9
--- /dev/null
+++ b/apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/web/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015-2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * OpenStack networking implementation.
+ */
+package org.onosproject.openstackinterface.web;
diff --git a/apps/openstackinterface/network-cfg.json b/apps/openstackinterface/network-cfg.json
new file mode 100644
index 0000000..c177e59
--- /dev/null
+++ b/apps/openstackinterface/network-cfg.json
@@ -0,0 +1,29 @@
+{
+ "apps" : {
+ "org.onosproject.openstackinterface" : {
+ "openstackinterface" : {
+ "neutron_server" : "http://10.40.101.209:9696/v2.0/",
+ "keystone_server" : "http://10.40.101.209:5000/v2.0/",
+ "user_name" : "admin",
+ "password" : "nova"
+ }
+ }
+ },
+ "devices" : {
+ "of:0000000000000001" : {
+ "basic" : {
+ "driver" : "sona"
+ }
+ },
+ "of:0000000000000002" : {
+ "basic" : {
+ "driver" : "sona"
+ }
+ },
+ "of:0000000000000003" : {
+ "basic" : {
+ "driver" : "sona"
+ }
+ }
+ }
+}
diff --git a/apps/openstackinterface/pom.xml b/apps/openstackinterface/pom.xml
new file mode 100644
index 0000000..2298af9
--- /dev/null
+++ b/apps/openstackinterface/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2016 Open Networking Laboratory
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-apps</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>onos-app-openstackinterface</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>api</module>
+ <module>app</module>
+ </modules>
+
+</project>
+
diff --git a/apps/openstacknetworking/api/pom.xml b/apps/openstacknetworking/api/pom.xml
index b4ad7c1..ba59f98 100644
--- a/apps/openstacknetworking/api/pom.xml
+++ b/apps/openstacknetworking/api/pom.xml
@@ -31,6 +31,11 @@
<dependencies>
<dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-app-openstackinterface-api</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRoutingService.java b/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRoutingService.java
index 101059a..c6627af 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRoutingService.java
+++ b/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRoutingService.java
@@ -15,6 +15,10 @@
*/
package org.onosproject.openstacknetworking;
+import org.onosproject.openstackinterface.OpenstackFloatingIP;
+import org.onosproject.openstackinterface.OpenstackRouter;
+import org.onosproject.openstackinterface.OpenstackRouterInterface;
+
/**
* The Interface of Openstack Routing.
*/
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSwitchingService.java b/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSwitchingService.java
index 9f70a00..a826f98 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSwitchingService.java
+++ b/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSwitchingService.java
@@ -15,6 +15,10 @@
*/
package org.onosproject.openstacknetworking;
+import org.onosproject.openstackinterface.OpenstackNetwork;
+import org.onosproject.openstackinterface.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackSubnet;
+
import java.util.Map;
/**
diff --git a/apps/openstacknetworking/openstackrouting/pom.xml b/apps/openstacknetworking/openstackrouting/pom.xml
index ffd5de9..d35a9fd 100644
--- a/apps/openstacknetworking/openstackrouting/pom.xml
+++ b/apps/openstacknetworking/openstackrouting/pom.xml
@@ -48,6 +48,11 @@
<artifactId>onos-app-openstacknetworking-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-app-openstackinterface-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</project>
diff --git a/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackFloatingIPHandler.java b/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackFloatingIPHandler.java
index 3ef1c88..8f861a9 100644
--- a/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackFloatingIPHandler.java
+++ b/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackFloatingIPHandler.java
@@ -15,7 +15,7 @@
*/
package org.onosproject.openstacknetworking.routing;
-import org.onosproject.event.AbstractEvent;
+ import org.onosproject.event.AbstractEvent;
/**
* Handle FloatingIP Event for Managing Flow Rules In Openstack Nodes.
diff --git a/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackPnatHandler.java b/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackPnatHandler.java
index 65b8a5f..4d9b60a 100644
--- a/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackPnatHandler.java
+++ b/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackPnatHandler.java
@@ -29,10 +29,10 @@
import org.onosproject.net.packet.InboundPacket;
import org.onosproject.net.packet.PacketContext;
import org.onosproject.net.packet.PacketService;
-import org.onosproject.openstacknetworking.OpenstackNetwork;
-import org.onosproject.openstacknetworking.OpenstackNetworkingService;
-import org.onosproject.openstacknetworking.OpenstackPort;
-import org.onosproject.openstacknetworking.OpenstackRouter;
+import org.onosproject.openstackinterface.OpenstackInterfaceService;
+import org.onosproject.openstackinterface.OpenstackNetwork;
+import org.onosproject.openstackinterface.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackRouter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -91,7 +91,7 @@
}
private OpenstackRouter getOpenstackRouter(OpenstackPort openstackPort) {
- OpenstackNetworkingService networkingService = getService(OpenstackNetworkingService.class);
+ OpenstackInterfaceService networkingService = getService(OpenstackInterfaceService.class);
OpenstackNetwork network = networkingService.network(openstackPort.networkId());
OpenstackPort port = networkingService.ports()
diff --git a/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java b/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java
index 1aa4acb..b1c0a74 100644
--- a/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java
+++ b/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingManager.java
@@ -39,11 +39,11 @@
import org.onosproject.net.packet.PacketContext;
import org.onosproject.net.packet.PacketProcessor;
import org.onosproject.net.packet.PacketService;
-import org.onosproject.openstacknetworking.OpenstackFloatingIP;
-import org.onosproject.openstacknetworking.OpenstackNetworkingService;
-import org.onosproject.openstacknetworking.OpenstackPort;
-import org.onosproject.openstacknetworking.OpenstackRouter;
-import org.onosproject.openstacknetworking.OpenstackRouterInterface;
+import org.onosproject.openstackinterface.OpenstackFloatingIP;
+import org.onosproject.openstackinterface.OpenstackInterfaceService;
+import org.onosproject.openstackinterface.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackRouter;
+import org.onosproject.openstackinterface.OpenstackRouterInterface;
import org.onosproject.openstacknetworking.OpenstackRoutingService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -77,7 +77,7 @@
protected DeviceService deviceService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected OpenstackNetworkingService openstackService;
+ protected OpenstackInterfaceService openstackService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected FlowObjectiveService flowObjectiveService;
diff --git a/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingRulePopulator.java b/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingRulePopulator.java
index cc0fecd..a9421bb 100644
--- a/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingRulePopulator.java
+++ b/apps/openstacknetworking/openstackrouting/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackRoutingRulePopulator.java
@@ -47,11 +47,11 @@
import org.onosproject.net.flowobjective.FlowObjectiveService;
import org.onosproject.net.flowobjective.ForwardingObjective;
import org.onosproject.net.packet.InboundPacket;
-import org.onosproject.openstacknetworking.OpenstackNetworkingService;
-import org.onosproject.openstacknetworking.OpenstackPort;
-import org.onosproject.openstacknetworking.OpenstackRouter;
-import org.onosproject.openstacknetworking.OpenstackRouterInterface;
-import org.onosproject.openstacknetworking.OpenstackSubnet;
+import org.onosproject.openstackinterface.OpenstackInterfaceService;
+import org.onosproject.openstackinterface.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackRouter;
+import org.onosproject.openstackinterface.OpenstackRouterInterface;
+import org.onosproject.openstackinterface.OpenstackSubnet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -68,7 +68,7 @@
private final ApplicationId appId;
private final FlowObjectiveService flowObjectiveService;
- private final OpenstackNetworkingService openstackService;
+ private final OpenstackInterfaceService openstackService;
private final DeviceService deviceService;
private final DriverService driverService;
@@ -105,7 +105,7 @@
* @param deviceService DeviceService
* @param driverService DriverService
*/
- public OpenstackRoutingRulePopulator(ApplicationId appId, OpenstackNetworkingService openstackService,
+ public OpenstackRoutingRulePopulator(ApplicationId appId, OpenstackInterfaceService openstackService,
FlowObjectiveService flowObjectiveService,
DeviceService deviceService, DriverService driverService) {
this.appId = appId;
diff --git a/apps/openstacknetworking/openstackswitching/pom.xml b/apps/openstacknetworking/openstackswitching/pom.xml
index 932da8f..3910025 100644
--- a/apps/openstacknetworking/openstackswitching/pom.xml
+++ b/apps/openstacknetworking/openstackswitching/pom.xml
@@ -37,6 +37,11 @@
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
+ <artifactId>onos-app-openstackinterface-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
<artifactId>onos-app-dhcp</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackArpHandler.java b/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackArpHandler.java
index 415b6d2..e417d9a 100644
--- a/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackArpHandler.java
+++ b/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackArpHandler.java
@@ -27,8 +27,8 @@
import org.onosproject.net.packet.DefaultOutboundPacket;
import org.onosproject.net.packet.InboundPacket;
import org.onosproject.net.packet.PacketService;
-import org.onosproject.openstacknetworking.OpenstackNetworkingService;
-import org.onosproject.openstacknetworking.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackInterfaceService;
+import org.onosproject.openstackinterface.OpenstackPort;
import org.onosproject.openstacknetworking.OpenstackPortInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,7 +46,7 @@
.getLogger(OpenstackArpHandler.class);
private static final MacAddress GATEWAY_MAC = MacAddress.valueOf("1f:1f:1f:1f:1f:1f");
private PacketService packetService;
- private OpenstackNetworkingService openstackService;
+ private OpenstackInterfaceService openstackService;
private HostService hostService;
/**
@@ -56,7 +56,7 @@
* @param packetService PacketService reference
* @param hostService host service
*/
- public OpenstackArpHandler(OpenstackNetworkingService openstackService, PacketService packetService,
+ public OpenstackArpHandler(OpenstackInterfaceService openstackService, PacketService packetService,
HostService hostService) {
this.openstackService = openstackService;
this.packetService = packetService;
diff --git a/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingManager.java b/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingManager.java
index 52b0436..4e66d95 100644
--- a/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingManager.java
+++ b/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingManager.java
@@ -16,7 +16,6 @@
package org.onosproject.openstacknetworking.switching;
import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.felix.scr.annotations.Activate;
@@ -35,10 +34,6 @@
import org.onosproject.net.DeviceId;
import org.onosproject.net.Host;
import org.onosproject.net.Port;
-import org.onosproject.net.config.ConfigFactory;
-import org.onosproject.net.config.NetworkConfigEvent;
-import org.onosproject.net.config.NetworkConfigListener;
-import org.onosproject.net.config.NetworkConfigRegistry;
import org.onosproject.net.device.DeviceEvent;
import org.onosproject.net.device.DeviceListener;
import org.onosproject.net.device.DeviceService;
@@ -51,24 +46,21 @@
import org.onosproject.net.packet.PacketContext;
import org.onosproject.net.packet.PacketProcessor;
import org.onosproject.net.packet.PacketService;
-import org.onosproject.openstacknetworking.OpenstackNetwork;
-import org.onosproject.openstacknetworking.OpenstackNetworkingConfig;
-import org.onosproject.openstacknetworking.OpenstackNetworkingService;
-import org.onosproject.openstacknetworking.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackInterfaceService;
+import org.onosproject.openstackinterface.OpenstackNetwork;
+import org.onosproject.openstackinterface.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackSecurityGroup;
+import org.onosproject.openstackinterface.OpenstackSubnet;
import org.onosproject.openstacknetworking.OpenstackPortInfo;
-import org.onosproject.openstacknetworking.OpenstackSecurityGroup;
-import org.onosproject.openstacknetworking.OpenstackSubnet;
import org.onosproject.openstacknetworking.OpenstackSwitchingService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Collection;
import java.util.Map;
-import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY;
import static org.onlab.util.Tools.groupedThreads;
@Service
@@ -100,13 +92,9 @@
protected DhcpService dhcpService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected NetworkConfigRegistry cfgService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected DriverService driverService;
- @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected OpenstackNetworkingService openstackService;
+ protected OpenstackInterfaceService openstackService;
public static final String PORTNAME_PREFIX_VM = "tap";
public static final String PORTNAME_PREFIX_ROUTER = "qr-";
@@ -116,37 +104,15 @@
public static final String DEVICE_OWNER_GATEWAY = "network:router_gateway";
private ApplicationId appId;
- private boolean doNotPushFlows;
- private Ip4Address neutronServer;
- private Ip4Address keystoneServer;
- private String userName;
- private String password;
- private String physicalRouterMac;
- private OpenstackArpHandler arpHandler;
+ private OpenstackArpHandler arpHandler = new OpenstackArpHandler(openstackService, packetService, hostService);
private ExecutorService deviceEventExcutorService =
Executors.newSingleThreadExecutor(groupedThreads("onos/openstackswitching", "device-event"));
- private ExecutorService networkEventExcutorService =
- Executors.newSingleThreadExecutor(groupedThreads("onos/openstackswitching", "config-event"));
private InternalPacketProcessor internalPacketProcessor = new InternalPacketProcessor();
private InternalDeviceListener internalDeviceListener = new InternalDeviceListener();
- private InternalConfigListener internalConfigListener = new InternalConfigListener();
private InternalHostListener internalHostListener = new InternalHostListener();
-
- private final Set<ConfigFactory> factories = ImmutableSet.of(
- new ConfigFactory<ApplicationId, OpenstackNetworkingConfig>(APP_SUBJECT_FACTORY,
- OpenstackNetworkingConfig.class,
- "openstackswitching") {
- @Override
- public OpenstackNetworkingConfig createConfig() {
- return new OpenstackNetworkingConfig();
- }
- }
- );
-
-
private Map<String, OpenstackPortInfo> openstackPortInfoMap = Maps.newHashMap();
@Activate
@@ -154,13 +120,11 @@
appId = coreService
.registerApplication("org.onosproject.openstackswitching");
- factories.forEach(cfgService::registerConfigFactory);
packetService.addProcessor(internalPacketProcessor, PacketProcessor.director(1));
deviceService.addListener(internalDeviceListener);
hostService.addListener(internalHostListener);
- cfgService.addListener(internalConfigListener);
- internalConfigListener.configureNetwork();
+ initializeFlowRules();
log.info("Started");
}
@@ -169,8 +133,6 @@
protected void deactivate() {
packetService.removeProcessor(internalPacketProcessor);
deviceService.removeListener(internalDeviceListener);
- cfgService.removeListener(internalConfigListener);
- factories.forEach(cfgService::unregisterConfigFactory);
deviceEventExcutorService.shutdown();
@@ -206,20 +168,18 @@
OpenstackPortInfo routerPortInfo = openstackPortInfoMap.get(routerPortName);
if (routerPortInfo != null) {
dhcpService.removeStaticMapping(routerPortInfo.mac());
- if (!doNotPushFlows) {
- deviceService.getPorts(routerPortInfo.deviceId()).forEach(port -> {
- String pName = port.annotations().value("portName");
- if (pName.equals(routerPortName)) {
- OpenstackSwitchingRulePopulator rulePopulator =
- new OpenstackSwitchingRulePopulator(appId, flowObjectiveService,
- deviceService, openstackService, driverService);
+ deviceService.getPorts(routerPortInfo.deviceId()).forEach(port -> {
+ String pName = port.annotations().value("portName");
+ if (pName.equals(routerPortName)) {
+ OpenstackSwitchingRulePopulator rulePopulator =
+ new OpenstackSwitchingRulePopulator(appId, flowObjectiveService,
+ deviceService, openstackService, driverService);
- rulePopulator.removeSwitchingRules(doNotPushFlows, port, openstackPortInfoMap);
- openstackPortInfoMap.remove(routerPortName);
- return;
- }
- });
- }
+ rulePopulator.removeSwitchingRules(port, openstackPortInfoMap);
+ openstackPortInfoMap.remove(routerPortName);
+ return;
+ }
+ });
}
}
@@ -245,13 +205,13 @@
}
private void processPortUpdated(Device device, Port port) {
- if (!port.annotations().value(PORTNAME).equals(PORTNAME_PREFIX_TUNNEL) && !doNotPushFlows) {
+ if (!port.annotations().value(PORTNAME).equals(PORTNAME_PREFIX_TUNNEL)) {
if (port.isEnabled() || port.annotations().value(PORTNAME).startsWith(PORTNAME_PREFIX_ROUTER)) {
OpenstackSwitchingRulePopulator rulePopulator =
new OpenstackSwitchingRulePopulator(appId, flowObjectiveService,
deviceService, openstackService, driverService);
- rulePopulator.populateSwitchingRules(doNotPushFlows, device, port);
+ rulePopulator.populateSwitchingRules(device, port);
updatePortMap(device.id(), port, openstackService.networks(), openstackService.subnets(),
rulePopulator.openstackPort(port));
@@ -262,7 +222,7 @@
new OpenstackSwitchingRulePopulator(appId, flowObjectiveService,
deviceService, openstackService, driverService);
- rulePopulator.removeSwitchingRules(doNotPushFlows, port, openstackPortInfoMap);
+ rulePopulator.removeSwitchingRules(port, openstackPortInfoMap);
dhcpService.removeStaticMapping(openstackPortInfoMap.get(port.annotations().value(PORTNAME)).mac());
openstackPortInfoMap.remove(port.annotations().value(PORTNAME));
}
@@ -290,10 +250,8 @@
.forEach(vmPort -> {
OpenstackPort osPort = rulePopulator.openstackPort(vmPort);
if (osPort != null && !osPort.deviceOwner().equals(DEVICE_OWNER_GATEWAY)) {
- if (!doNotPushFlows) {
- rulePopulator.populateSwitchingRules(doNotPushFlows, device, vmPort);
- updatePortMap(device.id(), vmPort, networks, subnets, osPort);
- }
+ rulePopulator.populateSwitchingRules(device, vmPort);
+ updatePortMap(device.id(), vmPort, networks, subnets, osPort);
registerDhcpInfo(osPort);
} else {
log.warn("No openstackPort information for port {}", vmPort);
@@ -458,34 +416,4 @@
}
}
}
-
- private class InternalConfigListener implements NetworkConfigListener {
-
- public void configureNetwork() {
- OpenstackNetworkingConfig cfg =
- cfgService.getConfig(appId, OpenstackNetworkingConfig.class);
- if (cfg == null) {
- log.error("There is no openstack server information in config.");
- return;
- }
-
- doNotPushFlows = cfg.doNotPushFlows();
- physicalRouterMac = cfg.physicalRouterMac();
- openstackService.setConfigurations(cfg.neutronServer(), cfg.keystoneServer(),
- cfg.userName(), cfg.password());
- arpHandler = new OpenstackArpHandler(openstackService, packetService, hostService);
- initializeFlowRules();
- }
-
- @Override
- public void event(NetworkConfigEvent event) {
- if (((event.type() == NetworkConfigEvent.Type.CONFIG_ADDED ||
- event.type() == NetworkConfigEvent.Type.CONFIG_UPDATED)) &&
- event.configClass().equals(OpenstackNetworkingConfig.class)) {
-
- log.info("Network configuration changed");
- networkEventExcutorService.execute(this::configureNetwork);
- }
- }
- }
}
diff --git a/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingRulePopulator.java b/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingRulePopulator.java
index 258b24c..d7223da 100644
--- a/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingRulePopulator.java
+++ b/apps/openstacknetworking/openstackswitching/src/main/java/org/onosproject/openstacknetworking/switching/OpenstackSwitchingRulePopulator.java
@@ -40,9 +40,9 @@
import org.onosproject.net.flowobjective.DefaultForwardingObjective;
import org.onosproject.net.flowobjective.FlowObjectiveService;
import org.onosproject.net.flowobjective.ForwardingObjective;
-import org.onosproject.openstacknetworking.OpenstackNetwork;
-import org.onosproject.openstacknetworking.OpenstackNetworkingService;
-import org.onosproject.openstacknetworking.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackInterfaceService;
+import org.onosproject.openstackinterface.OpenstackNetwork;
+import org.onosproject.openstackinterface.OpenstackPort;
import org.onosproject.openstacknetworking.OpenstackPortInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -80,7 +80,7 @@
public OpenstackSwitchingRulePopulator(ApplicationId appId,
FlowObjectiveService flowObjectiveService,
DeviceService deviceService,
- OpenstackNetworkingService openstackService,
+ OpenstackInterfaceService openstackService,
DriverService driverService) {
this.flowObjectiveService = flowObjectiveService;
this.deviceService = deviceService;
@@ -95,14 +95,10 @@
/**
* Populates flow rules for the VM created.
*
- * @param doNotPushFlow true to suppress push of initial flows
* @param device device to populate rules to
* @param port port for the VM created
*/
- public void populateSwitchingRules(boolean doNotPushFlow, Device device, Port port) {
- if (doNotPushFlow) {
- return;
- }
+ public void populateSwitchingRules(Device device, Port port) {
populateFlowRulesForTunnelTag(device, port);
populateFlowRulesForTrafficToSameCnode(device, port);
populateFlowRulesForTrafficToDifferentCnode(device, port);
@@ -271,15 +267,11 @@
/**
* Remove flows rules for the removed VM.
*
- * @param doNotPushFlows true to suppress push of initial flows
* @param removedPort removedport info
* @param openstackPortInfoMap openstackPortInfoMap
*/
- public void removeSwitchingRules(boolean doNotPushFlows, Port removedPort, Map<String,
+ public void removeSwitchingRules(Port removedPort, Map<String,
OpenstackPortInfo> openstackPortInfoMap) {
- if (doNotPushFlows) {
- return;
- }
OpenstackPortInfo openstackPortInfo = openstackPortInfoMap
.get(removedPort.annotations().value("portName"));
diff --git a/apps/openstacknetworking/web/pom.xml b/apps/openstacknetworking/web/pom.xml
index 3db71f6..548b384 100644
--- a/apps/openstacknetworking/web/pom.xml
+++ b/apps/openstacknetworking/web/pom.xml
@@ -47,6 +47,16 @@
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
+ <artifactId>onos-app-openstackinterface-app</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-app-openstackinterface-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
<artifactId>onos-rest</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpensatckRouterWebResource.java b/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpensatckRouterWebResource.java
index d7d6b6d..b57b704 100644
--- a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpensatckRouterWebResource.java
+++ b/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpensatckRouterWebResource.java
@@ -17,8 +17,10 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
-import org.onosproject.openstacknetworking.OpenstackRouter;
-import org.onosproject.openstacknetworking.OpenstackRouterInterface;
+import org.onosproject.openstackinterface.OpenstackRouter;
+import org.onosproject.openstackinterface.OpenstackRouterInterface;
+import org.onosproject.openstackinterface.web.OpenstackRouterCodec;
+import org.onosproject.openstackinterface.web.OpenstackRouterInterfaceCodec;
import org.onosproject.openstacknetworking.OpenstackRoutingService;
import org.onosproject.rest.AbstractWebResource;
import org.slf4j.Logger;
diff --git a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortWebResource.java b/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortWebResource.java
index a60d81a..ce6fd7e 100644
--- a/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortWebResource.java
+++ b/apps/openstacknetworking/web/src/main/java/org/onosproject/openstacknetworking/web/OpenstackPortWebResource.java
@@ -17,7 +17,8 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
-import org.onosproject.openstacknetworking.OpenstackPort;
+import org.onosproject.openstackinterface.OpenstackPort;
+import org.onosproject.openstackinterface.web.OpenstackPortCodec;
import org.onosproject.openstacknetworking.OpenstackSwitchingService;
import org.onosproject.rest.AbstractWebResource;
import org.slf4j.Logger;
diff --git a/apps/pom.xml b/apps/pom.xml
index 0aa0716..34fdee0 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -68,6 +68,7 @@
<module>vpls</module>
<module>openstacknode</module>
<module>openstacknetworking</module>
+ <module>openstackinterface</module>
</modules>
<properties>