You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/03/01 06:18:50 UTC

stratos git commit: Renaming tomcat-sso sample application to tomcat-single-signon and adding mock artifacts

Repository: stratos
Updated Branches:
  refs/heads/master f7a397ede -> 42c0baea9


Renaming tomcat-sso sample application to tomcat-single-signon and adding mock artifacts


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

Branch: refs/heads/master
Commit: 42c0baea9f8134e317f44ce28bfc37bb032b749f
Parents: f7a397e
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Mar 1 10:48:39 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 1 10:48:39 2015 +0530

----------------------------------------------------------------------
 .../applications/tomcat-single-signon/README.md | 18 +++++++
 .../artifacts/application-policy.json           |  8 ++++
 .../artifacts/application.json                  | 38 +++++++++++++++
 .../scripts/common/deploy.sh                    | 48 +++++++++++++++++++
 .../scripts/common/undeploy.sh                  | 21 +++++++++
 .../tomcat-single-signon/scripts/ec2/deploy.sh  |  9 ++++
 .../scripts/ec2/undeploy.sh                     |  7 +++
 .../scripts/kubernetes/deploy.sh                | 16 +++++++
 .../scripts/kubernetes/undeploy.sh              | 13 ++++++
 .../tomcat-single-signon/scripts/mock/deploy.sh |  9 ++++
 .../scripts/mock/undeploy.sh                    |  7 +++
 .../scripts/openstack/deploy.sh                 |  9 ++++
 .../scripts/openstack/undeploy.sh               |  7 +++
 samples/applications/tomcat-sso/README.md       | 18 -------
 .../artifacts/application-policy.json           |  8 ----
 .../tomcat-sso/artifacts/application.json       | 38 ---------------
 .../tomcat-sso/scripts/common/deploy.sh         | 49 --------------------
 .../tomcat-sso/scripts/common/undeploy.sh       | 21 ---------
 .../tomcat-sso/scripts/ec2/deploy.sh            |  9 ----
 .../tomcat-sso/scripts/ec2/undeploy.sh          |  7 ---
 .../tomcat-sso/scripts/kubernetes/deploy.sh     | 16 -------
 .../tomcat-sso/scripts/kubernetes/undeploy.sh   | 13 ------
 .../tomcat-sso/scripts/mock/deploy.sh           |  9 ----
 .../tomcat-sso/scripts/mock/undeploy.sh         |  7 ---
 .../tomcat-sso/scripts/openstack/deploy.sh      |  9 ----
 .../tomcat-sso/scripts/openstack/undeploy.sh    |  7 ---
 samples/cartridges/kubernetes/tomcat-sso.json   | 30 ------------
 samples/cartridges/kubernetes/tomcat3.json      | 30 ++++++++++++
 samples/cartridges/mock/tomcat3.json            | 30 ++++++++++++
 samples/cartridges/mock/wso2-is.json            | 27 +++++++++++
 .../mock/network-partition-3.json               | 15 ++++++
 31 files changed, 312 insertions(+), 241 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/README.md b/samples/applications/tomcat-single-signon/README.md
