Repository: stratos
Updated Branches:
  refs/heads/master 72529738c -> 5c502b266


Fix dependent-scaling/sample-groups to adhere new deployment policy changes


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

Branch: refs/heads/master
Commit: 5c502b26620bca110e7a6c41c88544bfc5ae4b5f
Parents: 7252973
Author: Lahiru Sandaruwan <[email protected]>
Authored: Sun Mar 8 07:58:25 2015 +0530
Committer: Lahiru Sandaruwan <[email protected]>
Committed: Sun Mar 8 07:58:25 2015 +0530

----------------------------------------------------------------------
 .../sample-groups/artifacts/application-policy.json  |  8 --------
 .../sample-groups/artifacts/autoscaling-policy.json  | 14 --------------
 .../sample-groups/artifacts/deployment-policy.json   | 15 ---------------
 .../sample-groups/artifacts/network-partition.json   | 15 ---------------
 .../sample-groups/scripts/common/deploy.sh           | 11 ++++++++---
 5 files changed, 8 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/5c502b26/samples/applications/dependent-scaling/sample-groups/artifacts/application-policy.json
----------------------------------------------------------------------
diff --git 
a/samples/applications/dependent-scaling/sample-groups/artifacts/application-policy.json
 
b/samples/applications/dependent-scaling/sample-groups/artifacts/application-policy.json
deleted file mode 100644
index 9d2c6a1..0000000
--- 
a/samples/applications/dependent-scaling/sample-groups/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/5c502b26/samples/applications/dependent-scaling/sample-groups/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git 
a/samples/applications/dependent-scaling/sample-groups/artifacts/autoscaling-policy.json
 
b/samples/applications/dependent-scaling/sample-groups/artifacts/autoscaling-policy.json
deleted file mode 100755
index 2f670f6..0000000
--- 
a/samples/applications/dependent-scaling/sample-groups/artifacts/autoscaling-policy.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscaling-policy-1",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 50
-        },
-        "memoryConsumption": {
-            "threshold": 70
-        },
-        "loadAverage": {
-            "threshold": 1000
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/5c502b26/samples/applications/dependent-scaling/sample-groups/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git 
a/samples/applications/dependent-scaling/sample-groups/artifacts/deployment-policy.json
 
b/samples/applications/dependent-scaling/sample-groups/artifacts/deployment-policy.json
deleted file mode 100644
index 666c299..0000000
--- 
a/samples/applications/dependent-scaling/sample-groups/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/5c502b26/samples/applications/dependent-scaling/sample-groups/artifacts/network-partition.json
----------------------------------------------------------------------
diff --git 
a/samples/applications/dependent-scaling/sample-groups/artifacts/network-partition.json
 
b/samples/applications/dependent-scaling/sample-groups/artifacts/network-partition.json
deleted file mode 100644
index 2a5b7ec..0000000
--- 
a/samples/applications/dependent-scaling/sample-groups/artifacts/network-partition.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "id": "network-partition-1",
-    "partitions": [
-        {
-            "id": "partition-1",
-            "provider": "mock",
-            "property": [
-                {
-                    "name": "region",
-                    "value": "default"
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/5c502b26/samples/applications/dependent-scaling/sample-groups/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git 
a/samples/applications/dependent-scaling/sample-groups/scripts/common/deploy.sh 
b/samples/applications/dependent-scaling/sample-groups/scripts/common/deploy.sh
index ddd1f33..f9ccdce 100755
--- 
a/samples/applications/dependent-scaling/sample-groups/scripts/common/deploy.sh
+++ 
b/samples/applications/dependent-scaling/sample-groups/scripts/common/deploy.sh
@@ -8,12 +8,12 @@ prgdir=`dirname "$0"`
 script_path=`cd "$prgdir"; pwd`
 
 artifacts_path=`cd "${script_path}/../../artifacts"; pwd`
-iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
 cartridges_path=`cd "${script_path}/../../../../../cartridges/${iaas}"; pwd`
 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
 
@@ -31,7 +31,6 @@ curl -X POST -H "Content-Type: application/json" -d 
"@${network_partitions_path}
 
 echo "Adding deployment policies..."
 curl -X POST -H "Content-Type: application/json" -d 
"@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin 
https://${host_ip}:${host_port}/api/deploymentPolicies
-curl -X POST -H "Content-Type: application/json" -d 
"@${deployment_policies_path}/deployment-policy-2.json" -k -v -u admin:admin 
https://${host_ip}:${host_port}/api/deploymentPolicies
 
 echo "Adding tomcat cartridge..."
 curl -X POST -H "Content-Type: application/json" -d 
"@${cartridges_path}/tomcat.json" -k -v -u admin:admin 
https://${host_ip}:${host_port}/api/cartridges
@@ -46,6 +45,10 @@ echo "Adding esb-php-group group..."
 curl -X POST -H "Content-Type: application/json" -d 
"@${cartridges_groups_path}/esb-php-group.json" -k -v -u admin:admin 
https://${host_ip}:${host_port}/api/cartridgeGroups
 
 sleep 1
+echo "Adding application policy..."
+curl -X POST -H "Content-Type: application/json" -d 
"@${application_policies_path}/application-policy-1.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
@@ -53,4 +56,6 @@ curl -X POST -H "Content-Type: application/json" -d 
"@${artifacts_path}/applicat
 sleep 1
 
 echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d 
"@${artifacts_path}/application-policy-1.json" -k -v -u admin:admin 
https://${host_ip}:${host_port}/api/applications/dependency-scaling-groups-app/deploy
+
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin 
https://${host_ip}:${host_port}/api/applications/dependency-scaling-groups-app/deploy/application-policy-1
+

Reply via email to