You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by bh...@apache.org on 2019/04/15 16:00:32 UTC

[incubator-dlab] branch feature-DLAB-603 created (now 6ef4981)

This is an automated email from the ASF dual-hosted git repository.

bhliva pushed a change to branch feature-DLAB-603
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


      at 6ef4981  DLAB-603 added public ip to getAllEnv API

This branch includes the following new commits:

     new 6ef4981  DLAB-603 added public ip to getAllEnv API

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/01: DLAB-603 added public ip to getAllEnv API

Posted by bh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bhliva pushed a commit to branch feature-DLAB-603
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 6ef49813350e9ec52da808b1beaf9d57d80f86ef
Author: bhliva <bo...@epam.com>
AuthorDate: Mon Apr 15 18:59:11 2019 +0300

    DLAB-603 added public ip to getAllEnv API
---
 .../com/epam/dlab/backendapi/resources/dto/UserResourceInfo.java  | 8 ++++++++
 .../epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserResourceInfo.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserResourceInfo.java
index ecdb6ff..bf0e4d4 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserResourceInfo.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserResourceInfo.java
@@ -49,6 +49,9 @@ public class UserResourceInfo {
 	@JsonProperty
 	private String user;
 
+	@JsonProperty("public_ip")
+	private String ip;
+
 
 	public UserResourceInfo withResourceType(ResourceEnum resourceType) {
 		setResourceType(resourceType);
@@ -79,4 +82,9 @@ public class UserResourceInfo {
 		setUser(user);
 		return this;
 	}
+
+	public UserResourceInfo withIp(String ip) {
+		setIp(ip);
+		return this;
+	}
 }
diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java
index 7d28d47..ade44fb 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java
@@ -212,7 +212,8 @@ public class EnvironmentServiceImpl implements EnvironmentService {
 		EdgeInfo edgeInfo = keyDAO.getEdgeInfo(user);
 		UserResourceInfo edgeResource = new UserResourceInfo().withResourceType(ResourceEnum.EDGE_NODE)
 				.withResourceStatus(edgeInfo.getEdgeStatus())
-				.withUser(user);
+				.withUser(user)
+				.withIp(edgeInfo.getPublicIp());
 		return Stream.concat(Stream.of(edgeResource), allInstances.stream()
 				.filter(instance -> instance.getUser().equals(user)).map(this::toUserResourceInfo))
 				.collect(toList());


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org