You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2015/04/30 08:28:25 UTC
[03/10] stratos git commit: refining the application samples hierarchy
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/kubernetes/undeploy.sh b/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/kubernetes/undeploy.sh
new file mode 100644
index 0000000..0054670
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/group-scaling-v1/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-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/mock/deploy.sh b/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/mock/deploy.sh
new file mode 100755
index 0000000..93f8517
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/group-scaling-v1/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/aaa8a0f4/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/mock/undeploy.sh b/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/group-scaling-v1/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/aaa8a0f4/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/openstack/deploy.sh b/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..4c39959
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/group-scaling-v1/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/aaa8a0f4/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/openstack/undeploy.sh b/samples/applications/scaling/group-scaling/group-scaling-v1/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/group-scaling-v1/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/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/README.md b/samples/applications/scaling/group-scaling/single-group-group-scaling/README.md
new file mode 100644
index 0000000..7ba069c
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/README.md
@@ -0,0 +1,13 @@
+single-group-group-scaling
+==========================
+
+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/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/artifacts/application.json b/samples/applications/scaling/group-scaling/single-group-group-scaling/artifacts/application.json
new file mode 100644
index 0000000..08c7ede
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/artifacts/application.json
@@ -0,0 +1,33 @@
+{
+ "applicationId": "single-group-group-scaling",
+ "alias": "my-single-group-group-scaling",
+ "components": {
+ "groups": [
+ {
+ "name": "group6",
+ "alias": "my-group6",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 3,
+ "deploymentPolicy":"deployment-policy-1",
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 1,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "my-tomcat",
+ "autoscalingPolicy": "autoscaling-policy-1",
+ "artifactRepository":{
+ "privateRepo":false,
+ "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
+ "repoUsername":"",
+ "repoPassword":""
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/common/deploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/common/deploy.sh
new file mode 100755
index 0000000..b55e113
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/common/deploy.sh
@@ -0,0 +1,55 @@
+#!/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`
+autoscaling_policies_path=`cd "${script_path}/../../../../../autoscaling-policies"; pwd`
+network_partitions_path=`cd "${script_path}/../../../../../network-partitions/${iaas}"; pwd`
+deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd`
+application_policies_path=`cd "${script_path}/../../../../../application-policies"; pwd`
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+ echo "Usage: deploy.sh [iaas]"
+ exit
+fi
+
+echo ${autoscaling_policies_path}/autoscaling-policy-1.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-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions
+
+echo "Adding deployment policies..."
+curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
+
+echo "Adding tomcat cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding group6c4 group..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group6c4.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
+
+sleep 1
+
+echo "Adding application policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies
+
+sleep 1
+
+echo "Creating application..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
+
+sleep 1
+
+echo "Deploying application..."
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-group-group-scaling/deploy/application-policy-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/common/undeploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/common/undeploy.sh
new file mode 100644
index 0000000..7060ee1
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/common/undeploy.sh
@@ -0,0 +1,28 @@
+#!/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-group-group-scaling/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-group-group-scaling
+
+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
+
+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
+
+echo "Removing application policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1
+
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/ec2/deploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/ec2/deploy.sh
new file mode 100755
index 0000000..1370667
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/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/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/ec2/undeploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/ec2/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/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/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/kubernetes/deploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..32eff3c
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/kubernetes/deploy.sh
@@ -0,0 +1,15 @@
+#!/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`
+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/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/kubernetes/undeploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/kubernetes/undeploy.sh
new file mode 100644
index 0000000..0054670
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/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-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/mock/deploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/mock/deploy.sh
new file mode 100755
index 0000000..93f8517
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/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/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/mock/undeploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/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/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/openstack/deploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..4c39959
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/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/aaa8a0f4/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/openstack/undeploy.sh b/samples/applications/scaling/group-scaling/single-group-group-scaling/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/scaling/group-scaling/single-group-group-scaling/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/aaa8a0f4/samples/applications/simple/single-cartridge-app/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/README.md b/samples/applications/simple/single-cartridge-app/README.md
new file mode 100644
index 0000000..4c13b2c
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/README.md
@@ -0,0 +1,8 @@
+single_cartridge
+================
+i) In this artifact sample you can find we have listed them as mock and openstack.
+
+ii) In this sample artifact, it deployes simple application with a php cartridge and start it.
+
+iii) You can choose the IaaS and navigate to it and simply run the single_cartridge.sh file. It'll deploy the relevant artifacts and start the application.
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/artifacts/application-signup.json
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/artifacts/application-signup.json b/samples/applications/simple/single-cartridge-app/artifacts/application-signup.json
new file mode 100644
index 0000000..138648e
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/artifacts/application-signup.json
@@ -0,0 +1,18 @@
+{
+ "artifactRepositories":[
+ {
+ "alias":"php",
+ "privateRepo":false,
+ "repoUrl":"https://github.com/imesh/stratos-php-applications.git",
+ "repoUsername":"",
+ "repoPassword":""
+ },
+ {
+ "alias":"tomcat",
+ "privateRepo":false,
+ "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
+ "repoUsername":"",
+ "repoPassword":""
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/artifacts/application.json b/samples/applications/simple/single-cartridge-app/artifacts/application.json
new file mode 100644
index 0000000..6e66fe3
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/artifacts/application.json
@@ -0,0 +1,25 @@
+{
+ "applicationId": "single-cartridge-app",
+ "alias": "single-cartridge-app",
+ "multiTenant": false,
+ "components": {
+ "cartridges": [
+ {
+ "type": "php",
+ "cartridgeMin": 1,
+ "cartridgeMax": 10,
+ "subscribableInfo": {
+ "alias": "my-php",
+ "autoscalingPolicy": "autoscaling-policy-1",
+ "deploymentPolicy": "deployment-policy-1",
+ "artifactRepository": {
+ "privateRepo": false,
+ "repoUrl": "https://github.com/imesh/stratos-php-applications.git",
+ "repoUsername": "",
+ "repoPassword": ""
+ }
+ }
+ }
+ ]
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/artifacts/domain-mappings.json
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/artifacts/domain-mappings.json b/samples/applications/simple/single-cartridge-app/artifacts/domain-mappings.json
new file mode 100644
index 0000000..78e6008
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/artifacts/domain-mappings.json
@@ -0,0 +1,9 @@
+{
+ "domainMappings": [
+ {
+ "cartridgeAlias":"my-php",
+ "domainName":"abc.com",
+ "contextPath":"/abc/app"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/common/add-domain-mappings.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/add-domain-mappings.sh b/samples/applications/simple/single-cartridge-app/scripts/common/add-domain-mappings.sh
new file mode 100755
index 0000000..74c6ed7
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/scripts/common/add-domain-mappings.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+export host_ip="localhost"
+export artifacts_path="../../artifacts"
+
+pushd ${artifacts_path}
+echo "Adding domain mappings..."
+curl -X POST -H "Content-Type: application/json" -d @'domain-mappings.json' -k -u admin:admin https://${host_ip}:9443/api/applications/single-cartridge-app/domainMappings
+popd
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/common/add-network-partition.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/add-network-partition.sh b/samples/applications/simple/single-cartridge-app/scripts/common/add-network-partition.sh
new file mode 100644
index 0000000..56c7c6c
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/scripts/common/add-network-partition.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+export host_ip="localhost"
+export artifacts_path="../../artifacts"
+
+pushd ${artifacts_path}
+echo "Adding network partition..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+popd
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh b/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh
new file mode 100755
index 0000000..a94c525
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh
@@ -0,0 +1,49 @@
+#!/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`
+application_policies_path=`cd "${script_path}/../../../../../application-policies"; pwd`
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+ echo "Usage: deploy.sh [iaas]"
+ exit
+fi
+
+echo ${autoscaling_policies_path}/autoscaling-policy-1.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-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions
+
+echo "Adding deployment policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
+
+echo "Adding php cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+sleep 1
+echo "Adding application policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies
+
+sleep 1
+echo "Adding 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" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app/deploy/application-policy-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/common/get-application-runtime.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/get-application-runtime.sh b/samples/applications/simple/single-cartridge-app/scripts/common/get-application-runtime.sh
new file mode 100755
index 0000000..ed80688
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/scripts/common/get-application-runtime.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+iaas=$1
+host_ip="localhost"
+host_port=9443
+
+set -e
+
+echo "Getting application runtime..."
+curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app/runtime
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/common/list-domain-mappings.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/list-domain-mappings.sh b/samples/applications/simple/single-cartridge-app/scripts/common/list-domain-mappings.sh
new file mode 100755
index 0000000..0b49f6f
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/scripts/common/list-domain-mappings.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "Listing domain mappings..."
+curl -X GET -H "Content-Type: application/json" -k -u admin:admin https://localhost:9443/api/applications/single-cartridge-app/domainMappings
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/common/list-network-partition.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/list-network-partition.sh b/samples/applications/simple/single-cartridge-app/scripts/common/list-network-partition.sh
new file mode 100755
index 0000000..6e3812d
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/scripts/common/list-network-partition.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "Listing network partitions..."
+curl -X GET -H "Content-Type: application/json" -k -u admin:admin https://localhost:9443/api/networkPartitions
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/undeploy.sh b/samples/applications/simple/single-cartridge-app/scripts/common/undeploy.sh
new file mode 100644
index 0000000..b0174b8
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/scripts/common/undeploy.sh
@@ -0,0 +1,31 @@
+#!/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/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/autoscaling-policy-1
+
+echo "Removing deployment policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-1
+
+echo "Removing network partitions..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2
+
+echo "Removing application policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/common/update-deployment-policy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/update-deployment-policy.sh b/samples/applications/simple/single-cartridge-app/scripts/common/update-deployment-policy.sh
new file mode 100755
index 0000000..d28fb40
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/scripts/common/update-deployment-policy.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+iaas=$1
+host_ip="localhost"
+host_port=9443
+
+script_path=`cd "$prgdir"; pwd`
+
+deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd`
+
+curl -X PUT -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/ec2/deploy.sh b/samples/applications/simple/single-cartridge-app/scripts/ec2/deploy.sh
new file mode 100755
index 0000000..1370667
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/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/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/ec2/undeploy.sh b/samples/applications/simple/single-cartridge-app/scripts/ec2/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/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/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/kubernetes/deploy.sh b/samples/applications/simple/single-cartridge-app/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..eab754c
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/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-1.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/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/kubernetes/undeploy.sh b/samples/applications/simple/single-cartridge-app/scripts/kubernetes/undeploy.sh
new file mode 100755
index 0000000..0054670
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/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-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/mock/deploy.sh b/samples/applications/simple/single-cartridge-app/scripts/mock/deploy.sh
new file mode 100755
index 0000000..93f8517
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/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/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/mock/undeploy.sh b/samples/applications/simple/single-cartridge-app/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/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/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/openstack/deploy.sh b/samples/applications/simple/single-cartridge-app/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..4c39959
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/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/aaa8a0f4/samples/applications/simple/single-cartridge-app/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/openstack/undeploy.sh b/samples/applications/simple/single-cartridge-app/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/simple/single-cartridge-app/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/aaa8a0f4/samples/applications/simple/single-group-app/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/README.md b/samples/applications/simple/single-group-app/README.md
new file mode 100644
index 0000000..294a1a2
--- /dev/null
+++ b/samples/applications/simple/single-group-app/README.md
@@ -0,0 +1,15 @@
+single_group_v1
+==============
+
+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/aaa8a0f4/samples/applications/simple/single-group-app/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/artifacts/application.json b/samples/applications/simple/single-group-app/artifacts/application.json
new file mode 100644
index 0000000..a66f8f0
--- /dev/null
+++ b/samples/applications/simple/single-group-app/artifacts/application.json
@@ -0,0 +1,72 @@
+
+{
+ "applicationId": "cartridge-group-app",
+ "alias": "my-cartridge-group-app",
+ "components": {
+ "groups": [
+ {
+ "name": "esb-php-group",
+ "alias": "my-esb-php-group",
+ "deploymentPolicy":"deployment-policy-1",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 2,
+ "cartridges": [
+ {
+ "type": "esb",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "my-esb",
+ "autoscalingPolicy": "autoscaling-policy-1",
+ "deploymentPolicy":"deployment-policy-1",
+ "artifactRepository":{
+ "privateRepo":false,
+ "repoUrl":"https://github.com/imesh/stratos-esb-applications.git",
+ "repoUsername":"",
+ "repoPassword":""
+ }
+ }
+ },
+ {
+ "type": "php",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "my-php",
+ "autoscalingPolicy": "autoscaling-policy-1",
+ "deploymentPolicy":"deployment-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": "my-tomcat",
+ "autoscalingPolicy": "autoscaling-policy-1",
+ "deploymentPolicy":"deployment-policy-1",
+ "artifactRepository":{
+ "privateRepo":false,
+ "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
+ "repoUsername":"",
+ "repoPassword":""
+ }
+ }
+ }
+ ],
+ "dependencies": {
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-group-app/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/common/deploy.sh b/samples/applications/simple/single-group-app/scripts/common/deploy.sh
new file mode 100755
index 0000000..10bf6b3
--- /dev/null
+++ b/samples/applications/simple/single-group-app/scripts/common/deploy.sh
@@ -0,0 +1,62 @@
+#!/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`
+autoscaling_policies_path=`cd "${script_path}/../../../../../autoscaling-policies"; pwd`
+network_partitions_path=`cd "${script_path}/../../../../../network-partitions/${iaas}"; pwd`
+deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd`
+application_policies_path=`cd "${script_path}/../../../../../application-policies"; pwd`
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+ echo "Usage: deploy.sh [iaas]"
+ exit
+fi
+
+echo ${autoscaling_policies_path}/autoscaling-policy-1.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-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions
+
+echo "Adding deployment policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
+
+echo "Adding tomcat cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+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 esb-php-group group..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/esb-php-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
+
+sleep 1
+
+echo "Adding application policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies
+
+sleep 1
+
+echo "Creating application..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
+
+sleep 1
+
+echo "Deploying application..."
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/cartridge-group-app/deploy/application-policy-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-group-app/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/common/undeploy.sh b/samples/applications/simple/single-group-app/scripts/common/undeploy.sh
new file mode 100644
index 0000000..b97b398
--- /dev/null
+++ b/samples/applications/simple/single-group-app/scripts/common/undeploy.sh
@@ -0,0 +1,37 @@
+#!/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/cartridge-group-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/cartridge-group-app
+
+echo "Removing groups..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/esb-php-group
+
+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/autoscaling-policy-1
+
+echo "Removing deployment policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-1
+
+echo "Removing network partitions..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2
+
+echo "Removing application policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1
+
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-group-app/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/ec2/deploy.sh b/samples/applications/simple/single-group-app/scripts/ec2/deploy.sh
new file mode 100755
index 0000000..1370667
--- /dev/null
+++ b/samples/applications/simple/single-group-app/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/aaa8a0f4/samples/applications/simple/single-group-app/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/ec2/undeploy.sh b/samples/applications/simple/single-group-app/scripts/ec2/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/simple/single-group-app/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/aaa8a0f4/samples/applications/simple/single-group-app/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/kubernetes/deploy.sh b/samples/applications/simple/single-group-app/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..c8f11f7
--- /dev/null
+++ b/samples/applications/simple/single-group-app/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`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+kubernetes_clusters_path=`cd "${script_path}/../../../../../kubernets-clusters"; pwd`
+
+echo "Adding kubernetes cluster..."
+curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-1.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
+
+bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-group-app/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/kubernetes/undeploy.sh b/samples/applications/simple/single-group-app/scripts/kubernetes/undeploy.sh
new file mode 100644
index 0000000..0054670
--- /dev/null
+++ b/samples/applications/simple/single-group-app/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-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/simple/single-group-app/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/mock/deploy.sh b/samples/applications/simple/single-group-app/scripts/mock/deploy.sh
new file mode 100755
index 0000000..93f8517
--- /dev/null
+++ b/samples/applications/simple/single-group-app/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/aaa8a0f4/samples/applications/simple/single-group-app/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/mock/undeploy.sh b/samples/applications/simple/single-group-app/scripts/mock/undeploy.sh
new file mode 100755
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/simple/single-group-app/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/aaa8a0f4/samples/applications/simple/single-group-app/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/openstack/deploy.sh b/samples/applications/simple/single-group-app/scripts/openstack/deploy.sh
new file mode 100755
index 0000000..4c39959
--- /dev/null
+++ b/samples/applications/simple/single-group-app/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/aaa8a0f4/samples/applications/simple/single-group-app/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-group-app/scripts/openstack/undeploy.sh b/samples/applications/simple/single-group-app/scripts/openstack/undeploy.sh
new file mode 100644
index 0000000..17d8c71
--- /dev/null
+++ b/samples/applications/simple/single-group-app/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/aaa8a0f4/samples/applications/single-cartridge/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/README.md b/samples/applications/single-cartridge/README.md
deleted file mode 100644
index 4c13b2c..0000000
--- a/samples/applications/single-cartridge/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-single_cartridge
-================
-i) In this artifact sample you can find we have listed them as mock and openstack.
-
-ii) In this sample artifact, it deployes simple application with a php cartridge and start it.
-
-iii) You can choose the IaaS and navigate to it and simply run the single_cartridge.sh file. It'll deploy the relevant artifacts and start the application.
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/artifacts/application-signup.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/artifacts/application-signup.json b/samples/applications/single-cartridge/artifacts/application-signup.json
deleted file mode 100644
index 138648e..0000000
--- a/samples/applications/single-cartridge/artifacts/application-signup.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "artifactRepositories":[
- {
- "alias":"php",
- "privateRepo":false,
- "repoUrl":"https://github.com/imesh/stratos-php-applications.git",
- "repoUsername":"",
- "repoPassword":""
- },
- {
- "alias":"tomcat",
- "privateRepo":false,
- "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
- "repoUsername":"",
- "repoPassword":""
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/artifacts/application.json b/samples/applications/single-cartridge/artifacts/application.json
deleted file mode 100644
index 6e66fe3..0000000
--- a/samples/applications/single-cartridge/artifacts/application.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "applicationId": "single-cartridge-app",
- "alias": "single-cartridge-app",
- "multiTenant": false,
- "components": {
- "cartridges": [
- {
- "type": "php",
- "cartridgeMin": 1,
- "cartridgeMax": 10,
- "subscribableInfo": {
- "alias": "my-php",
- "autoscalingPolicy": "autoscaling-policy-1",
- "deploymentPolicy": "deployment-policy-1",
- "artifactRepository": {
- "privateRepo": false,
- "repoUrl": "https://github.com/imesh/stratos-php-applications.git",
- "repoUsername": "",
- "repoPassword": ""
- }
- }
- }
- ]
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/artifacts/domain-mappings.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/artifacts/domain-mappings.json b/samples/applications/single-cartridge/artifacts/domain-mappings.json
deleted file mode 100644
index 78e6008..0000000
--- a/samples/applications/single-cartridge/artifacts/domain-mappings.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "domainMappings": [
- {
- "cartridgeAlias":"my-php",
- "domainName":"abc.com",
- "contextPath":"/abc/app"
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/common/add-domain-mappings.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/common/add-domain-mappings.sh b/samples/applications/single-cartridge/scripts/common/add-domain-mappings.sh
deleted file mode 100755
index 74c6ed7..0000000
--- a/samples/applications/single-cartridge/scripts/common/add-domain-mappings.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-export artifacts_path="../../artifacts"
-
-pushd ${artifacts_path}
-echo "Adding domain mappings..."
-curl -X POST -H "Content-Type: application/json" -d @'domain-mappings.json' -k -u admin:admin https://${host_ip}:9443/api/applications/single-cartridge-app/domainMappings
-popd
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/common/add-network-partition.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/common/add-network-partition.sh b/samples/applications/single-cartridge/scripts/common/add-network-partition.sh
deleted file mode 100644
index 56c7c6c..0000000
--- a/samples/applications/single-cartridge/scripts/common/add-network-partition.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-export artifacts_path="../../artifacts"
-
-pushd ${artifacts_path}
-echo "Adding network partition..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
-popd
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/common/deploy.sh b/samples/applications/single-cartridge/scripts/common/deploy.sh
deleted file mode 100755
index a32d462..0000000
--- a/samples/applications/single-cartridge/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_cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
-cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
-autoscaling_policies_path=`cd "${script_path}/../../../../autoscaling-policies"; pwd`
-network_partitions_path=`cd "${script_path}/../../../../network-partitions/${iaas}"; pwd`
-deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd`
-application_policies_path=`cd "${script_path}/../../../../application-policies"; pwd`
-
-set -e
-
-if [[ -z "${iaas}" ]]; then
- echo "Usage: deploy.sh [iaas]"
- exit
-fi
-
-echo ${autoscaling_policies_path}/autoscaling-policy-1.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-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions
-curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions
-
-echo "Adding deployment policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
-
-echo "Adding php cartridge..."
-curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
-
-sleep 1
-echo "Adding application policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies
-
-sleep 1
-echo "Adding 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" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app/deploy/application-policy-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/common/get-application-runtime.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/common/get-application-runtime.sh b/samples/applications/single-cartridge/scripts/common/get-application-runtime.sh
deleted file mode 100755
index ed80688..0000000
--- a/samples/applications/single-cartridge/scripts/common/get-application-runtime.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-iaas=$1
-host_ip="localhost"
-host_port=9443
-
-set -e
-
-echo "Getting application runtime..."
-curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app/runtime
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/common/list-domain-mappings.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/common/list-domain-mappings.sh b/samples/applications/single-cartridge/scripts/common/list-domain-mappings.sh
deleted file mode 100755
index 0b49f6f..0000000
--- a/samples/applications/single-cartridge/scripts/common/list-domain-mappings.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-echo "Listing domain mappings..."
-curl -X GET -H "Content-Type: application/json" -k -u admin:admin https://localhost:9443/api/applications/single-cartridge-app/domainMappings
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/common/list-network-partition.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/common/list-network-partition.sh b/samples/applications/single-cartridge/scripts/common/list-network-partition.sh
deleted file mode 100755
index 6e3812d..0000000
--- a/samples/applications/single-cartridge/scripts/common/list-network-partition.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-echo "Listing network partitions..."
-curl -X GET -H "Content-Type: application/json" -k -u admin:admin https://localhost:9443/api/networkPartitions
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/common/undeploy.sh b/samples/applications/single-cartridge/scripts/common/undeploy.sh
deleted file mode 100644
index b0174b8..0000000
--- a/samples/applications/single-cartridge/scripts/common/undeploy.sh
+++ /dev/null
@@ -1,31 +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/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/autoscaling-policy-1
-
-echo "Removing deployment policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-1
-
-echo "Removing network partitions..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2
-
-echo "Removing application policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/common/update-deployment-policy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/common/update-deployment-policy.sh b/samples/applications/single-cartridge/scripts/common/update-deployment-policy.sh
deleted file mode 100755
index f0bd8fb..0000000
--- a/samples/applications/single-cartridge/scripts/common/update-deployment-policy.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-iaas=$1
-host_ip="localhost"
-host_port=9443
-
-script_path=`cd "$prgdir"; pwd`
-
-deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd`
-
-curl -X PUT -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/ec2/deploy.sh b/samples/applications/single-cartridge/scripts/ec2/deploy.sh
deleted file mode 100755
index 1370667..0000000
--- a/samples/applications/single-cartridge/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/aaa8a0f4/samples/applications/single-cartridge/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/ec2/undeploy.sh b/samples/applications/single-cartridge/scripts/ec2/undeploy.sh
deleted file mode 100644
index 17d8c71..0000000
--- a/samples/applications/single-cartridge/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/aaa8a0f4/samples/applications/single-cartridge/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/kubernetes/deploy.sh b/samples/applications/single-cartridge/scripts/kubernetes/deploy.sh
deleted file mode 100755
index d6c47c1..0000000
--- a/samples/applications/single-cartridge/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-1.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/aaa8a0f4/samples/applications/single-cartridge/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/kubernetes/undeploy.sh b/samples/applications/single-cartridge/scripts/kubernetes/undeploy.sh
deleted file mode 100755
index 0054670..0000000
--- a/samples/applications/single-cartridge/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-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-cartridge/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/mock/deploy.sh b/samples/applications/single-cartridge/scripts/mock/deploy.sh
deleted file mode 100755
index 93f8517..0000000
--- a/samples/applications/single-cartridge/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/aaa8a0f4/samples/applications/single-cartridge/scripts/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/mock/undeploy.sh b/samples/applications/single-cartridge/scripts/mock/undeploy.sh
deleted file mode 100755
index 17d8c71..0000000
--- a/samples/applications/single-cartridge/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/aaa8a0f4/samples/applications/single-cartridge/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/openstack/deploy.sh b/samples/applications/single-cartridge/scripts/openstack/deploy.sh
deleted file mode 100755
index 4c39959..0000000
--- a/samples/applications/single-cartridge/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/aaa8a0f4/samples/applications/single-cartridge/scripts/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/openstack/undeploy.sh b/samples/applications/single-cartridge/scripts/openstack/undeploy.sh
deleted file mode 100644
index 17d8c71..0000000
--- a/samples/applications/single-cartridge/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/aaa8a0f4/samples/applications/single-group-cartridge/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/README.md b/samples/applications/single-group-cartridge/README.md
deleted file mode 100644
index 294a1a2..0000000
--- a/samples/applications/single-group-cartridge/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-single_group_v1
-==============
-
-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/aaa8a0f4/samples/applications/single-group-cartridge/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/artifacts/application.json b/samples/applications/single-group-cartridge/artifacts/application.json
deleted file mode 100644
index a66f8f0..0000000
--- a/samples/applications/single-group-cartridge/artifacts/application.json
+++ /dev/null
@@ -1,72 +0,0 @@
-
-{
- "applicationId": "cartridge-group-app",
- "alias": "my-cartridge-group-app",
- "components": {
- "groups": [
- {
- "name": "esb-php-group",
- "alias": "my-esb-php-group",
- "deploymentPolicy":"deployment-policy-1",
- "groupMinInstances": 1,
- "groupMaxInstances": 2,
- "cartridges": [
- {
- "type": "esb",
- "cartridgeMin": 1,
- "cartridgeMax": 2,
- "subscribableInfo": {
- "alias": "my-esb",
- "autoscalingPolicy": "autoscaling-policy-1",
- "deploymentPolicy":"deployment-policy-1",
- "artifactRepository":{
- "privateRepo":false,
- "repoUrl":"https://github.com/imesh/stratos-esb-applications.git",
- "repoUsername":"",
- "repoPassword":""
- }
- }
- },
- {
- "type": "php",
- "cartridgeMin": 1,
- "cartridgeMax": 2,
- "subscribableInfo": {
- "alias": "my-php",
- "autoscalingPolicy": "autoscaling-policy-1",
- "deploymentPolicy":"deployment-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": "my-tomcat",
- "autoscalingPolicy": "autoscaling-policy-1",
- "deploymentPolicy":"deployment-policy-1",
- "artifactRepository":{
- "privateRepo":false,
- "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
- "repoUsername":"",
- "repoPassword":""
- }
- }
- }
- ],
- "dependencies": {
- "terminationBehaviour": "terminate-none"
- }
- }
-}
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-group-cartridge/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/common/deploy.sh b/samples/applications/single-group-cartridge/scripts/common/deploy.sh
deleted file mode 100755
index 9afe1db..0000000
--- a/samples/applications/single-group-cartridge/scripts/common/deploy.sh
+++ /dev/null
@@ -1,62 +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`
-cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
-cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
-autoscaling_policies_path=`cd "${script_path}/../../../../autoscaling-policies"; pwd`
-network_partitions_path=`cd "${script_path}/../../../../network-partitions/${iaas}"; pwd`
-deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd`
-application_policies_path=`cd "${script_path}/../../../../application-policies"; pwd`
-
-set -e
-
-if [[ -z "${iaas}" ]]; then
- echo "Usage: deploy.sh [iaas]"
- exit
-fi
-
-echo ${autoscaling_policies_path}/autoscaling-policy-1.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-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions
-curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions
-
-echo "Adding deployment policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
-
-echo "Adding tomcat cartridge..."
-curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
-
-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 esb-php-group group..."
-curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/esb-php-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
-
-sleep 1
-
-echo "Adding application policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies
-
-sleep 1
-
-echo "Creating application..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
-
-sleep 1
-
-echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/cartridge-group-app/deploy/application-policy-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-group-cartridge/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/common/undeploy.sh b/samples/applications/single-group-cartridge/scripts/common/undeploy.sh
deleted file mode 100644
index b97b398..0000000
--- a/samples/applications/single-group-cartridge/scripts/common/undeploy.sh
+++ /dev/null
@@ -1,37 +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/cartridge-group-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/cartridge-group-app
-
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/esb-php-group
-
-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/autoscaling-policy-1
-
-echo "Removing deployment policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-1
-
-echo "Removing network partitions..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2
-
-echo "Removing application policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1
-
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-group-cartridge/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/ec2/deploy.sh b/samples/applications/single-group-cartridge/scripts/ec2/deploy.sh
deleted file mode 100755
index 1370667..0000000
--- a/samples/applications/single-group-cartridge/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/aaa8a0f4/samples/applications/single-group-cartridge/scripts/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/ec2/undeploy.sh b/samples/applications/single-group-cartridge/scripts/ec2/undeploy.sh
deleted file mode 100644
index 17d8c71..0000000
--- a/samples/applications/single-group-cartridge/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/aaa8a0f4/samples/applications/single-group-cartridge/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/kubernetes/deploy.sh b/samples/applications/single-group-cartridge/scripts/kubernetes/deploy.sh
deleted file mode 100755
index 0d614cc..0000000
--- a/samples/applications/single-group-cartridge/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`
-iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
-kubernetes_clusters_path=`cd "${script_path}/../../../../kubernets-clusters"; pwd`
-
-echo "Adding kubernetes cluster..."
-curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-1.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
-
-bash ${common_folder}/deploy.sh ${iaas}
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-group-cartridge/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/kubernetes/undeploy.sh b/samples/applications/single-group-cartridge/scripts/kubernetes/undeploy.sh
deleted file mode 100644
index 0054670..0000000
--- a/samples/applications/single-group-cartridge/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-1
http://git-wip-us.apache.org/repos/asf/stratos/blob/aaa8a0f4/samples/applications/single-group-cartridge/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-cartridge/scripts/mock/deploy.sh b/samples/applications/single-group-cartridge/scripts/mock/deploy.sh
deleted file mode 100755
index 93f8517..0000000
--- a/samples/applications/single-group-cartridge/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}