Skip to content

Commit

Permalink
Merge pull request #737 from miguelaferreira/feature/mferreira/ncx-fo…
Browse files Browse the repository at this point in the history
…llow-redirects-gardened-rebase

CLOUDSTACK-8758: Handle redirects in communication with NXS controller (a.k.a. Nicira NVP)When an NSX controller node is part of a cluster it will redirect API calls to the master controller. Because the ACS management server does not follow such redirects, if there is a change of master within a NSX cluster, the NSX device (a.k.a.  NiciraNvp) needs to be reconfigured (via the management server DB).

The goal of this PR is to enable ACS management server to follow HTTP redirects sent by NSX controllers. However, other changes were made to the cloud-utils module that provides the REST client that the NSX plugin uses.

Cosmetic changes:
* Upgrade maven module structure for cloud-utils and cloud-plugin-netowkr-nvp to comply with maven default
* Several refactorings on both modules to consistently format the code, remove unused code, declare final when possible, remove auto generated comments, etc

Other changes:
* Upgrade HTTP library used in REST client to version 4.5 of Apache HTTP Components
* Implement generic REST client that supports HTTP redirects
* Implement NSX specific REST client
* Simplify NSX api implementation
* Previously existing unit tests for both the REST client and NSX api were either maintained in the same test classes, moved to new test classes (because code under tests also moved), or removed (because code under tests was also removed)
* New Marvin tests for NSX controllers

Testing:
* Ran all unit tests present in the project
* Ran Java Integration tests for NSX api targeting both a master and a slave controller
* Ran new Marvin test for NSX controller
* Manual inspection of logs to confirm redirection is taking place

* pr/737:
  Use NSX specific RestClient in API implementation (NiciraNvpApi)
  Refactor NSX api implementation (NiciraNvpApi)
  Add NSX specific RestClient implementation
  Delegate HTTP protocol activity in RESTServiceConnector to RestClient
  Add basic RestClient implentation based on HTTP Components 4.5
  Code clean up in cloud-plugin-network-nvp project
  Code clean up in cloud-utils project
  Refactor cloud-plugin-network-nvp project into Maven default structure
  Refactor cloud-utils project into Maven default structure
  Fix unit-test library dependencies
  Add Marvin test for Nicira NVP plugin
  Create Nicira NVP devices and enable plugin at deploy

Signed-off-by: Remi Bergsma <github@remi.nl>
  • Loading branch information
remibergsma committed Aug 25, 2015
2 parents 2772e4d + 09f7153 commit 44ba14d
Show file tree
Hide file tree
Showing 309 changed files with 4,029 additions and 2,627 deletions.
24 changes: 22 additions & 2 deletions plugins/network-elements/nicira-nvp/pom.xml
Expand Up @@ -18,7 +18,8 @@
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">
<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>
<artifactId>cloud-plugin-network-nvp</artifactId>
<name>Apache CloudStack Plugin - Network Nicira NVP</name>
Expand All @@ -29,10 +30,29 @@
<relativePath>../../pom.xml</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>4.6.0-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
<outputDirectory>target/classes</outputDirectory>
<testOutputDirectory>target/test-classes</testOutputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>test/resources</directory>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
Expand Down

0 comments on commit 44ba14d

Please sign in to comment.