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:49:38 UTC

[1/5] stratos git commit: Fixed group-scaling sample application.

Repository: stratos
Updated Branches:
  refs/heads/master fc539552c -> 373bf94db


Fixed group-scaling sample application.


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

Branch: refs/heads/master
Commit: f2c51c309766ce1317733992e96e874d29cfbcd6
Parents: 6dfbea5
Author: Dinithi <di...@wso2.com>
Authored: Wed Mar 4 14:23:12 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed Mar 4 14:23:12 2015 +0530

----------------------------------------------------------------------
 .../artifacts/application-policy.json           |  8 +++
 .../group-scaling/artifacts/application.json    | 18 ++---
 .../artifacts/autoscaling-policy-c1.json        | 14 ----
 .../artifacts/autoscaling-policy-c2.json        | 14 ----
 .../artifacts/autoscaling-policy-c3.json        | 14 ----
 .../artifacts/autoscaling-policy-c4.json        | 14 ----
 .../artifacts/deployment-policy.json            |  2 +-
 .../artifacts/ec2/deployment-policy.json        | 70 -------------------
 .../artifacts/kubernetes/deployment-policy.json | 71 --------------------
 .../kubernetes/kubernetes-cluster.json          | 56 ---------------
 .../artifacts/mock/deployment-policy.json       | 70 -------------------
 .../artifacts/openstack/deployment-policy.json  | 70 -------------------
 .../group-scaling/scripts/common/deploy.sh      | 19 ++++--
 .../autoscaling-policy-c1.json                  | 14 ++++
 .../autoscaling-policy-c2.json                  | 14 ++++
 .../autoscaling-policy-c3.json                  | 14 ++++
 .../autoscaling-policy-c4.json                  | 14 ++++
 samples/cartridges-groups/group1.json           | 14 ++--
 18 files changed, 93 insertions(+), 417 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/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
