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 16:15:11 UTC

[4/6] stratos git commit: updating single-group-v1 sample

updating single-group-v1 sample


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

Branch: refs/heads/master
Commit: c58be4d8816dbb748026e25938c15f407aad9b0c
Parents: 87f8b4e
Author: R-Rajkumar <rr...@gmail.com>
Authored: Wed Mar 4 20:40:39 2015 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Wed Mar 4 20:40:39 2015 +0530

----------------------------------------------------------------------
 .../single-group-v1/artifacts/application-policy.json |  8 --------
 .../single-group-v1/artifacts/autoscaling-policy.json | 14 --------------
 .../single-group-v1/scripts/common/deploy.sh          |  8 +++++++-
 .../single-group-v1/scripts/common/undeploy.sh        |  4 ++++
 4 files changed, 11 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/stratos/blob/c58be4d8/samples/applications/single-group-v1/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/artifacts/autoscaling-policy.json b/samples/applications/single-group-v1/artifacts/autoscaling-policy.json
deleted file mode 100755
index b41726e..0000000
--- a/samples/applications/single-group-v1/artifacts/autoscaling-policy.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscaling-policy-1",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 80
-        },
-        "memoryConsumption": {
-            "threshold": 90
-        },
-        "loadAverage": {
-            "threshold": 50
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/c58be4d8/samples/applications/single-group-v1/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/scripts/common/deploy.sh b/samples/applications/single-group-v1/scripts/common/deploy.sh
index 29371c0..daa2e4a 100755
--- a/samples/applications/single-group-v1/scripts/common/deploy.sh
+++ b/samples/applications/single-group-v1/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
 
@@ -43,9 +44,14 @@ 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
 
 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/single-group-v1/deploy
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-group-v1/deploy/application-policy-1
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/c58be4d8/samples/applications/single-group-v1/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/scripts/common/undeploy.sh b/samples/applications/single-group-v1/scripts/common/undeploy.sh
index 856b521..a6a09b9 100644
--- a/samples/applications/single-group-v1/scripts/common/undeploy.sh
+++ b/samples/applications/single-group-v1/scripts/common/undeploy.sh
@@ -29,3 +29,7 @@ curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://
 echo "Removing network partitions..."
 curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-3
 
+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
+
+