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/06 09:59:57 UTC

[incubator-datalab] branch develop updated: [DATALAB-2314] -- hot fix

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new a0440b0  [DATALAB-2314] -- hot fix
     new 72e7988  Merge branch 'develop' of https://github.com/apache/incubator-datalab into develop
a0440b0 is described below

commit a0440b00767f09cd76ca08f2e69a941a0c08d077
Author: KinashYurii <ur...@gmail.com>
AuthorDate: Tue Apr 6 12:59:26 2021 +0300

    [DATALAB-2314] -- hot fix
---
 ...roperties.java => ChangePropertiesService.java} | 135 +++++----------------
 .../properties/ExternalChangeProperties.java       |  91 ++++++++++++++
 .../resources/ChangePropertiesResource.java        |  23 ++--
 .../resources/ChangePropertiesResource.java        |  22 ++--
 4 files changed, 141 insertions(+), 130 deletions(-)

diff --git a/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/DynamicChangeProperties.java b/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesService.java
similarity index 61%
rename from services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/DynamicChangeProperties.java
rename to services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesService.java
index 9691739..7244137 100644
--- a/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/DynamicChangeProperties.java
+++ b/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesService.java
@@ -1,15 +1,9 @@
 package com.epam.datalab.properties;
 
-import com.epam.datalab.auth.UserInfo;
-import com.epam.datalab.constants.ServiceConsts;
 import com.epam.datalab.exceptions.DynamicChangePropertiesException;
-import com.epam.datalab.rest.client.RESTService;
-import com.google.inject.name.Named;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FileUtils;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
 