new file mode 100644
index 0000000..9d2c6a1
--- /dev/null
+++ b/samples/applications/group-scaling/artifacts/application-policy.json
@@ -0,0 +1,8 @@
+{
+   "networkPartition":[
+      {
+         "id":"network-partition-1",
+         "activeByDefault":"true"
+      }
+   ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/applications/group-scaling/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/artifacts/application.json b/samples/applications/group-scaling/artifacts/application.json
index d700298..c2b3f3c 100644
--- a/samples/applications/group-scaling/artifacts/application.json
+++ b/samples/applications/group-scaling/artifacts/application.json
@@ -1,17 +1,18 @@
 {
     "applicationId": "group-scaling",
-    "alias": "group-scaling",
+    "alias": "my-group-scaling",
     "components": {
         "groups": [
             {
                 "name": "group1",
-                "alias": "mygroup1",
+                "alias": "my-group1",
                 "groupMinInstances": 1,
                 "groupMaxInstances": 1,
+                "deploymentPolicy":"deployment-policy-1",
                 "groups": [
                     {
                         "name": "group2",
-                        "alias": "mygroup2",
+                        "alias": "my-group2",
                         "groupMinInstances": 1,
                         "groupMaxInstances": 2,
                         "cartridges": [
@@ -20,7 +21,7 @@
                                 "cartridgeMin": 2,
                                 "cartridgeMax": 4,
                                 "subscribableInfo": {
-                                    "alias": "group2c2",
+                                    "alias": "my-c2-group2",
                                     "autoscalingPolicy": "autoscaling-policy-c2",
                                     "artifactRepository":{
                                         "privateRepo":false,
@@ -35,7 +36,7 @@
                                 "cartridgeMin": 1,
                                 "cartridgeMax": 2,
                                 "subscribableInfo": {
-                                    "alias": "group2c3",
+                                    "alias": "my-c3-group2",
                                     "autoscalingPolicy": "autoscaling-policy-c3",
                                     "artifactRepository":{
                                         "privateRepo":false,
@@ -54,7 +55,7 @@
                         "cartridgeMin": 2,
                         "cartridgeMax": 4,
                         "subscribableInfo": {
-                            "alias": "group1c1",
+                            "alias": "my-c1-group1",
                             "autoscalingPolicy": "autoscaling-policy-c1",
                             "artifactRepository":{
                                 "privateRepo":false,
@@ -73,8 +74,9 @@
                 "cartridgeMin": 1,
                 "cartridgeMax": 2,
                 "subscribableInfo": {
-                    "alias": "myc4",
+                    "alias": "my-c4",
                     "autoscalingPolicy": "autoscaling-policy-c4",
+                    "deploymentPolicy":"deployment-policy-1",
                     "artifactRepository":{
                         "privateRepo":false,
                         "repoUrl":"https://github.com/imesh/stratos-c4-applications.git",
@@ -86,7 +88,7 @@
         ],
         "dependencies": {
             "startupOrders": [
-                "group.group1,cartridge.c4"
+                "group.my-group1,cartridge.my-c4"
             ],
             "terminationBehaviour": "terminate-dependents"
         }

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

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/applications/group-scaling/artifacts/autoscaling-policy-c3.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/artifacts/autoscaling-policy-c3.json b/samples/applications/group-scaling/artifacts/autoscaling-policy-c3.json
deleted file mode 100755
index 25bab8f..0000000
--- a/samples/applications/group-scaling/artifacts/autoscaling-policy-c3.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscaling-policy-c3",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 100
-        },
-        "memoryConsumption": {
-            "threshold": 10
-        },
-        "loadAverage": {
-            "threshold": 50
-        }
-    }
-}

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/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
index d858aed..666c299 100644
--- a/samples/applications/group-scaling/artifacts/deployment-policy.json
+++ b/samples/applications/group-scaling/artifacts/deployment-policy.json
@@ -1,5 +1,5 @@
 {
-   "id": "deployment-policy-2",
+   "id": "deployment-policy-1",
    "networkPartition": [
       {
          "id": "network-partition-1",

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/applications/group-scaling/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/artifacts/ec2/deployment-policy.json b/samples/applications/group-scaling/artifacts/ec2/deployment-policy.json
deleted file mode 100644
index b1f3699..0000000
--- a/samples/applications/group-scaling/artifacts/ec2/deployment-policy.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "ec2",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "ap-southeast-1"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "myc4",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "group1c1",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 4
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup2",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/applications/group-scaling/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/artifacts/kubernetes/deployment-policy.json b/samples/applications/group-scaling/artifacts/kubernetes/deployment-policy.json
deleted file mode 100644
index 53b81f0..0000000
--- a/samples/applications/group-scaling/artifacts/kubernetes/deployment-policy.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id":"network-partition-1",
-                "kubernetesClusterId":"kubernetes-cluster-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "kubernetes",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "myc4",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "group1c1",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 4
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup2",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/applications/group-scaling/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/group-scaling/artifacts/kubernetes/kubernetes-cluster.json
deleted file mode 100644
index 2988ed1..0000000
--- a/samples/applications/group-scaling/artifacts/kubernetes/kubernetes-cluster.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "clusterId": "kubernetes-cluster-1",
-    "description": "Kubernetes CoreOS cluster",
-    "kubernetesMaster": {
-        "hostId": "KubHostMaster1",
-        "hostname": "master.dev.kubernetes.example.org",
-        "privateIPAddress": "172.17.8.100",
-        "publicIPAddress": "172.17.8.100",
-        "property": [
-        ]
-    },
-    "portRange": {
-        "upper": "5000",
-        "lower": "4500"
-    },
-    "kubernetesHosts": [
-        {
-            "hostId": "KubHostSlave1",
-            "hostname": "slave1.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.101",
-            "publicIPAddress": "172.17.8.101",
-            "property": [
-            ]
-        },
-        {
-            "hostId": "KubHostSlave2",
-            "hostname": "slave2.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.102",
-            "publicIPAddress": "172.17.8.102",
-            "property": [
-            ]
-        }
-    ],
-    "property": [
-        {
-            "name": "payload_parameter.MB_IP",
-            "value": "172.17.8.1"
-        },
-        {
-            "name": "payload_parameter.MB_PORT",
-            "value": "1883"
-        },
-        {
-            "name": "payload_parameter.CEP_IP",
-            "value": "172.17.8.1"
-        },
-        {
-            "name": "payload_parameter.CEP_PORT",
-            "value": "7711"
-        },
-        {
-            "name": "payload_parameter.LOG_LEVEL",
-            "value": "DEBUG"
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/applications/group-scaling/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/artifacts/mock/deployment-policy.json b/samples/applications/group-scaling/artifacts/mock/deployment-policy.json
deleted file mode 100644
index 0210b3e..0000000
--- a/samples/applications/group-scaling/artifacts/mock/deployment-policy.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "myc4",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "group1c1",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 4
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup2",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/applications/group-scaling/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling/artifacts/openstack/deployment-policy.json b/samples/applications/group-scaling/artifacts/openstack/deployment-policy.json
deleted file mode 100644
index a1bbc7c..0000000
--- a/samples/applications/group-scaling/artifacts/openstack/deployment-policy.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "openstack",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "myc4",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "group1c1",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 4
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup2",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/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 b7f46e3..af0f80e 100644
--- a/samples/applications/group-scaling/scripts/common/deploy.sh
+++ b/samples/applications/group-scaling/scripts/common/deploy.sh
@@ -11,6 +11,9 @@ 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`
 
 set -e
 
@@ -20,16 +23,22 @@ if [[ -z "${iaas}" ]]; then
 fi
 
 echo "Adding autoscaling policy c1..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy-c1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-c1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
 
 echo "Adding autoscaling policy c2..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy-c2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-c2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
 
 echo "Adding autoscaling policy c3..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy-c3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-c3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
 
 echo "Adding autoscaling policy c4..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy-c4.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-c4.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+
+echo "Adding network partitions..."
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+
+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
 
 echo "Adding c1 cartridge..."
 curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/c1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
@@ -54,4 +63,4 @@ 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 "@${iaas_artifacts_path}/deployment-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" -d "@${artifacts_path}/application-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/group-scaling/deploy

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/autoscaling-policies/autoscaling-policy-c1.json
----------------------------------------------------------------------
diff --git a/samples/autoscaling-policies/autoscaling-policy-c1.json b/samples/autoscaling-policies/autoscaling-policy-c1.json
new file mode 100755
index 0000000..14cde7d
--- /dev/null
+++ b/samples/autoscaling-policies/autoscaling-policy-c1.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscaling-policy-c1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 80
+        },
+        "memoryConsumption": {
+            "threshold": 80
+        },
+        "loadAverage": {
+            "threshold": 50
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/autoscaling-policies/autoscaling-policy-c2.json
----------------------------------------------------------------------
diff --git a/samples/autoscaling-policies/autoscaling-policy-c2.json b/samples/autoscaling-policies/autoscaling-policy-c2.json
new file mode 100755
index 0000000..b46f1fc
--- /dev/null
+++ b/samples/autoscaling-policies/autoscaling-policy-c2.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscaling-policy-c2",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 90
+        },
+        "memoryConsumption": {
+            "threshold": 5
+        },
+        "loadAverage": {
+            "threshold": 50
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/autoscaling-policies/autoscaling-policy-c3.json
----------------------------------------------------------------------
diff --git a/samples/autoscaling-policies/autoscaling-policy-c3.json b/samples/autoscaling-policies/autoscaling-policy-c3.json
new file mode 100755
index 0000000..25bab8f
--- /dev/null
+++ b/samples/autoscaling-policies/autoscaling-policy-c3.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscaling-policy-c3",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 100
+        },
+        "memoryConsumption": {
+            "threshold": 10
+        },
+        "loadAverage": {
+            "threshold": 50
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/autoscaling-policies/autoscaling-policy-c4.json
----------------------------------------------------------------------
diff --git a/samples/autoscaling-policies/autoscaling-policy-c4.json b/samples/autoscaling-policies/autoscaling-policy-c4.json
new file mode 100755
index 0000000..d09e50a
--- /dev/null
+++ b/samples/autoscaling-policies/autoscaling-policy-c4.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscaling-policy-c4",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 50
+        },
+        "memoryConsumption": {
+            "threshold": 85
+        },
+        "loadAverage": {
+            "threshold": 75
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/f2c51c30/samples/cartridges-groups/group1.json
----------------------------------------------------------------------
diff --git a/samples/cartridges-groups/group1.json b/samples/cartridges-groups/group1.json
index 9acf5e6..09e973c 100644
--- a/samples/cartridges-groups/group1.json
+++ b/samples/cartridges-groups/group1.json
@@ -5,15 +5,12 @@
             "name": "group2",
             "groupScalingEnabled": "true",
             "cartridges": [
-                "c2",
-                "c3"
+                "c3",
+                "c2"
             ],
             "dependencies": {
                 "startupOrders": [
-                    "cartridge.c3,cartridge.c2"
-                ],
-                "scalingDependants": [
-                    "cartridge.c3, cartridge.c2"
+                    "cartridge.my-c3-group2,cartridge.my-c2-group2"
                 ],
                 "terminationBehaviour": "terminate-all"
             }
@@ -24,10 +21,7 @@
     ],
     "dependencies": {
         "startupOrders": [
-            "cartridge.c1,group.group2"
-        ],
-        "scalingDependants": [
-            "cartridge.c1, group.group2"
+            "cartridge.my-c1-group1,group.group2"
         ],
         "terminationBehaviour": "terminate-dependents"
     }


[3/5] stratos git commit: Fixed single-group-group-scaling-v1 sample application.

Posted by ra...@apache.org.
Fixed single-group-group-scaling-v1 sample application.


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

Branch: refs/heads/master
Commit: 6470b00a46653e6c4a996671fc2118674348984e
Parents: 64bd01d
Author: Dinithi <di...@wso2.com>
Authored: Wed Mar 4 15:45:41 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed Mar 4 15:45:41 2015 +0530

----------------------------------------------------------------------
 .../artifacts/application-policy.json           |  8 +++
 .../artifacts/application.json                  |  7 +--
 .../artifacts/deployment-policy.json            |  2 +-
 .../artifacts/ec2/deployment-policy.json        | 41 --------------
 .../artifacts/kubernetes/deployment-policy.json | 42 ---------------
 .../kubernetes/kubernetes-cluster.json          | 56 --------------------
 .../artifacts/mock/deployment-policy.json       | 41 --------------
 .../artifacts/openstack/deployment-policy.json  | 41 --------------
 .../scripts/common/deploy.sh                    | 15 ++++--
 9 files changed, 25 insertions(+), 228 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/stratos/blob/6470b00a/samples/applications/single-group-group-scaling/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/application.json b/samples/applications/single-group-group-scaling/artifacts/application.json
index 2b4142c..08c7ede 100644
--- a/samples/applications/single-group-group-scaling/artifacts/application.json
+++ b/samples/applications/single-group-group-scaling/artifacts/application.json
@@ -1,20 +1,21 @@
 {
     "applicationId": "single-group-group-scaling",
-    "alias": "single-group-group-scaling-v1",
+    "alias": "my-single-group-group-scaling",
     "components": {
         "groups": [
             {
                 "name": "group6",
-                "alias": "mygroup6",
+                "alias": "my-group6",
                 "groupMinInstances": 1,
                 "groupMaxInstances": 3,
+                "deploymentPolicy":"deployment-policy-1",
                 "cartridges": [
                     {
                         "type": "tomcat",
                         "cartridgeMin": 1,
                         "cartridgeMax": 4,
                         "subscribableInfo": {
-                            "alias": "tom1group6",
+                            "alias": "my-tomcat",
                             "autoscalingPolicy": "autoscaling-policy-1",
                             "artifactRepository":{
                                "privateRepo":false,

http://git-wip-us.apache.org/repos/asf/stratos/blob/6470b00a/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json
index d858aed..666c299 100644
--- a/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json
+++ b/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json
@@ -1,5 +1,5 @@
 {
-   "id": "deployment-policy-2",
+   "id": "deployment-policy-1",
    "networkPartition": [
       {
          "id": "network-partition-1",

http://git-wip-us.apache.org/repos/asf/stratos/blob/6470b00a/samples/applications/single-group-group-scaling/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/ec2/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/ec2/deployment-policy.json
deleted file mode 100644
index d99cd34..0000000
--- a/samples/applications/single-group-group-scaling/artifacts/ec2/deployment-policy.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-    "applicationId": "single-group-group-scaling",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "ec2",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "ap-southeast-1"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mygroup6",
-            "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/6470b00a/samples/applications/single-group-group-scaling/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/kubernetes/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/kubernetes/deployment-policy.json
deleted file mode 100644
index c347514..0000000
--- a/samples/applications/single-group-group-scaling/artifacts/kubernetes/deployment-policy.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
-    "applicationId": "single-group-group-scaling",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id":"network-partition-1",
-                "kubernetesClusterId":"kubernetes-cluster-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "kubernetes",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mygroup6",
-            "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/6470b00a/samples/applications/single-group-group-scaling/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/single-group-group-scaling/artifacts/kubernetes/kubernetes-cluster.json
deleted file mode 100644
index 2988ed1..0000000
--- a/samples/applications/single-group-group-scaling/artifacts/kubernetes/kubernetes-cluster.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "clusterId": "kubernetes-cluster-1",
-    "description": "Kubernetes CoreOS cluster",
-    "kubernetesMaster": {
-        "hostId": "KubHostMaster1",
-        "hostname": "master.dev.kubernetes.example.org",
-        "privateIPAddress": "172.17.8.100",
-        "publicIPAddress": "172.17.8.100",
-        "property": [
-        ]
-    },
-    "portRange": {
-        "upper": "5000",
-        "lower": "4500"
-    },
-    "kubernetesHosts": [
-        {
-            "hostId": "KubHostSlave1",
-            "hostname": "slave1.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.101",
-            "publicIPAddress": "172.17.8.101",
-            "property": [
-            ]
-        },
-        {
-            "hostId": "KubHostSlave2",
-            "hostname": "slave2.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.102",
-            "publicIPAddress": "172.17.8.102",
-            "property": [
-            ]
-        }
-    ],
-    "property": [
-        {
-            "name": "payload_parameter.MB_IP",
-            "value": "172.17.8.1"
-        },
-        {
-            "name": "payload_parameter.MB_PORT",
-            "value": "1883"
-        },
-        {
-            "name": "payload_parameter.CEP_IP",
-            "value": "172.17.8.1"
-        },
-        {
-            "name": "payload_parameter.CEP_PORT",
-            "value": "7711"
-        },
-        {
-            "name": "payload_parameter.LOG_LEVEL",
-            "value": "DEBUG"
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/6470b00a/samples/applications/single-group-group-scaling/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/mock/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/mock/deployment-policy.json
deleted file mode 100644
index 382e0ad..0000000
--- a/samples/applications/single-group-group-scaling/artifacts/mock/deployment-policy.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-    "applicationId": "single-group-group-scaling",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mygroup6",
-            "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/6470b00a/samples/applications/single-group-group-scaling/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/openstack/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/openstack/deployment-policy.json
deleted file mode 100644
index 79771b3..0000000
--- a/samples/applications/single-group-group-scaling/artifacts/openstack/deployment-policy.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-    "applicationId": "single-group-group-scaling",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "openstack",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mygroup6",
-            "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/6470b00a/samples/applications/single-group-group-scaling/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/scripts/common/deploy.sh b/samples/applications/single-group-group-scaling/scripts/common/deploy.sh
index 0e35412..4fcd9b7 100755
--- a/samples/applications/single-group-group-scaling/scripts/common/deploy.sh
+++ b/samples/applications/single-group-group-scaling/scripts/common/deploy.sh
@@ -11,6 +11,9 @@ 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`
 
 set -e
 
@@ -19,9 +22,15 @@ if [[ -z "${iaas}" ]]; then
     exit
 fi
 
-echo ${artifacts_path}/autoscaling-policy.json
+echo ${autoscaling_policies_path}/autoscaling-policy-1.json
 echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+
+echo "Adding network partitions..."
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+
+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
 
 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
@@ -37,4 +46,4 @@ 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 "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-group-group-scaling/deploy
\ No newline at end of file
+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-group-scaling/deploy
\ No newline at end of file


[4/5] stratos git commit: Fixed wordpress-extended-v1 sample application.

Posted by ra...@apache.org.
Fixed wordpress-extended-v1 sample application.


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

Branch: refs/heads/master
Commit: dfbc82ba87be1c6f8fddcb2a483145556b594f52
Parents: 6470b00
Author: Dinithi <di...@wso2.com>
Authored: Wed Mar 4 18:09:07 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed Mar 4 18:09:07 2015 +0530

----------------------------------------------------------------------
 .../wordpress-extended-v1/artifacts/application-policy.json      | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/dfbc82ba/samples/applications/wordpress-extended-v1/artifacts/application-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/application-policy.json b/samples/applications/wordpress-extended-v1/artifacts/application-policy.json
index 5aa91dd..9d2c6a1 100644
--- a/samples/applications/wordpress-extended-v1/artifacts/application-policy.json
+++ b/samples/applications/wordpress-extended-v1/artifacts/application-policy.json
@@ -3,10 +3,6 @@
       {
          "id":"network-partition-1",
          "activeByDefault":"true"
-      },
-      {
-         "id":"network-partition-2",
-         "activeByDefault":"false"
       }
    ]
 }


[5/5] stratos git commit: This closes #256 on GitHub

Posted by ra...@apache.org.
This closes #256 on GitHub


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

Branch: refs/heads/master
Commit: 373bf94db349b5d1342fb3e20ca4a108ebe20e5e
Parents: fc53955 dfbc82b
Author: R-Rajkumar <rr...@gmail.com>
Authored: Wed Mar 4 20:18:11 2015 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Wed Mar 4 20:18:11 2015 +0530

----------------------------------------------------------------------
 .../artifacts/application-policy.json           |  8 +++
 .../group-scaling-v1/artifacts/application.json |  9 +--
 .../artifacts/autoscaling-policy-c1.json        | 14 ----
 .../artifacts/autoscaling-policy-c2.json        | 14 ----
 .../artifacts/autoscaling-policy-c3.json        | 14 ----
 .../artifacts/autoscaling-policy-c4.json        | 14 ----
 .../artifacts/deployment-policy.json            |  2 +-
 .../artifacts/ec2/deployment-policy.json        | 67 ------------------
 .../artifacts/kubernetes/deployment-policy.json | 68 -------------------
 .../kubernetes/kubernetes-cluster.json          | 56 ---------------
 .../artifacts/mock/deployment-policy.json       | 67 ------------------
 .../artifacts/openstack/deployment-policy.json  | 67 ------------------
 .../group-scaling-v1/scripts/common/deploy.sh   | 25 +++----
 .../group-scaling-v1/scripts/common/undeploy.sh |  6 +-
 .../artifacts/application-policy.json           |  8 +++
 .../group-scaling/artifacts/application.json    | 18 ++---
 .../artifacts/autoscaling-policy-c1.json        | 14 ----
 .../artifacts/autoscaling-policy-c2.json        | 14 ----
 .../artifacts/autoscaling-policy-c3.json        | 14 ----
 .../artifacts/autoscaling-policy-c4.json        | 14 ----
 .../artifacts/deployment-policy.json            |  2 +-
 .../artifacts/ec2/deployment-policy.json        | 70 -------------------
 .../artifacts/kubernetes/deployment-policy.json | 71 --------------------
 .../kubernetes/kubernetes-cluster.json          | 56 ---------------
 .../artifacts/mock/deployment-policy.json       | 70 -------------------
 .../artifacts/openstack/deployment-policy.json  | 70 -------------------
 .../group-scaling/scripts/common/deploy.sh      | 19 ++++--
 .../artifacts/application-policy.json           |  8 +++
 .../artifacts/application.json                  |  7 +-
 .../artifacts/deployment-policy.json            |  2 +-
 .../artifacts/ec2/deployment-policy.json        | 41 -----------
 .../artifacts/kubernetes/deployment-policy.json | 42 ------------
 .../kubernetes/kubernetes-cluster.json          | 56 ---------------
 .../artifacts/mock/deployment-policy.json       | 41 -----------
 .../artifacts/openstack/deployment-policy.json  | 41 -----------
 .../scripts/common/deploy.sh                    | 15 ++++-
 .../artifacts/application-policy.json           |  4 --
 .../autoscaling-policy-c1.json                  | 14 ++++
 .../autoscaling-policy-c2.json                  | 14 ++++
 .../autoscaling-policy-c3.json                  | 14 ++++
 .../autoscaling-policy-c4.json                  | 14 ++++
 samples/cartridges-groups/group1.json           | 14 ++--
 samples/cartridges-groups/group1b.json          |  5 +-
 43 files changed, 144 insertions(+), 1059 deletions(-)
----------------------------------------------------------------------



[2/5] stratos git commit: Fixed group-scaling-v1 sample application.

Posted by ra...@apache.org.
Fixed group-scaling-v1 sample application.


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

Branch: refs/heads/master
Commit: 64bd01d7fc611ce38b66ea6e712e76568f9aca2f
Parents: f2c51c3
Author: Dinithi <di...@wso2.com>
Authored: Wed Mar 4 14:54:06 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed Mar 4 14:54:06 2015 +0530

----------------------------------------------------------------------
 .../artifacts/application-policy.json           |  8 +++
 .../group-scaling-v1/artifacts/application.json |  9 +--
 .../artifacts/autoscaling-policy-c1.json        | 14 ----
 .../artifacts/autoscaling-policy-c2.json        | 14 ----
 .../artifacts/autoscaling-policy-c3.json        | 14 ----
 .../artifacts/autoscaling-policy-c4.json        | 14 ----
 .../artifacts/deployment-policy.json            |  2 +-
 .../artifacts/ec2/deployment-policy.json        | 67 -------------------
 .../artifacts/kubernetes/deployment-policy.json | 68 --------------------
 .../kubernetes/kubernetes-cluster.json          | 56 ----------------
 .../artifacts/mock/deployment-policy.json       | 67 -------------------
 .../artifacts/openstack/deployment-policy.json  | 67 -------------------
 .../group-scaling-v1/scripts/common/deploy.sh   | 25 +++----
 .../group-scaling-v1/scripts/common/undeploy.sh |  6 +-
 samples/cartridges-groups/group1b.json          |  5 +-
 15 files changed, 26 insertions(+), 410 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/artifacts/application.json b/samples/applications/group-scaling-v1/artifacts/application.json
index ce357a2..c486e93 100644
--- a/samples/applications/group-scaling-v1/artifacts/application.json
+++ b/samples/applications/group-scaling-v1/artifacts/application.json
@@ -1,20 +1,21 @@
 {
     "applicationId": "group-scaling-v1",
-    "alias": "group-scaling-v1",
+    "alias": "my-group-scaling-v1",
     "components": {
         "groups": [
             {
                 "name": "group2",
-                "alias": "mygroup2",
+                "alias": "my-group2",
                 "groupMinInstances": 1,
                 "groupMaxInstances": 2,
+                "deploymentPolicy":"deployment-policy-1",
                 "cartridges": [
                     {
                         "type": "c2",
                         "cartridgeMin": 2,
                         "cartridgeMax": 4,
                         "subscribableInfo": {
-                            "alias": "group2c2",
+                            "alias": "my-c2",
                             "autoscalingPolicy": "autoscaling-policy-c2",
                             "artifactRepository":{
                                 "privateRepo":false,
@@ -29,7 +30,7 @@
                         "cartridgeMin": 1,
                         "cartridgeMax": 2,
                         "subscribableInfo": {
-                            "alias": "group2c3",
+                            "alias": "my-c3",
                             "autoscalingPolicy": "autoscaling-policy-c3",
                             "artifactRepository":{
                                 "privateRepo":false,

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

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/artifacts/autoscaling-policy-c3.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/artifacts/autoscaling-policy-c3.json b/samples/applications/group-scaling-v1/artifacts/autoscaling-policy-c3.json
deleted file mode 100755
index 25bab8f..0000000
--- a/samples/applications/group-scaling-v1/artifacts/autoscaling-policy-c3.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscaling-policy-c3",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 100
-        },
-        "memoryConsumption": {
-            "threshold": 10
-        },
-        "loadAverage": {
-            "threshold": 50
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/artifacts/autoscaling-policy-c4.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/artifacts/autoscaling-policy-c4.json b/samples/applications/group-scaling-v1/artifacts/autoscaling-policy-c4.json
deleted file mode 100755
index 2da805a..0000000
--- a/samples/applications/group-scaling-v1/artifacts/autoscaling-policy-c4.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscaling-policy-c4",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 50
-        },
-        "memoryConsumption": {
-            "threshold": 28
-        },
-        "loadAverage": {
-            "threshold": 75
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/artifacts/deployment-policy.json b/samples/applications/group-scaling-v1/artifacts/deployment-policy.json
index d858aed..666c299 100644
--- a/samples/applications/group-scaling-v1/artifacts/deployment-policy.json
+++ b/samples/applications/group-scaling-v1/artifacts/deployment-policy.json
@@ -1,5 +1,5 @@
 {
-   "id": "deployment-policy-2",
+   "id": "deployment-policy-1",
    "networkPartition": [
       {
          "id": "network-partition-1",

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/artifacts/ec2/deployment-policy.json b/samples/applications/group-scaling-v1/artifacts/ec2/deployment-policy.json
deleted file mode 100644
index 13c128b..0000000
--- a/samples/applications/group-scaling-v1/artifacts/ec2/deployment-policy.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
-    "applicationId": "group-scaling-v1",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "ec2",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            },
-            {
-                "id": "network-partition-2",
-                "activeByDefault": "false",
-                "partitions": [
-                    {
-                        "id": "partition-2",
-                        "provider": "ec2",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mygroup2",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                },
-                {
-                    "id": "network-partition-2",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-2",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/artifacts/kubernetes/deployment-policy.json b/samples/applications/group-scaling-v1/artifacts/kubernetes/deployment-policy.json
deleted file mode 100644
index 43a2cfa..0000000
--- a/samples/applications/group-scaling-v1/artifacts/kubernetes/deployment-policy.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
-    "applicationId": "group-scaling-v1",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id":"network-partition-1",
-                "kubernetesClusterId":"kubernetes-cluster-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "kubernetes",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            },
-            {
-                "id": "network-partition-2",
-                "activeByDefault": "false",
-                "partitions": [
-                    {
-                        "id": "partition-2",
-                        "provider": "kubernetes",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mygroup2",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                },
-                {
-                    "id": "network-partition-2",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-2",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/group-scaling-v1/artifacts/kubernetes/kubernetes-cluster.json
deleted file mode 100644
index 2988ed1..0000000
--- a/samples/applications/group-scaling-v1/artifacts/kubernetes/kubernetes-cluster.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "clusterId": "kubernetes-cluster-1",
-    "description": "Kubernetes CoreOS cluster",
-    "kubernetesMaster": {
-        "hostId": "KubHostMaster1",
-        "hostname": "master.dev.kubernetes.example.org",
-        "privateIPAddress": "172.17.8.100",
-        "publicIPAddress": "172.17.8.100",
-        "property": [
-        ]
-    },
-    "portRange": {
-        "upper": "5000",
-        "lower": "4500"
-    },
-    "kubernetesHosts": [
-        {
-            "hostId": "KubHostSlave1",
-            "hostname": "slave1.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.101",
-            "publicIPAddress": "172.17.8.101",
-            "property": [
-            ]
-        },
-        {
-            "hostId": "KubHostSlave2",
-            "hostname": "slave2.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.102",
-            "publicIPAddress": "172.17.8.102",
-            "property": [
-            ]
-        }
-    ],
-    "property": [
-        {
-            "name": "payload_parameter.MB_IP",
-            "value": "172.17.8.1"
-        },
-        {
-            "name": "payload_parameter.MB_PORT",
-            "value": "1883"
-        },
-        {
-            "name": "payload_parameter.CEP_IP",
-            "value": "172.17.8.1"
-        },
-        {
-            "name": "payload_parameter.CEP_PORT",
-            "value": "7711"
-        },
-        {
-            "name": "payload_parameter.LOG_LEVEL",
-            "value": "DEBUG"
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/artifacts/mock/deployment-policy.json b/samples/applications/group-scaling-v1/artifacts/mock/deployment-policy.json
deleted file mode 100644
index 36ea752..0000000
--- a/samples/applications/group-scaling-v1/artifacts/mock/deployment-policy.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
-    "applicationId": "group-scaling-v1",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            },
-            {
-                "id": "network-partition-2",
-                "activeByDefault": "false",
-                "partitions": [
-                    {
-                        "id": "partition-2",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mygroup2",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                },
-                {
-                    "id": "network-partition-2",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-2",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/artifacts/openstack/deployment-policy.json b/samples/applications/group-scaling-v1/artifacts/openstack/deployment-policy.json
deleted file mode 100644
index 6ecbe4b..0000000
--- a/samples/applications/group-scaling-v1/artifacts/openstack/deployment-policy.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
-    "applicationId": "group-scaling-v1",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "openstack",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            },
-            {
-                "id": "network-partition-2",
-                "activeByDefault": "false",
-                "partitions": [
-                    {
-                        "id": "partition-2",
-                        "provider": "openstack",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mygroup2",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 2
-                        }
-                    ]
-                },
-                {
-                    "id": "network-partition-2",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-2",
-                            "max": 2
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/scripts/common/deploy.sh b/samples/applications/group-scaling-v1/scripts/common/deploy.sh
index 6ac05ee..baa4827 100644
--- a/samples/applications/group-scaling-v1/scripts/common/deploy.sh
+++ b/samples/applications/group-scaling-v1/scripts/common/deploy.sh
@@ -11,6 +11,9 @@ 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`
 
 set -e
 
@@ -19,20 +22,17 @@ if [[ -z "${iaas}" ]]; then
     exit
 fi
 
-echo "Adding autoscaling policy c1..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy-c1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
-
 echo "Adding autoscaling policy c2..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy-c2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-c2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
 
 echo "Adding autoscaling policy c3..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy-c3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-c3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
 
-echo "Adding autoscaling policy c4..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy-c4.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+echo "Adding network partitions..."
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
 
-echo "Adding c1 cartridge..."
-curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/c1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+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
 
 echo "Adding c2 cartridge..."
 curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/c2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
@@ -40,9 +40,6 @@ curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/c2.json
 echo "Adding c3 cartridge..."
 curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/c3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
 
-echo "Adding c4 cartridge..."
-curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/c4.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
-
 echo "Adding group1b group..."
 curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group1b.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
 
@@ -51,7 +48,5 @@ 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 "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/group-scaling-v1/deploy
+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-v1/deploy

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/applications/group-scaling-v1/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/group-scaling-v1/scripts/common/undeploy.sh b/samples/applications/group-scaling-v1/scripts/common/undeploy.sh
index 04dae04..deb86fd 100644
--- a/samples/applications/group-scaling-v1/scripts/common/undeploy.sh
+++ b/samples/applications/group-scaling-v1/scripts/common/undeploy.sh
@@ -17,13 +17,9 @@ echo "Removing groups..."
 curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/group2
 
 echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/c1
 curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/c2
 curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/c3
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/c4
 
 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-c3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/64bd01d7/samples/cartridges-groups/group1b.json
----------------------------------------------------------------------
diff --git a/samples/cartridges-groups/group1b.json b/samples/cartridges-groups/group1b.json
index d1d4267..3df3413 100644
--- a/samples/cartridges-groups/group1b.json
+++ b/samples/cartridges-groups/group1b.json
@@ -7,10 +7,7 @@
     ],
     "dependencies": {
         "startupOrders": [
-            "cartridge.c3,cartridge.c2"
-        ],
-        "scalingDependants": [
-            "cartridge.c3, cartridge.c2"
+            "cartridge.my-c3,cartridge.my-c2"
         ],
         "terminationBehaviour": "terminate-all"
     }