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:57:40 UTC
stratos git commit: updating group-scaling sample
Repository: stratos
Updated Branches:
refs/heads/master 812085910 -> b60c781a6
updating group-scaling sample
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b60c781a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b60c781a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b60c781a
Branch: refs/heads/master
Commit: b60c781a631317d0ee21de65a3fcfc6ecd170a67
Parents: 8120859
Author: R-Rajkumar <rr...@gmail.com>
Authored: Wed Mar 4 20:27:28 2015 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Wed Mar 4 20:27:28 2015 +0530
----------------------------------------------------------------------
.../group-scaling/artifacts/application-policy.json | 8 --------
.../group-scaling/artifacts/deployment-policy.json | 15 ---------------
.../group-scaling/scripts/common/deploy.sh | 8 +++++++-
.../group-scaling/scripts/common/undeploy.sh | 6 +++++-
4 files changed, 12 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/b60c781a/samples/applications/group-scaling/artifacts/application-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/artifacts/application-policy.json b/samples/applications/group-scaling/artifacts/application-policy.json
deleted file mode 100644
index 9d2c6a1..0000000
--- a/samples/applications/group-scaling/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/b60c781a/samples/applications/group-scaling/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/artifacts/deployment-policy.json b/samples/applications/group-scaling/artifacts/deployment-policy.json
deleted file mode 100644
index 666c299..0000000
--- a/samples/applications/group-scaling/artifacts/deployment-policy.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "id": "deployment-policy-1",
- "networkPartition": [
- {
- "id": "network-partition-1",
- "partitionAlgo": "one-after-another",
- "partitions": [
- {
- "id": "partition-1",
- "max": 5
- }
- ]
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/b60c781a/samples/applications/group-scaling/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/scripts/common/deploy.sh b/samples/applications/group-scaling/scripts/common/deploy.sh
index af0f80e..0915e04 100644
--- a/samples/applications/group-scaling/scripts/common/deploy.sh
+++ b/samples/applications/group-scaling/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
@@ -57,10 +58,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/group-scaling/deploy
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/group-scaling/deploy/application-policy-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/b60c781a/samples/applications/group-scaling/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/scripts/common/undeploy.sh b/samples/applications/group-scaling/scripts/common/undeploy.sh
index e5a1b97..599e6d7 100644
--- a/samples/applications/group-scaling/scripts/common/undeploy.sh
+++ b/samples/applications/group-scaling/scripts/common/undeploy.sh
@@ -26,4 +26,8 @@ echo "Removing autoscaling policies..."
curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-c1
curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-c2
curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-c3
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-c4
\ 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-c4
+
+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
+