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 2019/10/24 13:17:40 UTC
[incubator-dlab] 01/01: [DLAB-1205] - Fetch endpoint of notebook
from which image is created
This is an automated email from the ASF dual-hosted git repository.
ofuks pushed a commit to branch DLAB-1205
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 244e769ba53d407ec4dc935dba26704a6195812c
Author: Oleh Fuks <ol...@gmail.com>
AuthorDate: Thu Oct 24 16:17:12 2019 +0300
[DLAB-1205] - Fetch endpoint of notebook from which image is created
---
.../backendapi/service/impl/ImageExploratoryServiceImpl.java | 10 +++++-----
.../webapp/src/app/core/services/userResource.service.ts | 4 ++--
.../create-environment/create-environment.component.ts | 3 ++-
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ImageExploratoryServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ImageExploratoryServiceImpl.java
index e1d032f..8beda82 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ImageExploratoryServiceImpl.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ImageExploratoryServiceImpl.java
@@ -24,6 +24,7 @@ import com.epam.dlab.backendapi.dao.ExploratoryDAO;
import com.epam.dlab.backendapi.dao.ExploratoryLibDAO;
import com.epam.dlab.backendapi.dao.ImageExploratoryDao;
import com.epam.dlab.backendapi.resources.dto.ImageInfoRecord;
+import com.epam.dlab.backendapi.service.EndpointService;
import com.epam.dlab.backendapi.service.ImageExploratoryService;
import com.epam.dlab.backendapi.util.RequestBuilder;
import com.epam.dlab.constants.ServiceConsts;
@@ -55,21 +56,20 @@ public class ImageExploratoryServiceImpl implements ImageExploratoryService {
private static final String IMAGE_EXISTS_MSG = "Image with name %s is already exist";
private static final String IMAGE_NOT_FOUND_MSG = "Image with name %s was not found for user %s";
+
@Inject
private ExploratoryDAO exploratoryDAO;
-
@Inject
private ImageExploratoryDao imageExploratoryDao;
-
@Inject
private ExploratoryLibDAO libDAO;
-
@Inject
@Named(ServiceConsts.PROVISIONING_SERVICE_NAME)
private RESTService provisioningService;
-
@Inject
private RequestBuilder requestBuilder;
+ @Inject
+ private EndpointService endpointService;
@Override
public String createImage(UserInfo user, String exploratoryName, String imageName, String imageDescription) {
@@ -100,7 +100,7 @@ public class ImageExploratoryServiceImpl implements ImageExploratoryService {
.withExploratoryName(exploratoryName)
.withStatus(UserInstanceStatus.CREATING_IMAGE));
- return provisioningService.post(ExploratoryAPI.EXPLORATORY_IMAGE, user.getAccessToken(),
+ return provisioningService.post(endpointService.get(userInstance.getEndpoint()).getUrl() + ExploratoryAPI.EXPLORATORY_IMAGE, user.getAccessToken(),
requestBuilder.newExploratoryImageCreate(user, userInstance, imageName), String.class);
}
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts
index 0ac58b5..224ba9c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts
@@ -143,8 +143,8 @@ export class UserResourceService {
catchError(ErrorUtils.handleServiceError));
}
- public getUserImages(image, project): Observable<{}> {
- const body = `?docker_image=${image}&project=${project}`;
+ public getUserImages(image, project, endpoint): Observable<{}> {
+ const body = `?docker_image=${image}&project=${project}&endpoint=${endpoint}`;
return this.applicationServiceFacade
.buildGetUserImages(body)
.pipe(
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
index 4e914e7..b5c2a76 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
@@ -130,7 +130,8 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
}
private getImagesList() {
- this.userResourceService.getUserImages(this.currentTemplate.image, this.createExploratoryForm.controls['project'].value)
+ this.userResourceService.getUserImages(this.currentTemplate.image, this.createExploratoryForm.controls['project'].value,
+ this.createExploratoryForm.controls['endpoint'].value)
.subscribe((res: any) => this.images = res.filter(el => el.status === 'CREATED'),
error => this.toastr.error(error.message || 'Images list loading failed!', 'Oops!'));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org