You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by of...@apache.org on 2020/09/18 14:54:08 UTC

[incubator-dlab] branch develop updated: [DLAB-2038] Added 'endpoint' field to response on the 'Environment management' page

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

ofuks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/develop by this push:
     new 0999920  [DLAB-2038] Added 'endpoint' field to response on the 'Environment management' page
0999920 is described below

commit 0999920758af8571c234c62bae5296244378586d
Author: Oleh Fuks <ol...@gmail.com>
AuthorDate: Fri Sep 18 17:53:42 2020 +0300

    [DLAB-2038] Added 'endpoint' field to response on the 'Environment management' page
---
 .../epam/dlab/backendapi/resources/dto/UserResourceInfo.java   |  2 ++
 .../dlab/backendapi/service/impl/EnvironmentServiceImpl.java   |  2 ++
 .../backendapi/service/impl/EnvironmentServiceImplTest.java    | 10 ++++++----
 3 files changed, 10 insertions(+), 4 deletions(-)

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 5958411..aebe2b1 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
@@ -36,6 +36,8 @@ public class UserResourceInfo {
 	private String user;
 	@JsonProperty
 	private String project;
+	@JsonProperty
+	private String endpoint;
 	@JsonProperty("resource_type")
 	private ResourceEnum resourceType;
 	@JsonProperty("resource_name")
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 2ae828c..95681de 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
@@ -197,6 +197,7 @@ public class EnvironmentServiceImpl implements EnvironmentService {
 							.resourceType(ResourceEnum.EDGE_NODE)
 							.resourceStatus(e.getStatus().toString())
 							.project(projectDTO.getName())
+							.endpoint(e.getName())
 							.ip(e.getEdgeInfo() != null ? e.getEdgeInfo().getPublicIp() : null)
 							.build());
 			return Stream.concat(edges, userResources).collect(toList());
@@ -214,6 +215,7 @@ public class EnvironmentServiceImpl implements EnvironmentService {
 				.computationalResources(userInstance.getResources())
 				.user(userInstance.getUser())
 				.project(userInstance.getProject())
+				.endpoint(userInstance.getEndpoint())
 				.cloudProvider(userInstance.getCloudProvider())
 				.exploratoryUrls(userInstance.getResourceUrl())
 				.build();
diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImplTest.java
index d9b97ef..2f2c7c7 100644
--- a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImplTest.java
+++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImplTest.java
@@ -317,6 +317,7 @@ public class EnvironmentServiceImplTest {
 				.resourceType(ResourceEnum.EDGE_NODE)
 				.resourceStatus("running")
 				.project(PROJECT_NAME)
+				.endpoint(ENDPOINT_NAME)
 				.ip(null)
 				.build();
 	}
@@ -330,6 +331,7 @@ public class EnvironmentServiceImplTest {
 				.computationalResources(Collections.emptyList())
 				.user(USER)
 				.project(PROJECT_NAME)
+				.endpoint(ENDPOINT_NAME)
 				.cloudProvider("aws")
 				.exploratoryUrls(null)
 				.build();
@@ -345,10 +347,10 @@ public class EnvironmentServiceImplTest {
 
 	private List<UserInstanceDTO> getUserInstances() {
 		return Arrays.asList(
-				new UserInstanceDTO().withExploratoryName(EXPLORATORY_NAME_1).withUser(USER).withProject(PROJECT_NAME).withShape(SHAPE).withStatus("running")
-						.withResources(Collections.emptyList()).withCloudProvider("aws"),
-				new UserInstanceDTO().withExploratoryName(EXPLORATORY_NAME_2).withUser(USER).withProject(PROJECT_NAME).withShape(SHAPE).withStatus("running")
-						.withResources(Collections.emptyList()).withCloudProvider("aws"));
+				new UserInstanceDTO().withExploratoryName(EXPLORATORY_NAME_1).withUser(USER).withProject(PROJECT_NAME).withEndpoint(ENDPOINT_NAME)
+						.withShape(SHAPE).withStatus("running").withResources(Collections.emptyList()).withCloudProvider("aws"),
+				new UserInstanceDTO().withExploratoryName(EXPLORATORY_NAME_2).withUser(USER).withProject(PROJECT_NAME).withEndpoint(ENDPOINT_NAME)
+						.withShape(SHAPE).withStatus("running").withResources(Collections.emptyList()).withCloudProvider("aws"));
 	}
 
 	private ProjectDTO getProjectDTO() {


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