-import javax.inject.Inject;
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileWriter;
@@ -23,50 +17,33 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 @Slf4j
-public class DynamicChangeProperties implements ChangePropertiesConst {
-    private final RESTService externalSelfService;
+public class ChangePropertiesService {
 
-    @Inject
-    public DynamicChangeProperties(@Named(ServiceConsts.PROVISIONING_SERVICE_NAME) RESTService externalSelfService) {
-        this.externalSelfService = externalSelfService;
-    }
-
-    public String getProperties(String path, String name) {
-        return readFileAsString(path, name);
-    }
-
-    public void overwriteProperties(String path, String name, String ymlString) {
-        writeFileFromString(ymlString, name, path);
-    }
-
-    public Map<String, String> getPropertiesWithExternal(String endpoint, UserInfo userInfo, String url) {
-        Map<String, String> properties = new HashMap<>();
-        if (endpoint.equals(ChangePropertiesConst.LOCAL_ENDPOINT_NAME)) {
-            properties.put(ChangePropertiesConst.SELF_SERVICE, getProperties(ChangePropertiesConst.SELF_SERVICE_PROP_PATH, ChangePropertiesConst.SELF_SERVICE));
-            properties.put(ChangePropertiesConst.PROVISIONING_SERVICE, getProperties(ChangePropertiesConst.PROVISIONING_SERVICE_PROP_PATH, ChangePropertiesConst.PROVISIONING_SERVICE));
-            properties.put(ChangePropertiesConst.BILLING_SERVICE, getProperties(ChangePropertiesConst.BILLING_SERVICE_PROP_PATH, ChangePropertiesConst.BILLING_SERVICE));
-        } else {
-            log.info("Trying to read properties, for external endpoint : {} , for user: {}",
-                    endpoint, userInfo.getSimpleName());
-            properties.put(ChangePropertiesConst.PROVISIONING_SERVICE,
-                    externalSelfService.get(url + "/provisioning-service", userInfo.getAccessToken(), String.class));
-            properties.put(ChangePropertiesConst.BILLING_SERVICE,
-                    externalSelfService.get(url + "/billing", userInfo.getAccessToken(), String.class));
+    public String readFileAsString(String selfServicePropPath, String serviceName) {
+        try {
+            log.info("Trying to read {}, file from path {} :", serviceName, selfServicePropPath);
+            String currentConf = FileUtils.readFileToString(new File(selfServicePropPath), Charset.defaultCharset());
+            return hideSecretsAndRemoveLicence(currentConf);
+        } catch (IOException e) {
+            log.error(e.getMessage());
+            throw new DynamicChangePropertiesException(String.format("Failed while read file %s", serviceName));
         }
-        return properties;
     }
 
-    public void overwritePropertiesWithExternal(String path, String name, YmlDTO ymlDTO, UserInfo userInfo,
-                                                String url) {
-        log.info("Trying to write {}, for external endpoint : {} , for user: {}",
-                name, ymlDTO.getEndpointName(), userInfo.getSimpleName());
-        if (ymlDTO.getEndpointName().equals(ChangePropertiesConst.LOCAL_ENDPOINT_NAME)
-                || name.equals(SELF_SERVICE)
-                || name.equals(GKE_SELF_SERVICE)) {
-            writeFileFromString(ymlDTO.getYmlString(), name, path);
-        } else {
-            url += findMethodName(name);
-            externalSelfService.post(url, ymlDTO.getYmlString(), userInfo.getAccessToken(), String.class);
+    public void writeFileFromString(String newPropFile, String serviceName, String servicePath) {
+        try {
+            String oldFile = FileUtils.readFileToString(new File(servicePath), Charset.defaultCharset());
+            changeCHMODE(serviceName, servicePath, ChangePropertiesConst.DEFAULT_CHMOD, ChangePropertiesConst.WRITE_CHMOD);
+            BufferedWriter writer = new BufferedWriter(new FileWriter(servicePath));
+            log.info("Trying to overwrite {}, file for path {} :", serviceName, servicePath);
+            writer.write(addLicence());
+            writer.write(checkAndReplaceSecretIfEmpty(newPropFile, oldFile));
+            log.info("{} overwritten successfully", serviceName);
+            writer.close();
+            changeCHMODE(serviceName, servicePath, ChangePropertiesConst.WRITE_CHMOD, ChangePropertiesConst.DEFAULT_CHMOD);
+        } catch (IOException e) {
+            log.error("Failed during overwriting {}", serviceName);
+            throw new DynamicChangePropertiesException(String.format("Failed during overwriting %s", serviceName));
         }
     }
 
@@ -84,47 +61,6 @@ public class DynamicChangeProperties implements ChangePropertiesConst {
         }
     }
 
-    public void restartForExternal(RestartForm restartForm, UserInfo userInfo, String url) {
-        if (restartForm.getEndpoint().equals(LOCAL_ENDPOINT_NAME)) {
-            restart(restartForm);
-        } else {
-            log.info("External request for endpoint {}, for user {}", restartForm.getEndpoint(), userInfo.getSimpleName());
-            externalSelfService.post(url, userInfo.getAccessToken(), restartForm, Void.class);
-        }
-    }
-
-    private String findMethodName(String name) {
-        switch (name) {
-            case "provisioning.yml": {
-                return "/provisioning-service";
-            }
-            case "billing.yml": {
-                return "/billing";
-            }
-            default:
-                return "";
-        }
-    }
-
-
-    private String buildSHRestartCommand(boolean billing, boolean provserv, boolean ui) {
-        StringBuilder stringBuilder = new StringBuilder(ChangePropertiesConst.SUPERVISORCTL_RESTART_SH_COMMAND);
-        if (billing) stringBuilder.append(ChangePropertiesConst.BILLING_SERVICE_SUPERVISORCTL_RUN_NAME);
-        if (provserv) stringBuilder.append(ChangePropertiesConst.PROVISIONING_SERVICE_SUPERVISORCTL_RUN_NAME);
-        if (ui) stringBuilder.append(ChangePropertiesConst.SELF_SERVICE_SUPERVISORCTL_RUN_NAME);
-        return stringBuilder.toString();
-    }
-
-    private String readFileAsString(String selfServicePropPath, String serviceName) {
-        try {
-            log.info("Trying to read {}, file from path {} :", serviceName, selfServicePropPath);
-            String currentConf = FileUtils.readFileToString(new File(selfServicePropPath), Charset.defaultCharset());
-            return hideSecretsAndRemoveLicence(currentConf);
-        } catch (IOException e) {
-            log.error(e.getMessage());
-            throw new DynamicChangePropertiesException(String.format("Failed while read file %s", serviceName));
-        }
-    }
 
     private String hideSecretsAndRemoveLicence(String currentConf) {
         Matcher m = Pattern.compile(ChangePropertiesConst.SECRET_REGEX).matcher(currentConf);
@@ -145,22 +81,6 @@ public class DynamicChangeProperties implements ChangePropertiesConst {
         return conf.split(ChangePropertiesConst.LICENCE_REGEX)[conf.split(ChangePropertiesConst.LICENCE_REGEX).length - 1];
     }
 
-    private void writeFileFromString(String newPropFile, String serviceName, String servicePath) {
-        try {
-            String oldFile = FileUtils.readFileToString(new File(servicePath), Charset.defaultCharset());
-            changeCHMODE(serviceName, servicePath, ChangePropertiesConst.DEFAULT_CHMOD, ChangePropertiesConst.WRITE_CHMOD);
-            BufferedWriter writer = new BufferedWriter(new FileWriter(servicePath));
-            log.info("Trying to overwrite {}, file for path {} :", serviceName, servicePath);
-            writer.write(addLicence());
-            writer.write(checkAndReplaceSecretIfEmpty(newPropFile, oldFile));
-            log.info("{} overwritten successfully", serviceName);
-            writer.close();
-            changeCHMODE(serviceName, servicePath, ChangePropertiesConst.WRITE_CHMOD, ChangePropertiesConst.DEFAULT_CHMOD);
-        } catch (IOException e) {
-            log.error("Failed during overwriting {}", serviceName);
-            throw new DynamicChangePropertiesException(String.format("Failed during overwriting %s", serviceName));
-        }
-    }
 
     private void changeCHMODE(String serviceName, String path, String fromMode, String toMode) throws IOException {
         try {
@@ -206,7 +126,12 @@ public class DynamicChangeProperties implements ChangePropertiesConst {
         return emptySecrets;
     }
 
-    public void restartForExternalForGKE(UserInfo userInfo, RestartForm restartForm) {
-        throw new NotImplementedException();
+    private String buildSHRestartCommand(boolean billing, boolean provserv, boolean ui) {
+        StringBuilder stringBuilder = new StringBuilder(ChangePropertiesConst.SUPERVISORCTL_RESTART_SH_COMMAND);
+        if (billing) stringBuilder.append(ChangePropertiesConst.BILLING_SERVICE_SUPERVISORCTL_RUN_NAME);
+        if (provserv) stringBuilder.append(ChangePropertiesConst.PROVISIONING_SERVICE_SUPERVISORCTL_RUN_NAME);
+        if (ui) stringBuilder.append(ChangePropertiesConst.SELF_SERVICE_SUPERVISORCTL_RUN_NAME);
+        return stringBuilder.toString();
     }
+
 }
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
new file mode 100644
index 0000000..8e7fcf3
--- /dev/null
+++ b/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ExternalChangeProperties.java
@@ -0,0 +1,91 @@
+package com.epam.datalab.properties;
+
+import com.epam.datalab.auth.UserInfo;
+import com.epam.datalab.constants.ServiceConsts;
+import com.epam.datalab.rest.client.RESTService;
+import com.google.inject.name.Named;
+import lombok.extern.slf4j.Slf4j;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+import javax.inject.Inject;
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+public class ExternalChangeProperties implements ChangePropertiesConst {
+    private final RESTService externalSelfService;
+    private final ChangePropertiesService changePropertiesService;
+
+    @Inject
+    public ExternalChangeProperties(@Named(ServiceConsts.PROVISIONING_SERVICE_NAME)
+                                           RESTService externalSelfService, ChangePropertiesService changePropertiesService) {
+        this.externalSelfService = externalSelfService;
+        this.changePropertiesService = changePropertiesService;
+    }
+
+    public String getProperties(String path, String name) {
+        return changePropertiesService.readFileAsString(path, name);
+    }
+
+    public void overwriteProperties(String path, String name, String ymlString) {
+        changePropertiesService.writeFileFromString(ymlString, name, path);
+    }
+
+    public Map<String, String> getPropertiesWithExternal(String endpoint, UserInfo userInfo, String url) {
+        Map<String, String> properties = new HashMap<>();
+        if (endpoint.equals(ChangePropertiesConst.LOCAL_ENDPOINT_NAME)) {
+            properties.put(ChangePropertiesConst.SELF_SERVICE, getProperties(ChangePropertiesConst.SELF_SERVICE_PROP_PATH, ChangePropertiesConst.SELF_SERVICE));
+            properties.put(ChangePropertiesConst.PROVISIONING_SERVICE, getProperties(ChangePropertiesConst.PROVISIONING_SERVICE_PROP_PATH, ChangePropertiesConst.PROVISIONING_SERVICE));
+            properties.put(ChangePropertiesConst.BILLING_SERVICE, getProperties(ChangePropertiesConst.BILLING_SERVICE_PROP_PATH, ChangePropertiesConst.BILLING_SERVICE));
+        } else {
+            log.info("Trying to read properties, for external endpoint : {} , for user: {}",
+                    endpoint, userInfo.getSimpleName());
+            properties.put(ChangePropertiesConst.PROVISIONING_SERVICE,
+                    externalSelfService.get(url + "/provisioning-service", userInfo.getAccessToken(), String.class));
+            properties.put(ChangePropertiesConst.BILLING_SERVICE,
+                    externalSelfService.get(url + "/billing", userInfo.getAccessToken(), String.class));
+        }
+        return properties;
+    }
+
+    public void overwritePropertiesWithExternal(String path, String name, YmlDTO ymlDTO, UserInfo userInfo,
+                                                String url) {
+        log.info("Trying to write {}, for external endpoint : {} , for user: {}",
+                name, ymlDTO.getEndpointName(), userInfo.getSimpleName());
+        if (ymlDTO.getEndpointName().equals(ChangePropertiesConst.LOCAL_ENDPOINT_NAME)
+                || name.equals(SELF_SERVICE)
+                || name.equals(GKE_SELF_SERVICE)) {
+            changePropertiesService.writeFileFromString(ymlDTO.getYmlString(), name, path);
+        } else {
+            url += findMethodName(name);
+            externalSelfService.post(url, ymlDTO.getYmlString(), userInfo.getAccessToken(), String.class);
+        }
+    }
+
+
+    public void restartForExternal(RestartForm restartForm, UserInfo userInfo, String url) {
+        if (restartForm.getEndpoint().equals(LOCAL_ENDPOINT_NAME)) {
+            changePropertiesService.restart(restartForm);
+        } else {
+            log.info("External request for endpoint {}, for user {}", restartForm.getEndpoint(), userInfo.getSimpleName());
+            externalSelfService.post(url, userInfo.getAccessToken(), restartForm, Void.class);
+        }
+    }
+
+    private String findMethodName(String name) {
+        switch (name) {
+            case "provisioning.yml": {
+                return "/provisioning-service";
+            }
+            case "billing.yml": {
+                return "/billing";
+            }
+            default:
+                return "";
+        }
+    }
+
+    public void restartForExternalForGKE(UserInfo userInfo, RestartForm restartForm) {
+        throw new NotImplementedException();
+    }
+}
diff --git a/services/provisioning-service/src/main/java/com/epam/datalab/backendapi/resources/ChangePropertiesResource.java b/services/provisioning-service/src/main/java/com/epam/datalab/backendapi/resources/ChangePropertiesResource.java
index 0f61552..2b8306d 100644
--- a/services/provisioning-service/src/main/java/com/epam/datalab/backendapi/resources/ChangePropertiesResource.java
+++ b/services/provisioning-service/src/main/java/com/epam/datalab/backendapi/resources/ChangePropertiesResource.java
@@ -1,15 +1,11 @@
 package com.epam.datalab.backendapi.resources;
 
 import com.epam.datalab.auth.UserInfo;
-import com.epam.datalab.backendapi.ProvisioningServiceApplicationConfiguration;
-import com.epam.datalab.backendapi.core.FileHandlerCallback;
 import com.epam.datalab.backendapi.core.response.folderlistener.FolderListener;
-import com.epam.datalab.backendapi.core.response.folderlistener.FolderListenerExecutor;
 import com.epam.datalab.backendapi.core.response.folderlistener.WatchItem;
 import com.epam.datalab.backendapi.core.response.folderlistener.WatchItemList;
-import com.epam.datalab.backendapi.core.response.handlers.dao.CallbackHandlerDao;
 import com.epam.datalab.properties.ChangePropertiesConst;
-import com.epam.datalab.properties.DynamicChangeProperties;
+import com.epam.datalab.properties.ChangePropertiesService;
 import com.epam.datalab.properties.RestartForm;
 import com.epam.datalab.properties.YmlDTO;
 import io.dropwizard.auth.Auth;
@@ -33,20 +29,19 @@ import static com.epam.datalab.backendapi.core.response.folderlistener.WatchItem
 @Slf4j
 public class ChangePropertiesResource implements ChangePropertiesConst {
 
-    private final DynamicChangeProperties dynamicChangeProperties;
+    private final ChangePropertiesService changePropertiesService;
     private final List<WatchItem.ItemStatus> inProgressStatuses = Arrays.asList(INPROGRESS, WAIT_FOR_FILE);
 
     @Inject
-    public ChangePropertiesResource(DynamicChangeProperties dynamicChangeProperties,
-                                    ProvisioningServiceApplicationConfiguration conf) {
-        this.dynamicChangeProperties = dynamicChangeProperties;
+    public ChangePropertiesResource(ChangePropertiesService changePropertiesService) {
+        this.changePropertiesService = changePropertiesService;
     }
 
     @GET
     @Path("/provisioning-service")
     public Response getProvisioningServiceProperties(@Auth UserInfo userInfo) {
         return Response
-                .ok(dynamicChangeProperties.getProperties(PROVISIONING_SERVICE_PROP_PATH, PROVISIONING_SERVICE))
+                .ok(changePropertiesService.readFileAsString(PROVISIONING_SERVICE_PROP_PATH, PROVISIONING_SERVICE))
                 .build();
     }
 
@@ -54,14 +49,14 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
     @Path("/billing")
     public Response getBillingServiceProperties(@Auth UserInfo userInfo) {
         return Response
-                .ok(dynamicChangeProperties.getProperties(BILLING_SERVICE_PROP_PATH, BILLING_SERVICE))
+                .ok(changePropertiesService.readFileAsString(BILLING_SERVICE_PROP_PATH, BILLING_SERVICE))
                 .build();
     }
 
     @POST
     @Path("/provisioning-service")
     public Response overwriteProvisioningServiceProperties(@Auth UserInfo userInfo, YmlDTO ymlDTO) {
-        dynamicChangeProperties.overwriteProperties(PROVISIONING_SERVICE_PROP_PATH, PROVISIONING_SERVICE,
+        changePropertiesService.writeFileFromString(PROVISIONING_SERVICE_PROP_PATH, PROVISIONING_SERVICE,
                 ymlDTO.getYmlString());
         return Response.ok().build();
     }
@@ -69,7 +64,7 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
     @POST
     @Path("/billing")
     public Response overwriteBillingServiceProperties(@Auth UserInfo userInfo, YmlDTO ymlDTO) {
-        dynamicChangeProperties.overwriteProperties(BILLING_SERVICE_PROP_PATH, BILLING_SERVICE, ymlDTO.getYmlString());
+        changePropertiesService.writeFileFromString(BILLING_SERVICE_PROP_PATH, BILLING_SERVICE, ymlDTO.getYmlString());
         return Response.ok().build();
 
     }
@@ -78,7 +73,7 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
     @Path("/restart")
     public Response restart(@Auth UserInfo userInfo, RestartForm restartForm) {
         checkResponseFiles(restartForm);
-        dynamicChangeProperties.restart(restartForm);
+        changePropertiesService.restart(restartForm);
         return Response.ok().build();
     }
 
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 fa86d6d..bc03f15 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
@@ -1,7 +1,7 @@
 package com.epam.datalab.backendapi.resources;
 
 import com.epam.datalab.properties.ChangePropertiesConst;
-import com.epam.datalab.properties.DynamicChangeProperties;
+import com.epam.datalab.properties.ExternalChangeProperties;
 import com.epam.datalab.properties.RestartForm;
 import com.epam.datalab.properties.YmlDTO;
 import com.epam.datalab.auth.UserInfo;
@@ -23,14 +23,14 @@ import javax.ws.rs.core.Response;
 public class ChangePropertiesResource implements ChangePropertiesConst {
 
     private final EndpointDAO endpointDAO;
-    private final DynamicChangeProperties dynamicChangeProperties;
+    private final ExternalChangeProperties externalChangeProperties;
     private final String deployedOn;
 
     @Inject
-    public ChangePropertiesResource(EndpointDAO endpointDAO, DynamicChangeProperties dynamicChangeProperties,
+    public ChangePropertiesResource(EndpointDAO endpointDAO, ExternalChangeProperties externalChangeProperties,
                                     SelfServiceApplicationConfiguration selfServiceApplicationConfiguration) {
         this.endpointDAO = endpointDAO;
-        this.dynamicChangeProperties = dynamicChangeProperties;
+        this.externalChangeProperties = externalChangeProperties;
         deployedOn = selfServiceApplicationConfiguration.getDeployed();
     }
 
@@ -40,7 +40,7 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
         if (UserRoles.isAdmin(userInfo)) {
             String url = findEndpointDTO(endpoint).getUrl() + ChangePropertiesConst.BASE_CONFIG_URL;
             return Response
-                    .ok(dynamicChangeProperties.getPropertiesWithExternal(endpoint, userInfo, url))
+                    .ok(externalChangeProperties.getPropertiesWithExternal(endpoint, userInfo, url))
                     .build();
         } else {
             return Response
@@ -54,10 +54,10 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
     public Response overwriteExternalSelfServiceProperties(@Auth UserInfo userInfo, YmlDTO ymlDTO) {
         if (UserRoles.isAdmin(userInfo)) {
             if (deployedOn.equals("GKE")) {
-                dynamicChangeProperties.overwritePropertiesWithExternal(GKE_SELF_SERVICE_PATH, GKE_SELF_SERVICE,
+                externalChangeProperties.overwritePropertiesWithExternal(GKE_SELF_SERVICE_PATH, GKE_SELF_SERVICE,
                         ymlDTO, userInfo, null);
             } else {
-                dynamicChangeProperties.overwritePropertiesWithExternal(SELF_SERVICE_PROP_PATH, SELF_SERVICE,
+                externalChangeProperties.overwritePropertiesWithExternal(SELF_SERVICE_PROP_PATH, SELF_SERVICE,
                         ymlDTO, userInfo, null);
             }
             return Response.status(Response.Status.OK).build();
@@ -73,7 +73,7 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
     public Response overwriteExternalProvisioningServiceProperties(@Auth UserInfo userInfo, YmlDTO ymlDTO) {
         if (UserRoles.isAdmin(userInfo)) {
             String url = findEndpointDTO(ymlDTO.getEndpointName()).getUrl() + ChangePropertiesConst.BASE_MULTIPLE_CONFIG_URL;
-            dynamicChangeProperties.overwritePropertiesWithExternal(PROVISIONING_SERVICE_PROP_PATH, PROVISIONING_SERVICE,
+            externalChangeProperties.overwritePropertiesWithExternal(PROVISIONING_SERVICE_PROP_PATH, PROVISIONING_SERVICE,
                     ymlDTO, userInfo, url);
             return Response.status(Response.Status.OK).build();
         } else {
@@ -88,7 +88,7 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
     public Response overwriteExternalBillingProperties(@Auth UserInfo userInfo, YmlDTO ymlDTO) {
         if (UserRoles.isAdmin(userInfo)) {
             String url = findEndpointDTO(ymlDTO.getEndpointName()).getUrl() + ChangePropertiesConst.BASE_MULTIPLE_CONFIG_URL;
-            dynamicChangeProperties.overwritePropertiesWithExternal(BILLING_SERVICE_PROP_PATH, BILLING_SERVICE,
+            externalChangeProperties.overwritePropertiesWithExternal(BILLING_SERVICE_PROP_PATH, BILLING_SERVICE,
                     ymlDTO, userInfo, url);
             return Response.status(Response.Status.OK).build();
         } else {
@@ -104,10 +104,10 @@ public class ChangePropertiesResource implements ChangePropertiesConst {
     public Response restartWithExternal(@Auth UserInfo userInfo, RestartForm restartForm) {
         if (UserRoles.isAdmin(userInfo)) {
             if (deployedOn.equals("GKE")) {
-                dynamicChangeProperties.restartForExternalForGKE(userInfo, restartForm);
+                externalChangeProperties.restartForExternalForGKE(userInfo, restartForm);
             } else {
                 String url = findEndpointDTO(restartForm.getEndpoint()).getUrl() + ChangePropertiesConst.RESTART_URL;
-                dynamicChangeProperties.restartForExternal(restartForm, userInfo, url);
+                externalChangeProperties.restartForExternal(restartForm, userInfo, url);
             }
             return Response.ok().build();
         } else {

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