You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ch...@apache.org on 2015/10/13 21:02:11 UTC

[2/2] stratos git commit: Fixing missing methods for application undeployment and application policy adding in Python CLI

Fixing missing methods for application undeployment and application policy adding in Python CLI


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

Branch: refs/heads/stratos-4.1.x
Commit: 34c9d560f0c36fecd0c058d731377e11d70da4ad
Parents: a75c45d
Author: Chamila de Alwis <ch...@apache.org>
Authored: Wed Oct 14 00:02:38 2015 +0530
Committer: Chamila de Alwis <ch...@apache.org>
Committed: Wed Oct 14 00:02:38 2015 +0530

----------------------------------------------------------------------
 .../org.apache.stratos.python.cli/src/main/python/cli/CLI.py | 6 +++---
 .../src/main/python/cli/Stratos.py                           | 8 ++++++--
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/34c9d560/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py b/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py
index f40e3b8..fe0c419 100755
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py
@@ -285,10 +285,10 @@ class CLI(Cmd):
     def do_undeploy_application(self, line , opts=None):
         """Undeploy an application."""
         try:
-            if not opts.application_id or not opts.application_policy_id:
-                print("usage: undeploy-application [-a <applicationId>] [-o <applicationPolicyId>]")
+            if not opts.application_id:
+                print("usage: undeploy-application [-a <applicationId>]")
             else:
-                application_removed = Stratos.undeploy_application(opts.application_id, opts.application_policy_id)
+                application_removed = Stratos.undeploy_application(opts.application_id)
                 if application_removed:
                     print("You have successfully undeployed application: "+opts.application_id)
                 else:

http://git-wip-us.apache.org/repos/asf/stratos/blob/34c9d560/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
index a1cf971..2b3dd29 100755
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
@@ -103,8 +103,8 @@ class Stratos:
         return Stratos.post('applications/'+application_id+'/deploy/'+application_policy_id, None)
 
     @staticmethod
-    def deploy_application(application_id, application_policy_id):
-        return Stratos.post('applications/'+application_id+'/undeploy/'+application_policy_id, None)
+    def undeploy_application(application_id):
+        return Stratos.post('applications/'+application_id+'/undeploy', None)
     @staticmethod
     def describe_application_runtime(application_id):
         return Stratos.get('applications/'+application_id+"/runtime")
@@ -342,6 +342,10 @@ class Stratos:
         return Stratos.post('autoscalingPolicies', json)
 
     @staticmethod
+    def add_application_policy(json):
+        return Stratos.post('applicationPolicies', json)
+
+    @staticmethod
     def update_autoscaling_policy(json):
         return Stratos.put('autoscalingPolicies', json)