Repository: stratos
Updated Branches:
  refs/heads/4.1.0-test aceb115f3 -> aa5032702


Updating deploy application cli command


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/cb576861
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/cb576861
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/cb576861

Branch: refs/heads/4.1.0-test
Commit: cb576861e61816f34a24a241ea16c0d1eea18ac7
Parents: aceb115
Author: Imesh Gunaratne <[email protected]>
Authored: Wed Dec 17 15:47:18 2014 +0530
Committer: Imesh Gunaratne <[email protected]>
Committed: Wed Dec 17 15:47:18 2014 +0530

----------------------------------------------------------------------
 .../java/org/apache/stratos/cli/RestCommandLineService.java   | 7 ++++---
 .../apache/stratos/cli/commands/DeployApplicationCommand.java | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/cb576861/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index ea7452d..61f5e2b 100644
--- 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -75,7 +75,7 @@ public class RestCommandLineService {
     private static final String ENDPOINT_DEPLOY_KUBERNETES_CLUSTER = 
API_CONTEXT + "/kubernetesCluster";
     private static final String ENDPOINT_DEPLOY_KUBERNETES_HOST = API_CONTEXT 
+ "/kubernetesCluster/{kubernetesClusterId}/minion";
     private static final String ENDPOINT_DEPLOY_SERVICE_GROUP = API_CONTEXT + 
"/groups";
-    private static final String ENDPOINT_DEPLOY_APPLICATION = API_CONTEXT + 
"/applications";
+    private static final String ENDPOINT_DEPLOY_APPLICATION = API_CONTEXT + 
"/applications/{applicationId}/deploy";
 
     private static final String ENDPOINT_UNDEPLOY_KUBERNETES_CLUSTER= 
API_CONTEXT + "/kubernetesCluster/{id}";
     private static final String ENDPOINT_UNDEPLOY_KUBERNETES_HOST = 
API_CONTEXT + "/kubernetesCluster/{kubernetesClusterId}/hosts/{id}";
@@ -930,8 +930,9 @@ public class RestCommandLineService {
     }
 
     // This method helps to deploy applications
-    public void deployApplication (String entityBody) {
-        restClient.deployEntity(ENDPOINT_DEPLOY_APPLICATION, entityBody, 
"application");
+    public void deployApplication (String applicationId, String entityBody) {
+        
restClient.deployEntity(ENDPOINT_DEPLOY_APPLICATION.replace("{applicationId}", 
applicationId), entityBody,
+                "application");
     }
 
     // This method helps to undeploy applications

http://git-wip-us.apache.org/repos/asf/stratos/blob/cb576861/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployApplicationCommand.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployApplicationCommand.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployApplicationCommand.java
index 25e9567..699f803 100644
--- 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployApplicationCommand.java
+++ 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DeployApplicationCommand.java
@@ -59,7 +59,7 @@ public class DeployApplicationCommand implements 
Command<StratosCommandContext>
 
     @Override
     public String getArgumentSyntax() {
-        return null;
+        return "[application-id]";
     }
 
     @Override
@@ -77,6 +77,7 @@ public class DeployApplicationCommand implements 
Command<StratosCommandContext>
             context.getStratosApplication().printUsage(getName());
             return CliConstants.COMMAND_FAILED;
         }
+        String applicationId = args[0];
 
         try {
             CommandLineParser parser = new GnuParser();
@@ -88,7 +89,7 @@ public class DeployApplicationCommand implements 
Command<StratosCommandContext>
                     return CliConstants.COMMAND_FAILED;
                 }
                 String resourceFileContent = 
CliUtils.readResource(resourcePath);
-                
RestCommandLineService.getInstance().deployApplication(resourceFileContent);
+                
RestCommandLineService.getInstance().deployApplication(applicationId, 
resourceFileContent);
                 return CliConstants.COMMAND_SUCCESSFULL;
             } else {
                 System.out.println("usage: " + getName() + " [-" + 
CliConstants.RESOURCE_PATH + " " + CliConstants.RESOURCE_PATH_LONG_OPTION + 
"]");

Reply via email to