You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ma...@apache.org on 2015/02/06 10:38:32 UTC

[1/2] stratos git commit: Fixed dependency-scaling sample applicatoins

Repository: stratos
Updated Branches:
  refs/heads/master 0fed5d448 -> b78e35a8a


http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/undeploy.sh b/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/undeploy.sh
deleted file mode 100644
index 56c539e..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/undeploy.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2/undeploy
-
-sleep 5
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2
-
-# Removing groups
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/esb
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/php
-
-# Removing kubernetes
-echo "Removing kubernetes cluster..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/kubernetesClusters/kubernetes-cluster-1
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/mock/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/mock/artifacts/dep_single_group.json b/samples/applications/dependency-scaling/sample-groups/iaases/mock/artifacts/dep_single_group.json
deleted file mode 100644
index c5c4d4d..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/mock/artifacts/dep_single_group.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "applicationId": "app_group_v2",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "openstack_R1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "P1",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "openstack_R1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup6",
-            "networkPartition": [
-                {
-                    "id": "openstack_R1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/mock/deploy.sh b/samples/applications/dependency-scaling/sample-groups/iaases/mock/deploy.sh
deleted file mode 100755
index 8a09d8d..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/mock/deploy.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-export iaas="mock"						#[openstack, ec2, mock, kubernetes]
-export host_ip="localhost"
-
-export artifacts_path="../../artifacts"
-export cartridges_path="../../../../../cartridges/${iaas}"
-export cartridges_groups_path="../../../../../cartridges-groups"
-
-set -e
-
-# Adding autoscale policy
-pushd ${artifacts_path}
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies
-popd
-
-# Adding cartridges
-pushd ${cartridges_path}
-	# Adding tomcat cartridge
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding esb cartridge
-echo "Adding esb cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'esb.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding php cartridge
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'php.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-popd
-
-# Adding groups
-pushd ${cartridges_groups_path}
-	# Adding group6c2
-echo "Adding group6c2 group..."
-curl -X POST -H "Content-Type: application/json" -d @'group6c2.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups
-popd
-
-sleep 3
-
-# Creating application
-pushd ${artifacts_path}
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d @'app_single_group.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications
-popd
-
-sleep 3
-
-# Deploy application
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_single_group.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2/deploy
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/mock/undeploy.sh b/samples/applications/dependency-scaling/sample-groups/iaases/mock/undeploy.sh
deleted file mode 100644
index 16d63aa..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/mock/undeploy.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2/undeploy
-
-sleep 5
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2
-
-# Removing groups
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/esb
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/php
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/openstack/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/openstack/artifacts/dep_single_group.json b/samples/applications/dependency-scaling/sample-groups/iaases/openstack/artifacts/dep_single_group.json
deleted file mode 100644
index d5f6e20..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/openstack/artifacts/dep_single_group.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "applicationId": "app_group_v2",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "openstack_R1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "P1",
-                        "provider": "openstack",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "openstack_R1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup6",
-            "networkPartition": [
-                {
-                    "id": "openstack_R1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/openstack/deploy.sh b/samples/applications/dependency-scaling/sample-groups/iaases/openstack/deploy.sh
deleted file mode 100755
index 8a09d8d..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/openstack/deploy.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-export iaas="mock"						#[openstack, ec2, mock, kubernetes]
-export host_ip="localhost"
-
-export artifacts_path="../../artifacts"
-export cartridges_path="../../../../../cartridges/${iaas}"
-export cartridges_groups_path="../../../../../cartridges-groups"
-
-set -e
-
-# Adding autoscale policy
-pushd ${artifacts_path}
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies
-popd
-
-# Adding cartridges
-pushd ${cartridges_path}
-	# Adding tomcat cartridge
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding esb cartridge
-echo "Adding esb cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'esb.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding php cartridge
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'php.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-popd
-
-# Adding groups
-pushd ${cartridges_groups_path}
-	# Adding group6c2
-echo "Adding group6c2 group..."
-curl -X POST -H "Content-Type: application/json" -d @'group6c2.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups
-popd
-
-sleep 3
-
-# Creating application
-pushd ${artifacts_path}
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d @'app_single_group.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications
-popd
-
-sleep 3
-
-# Deploy application
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_single_group.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2/deploy
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/openstack/undeploy.sh b/samples/applications/dependency-scaling/sample-groups/iaases/openstack/undeploy.sh
deleted file mode 100644
index deb9c66..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/openstack/undeploy.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2/undeploy
-
-sleep 30
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2
-
-# Removing groups
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/esb
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/php
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/common/deploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/common/deploy.sh
new file mode 100755
index 0000000..1d0a9b7
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/common/deploy.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+iaas=$1
+host_ip="localhost"
+host_port=9443
+
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+artifacts_path="${script_path}/../../artifacts"
+iaas_artifacts_path="${script_path}/../../artifacts/${iaas}"
+cartridges_path="${script_path}/../../../../../cartridges/${iaas}"
+cartridges_groups_path="${script_path}/../../../../../cartridges-groups"
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+    echo "Usage: deploy.sh [iaas]"
+    exit
+fi
+
+echo ${artifacts_path}/autoscale-policy.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
+
+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
+
+echo "Adding esb cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/esb.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding php cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding group6c2 group..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group6c2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
+
+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/sample-groups-app/deploy

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/common/undeploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/common/undeploy.sh
new file mode 100644
index 0000000..7e190cf
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/common/undeploy.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+set -e
+
+echo "Undeploying application..."
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/sample-groups-app/undeploy
+
+sleep 10
+
+echo "Deleting application..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/sample-groups-app
+
+echo "Removing groups..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/group6
+
+echo "Removing cartridges..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/esb
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php
+
+echo "Removing autoscale policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscale-policy-1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/ec2/deploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/ec2/deploy.sh
new file mode 100755
index 0000000..62063a2
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/ec2/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="ec2"
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash deploy.sh ${iaas}
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/ec2/undeploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/ec2/undeploy.sh
new file mode 100644
index 0000000..b05cf9f
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/ec2/undeploy.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash undeploy.sh
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/kubernetes/deploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..fbb53ff
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/kubernetes/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="kubernetes"
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash deploy.sh ${iaas}
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/kubernetes/undeploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/kubernetes/undeploy.sh
new file mode 100644
index 0000000..b05cf9f
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/kubernetes/undeploy.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash undeploy.sh
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/mock/deploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/mock/deploy.sh
new file mode 100755
index 0000000..a75033b
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/mock/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="mock"
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash deploy.sh ${iaas}
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/mock/undeploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..b05cf9f
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/mock/undeploy.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash undeploy.sh
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/openstack/deploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..1588a45
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/openstack/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="openstack"
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash deploy.sh ${iaas}
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/scripts/openstack/undeploy.sh b/samples/applications/dependency-scaling/sample-groups/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..b05cf9f
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/scripts/openstack/undeploy.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash undeploy.sh
+popd
\ No newline at end of file


[2/2] stratos git commit: Fixed dependency-scaling sample applicatoins

Posted by ma...@apache.org.
Fixed dependency-scaling sample applicatoins


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

Branch: refs/heads/master
Commit: b78e35a8a03d006467110aa8ca6dfef016215bcd
Parents: 0fed5d4
Author: Manula Thantriwatte <ma...@apache.org>
Authored: Fri Feb 6 09:37:42 2015 +0000
Committer: Manula Thantriwatte <ma...@apache.org>
Committed: Fri Feb 6 09:38:13 2015 +0000

----------------------------------------------------------------------
 .../sample-cartridges/README.md                 | 13 ++++
 .../artifacts/app_dependency_scaling.json       | 44 ------------
 .../artifacts/application.json                  | 44 ++++++++++++
 .../artifacts/autoscale-policy.json             | 14 ----
 .../artifacts/autoscaling-policy.json           | 14 ++++
 .../artifacts/ec2/deployment-policy.json        | 56 ++++++++++++++++
 .../artifacts/kubernetes/deployment-policy.json | 56 ++++++++++++++++
 .../kubernetes/kubernetes-cluster.json          | 55 +++++++++++++++
 .../artifacts/mock/deployment-policy.json       | 55 +++++++++++++++
 .../artifacts/openstack/deployment-policy.json  | 56 ++++++++++++++++
 .../ec2/artifacts/dep_dependency_scaling.json   | 56 ----------------
 .../sample-cartridges/iaases/ec2/deploy.sh      | 41 ------------
 .../sample-cartridges/iaases/ec2/undeploy.sh    | 24 -------
 .../artifacts/dep_dependency_scaling.json       | 56 ----------------
 .../iaases/kubernetes/deploy.sh                 | 47 -------------
 .../iaases/kubernetes/undeploy.sh               | 28 --------
 .../mock/artifacts/dep_dependency_scaling.json  | 55 ---------------
 .../sample-cartridges/iaases/mock/deploy.sh     | 41 ------------
 .../sample-cartridges/iaases/mock/undeploy.sh   | 24 -------
 .../artifacts/dep_dependency_scaling.json       | 56 ----------------
 .../iaases/openstack/deploy.sh                  | 41 ------------
 .../iaases/openstack/undeploy.sh                | 24 -------
 .../sample-cartridges/scripts/common/deploy.sh  | 40 +++++++++++
 .../scripts/common/undeploy.sh                  | 21 ++++++
 .../sample-cartridges/scripts/ec2/deploy.sh     |  9 +++
 .../sample-cartridges/scripts/ec2/undeploy.sh   |  8 +++
 .../scripts/kubernetes/deploy.sh                | 14 ++++
 .../scripts/kubernetes/undeploy.sh              | 13 ++++
 .../sample-cartridges/scripts/mock/deploy.sh    |  9 +++
 .../sample-cartridges/scripts/mock/undeploy.sh  |  8 +++
 .../scripts/openstack/deploy.sh                 |  9 +++
 .../scripts/openstack/undeploy.sh               |  8 +++
 .../dependency-scaling/sample-groups/README.md  | 13 ++++
 .../artifacts/app_single_group.json             | 70 --------------------
 .../sample-groups/artifacts/application.json    | 70 ++++++++++++++++++++
 .../artifacts/autoscale-policy.json             | 14 ----
 .../artifacts/autoscaling-policy.json           | 14 ++++
 .../artifacts/ec2/deployment-policy.json        | 56 ++++++++++++++++
 .../artifacts/kubernetes/deployment-policy.json | 57 ++++++++++++++++
 .../kubernetes/kubernetes-cluster.json          | 55 +++++++++++++++
 .../artifacts/mock/deployment-policy.json       | 56 ++++++++++++++++
 .../artifacts/openstack/deployment-policy.json  | 56 ++++++++++++++++
 .../iaases/ec2/artifacts/dep_single_group.json  | 56 ----------------
 .../sample-groups/iaases/ec2/deploy.sh          | 53 ---------------
 .../sample-groups/iaases/ec2/undeploy.sh        | 29 --------
 .../kubernetes/artifacts/dep_single_group.json  | 57 ----------------
 .../artifacts/kubernetes-cluster.json           | 55 ---------------
 .../sample-groups/iaases/kubernetes/deploy.sh   | 60 -----------------
 .../sample-groups/iaases/kubernetes/undeploy.sh | 33 ---------
 .../iaases/mock/artifacts/dep_single_group.json | 56 ----------------
 .../sample-groups/iaases/mock/deploy.sh         | 53 ---------------
 .../sample-groups/iaases/mock/undeploy.sh       | 29 --------
 .../openstack/artifacts/dep_single_group.json   | 56 ----------------
 .../sample-groups/iaases/openstack/deploy.sh    | 53 ---------------
 .../sample-groups/iaases/openstack/undeploy.sh  | 29 --------
 .../sample-groups/scripts/common/deploy.sh      | 44 ++++++++++++
 .../sample-groups/scripts/common/undeploy.sh    | 25 +++++++
 .../sample-groups/scripts/ec2/deploy.sh         |  9 +++
 .../sample-groups/scripts/ec2/undeploy.sh       |  8 +++
 .../sample-groups/scripts/kubernetes/deploy.sh  |  9 +++
 .../scripts/kubernetes/undeploy.sh              |  8 +++
 .../sample-groups/scripts/mock/deploy.sh        |  9 +++
 .../sample-groups/scripts/mock/undeploy.sh      |  8 +++
 .../sample-groups/scripts/openstack/deploy.sh   |  9 +++
 .../sample-groups/scripts/openstack/undeploy.sh |  8 +++
 65 files changed, 1002 insertions(+), 1254 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/README.md b/samples/applications/dependency-scaling/sample-cartridges/README.md
new file mode 100644
index 0000000..34feba2
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/README.md
@@ -0,0 +1,13 @@
+sample-cartridges
+=================
+
+Application folder structure
+----------------------------
+-- artifacts/<iaas>/ IaaS specific artifacts
+-- scripts/common/ Common scripts for all iaases
+-- scripts/<iaas> IaaS specific scripts
+
+How to run
+----------
+cd scripts/<iaas>/
+./deploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/artifacts/app_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/artifacts/app_dependency_scaling.json b/samples/applications/dependency-scaling/sample-cartridges/artifacts/app_dependency_scaling.json
deleted file mode 100644
index 0d8a9d2..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/artifacts/app_dependency_scaling.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "applicationId": "app_group_v1",
-    "alias": "mytestapp1",
-    "components": {
-        "cartridges": [
-            {
-                "type": "tomcat",
-                "cartridgeMin": 1,
-                "cartridgeMax": 2,
-                "subscribableInfo": {
-                    "alias": "mytomcat",
-                    "autoscalingPolicy": "autoscale_policy_1",
-                    "artifactRepository":{
-                        "privateRepo":false,
-                        "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
-                        "repoUsername":"",
-                        "repoPassword":""
-                    }
-                }
-            },
-            {
-                "type": "php",
-                "cartridgeMin": 2,
-                "cartridgeMax": 4,
-                "subscribableInfo": {
-                    "alias": "myphp",
-                    "autoscalingPolicy": "autoscale_policy_1",
-                    "artifactRepository":{
-                        "privateRepo":false,
-                        "repoUrl":"https://github.com/imesh/stratos-php-applications.git",
-                        "repoUsername":"",
-                        "repoPassword":""
-                    }
-                }
-            }
-        ],
-        "dependencies": {
-            "scalingDependants": [
-                "cartridge.tomcat, cartridge.php"
-            ],
-            "terminationBehaviour": "terminate-none"
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/artifacts/application.json b/samples/applications/dependency-scaling/sample-cartridges/artifacts/application.json
new file mode 100644
index 0000000..182aa73
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/artifacts/application.json
@@ -0,0 +1,44 @@
+{
+    "applicationId": "sample-cartridges-app",
+    "alias": "sample-cartridges-app",
+    "components": {
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 1,
+                "cartridgeMax": 2,
+                "subscribableInfo": {
+                    "alias": "mytomcat",
+                    "autoscalingPolicy": "autoscale-policy-1",
+                    "artifactRepository":{
+                        "privateRepo":false,
+                        "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
+                        "repoUsername":"",
+                        "repoPassword":""
+                    }
+                }
+            },
+            {
+                "type": "php",
+                "cartridgeMin": 2,
+                "cartridgeMax": 4,
+                "subscribableInfo": {
+                    "alias": "myphp",
+                    "autoscalingPolicy": "autoscale-policy-1",
+                    "artifactRepository":{
+                        "privateRepo":false,
+                        "repoUrl":"https://github.com/imesh/stratos-php-applications.git",
+                        "repoUsername":"",
+                        "repoPassword":""
+                    }
+                }
+            }
+        ],
+        "dependencies": {
+            "scalingDependants": [
+                "cartridge.tomcat, cartridge.php"
+            ],
+            "terminationBehaviour": "terminate-none"
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/artifacts/autoscale-policy.json b/samples/applications/dependency-scaling/sample-cartridges/artifacts/autoscale-policy.json
deleted file mode 100755
index f065167..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/artifacts/autoscale-policy.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscale_policy_1",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 40
-        },
-        "memoryConsumption": {
-            "threshold": 40
-        },
-        "loadAverage": {
-            "threshold": 40
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/artifacts/autoscaling-policy.json b/samples/applications/dependency-scaling/sample-cartridges/artifacts/autoscaling-policy.json
new file mode 100755
index 0000000..a107407
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/artifacts/autoscaling-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscale-policy-1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 40
+        },
+        "memoryConsumption": {
+            "threshold": 40
+        },
+        "loadAverage": {
+            "threshold": 40
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/artifacts/ec2/deployment-policy.json b/samples/applications/dependency-scaling/sample-cartridges/artifacts/ec2/deployment-policy.json
new file mode 100644
index 0000000..f830cff
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/artifacts/ec2/deployment-policy.json
@@ -0,0 +1,56 @@
+{
+    "applicationId": "sample-cartridges-app",
+    "applicationPolicy": {
+        "applicationId": "sample-cartridges-app",
+        "networkPartition": [
+            {
+                "id": "EC2-P1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "ec2",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "ap-southeast-1"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "mytomcat",
+            "networkPartition": [
+                {
+                    "id": "EC2-P1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "myphp",
+            "networkPartition": [
+                {
+                    "id": "EC2-P1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 10
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/artifacts/kubernetes/deployment-policy.json b/samples/applications/dependency-scaling/sample-cartridges/artifacts/kubernetes/deployment-policy.json
new file mode 100644
index 0000000..4e20358
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/artifacts/kubernetes/deployment-policy.json
@@ -0,0 +1,56 @@
+{
+    "applicationId": "sample-cartridges-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id":"network-p1",
+                "kubernetesClusterId":"kubernetes-cluster-1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "kubernetes",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "default"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "mytomcat",
+            "networkPartition": [
+                {
+                    "id": "network-p1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "myphp",
+            "networkPartition": [
+                {
+                    "id": "network-p1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 10
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/dependency-scaling/sample-cartridges/artifacts/kubernetes/kubernetes-cluster.json
new file mode 100644
index 0000000..228eeb3
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/artifacts/kubernetes/kubernetes-cluster.json
@@ -0,0 +1,55 @@
+{
+      "clusterId": "kubernetes-cluster-1",
+      "description": "Kubernetes CoreOS cluster",
+      "kubernetesMaster": {
+                  "hostId" : "KubHostMaster1",
+                  "hostname" : "master.dev.kubernetes.example.org",
+                  "hostIpAddress" : "172.17.8.100",
+                  "property" : [
+                  ]
+        },
+
+        "portRange" : {
+           "upper": "5000",
+           "lower": "4500"
+        },
+
+        "kubernetesHosts": [
+              {
+                     "hostId" : "KubHostSlave1",
+                     "hostname" : "slave1.dev.kubernetes.example.org",
+                     "hostIpAddress" : "172.17.8.101",
+                     "property" : [
+                     ]
+                },
+                {
+                     "hostId" : "KubHostSlave2",
+                     "hostname" : "slave2.dev.kubernetes.example.org",
+                     "hostIpAddress" : "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/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/artifacts/mock/deployment-policy.json b/samples/applications/dependency-scaling/sample-cartridges/artifacts/mock/deployment-policy.json
new file mode 100644
index 0000000..129ac67
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/artifacts/mock/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+    "applicationId": "sample-cartridges-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "openstack_R1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "mock",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "RegionOne"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "mytomcat",
+            "networkPartition": [
+                {
+                    "id": "openstack_R1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "myphp",
+            "networkPartition": [
+                {
+                    "id": "openstack_R1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 10
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/artifacts/openstack/deployment-policy.json b/samples/applications/dependency-scaling/sample-cartridges/artifacts/openstack/deployment-policy.json
new file mode 100644
index 0000000..c9ce59e
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/artifacts/openstack/deployment-policy.json
@@ -0,0 +1,56 @@
+{
+    "applicationId": "sample-cartridges-app",
+    "applicationPolicy": {
+        "applicationId": "sample-cartridges-app",
+        "networkPartition": [
+            {
+                "id": "openstack_R1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "openstack",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "RegionOne"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "mytomcat",
+            "networkPartition": [
+                {
+                    "id": "openstack_R1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "myphp",
+            "networkPartition": [
+                {
+                    "id": "openstack_R1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 10
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/artifacts/dep_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/artifacts/dep_dependency_scaling.json b/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/artifacts/dep_dependency_scaling.json
deleted file mode 100644
index 1fa241f..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/artifacts/dep_dependency_scaling.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "applicationId": "app_group_v1",
-    "applicationPolicy": {
-        "applicationId": "app_group_v1",
-        "networkPartition": [
-            {
-                "id": "EC2-P1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "P1",
-                        "provider": "ec2",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "ap-southeast-1"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "EC2-P1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "myphp",
-            "networkPartition": [
-                {
-                    "id": "EC2-P1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 10
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/deploy.sh b/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/deploy.sh
deleted file mode 100755
index ef152ed..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/deploy.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-export iaas="ec2"						#[openstack, ec2, mock, kubernetes]
-export host_ip="localhost"
-
-export artifacts_path="../../artifacts"
-export cartridges_path="../../../../../cartridges/${iaas}"
-
-set -e
-
-# Adding autoscale policy
-pushd ${artifacts_path}
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies
-popd
-
-# Adding cartridges
-pushd ${cartridges_path}
-	# Adding tomcat cartridge
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-    # Adding php cartridge
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'php.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-popd
-
-sleep 2
-
-# Creating application
-pushd ${artifacts_path}
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d @'app_dependency_scaling.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications
-popd
-
-sleep 2
-
-# Deploy application
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_dependency_scaling.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/deploy
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/undeploy.sh b/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/undeploy.sh
deleted file mode 100644
index c7d6de7..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/ec2/undeploy.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/undeploy
-
-sleep 30
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/php
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/artifacts/dep_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/artifacts/dep_dependency_scaling.json b/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/artifacts/dep_dependency_scaling.json
deleted file mode 100644
index 5cbf891..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/artifacts/dep_dependency_scaling.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "applicationId": "app_group_v1",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id":"network-p1",
-                "kubernetesClusterId":"kubernetes-cluster-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "P1",
-                        "provider": "kubernetes",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "network-p1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "myphp",
-            "networkPartition": [
-                {
-                    "id": "network-p1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 10
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/deploy.sh b/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/deploy.sh
deleted file mode 100755
index 30e642b..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/deploy.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-
-export iaas="kubernetes"						#[openstack, ec2, mock, kubernetes]
-export host_ip="localhost"
-
-export artifacts_path="../../artifacts"
-export cartridges_path="../../../../../cartridges/${iaas}"
-
-set -e
-
-# Adding autoscale policy
-pushd ${artifacts_path}
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies
-popd
-
-# Adding cartridges
-pushd ${cartridges_path}
-	# Adding tomcat cartridge
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-    # Adding php cartridge
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'php.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-popd
-
-sleep 3
-
-# Adding kubernetes cluster
-echo "Adding kubernetes cluster..."
-curl -X POST -H "Content-Type: application/json" -d @'artifacts/kubernetes-cluster.json' -k -u admin:admin https://${host_ip}:9443/api/kubernetesClusters
-
-sleep 2
-
-# Creating application
-pushd ${artifacts_path}
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d @'app_dependency_scaling.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications
-popd
-
-sleep 3
-
-# Deploy application
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_dependency_scaling.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/deploy
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/undeploy.sh b/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/undeploy.sh
deleted file mode 100644
index c550d8e..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/kubernetes/undeploy.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/undeploy
-
-sleep 5
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/php
-
-# Removing kubernetes
-echo "Removing kubernetes cluster..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/kubernetesClusters/kubernetes-cluster-1
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/artifacts/dep_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/artifacts/dep_dependency_scaling.json b/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/artifacts/dep_dependency_scaling.json
deleted file mode 100644
index 05b3a04..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/artifacts/dep_dependency_scaling.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationId": "app_group_v1",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "openstack_R1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "P1",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "openstack_R1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "myphp",
-            "networkPartition": [
-                {
-                    "id": "openstack_R1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 10
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/deploy.sh b/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/deploy.sh
deleted file mode 100755
index db960d3..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/deploy.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-export iaas="ec2"						#[openstack, ec2, mock, kubernetes]
-export host_ip="localhost"
-
-export artifacts_path="../../artifacts"
-export cartridges_path="../../../../../cartridges/${iaas}"
-
-set -e
-
-# Adding autoscale policy
-pushd ${artifacts_path}
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies
-popd
-
-# Adding cartridges
-pushd ${cartridges_path}
-	# Adding tomcat cartridge
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding php cartridge
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'php.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-popd
-
-sleep 3
-
-# Creating application
-pushd ${artifacts_path}
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d @'app_dependency_scaling.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications
-popd
-
-sleep 3
-
-# Deploy application
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_dependency_scaling.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/deploy
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/undeploy.sh b/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/undeploy.sh
deleted file mode 100644
index ef1223b..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/mock/undeploy.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/undeploy
-
-sleep 5
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/php
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/artifacts/dep_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/artifacts/dep_dependency_scaling.json b/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/artifacts/dep_dependency_scaling.json
deleted file mode 100644
index 903ed41..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/artifacts/dep_dependency_scaling.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "applicationId": "app_group_v1",
-    "applicationPolicy": {
-        "applicationId": "app_group_v1",
-        "networkPartition": [
-            {
-                "id": "openstack_R1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "P1",
-                        "provider": "openstack",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "openstack_R1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "myphp",
-            "networkPartition": [
-                {
-                    "id": "openstack_R1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 10
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/deploy.sh b/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/deploy.sh
deleted file mode 100755
index b253230..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/deploy.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh 
-
-export iaas="ec2"						#[openstack, ec2, mock, kubernetes]
-export host_ip="localhost"
-
-export artifacts_path="../../artifacts"
-export cartridges_path="../../../../../cartridges/${iaas}"
-
-set -e
-
-# Adding autoscale policy
-pushd ${artifacts_path}
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies
-popd
-
-# Adding cartridges
-pushd ${cartridges_path}
-	# Adding tomcat cartridge
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding php cartridge
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'tomcat1.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-popd
-
-sleep 2
-
-# Creating application
-pushd ${artifacts_path}
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d @'app_dependency_scaling.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications
-popd
-
-sleep 2
-
-# Deploy application
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_dependency_scaling.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/deploy
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/undeploy.sh b/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/undeploy.sh
deleted file mode 100644
index c513607..0000000
--- a/samples/applications/dependency-scaling/sample-cartridges/iaases/openstack/undeploy.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/undeploy
-
-sleep 30
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/php
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/common/deploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/common/deploy.sh
new file mode 100755
index 0000000..c2df59e
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/common/deploy.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+iaas=$1
+host_ip="localhost"
+host_port=9443
+
+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`
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+    echo "Usage: deploy.sh [iaas]"
+    exit
+fi
+
+echo ${artifacts_path}/autoscale-policy.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
+
+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
+
+echo "Adding php cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+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/sample-cartridges-app/deploy
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/common/undeploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/common/undeploy.sh
new file mode 100644
index 0000000..597d49b
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/common/undeploy.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+set -e
+
+echo "Undeploying application..."
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/sample-cartridges-app/undeploy
+
+sleep 10
+
+echo "Deleting application..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/sample-cartridges-app
+
+echo "Removing cartridges..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php
+
+echo "Removing autoscale policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscale-policy-1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/ec2/deploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/ec2/deploy.sh
new file mode 100755
index 0000000..62063a2
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/ec2/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="ec2"
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash deploy.sh ${iaas}
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/ec2/undeploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/ec2/undeploy.sh
new file mode 100644
index 0000000..b05cf9f
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/ec2/undeploy.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash undeploy.sh
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/kubernetes/deploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..b9064e1
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/kubernetes/deploy.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+iaas="kubernetes"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+
+echo "Adding kubernetes cluster..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/kubernetes-cluster.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
+
+bash ${common_folder}/deploy.sh ${iaas}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/kubernetes/undeploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/kubernetes/undeploy.sh
new file mode 100644
index 0000000..a27422e
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/kubernetes/undeploy.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder="${script_path}/../common"
+
+bash ${common_folder}/undeploy.sh
+
+echo "Removing kubernetes cluster..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters/kubernetes-cluster-1

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/mock/deploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/mock/deploy.sh
new file mode 100755
index 0000000..a75033b
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/mock/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="mock"
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash deploy.sh ${iaas}
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/mock/undeploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..b05cf9f
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/mock/undeploy.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash undeploy.sh
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/openstack/deploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..1588a45
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/openstack/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="openstack"
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash deploy.sh ${iaas}
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-cartridges/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-cartridges/scripts/openstack/undeploy.sh b/samples/applications/dependency-scaling/sample-cartridges/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..b05cf9f
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-cartridges/scripts/openstack/undeploy.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash undeploy.sh
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/README.md b/samples/applications/dependency-scaling/sample-groups/README.md
new file mode 100644
index 0000000..d1adf79
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/README.md
@@ -0,0 +1,13 @@
+sample-groups
+=============
+
+Application folder structure
+----------------------------
+-- artifacts/<iaas>/ IaaS specific artifacts
+-- scripts/common/ Common scripts for all iaases
+-- scripts/<iaas> IaaS specific scripts
+
+How to run
+----------
+cd scripts/<iaas>/
+./deploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/artifacts/app_single_group.json b/samples/applications/dependency-scaling/sample-groups/artifacts/app_single_group.json
deleted file mode 100644
index 2e93218..0000000
--- a/samples/applications/dependency-scaling/sample-groups/artifacts/app_single_group.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-    "applicationId": "app_group_v2",
-    "alias": "mytestapp1",
-    "components": {
-        "groups": [
-            {
-                "name": "group6",
-                "alias": "mygroup6",
-                "groupMinInstances": 1,
-                "groupMaxInstances": 2,
-                "cartridges": [
-                    {
-                        "type": "esb",
-                        "cartridgeMin": 1,
-                        "cartridgeMax": 2,
-                        "subscribableInfo": {
-                            "alias": "esbgroup6",
-                            "autoscalingPolicy": "autoscale_policy_1",
-                            "artifactRepository":{
-                                "privateRepo":false,
-                                "repoUrl":"https://github.com/imesh/stratos-esb-applications.git",
-                                "repoUsername":"",
-                                "repoPassword":""
-                            }
-                        }
-                    },
-                    {
-                        "type": "php",
-                        "cartridgeMin": 1,
-                        "cartridgeMax": 2,
-                        "subscribableInfo": {
-                            "alias": "phpgroup6",
-                            "autoscalingPolicy": "autoscale_policy_1",
-                            "artifactRepository":{
-                                "privateRepo":false,
-                                "repoUrl":"https://github.com/imesh/stratos-php-applications.git",
-                                "repoUsername":"",
-                                "repoPassword":""
-                            }
-                        }
-                    }
-                ]
-            }
-        ],
-        "cartridges": [
-            {
-                "type": "tomcat",
-                "cartridgeMin": 2,
-                "cartridgeMax": 4,
-                "subscribableInfo": {
-                    "alias": "mytomcat",
-                    "autoscalingPolicy": "autoscale_policy_1",
-                    "artifactRepository":{
-                        "privateRepo":false,
-                        "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
-                        "repoUsername":"",
-                        "repoPassword":""
-                    }
-                }
-            }
-        ],
-        "dependencies": {
-            "scalingDependants": [
-                "group.group6, cartridge.tomcat"
-            ],
-            "terminationBehaviour": "terminate-none"
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/artifacts/application.json b/samples/applications/dependency-scaling/sample-groups/artifacts/application.json
new file mode 100644
index 0000000..faca16a
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/artifacts/application.json
@@ -0,0 +1,70 @@
+{
+    "applicationId": "sample-groups-app",
+    "alias": "sample-groups-app",
+    "components": {
+        "groups": [
+            {
+                "name": "group6",
+                "alias": "mygroup6",
+                "groupMinInstances": 1,
+                "groupMaxInstances": 2,
+                "cartridges": [
+                    {
+                        "type": "esb",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "esbgroup6",
+                            "autoscalingPolicy": "autoscale-policy-1",
+                            "artifactRepository":{
+                                "privateRepo":false,
+                                "repoUrl":"https://github.com/imesh/stratos-esb-applications.git",
+                                "repoUsername":"",
+                                "repoPassword":""
+                            }
+                        }
+                    },
+                    {
+                        "type": "php",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "phpgroup6",
+                            "autoscalingPolicy": "autoscale-policy-1",
+                            "artifactRepository":{
+                                "privateRepo":false,
+                                "repoUrl":"https://github.com/imesh/stratos-php-applications.git",
+                                "repoUsername":"",
+                                "repoPassword":""
+                            }
+                        }
+                    }
+                ]
+            }
+        ],
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 2,
+                "cartridgeMax": 4,
+                "subscribableInfo": {
+                    "alias": "mytomcat",
+                    "autoscalingPolicy": "autoscale-policy-1",
+                    "artifactRepository":{
+                        "privateRepo":false,
+                        "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
+                        "repoUsername":"",
+                        "repoPassword":""
+                    }
+                }
+            }
+        ],
+        "dependencies": {
+            "scalingDependants": [
+                "group.group6, cartridge.tomcat"
+            ],
+            "terminationBehaviour": "terminate-none"
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/artifacts/autoscale-policy.json b/samples/applications/dependency-scaling/sample-groups/artifacts/autoscale-policy.json
deleted file mode 100755
index d1d3134..0000000
--- a/samples/applications/dependency-scaling/sample-groups/artifacts/autoscale-policy.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscale_policy_1",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 50
-        },
-        "memoryConsumption": {
-            "threshold": 70
-        },
-        "loadAverage": {
-            "threshold": 1000
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/artifacts/autoscaling-policy.json b/samples/applications/dependency-scaling/sample-groups/artifacts/autoscaling-policy.json
new file mode 100755
index 0000000..3365fb3
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/artifacts/autoscaling-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscale-policy-1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 50
+        },
+        "memoryConsumption": {
+            "threshold": 70
+        },
+        "loadAverage": {
+            "threshold": 1000
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/artifacts/ec2/deployment-policy.json b/samples/applications/dependency-scaling/sample-groups/artifacts/ec2/deployment-policy.json
new file mode 100644
index 0000000..4886186
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/artifacts/ec2/deployment-policy.json
@@ -0,0 +1,56 @@
+{
+    "applicationId": "sample-groups-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "EC2-P1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "ec2",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "ap-southeast-1"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "mytomcat",
+            "networkPartition": [
+                {
+                    "id": "EC2-P1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "mygroup6",
+            "networkPartition": [
+                {
+                    "id": "EC2-P1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/artifacts/kubernetes/deployment-policy.json b/samples/applications/dependency-scaling/sample-groups/artifacts/kubernetes/deployment-policy.json
new file mode 100644
index 0000000..9fb4bce
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/artifacts/kubernetes/deployment-policy.json
@@ -0,0 +1,57 @@
+{
+    "applicationId": "sample-groups-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id":"network-p1",
+                "kubernetesClusterId":"kubernetes-cluster-1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "kubernetes",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "default"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "mytomcat",
+            "networkPartition": [
+                {
+                    "id": "network-p1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "mygroup6",
+            "networkPartition": [
+                {
+                    "id": "network-p1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/dependency-scaling/sample-groups/artifacts/kubernetes/kubernetes-cluster.json
new file mode 100644
index 0000000..228eeb3
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/artifacts/kubernetes/kubernetes-cluster.json
@@ -0,0 +1,55 @@
+{
+      "clusterId": "kubernetes-cluster-1",
+      "description": "Kubernetes CoreOS cluster",
+      "kubernetesMaster": {
+                  "hostId" : "KubHostMaster1",
+                  "hostname" : "master.dev.kubernetes.example.org",
+                  "hostIpAddress" : "172.17.8.100",
+                  "property" : [
+                  ]
+        },
+
+        "portRange" : {
+           "upper": "5000",
+           "lower": "4500"
+        },
+
+        "kubernetesHosts": [
+              {
+                     "hostId" : "KubHostSlave1",
+                     "hostname" : "slave1.dev.kubernetes.example.org",
+                     "hostIpAddress" : "172.17.8.101",
+                     "property" : [
+                     ]
+                },
+                {
+                     "hostId" : "KubHostSlave2",
+                     "hostname" : "slave2.dev.kubernetes.example.org",
+                     "hostIpAddress" : "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/b78e35a8/samples/applications/dependency-scaling/sample-groups/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/artifacts/mock/deployment-policy.json b/samples/applications/dependency-scaling/sample-groups/artifacts/mock/deployment-policy.json
new file mode 100644
index 0000000..f553ab8
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/artifacts/mock/deployment-policy.json
@@ -0,0 +1,56 @@
+{
+    "applicationId": "sample-groups-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "openstack_R1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "mock",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "RegionOne"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "mytomcat",
+            "networkPartition": [
+                {
+                    "id": "openstack_R1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "mygroup6",
+            "networkPartition": [
+                {
+                    "id": "openstack_R1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/artifacts/openstack/deployment-policy.json b/samples/applications/dependency-scaling/sample-groups/artifacts/openstack/deployment-policy.json
new file mode 100644
index 0000000..5b924c2
--- /dev/null
+++ b/samples/applications/dependency-scaling/sample-groups/artifacts/openstack/deployment-policy.json
@@ -0,0 +1,56 @@
+{
+    "applicationId": "sample-groups-app",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "openstack_R1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "openstack",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "RegionOne"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "mytomcat",
+            "networkPartition": [
+                {
+                    "id": "openstack_R1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "mygroup6",
+            "networkPartition": [
+                {
+                    "id": "openstack_R1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/ec2/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/ec2/artifacts/dep_single_group.json b/samples/applications/dependency-scaling/sample-groups/iaases/ec2/artifacts/dep_single_group.json
deleted file mode 100644
index 1e927ca..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/ec2/artifacts/dep_single_group.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "applicationId": "app_group_v2",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "EC2-P1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "P1",
-                        "provider": "ec2",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "ap-southeast-1"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "EC2-P1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup6",
-            "networkPartition": [
-                {
-                    "id": "EC2-P1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/ec2/deploy.sh b/samples/applications/dependency-scaling/sample-groups/iaases/ec2/deploy.sh
deleted file mode 100755
index e8abe10..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/ec2/deploy.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-export iaas="ec2"						#[openstack, ec2, mock, kubernetes]
-export host_ip="localhost"
-
-export artifacts_path="../../artifacts"
-export cartridges_path="../../../../../cartridges/${iaas}"
-export cartridges_groups_path="../../../../../cartridges-groups"
-
-set -e
-
-# Adding autoscale policy
-pushd ${artifacts_path}
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies
-popd
-
-# Adding cartridges
-pushd ${cartridges_path}
-	# Adding tomcat cartridge
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding esb cartridge
-echo "Adding esb cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'esb.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding php cartridge
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'php.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-popd
-
-# Adding groups
-pushd ${cartridges_groups_path}
-	# Adding group6c2
-echo "Adding group6c2 group..."
-curl -X POST -H "Content-Type: application/json" -d @'group6c2.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups
-popd
-
-sleep 3
-
-# Creating application
-pushd ${artifacts_path}
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d @'app_single_group.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications
-popd
-
-sleep 3
-
-# Deploy application
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_single_group.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2/deploy
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/ec2/undeploy.sh b/samples/applications/dependency-scaling/sample-groups/iaases/ec2/undeploy.sh
deleted file mode 100644
index deb9c66..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/ec2/undeploy.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2/undeploy
-
-sleep 30
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2
-
-# Removing groups
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/esb
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/php
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/artifacts/dep_single_group.json b/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/artifacts/dep_single_group.json
deleted file mode 100644
index b1ea0b3..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/artifacts/dep_single_group.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
-    "applicationId": "app_group_v2",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id":"network-p1",
-                "kubernetesClusterId":"kubernetes-cluster-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "P1",
-                        "provider": "kubernetes",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "network-p1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup6",
-            "networkPartition": [
-                {
-                    "id": "network-p1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "P1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/artifacts/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/artifacts/kubernetes-cluster.json b/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/artifacts/kubernetes-cluster.json
deleted file mode 100644
index 228eeb3..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/artifacts/kubernetes-cluster.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-      "clusterId": "kubernetes-cluster-1",
-      "description": "Kubernetes CoreOS cluster",
-      "kubernetesMaster": {
-                  "hostId" : "KubHostMaster1",
-                  "hostname" : "master.dev.kubernetes.example.org",
-                  "hostIpAddress" : "172.17.8.100",
-                  "property" : [
-                  ]
-        },
-
-        "portRange" : {
-           "upper": "5000",
-           "lower": "4500"
-        },
-
-        "kubernetesHosts": [
-              {
-                     "hostId" : "KubHostSlave1",
-                     "hostname" : "slave1.dev.kubernetes.example.org",
-                     "hostIpAddress" : "172.17.8.101",
-                     "property" : [
-                     ]
-                },
-                {
-                     "hostId" : "KubHostSlave2",
-                     "hostname" : "slave2.dev.kubernetes.example.org",
-                     "hostIpAddress" : "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/b78e35a8/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/deploy.sh b/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/deploy.sh
deleted file mode 100755
index 8a8f016..0000000
--- a/samples/applications/dependency-scaling/sample-groups/iaases/kubernetes/deploy.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-
-export iaas="kubernetes"						#[openstack, ec2, mock, kubernetes]
-export host_ip="localhost"
-
-export artifacts_path="../../artifacts"
-export cartridges_path="../../../../../cartridges/${iaas}"
-export cartridges_groups_path="../../../../../cartridges-groups"
-
-set -e
-
-# Adding autoscale policy
-pushd ${artifacts_path}
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies
-popd
-
-# Adding cartridges
-pushd ${cartridges_path}
-	# Adding tomcat cartridge
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding esb cartridge
-echo "Adding esb cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'esb.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-
-	# Adding php cartridge
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d @'php.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges
-popd
-
-sleep 3
-
-# Adding kubernetes cluster
-echo "Adding kubernetes cluster..."
-curl -X POST -H "Content-Type: application/json" -d @'artifacts/kubernetes-cluster.json' -k -u admin:admin https://${host_ip}:9443/api/kubernetesClusters
-
-sleep 2
-
-# Adding groups
-pushd ${cartridges_groups_path}
-	# Adding group6c2
-echo "Adding group6c2 group..."
-curl -X POST -H "Content-Type: application/json" -d @'group6c2.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups
-popd
-
-sleep 3
-
-# Creating application
-pushd ${artifacts_path}
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d @'app_single_group.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications
-popd
-
-sleep 3
-
-# Deploy application
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_single_group.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v2/deploy
\ No newline at end of file