new file mode 100644
index 0000000..2faa840
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/README.md
@@ -0,0 +1,18 @@
+Tomcat Application
+==================
+Tomcat application provides an Apache Tomcat 7 cluster. It has no cartridge groups or any dependencies.
+
+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
+```
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/artifacts/application.json b/samples/applications/tomcat-single-signon/artifacts/application.json
new file mode 100644
index 0000000..2f237c1
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/artifacts/application.json
@@ -0,0 +1,38 @@
+{
+    "applicationId": "tomcat-single-signon",
+    "alias": "tomcat-single-signon",
+    "components": {
+
+        "cartridges": [
+            {
+                "type": "tomcat3",
+                "cartridgeMin": 1,
+                "cartridgeMax": 1,
+                "subscribableInfo": {
+                    "alias": "mytomcat3",
+                    "autoscalingPolicy": "autoscaling-policy-1",
+                    "deploymentPolicy": "deployment-policy-3",
+                    "artifactRepository":{
+                        "privateRepo":false,
+                        "repoUrl":"https://github.com/chamilad/travelocity-sample",
+                        "repoUsername":"",
+                        "repoPassword":""
+                    }
+                }
+            },
+            {
+                "type": "wso2is",
+                "cartridgeMin": 1,
+                "cartridgeMax": 1,
+                "subscribableInfo": {
+                    "alias": "mywso2is",
+                    "autoscalingPolicy": "autoscaling-policy-1",
+                    "deploymentPolicy": "deployment-policy-3"
+                }
+            }
+        ],
+        "dependencies": {
+            "terminationBehaviour": "terminate-none"
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/common/deploy.sh b/samples/applications/tomcat-single-signon/scripts/common/deploy.sh
new file mode 100755
index 0000000..07dd56d
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/scripts/common/deploy.sh
@@ -0,0 +1,48 @@
+#!/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_cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
+cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
+autoscaling_policies_path=`cd "${script_path}/../../../../autoscaling-policies"; pwd`
+network_partitions_path=`cd "${script_path}/../../../../network-partitions/${iaas}"; pwd`
+deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd`
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+    echo "Usage: deploy.sh [iaas]"
+    exit
+fi
+
+echo ${artifacts_path}/autoscaling-policy.json
+echo "Adding autoscale policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+
+echo "Adding network partitions..."
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-3.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+
+echo "Adding deployment policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
+
+echo "Adding tomcat cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/tomcat3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding wso2-is cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/wso2-is.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 "@${artifacts_path}/application-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/tomcat-single-signon/deploy

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/common/undeploy.sh b/samples/applications/tomcat-single-signon/scripts/common/undeploy.sh
new file mode 100644
index 0000000..8ba2646
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/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/single-cartridge-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/single-cartridge-app
+
+echo "Removing cartridges..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat3
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/wso2-is
+
+echo "Removing autoscale policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/ec2/deploy.sh b/samples/applications/tomcat-single-signon/scripts/ec2/deploy.sh
new file mode 100755
index 0000000..1370667
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/scripts/ec2/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="ec2"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/ec2/undeploy.sh b/samples/applications/tomcat-single-signon/scripts/ec2/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/scripts/ec2/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/kubernetes/deploy.sh b/samples/applications/tomcat-single-signon/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..753af7e
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/scripts/kubernetes/deploy.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+iaas="kubernetes"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+kubernetes_clusters_path=`cd "${script_path}/../../../../kubernetes-clusters"; pwd`
+
+
+echo "Adding kubernetes cluster..."
+curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-ec2.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/42c0baea/samples/applications/tomcat-single-signon/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/kubernetes/undeploy.sh b/samples/applications/tomcat-single-signon/scripts/kubernetes/undeploy.sh
new file mode 100755
index 0000000..c450ea0
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/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=`cd "${script_path}/../common"; pwd`
+
+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-ec2

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/mock/deploy.sh b/samples/applications/tomcat-single-signon/scripts/mock/deploy.sh
new file mode 100755
index 0000000..93f8517
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/scripts/mock/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+iaas="mock"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/mock/undeploy.sh b/samples/applications/tomcat-single-signon/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/scripts/mock/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/openstack/deploy.sh b/samples/applications/tomcat-single-signon/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..4c39959
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/scripts/openstack/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="openstack"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-single-signon/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-single-signon/scripts/openstack/undeploy.sh b/samples/applications/tomcat-single-signon/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/tomcat-single-signon/scripts/openstack/undeploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/undeploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/README.md b/samples/applications/tomcat-sso/README.md
deleted file mode 100644
index 2faa840..0000000
--- a/samples/applications/tomcat-sso/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-Tomcat Application
-==================
-Tomcat application provides an Apache Tomcat 7 cluster. It has no cartridge groups or any dependencies.
-
-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
-```
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/artifacts/application.json b/samples/applications/tomcat-sso/artifacts/application.json
deleted file mode 100644
index 7106a4f..0000000
--- a/samples/applications/tomcat-sso/artifacts/application.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
-    "applicationId": "tomcat-sso",
-    "alias": "tomcat-sso",
-    "components": {
-
-        "cartridges": [
-            {
-                "type": "tomcat-sso",
-                "cartridgeMin": 1,
-                "cartridgeMax": 1,
-                "subscribableInfo": {
-                    "alias": "mytomcat",
-                    "autoscalingPolicy": "autoscaling-policy-1",
-                    "deploymentPolicy": "deployment-policy-3",
-                    "artifactRepository":{
-                        "privateRepo":false,
-                        "repoUrl":"https://github.com/chamilad/travelocity-sample",
-                        "repoUsername":"",
-                        "repoPassword":""
-                    }
-                }
-            },
-            {
-                "type": "wso2is",
-                "cartridgeMin": 1,
-                "cartridgeMax": 1,
-                "subscribableInfo": {
-                    "alias": "mywso2is",
-                    "autoscalingPolicy": "autoscaling-policy-1",
-                    "deploymentPolicy": "deployment-policy-3"
-                }
-            }
-        ],
-        "dependencies": {
-            "terminationBehaviour": "terminate-none"
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/common/deploy.sh b/samples/applications/tomcat-sso/scripts/common/deploy.sh
deleted file mode 100755
index 32ba4be..0000000
--- a/samples/applications/tomcat-sso/scripts/common/deploy.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/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`
-iaas_cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
-cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
-autoscaling_policies_path=`cd "${script_path}/../../../../autoscaling-policies"; pwd`
-network_partitions_path=`cd "${script_path}/../../../../network-partitions/${iaas}"; pwd`
-deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd`
-
-set -e
-
-if [[ -z "${iaas}" ]]; then
-    echo "Usage: deploy.sh [iaas]"
-    exit
-fi
-
-echo ${artifacts_path}/autoscaling-policy.json
-echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
-
-echo "Adding network partitions..."
-curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-3.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
-
-echo "Adding deployment policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-3.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
-
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/tomcat-sso.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
-
-echo "Adding wso2-is cartridge..."
-curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/wso2-is.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 "@${artifacts_path}/application-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/tomcat-sso/deploy

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/common/undeploy.sh b/samples/applications/tomcat-sso/scripts/common/undeploy.sh
deleted file mode 100644
index 9bff2b0..0000000
--- a/samples/applications/tomcat-sso/scripts/common/undeploy.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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/single-cartridge-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/single-cartridge-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-sso
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/wso2-is
-
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/ec2/deploy.sh b/samples/applications/tomcat-sso/scripts/ec2/deploy.sh
deleted file mode 100755
index 1370667..0000000
--- a/samples/applications/tomcat-sso/scripts/ec2/deploy.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-iaas="ec2"
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/ec2/undeploy.sh b/samples/applications/tomcat-sso/scripts/ec2/undeploy.sh
deleted file mode 100644
index 17d8c71..0000000
--- a/samples/applications/tomcat-sso/scripts/ec2/undeploy.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/undeploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/kubernetes/deploy.sh b/samples/applications/tomcat-sso/scripts/kubernetes/deploy.sh
deleted file mode 100755
index 753af7e..0000000
--- a/samples/applications/tomcat-sso/scripts/kubernetes/deploy.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-host_ip="localhost"
-host_port=9443
-iaas="kubernetes"
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-kubernetes_clusters_path=`cd "${script_path}/../../../../kubernetes-clusters"; pwd`
-
-
-echo "Adding kubernetes cluster..."
-curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-ec2.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/42c0baea/samples/applications/tomcat-sso/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/kubernetes/undeploy.sh b/samples/applications/tomcat-sso/scripts/kubernetes/undeploy.sh
deleted file mode 100755
index c450ea0..0000000
--- a/samples/applications/tomcat-sso/scripts/kubernetes/undeploy.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-host_ip="localhost"
-host_port=9443
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-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-ec2

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/mock/deploy.sh b/samples/applications/tomcat-sso/scripts/mock/deploy.sh
deleted file mode 100755
index 93f8517..0000000
--- a/samples/applications/tomcat-sso/scripts/mock/deploy.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-iaas="mock"
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/mock/undeploy.sh b/samples/applications/tomcat-sso/scripts/mock/undeploy.sh
deleted file mode 100755
index 17d8c71..0000000
--- a/samples/applications/tomcat-sso/scripts/mock/undeploy.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/undeploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/openstack/deploy.sh b/samples/applications/tomcat-sso/scripts/openstack/deploy.sh
deleted file mode 100755
index 4c39959..0000000
--- a/samples/applications/tomcat-sso/scripts/openstack/deploy.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-iaas="openstack"
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/applications/tomcat-sso/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/tomcat-sso/scripts/openstack/undeploy.sh b/samples/applications/tomcat-sso/scripts/openstack/undeploy.sh
deleted file mode 100644
index 17d8c71..0000000
--- a/samples/applications/tomcat-sso/scripts/openstack/undeploy.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-prgdir=`dirname "$0"`
-script_path=`cd "$prgdir"; pwd`
-common_folder=`cd "${script_path}/../common"; pwd`
-
-bash ${common_folder}/undeploy.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/cartridges/kubernetes/tomcat-sso.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/tomcat-sso.json b/samples/cartridges/kubernetes/tomcat-sso.json
deleted file mode 100755
index d7e9f30..0000000
--- a/samples/cartridges/kubernetes/tomcat-sso.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-    "type": "tomcat-sso",
-    "provider": "apache",
-    "host": "tomcat.stratos.org",
-    "category": "data",
-    "displayName": "Tomcat 7",
-    "description": "Tomcat 7 Cartridge",
-    "version": "7",
-    "multiTenant": "false",
-    "portMapping": [
-        {
-            "protocol": "http",
-            "port": "8080",
-            "proxyPort": "8280"
-        }
-    ],
-    "deployment":{
-           "baseDir":"/opt/tomcat/webapps"
-    },
-    "iaasProvider":[
-        {
-            "type":"kubernetes",
-            "imageId":"chamilad/tomcat:4.1.0-beta",
-            "networkInterfaces":[
-            ],
-            "property":[
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/cartridges/kubernetes/tomcat3.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/tomcat3.json b/samples/cartridges/kubernetes/tomcat3.json
new file mode 100755
index 0000000..2f0f5cd
--- /dev/null
+++ b/samples/cartridges/kubernetes/tomcat3.json
@@ -0,0 +1,30 @@
+{
+    "type": "tomcat3",
+    "provider": "apache",
+    "host": "tomcat.stratos.org",
+    "category": "data",
+    "displayName": "Tomcat 7",
+    "description": "Tomcat 7 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "8080",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment":{
+           "baseDir":"/opt/tomcat/webapps"
+    },
+    "iaasProvider":[
+        {
+            "type":"kubernetes",
+            "imageId":"chamilad/tomcat:4.1.0-beta",
+            "networkInterfaces":[
+            ],
+            "property":[
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/cartridges/mock/tomcat3.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/mock/tomcat3.json b/samples/cartridges/mock/tomcat3.json
new file mode 100755
index 0000000..af4f745
--- /dev/null
+++ b/samples/cartridges/mock/tomcat3.json
@@ -0,0 +1,30 @@
+{
+    "type": "tomcat3",
+    "provider": "apache",
+    "host": "tomcat.stratos.org",
+    "category": "data",
+    "displayName": "Tomcat 7",
+    "description": "Tomcat 7 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "8080",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment":{
+           "baseDir":"/opt/tomcat/webapps"
+    },
+    "iaasProvider":[
+        {
+            "type":"mock",
+            "imageId":"not-needed",
+            "networkInterfaces":[
+            ],
+            "property":[
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/cartridges/mock/wso2-is.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/mock/wso2-is.json b/samples/cartridges/mock/wso2-is.json
new file mode 100644
index 0000000..b11132f
--- /dev/null
+++ b/samples/cartridges/mock/wso2-is.json
@@ -0,0 +1,27 @@
+{
+    "type": "wso2is",
+    "provider": "data",
+    "host": "wso2is.stratos.org",
+    "category": "data",
+    "displayName": "WSO2 IS 5.0.0",
+    "description": "WSO2 IS 5.0.0 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "9443",
+            "proxyPort": "8280"
+        }
+    ],
+    "iaasProvider":[
+        {
+            "type":"mock",
+            "imageId":"not-needed",
+            "networkInterfaces":[
+            ],
+            "property":[
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/42c0baea/samples/network-partitions/mock/network-partition-3.json
----------------------------------------------------------------------
diff --git a/samples/network-partitions/mock/network-partition-3.json b/samples/network-partitions/mock/network-partition-3.json
new file mode 100644
index 0000000..264fd0a
--- /dev/null
+++ b/samples/network-partitions/mock/network-partition-3.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-3",
+    "partitions": [
+        {
+            "id": "partition-1",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}