You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Boris Trishkin <no...@github.com> on 2018/10/05 10:14:57 UTC

[jclouds/jclouds-labs] JCLOUDS-1454 Implement ServerToServerWithExternalIp function for dimensiondata (#448)

JCLOUDS-1454 - Implement ServerToServerWithExternalIp function for dimensiondata
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/448

-- Commit Summary --

  * JCLOUDS-1454 - ServerToServerWithExternalIp Function implementation for dimensiondata

-- File Changes --

    A dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/compute/function/ServerToServerWithExternalIp.java (60)
    A dimensiondata/src/test/java/org/jclouds/dimensiondata/cloudcontrol/compute/function/ServerToServerWithExternalIpTest.java (118)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/448.patch
https://github.com/jclouds/jclouds-labs/pull/448.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/448

Re: [jclouds/jclouds-labs] JCLOUDS-1454 Implement ServerToServerWithExternalIp function for dimensiondata (#448)

Posted by Ignasi Barrera <no...@github.com>.
Closed #448.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/448#event-1975852024

Re: [jclouds/jclouds-labs] JCLOUDS-1454 Implement ServerToServerWithExternalIp function for dimensiondata (#448)

Posted by Boris Trishkin <no...@github.com>.
@btrishkin pushed 1 commit.

d338818  ServerToServerWithExternalIp implementation


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/448/files/4ab9e81c7071a79a217d76981530f644792edb6a..d338818955b1817c2bd675c583592214c2d2c731

Re: [jclouds/jclouds-labs] JCLOUDS-1454 Implement ServerToServerWithExternalIp function for dimensiondata (#448)

Posted by Ignasi Barrera <no...@github.com>.
Pushed to [master](http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/424f358e) and [2.1.x](http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/8ca49411).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/448#issuecomment-440055813

Re: [jclouds/jclouds-labs] JCLOUDS-1454 Implement ServerToServerWithExternalIp function for dimensiondata (#448)

Posted by Ignasi Barrera <no...@github.com>.
nacx commented on this pull request.

Just a couple minor comments. Thanks @btrishkin!

> +import org.jclouds.dimensiondata.cloudcontrol.domain.Server;
+import org.jclouds.dimensiondata.cloudcontrol.domain.internal.ServerWithExternalIp;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+@Singleton
+public class ServerToServerWithExternalIp implements Function<Server, ServerWithExternalIp> {
+
+    private final DimensionDataCloudControlApi api;
+
+    @Inject
+    ServerToServerWithExternalIp(DimensionDataCloudControlApi api) {
+        this.api = checkNotNull(api, "api");

Remove the redundant null check. Injection already enforces it.

> +      server = null;
+      ServerWithExternalIp result = new ServerToServerWithExternalIp(dimensionDataCloudControlApi).apply(server);
+      assertNull(result);
+   }
+
+   @Test(dependsOnMethods = "testServerToServerWithExternalIpApplyNotNull")
+   public void testServerToServerWithExternalIpApplyNetworkInfoNull() {
+      server = Server.builder().id("serverId").name("serverName").datacenterId("NA1").networkInfo(null).cpu(cpu)
+            .deployed(true).state(State.NORMAL).sourceImageId("imageId").started(false).createTime(new Date())
+            .memoryGb(1024).guest(Guest.builder().osCustomization(false).operatingSystem(os).build()).build();
+
+      ServerWithExternalIp result = new ServerToServerWithExternalIp(dimensionDataCloudControlApi).apply(server);
+      assertNotNull(result);
+      assertEquals(result.server(), server);
+      assertNull(result.externalIp());
+   }

Add a test case to verify what happens when there is network info but no matching nat rule is found.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/448#pullrequestreview-161974700