You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by yk...@apache.org on 2021/04/27 04:53:26 UTC

[incubator-datalab] 01/01: [DATALAB-2314/2369] - fixed bugs

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

ykinash pushed a commit to branch DATALAB-2314
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit f6ded756b24098d524300a4aa9dfc3971cfad405
Author: KinashYurii <ur...@gmail.com>
AuthorDate: Tue Apr 27 07:52:26 2021 +0300

    [DATALAB-2314/2369] - fixed bugs
---
 .../com/epam/datalab/properties/ChangePropertiesConst.java  |  5 ++---
 .../epam/datalab/properties/ExternalChangeProperties.java   | 13 +++++--------
 .../backendapi/resources/ChangePropertiesResource.java      |  4 ++--
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesConst.java b/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesConst.java
index d4985ae..fe7bcd3 100644
--- a/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesConst.java
+++ b/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesConst.java
@@ -36,10 +36,9 @@ public interface ChangePropertiesConst {
     String BILLING_SERVICE_PROP_PATH = "/opt/datalab/conf/billing.yml";
     String GKE_BILLING_PATH = "/root/billing.yaml";
     String GKE_BILLING_SERVICE = "billing.yml";
-    String RESTART_URL = "/api/config/restart";
+    String RESTART_URL = "/config/restart";
     String LOCAL_ENDPOINT_NAME = "local";
-    String BASE_CONFIG_URL = "/api/config";
-    String EXTERNAL_OVERWRITE_URL = "/api/config/";
+    String BASE_CONFIG_URL = "/config";
 
     String SELF_SERVICE_SUPERVISORCTL_RUN_NAME = " ui ";
     String PROVISIONING_SERVICE_SUPERVISORCTL_RUN_NAME = " provserv ";
diff --git a/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ExternalChangeProperties.java b/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ExternalChangeProperties.java
index 3ad2875..7c6bdd1 100644
--- a/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ExternalChangeProperties.java
+++ b/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ExternalChangeProperties.java
@@ -32,15 +32,12 @@ import java.util.Map;
 
 @Slf4j
 public class ExternalChangeProperties implements ChangePropertiesConst {
-    private final RESTService externalService;
     private final RESTService provService;
     private final ChangePropertiesService changePropertiesService;
 
     @Inject
-    public ExternalChangeProperties(RESTService externalService,
-                                    @Named(ServiceConsts.PROVISIONING_SERVICE_NAME) RESTService provService,
+    public ExternalChangeProperties(@Named(ServiceConsts.PROVISIONING_SERVICE_NAME) RESTService provService,
                                     ChangePropertiesService changePropertiesService) {
-        this.externalService = externalService;
         this.provService = provService;
         this.changePropertiesService = changePropertiesService;
     }
@@ -70,11 +67,11 @@ public class ExternalChangeProperties implements ChangePropertiesConst {
             String provPath = url + "/provisioning-service";
             log.info("TEST LOG!!!: provPath: {}", provPath);
             properties.put(PROVISIONING_SERVICE,
-                    externalService.get(provPath, userInfo.getAccessToken(), String.class));
+                    provService.get(provPath, userInfo.getAccessToken(), String.class));
             String billPath = url + "/billing";
             log.info("TEST LOG!!!: provPath: {}", provPath);
             properties.put(BILLING_SERVICE,
-                    externalService.get(billPath, userInfo.getAccessToken(), String.class));
+                    provService.get(billPath, userInfo.getAccessToken(), String.class));
         }
         return properties;
     }
@@ -91,7 +88,7 @@ public class ExternalChangeProperties implements ChangePropertiesConst {
 
             url += findMethodName(name);
             log.info("TEST LOG: on external call method , url for the next step: {}", url);
-            externalService.post(url, ymlDTO.getYmlString(), userInfo.getAccessToken(), String.class);
+            provService.post(url, ymlDTO.getYmlString(), userInfo.getAccessToken(), String.class);
         }
     }
 
@@ -104,7 +101,7 @@ public class ExternalChangeProperties implements ChangePropertiesConst {
             changePropertiesService.restart(restartForm);
         } else {
             log.info("External request for endpoint {}, for user {}", restartForm.getEndpoint(), userInfo.getSimpleName());
-            externalService.post(url, userInfo.getAccessToken(), restartForm, Void.class);
+            provService.post(url, userInfo.getAccessToken(), restartForm, Void.class);
         }
     }
 
diff --git a/services/self-service/src/main/java/com/epam/datalab/backendapi/resources/ChangePropertiesResource.java b/services/self-service/src/main/java/com/epam/datalab/backendapi/resources/ChangePropertiesResource.java
index 7d0dafc..0e6d032 100644
--- a/services/self-service/src/main/java/com/epam/datalab/backendapi/resources/ChangePropertiesResource.java
+++ b/services/self-service/src/main/java/com/epam/datalab/backendapi/resources/ChangePropertiesResource.java
@@ -93,7 +93,7 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
     @Path("/multiple/provisioning-service")
     public Response overwriteExternalProvisioningServiceProperties(@Auth UserInfo userInfo, YmlDTO ymlDTO) {
         if (UserRoles.isAdmin(userInfo)) {
-            String url = findEndpointDTOUrl(ymlDTO.getEndpointName()) + EXTERNAL_OVERWRITE_URL;
+            String url = findEndpointDTOUrl(ymlDTO.getEndpointName()) + BASE_CONFIG_URL;
             log.info("TEST LOG: on /multiple method, url for the next step: {}", url);
             externalChangeProperties.overwritePropertiesWithExternal(PROVISIONING_SERVICE_PROP_PATH, PROVISIONING_SERVICE,
                     ymlDTO, userInfo, url);
@@ -109,7 +109,7 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
     @Path("/multiple/billing")
     public Response overwriteExternalBillingProperties(@Auth UserInfo userInfo, YmlDTO ymlDTO) {
         if (UserRoles.isAdmin(userInfo)) {
-            String url = findEndpointDTOUrl(ymlDTO.getEndpointName()) + EXTERNAL_OVERWRITE_URL;
+            String url = findEndpointDTOUrl(ymlDTO.getEndpointName()) + BASE_CONFIG_URL;
             log.info("TEST LOG: on /multiple method, url for the next step: {}", url);
             externalChangeProperties.overwritePropertiesWithExternal(BILLING_SERVICE_PROP_PATH, BILLING_SERVICE,
                     ymlDTO, userInfo, url);

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