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

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


The following commit(s) were added to refs/heads/DATALAB-2369 by this push:
     new 1883180  [DATALAB-2314] -- fixed bugs with config page. Added --label 
edge_status options for  docker action: status
1883180 is described below

commit 18831802f5109dd2d843dd35fc5c38b78baf5241
Author: KinashYurii <[email protected]>
AuthorDate: Fri May 28 19:17:55 2021 +0300

    [DATALAB-2314] -- fixed bugs with config page. Added --label edge_status 
options for  docker action: status
---
 .../com/epam/datalab/properties/ChangePropertiesConst.java     | 10 +++++-----
 .../com/epam/datalab/properties/ExternalChangeProperties.java  |  9 +--------
 .../datalab/backendapi/core/commands/RunDockerCommand.java     |  5 +++--
 .../datalab/backendapi/resources/ChangePropertiesResource.java |  8 +++-----
 4 files changed, 12 insertions(+), 20 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 fe7bcd3..235ddc7 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
@@ -23,22 +23,22 @@ public interface ChangePropertiesConst {
     String GKE_SELF_SERVICE_PATH = "/root/self-service.yaml";
     String GKE_SELF_SERVICE = "self-service.yaml";
     String SELF_SERVICE = "self-service.yml";
-    //    String SELF_SERVICE_PROP_PATH = 
"services/self-service/self-service.yml";
+    //        String SELF_SERVICE_PROP_PATH = 
"services/self-service/self-service.yml";
     String SELF_SERVICE_PROP_PATH = "/opt/datalab/conf/self-service.yml";
     String PROVISIONING_SERVICE = "provisioning.yml";
-    //    String PROVISIONING_SERVICE_PROP_PATH = 
"services/provisioning-service/provisioning.yml";
+    //        String PROVISIONING_SERVICE_PROP_PATH = 
"services/provisioning-service/provisioning.yml";
     String PROVISIONING_SERVICE_PROP_PATH = 
"/opt/datalab/conf/provisioning.yml";
 
     String BILLING_SERVICE = "billing.yml";
-    //  String BILLING_SERVICE_PROP_PATH = "services/billing-gcp/billing.yml";
+    //      String BILLING_SERVICE_PROP_PATH = 
"services/billing-gcp/billing.yml";
 //      String BILLING_SERVICE_PROP_PATH = 
"services/billing-azure/billing.yml";
 //    String BILLING_SERVICE_PROP_PATH = "services/billing-aws/billing.yml";
     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 = "/config/restart";
+    String RESTART_URL = "config/restart";
     String LOCAL_ENDPOINT_NAME = "local";
-    String BASE_CONFIG_URL = "/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 19647a5..7debcae 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
@@ -52,24 +52,18 @@ public class ExternalChangeProperties implements 
ChangePropertiesConst {
 
     public Map<String, String> getPropertiesWithExternal(String endpoint, 
UserInfo userInfo, String url) {
         Map<String, String> properties = new HashMap<>();
-        log.info("TEST LOG!!!: endpoint: {}, local const: {}",
-                endpoint, LOCAL_ENDPOINT_NAME);
         if (endpoint.equals(LOCAL_ENDPOINT_NAME)) {
-            log.info("TEST LOG!!!: LOCAL");
             properties.put(SELF_SERVICE, getProperties(SELF_SERVICE_PROP_PATH, 
SELF_SERVICE));
             properties.put(PROVISIONING_SERVICE, 
getProperties(PROVISIONING_SERVICE_PROP_PATH, PROVISIONING_SERVICE));
             properties.put(BILLING_SERVICE, 
getProperties(BILLING_SERVICE_PROP_PATH, BILLING_SERVICE));
 
         } else {
-            log.info("TEST LOG!!!: EXTERNAL");
             log.info("Trying to read properties, for external endpoint : {} , 
for user: {}",
                     endpoint, userInfo.getSimpleName());
             String provPath = url + "/provisioning-service";
-            log.info("TEST LOG!!!: provPath: {}", provPath);
             properties.put(PROVISIONING_SERVICE,
                     provService.get(provPath, userInfo.getAccessToken(), 
String.class));
             String billPath = url + "/billing";
-            log.info("TEST LOG!!!: provPath: {}", provPath);
             properties.put(BILLING_SERVICE,
                     provService.get(billPath, userInfo.getAccessToken(), 
String.class));
         }
@@ -86,8 +80,7 @@ public class ExternalChangeProperties implements 
ChangePropertiesConst {
             changePropertiesService.writeFileFromString(ymlDTO.getYmlString(), 
name, path);
         } else {
             url += findMethodName(name);
-            log.info("TEST LOG: on external call method , url for the next 
step: {}", url);
-            provService.post(url, ymlDTO.getYmlString(), 
userInfo.getAccessToken(), String.class);
+            provService.post(url, userInfo.getAccessToken(), ymlDTO, 
Void.class);
         }
     }
 
diff --git 
a/services/provisioning-service/src/main/java/com/epam/datalab/backendapi/core/commands/RunDockerCommand.java
 
b/services/provisioning-service/src/main/java/com/epam/datalab/backendapi/core/commands/RunDockerCommand.java
index 66ca1be..3643bad 100644
--- 
a/services/provisioning-service/src/main/java/com/epam/datalab/backendapi/core/commands/RunDockerCommand.java
+++ 
b/services/provisioning-service/src/main/java/com/epam/datalab/backendapi/core/commands/RunDockerCommand.java
@@ -25,8 +25,8 @@ import java.util.List;
 
 public class RunDockerCommand implements CmdCommand {
     public static final String EDGE_USER_NAME_FORMAT = "-e 
\"edge_user_name=%s\"";
-    private String command = "docker run";
-    private List<String> options = new LinkedList<>();
+    private final String command = "docker run";
+    private final List<String> options = new LinkedList<>();
     private String image;
     private DockerAction action;
 
@@ -116,6 +116,7 @@ public class RunDockerCommand implements CmdCommand {
     }
 
     public RunDockerCommand withActionStatus(String toStatus) {
+        this.options.add("--label edge_status");
         this.image = toStatus;
         this.action = DockerAction.STATUS;
         return this;
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 0464d3f..f8ff2ff 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
@@ -75,23 +75,21 @@ public class ChangePropertiesResource implements 
ChangePropertiesConst {
     @POST
     @Path("/provisioning-service")
     public Response overwriteProvisioningServiceProperties(@Auth UserInfo 
userInfo, YmlDTO ymlDTO) {
-        
changePropertiesService.writeFileFromString(PROVISIONING_SERVICE_PROP_PATH, 
PROVISIONING_SERVICE,
-                ymlDTO.getYmlString());
+        changePropertiesService.writeFileFromString(ymlDTO.getYmlString(), 
PROVISIONING_SERVICE, PROVISIONING_SERVICE_PROP_PATH);
         return Response.ok().build();
     }
 
     @POST
     @Path("/billing")
     public Response overwriteBillingServiceProperties(@Auth UserInfo userInfo, 
YmlDTO ymlDTO) {
-        changePropertiesService.writeFileFromString(BILLING_SERVICE_PROP_PATH, 
BILLING_SERVICE, ymlDTO.getYmlString());
+        changePropertiesService.writeFileFromString(ymlDTO.getYmlString(), 
BILLING_SERVICE, BILLING_SERVICE_PROP_PATH);
         return Response.ok().build();
-
     }
 
     @POST
     @Path("/restart")
     public Response restart(@Auth UserInfo userInfo, RestartForm restartForm) {
-        checkResponseFiles(restartForm);
+//        checkResponseFiles(restartForm);
         changePropertiesService.restart(restartForm);
         return Response.ok().build();
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to