You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/03/04 15:47:47 UTC

stratos git commit: updating complex-app sample

Repository: stratos
Updated Branches:
  refs/heads/master 4d392b471 -> fc539552c


updating complex-app sample


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

Branch: refs/heads/master
Commit: fc539552c223bae0bb05bfb5fece3131853fc027
Parents: 4d392b4
Author: R-Rajkumar <rr...@gmail.com>
Authored: Wed Mar 4 20:17:30 2015 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Wed Mar 4 20:17:30 2015 +0530

----------------------------------------------------------------------
 .../complex-app/artifacts/application-policy.json            | 8 --------
 samples/applications/complex-app/scripts/common/deploy.sh    | 8 +++++++-
 samples/applications/complex-app/scripts/common/undeploy.sh  | 6 +++++-
 3 files changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/fc539552/samples/applications/complex-app/artifacts/application-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/complex-app/artifacts/application-policy.json b/samples/applications/complex-app/artifacts/application-policy.json
deleted file mode 100644
index 9d2c6a1..0000000
--- a/samples/applications/complex-app/artifacts/application-policy.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-   "networkPartition":[
-      {
-         "id":"network-partition-1",
-         "activeByDefault":"true"
-      }
-   ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/fc539552/samples/applications/complex-app/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/complex-app/scripts/common/deploy.sh b/samples/applications/complex-app/scripts/common/deploy.sh
index a9f9e0c..60b6614 100755
--- a/samples/applications/complex-app/scripts/common/deploy.sh
+++ b/samples/applications/complex-app/scripts/common/deploy.sh
@@ -14,6 +14,7 @@ cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
 autoscaling_policies_path=`cd "${script_path}/../../../../autoscaling-policies"; pwd`
 network_partitions_path=`cd "${script_path}/../../../../network-partitions/${iaas}"; pwd`
 deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd`
+application_policies_path=`cd "${script_path}/../../../../application-policies"; pwd`
 
 set -e
 
@@ -49,10 +50,15 @@ curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/
 
 sleep 1
 
+echo "Adding application policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies
+
+sleep 1
+
 echo "Creating application..."
 curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
 
 sleep 1
 
 echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/complex-app/deploy
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/complex-app/deploy/application-policy-1

http://git-wip-us.apache.org/repos/asf/stratos/blob/fc539552/samples/applications/complex-app/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/complex-app/scripts/common/undeploy.sh b/samples/applications/complex-app/scripts/common/undeploy.sh
index f8d4dd5..b02bb03 100644
--- a/samples/applications/complex-app/scripts/common/undeploy.sh
+++ b/samples/applications/complex-app/scripts/common/undeploy.sh
@@ -23,4 +23,8 @@ curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://
 curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat2
 
 echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
\ No newline at end of file
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
+
+echo "Removing application policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1
+