stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From man...@apache.org
Subject stratos git commit: Format single-group-v1 sample according to standard
Date Thu, 05 Feb 2015 06:40:40 GMT
Repository: stratos
Updated Branches:
  refs/heads/master bdfca915d -> 07cfd499b


Format single-group-v1 sample according to standard


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

Branch: refs/heads/master
Commit: 07cfd499b6a85827f008fda8b3b3f980897cd31c
Parents: bdfca91
Author: Manula Thantriwatte <manula@apache.org>
Authored: Thu Feb 5 06:39:22 2015 +0000
Committer: Manula Thantriwatte <manula@apache.org>
Committed: Thu Feb 5 06:39:22 2015 +0000

----------------------------------------------------------------------
 samples/applications/single-group-v1/README.md  | 12 +++-
 .../artifacts/app_single_group.json             | 55 ------------------
 .../single-group-v1/artifacts/application.json  | 55 ++++++++++++++++++
 .../artifacts/autoscale-policy.json             | 14 -----
 .../artifacts/autoscaling-policy.json           | 14 +++++
 .../artifacts/ec2/deployment-policy.json        | 56 ++++++++++++++++++
 .../artifacts/kubernetes/deployment-policy.json | 57 ++++++++++++++++++
 .../kubernetes/kubernetes-cluster.json          | 55 ++++++++++++++++++
 .../artifacts/mock/deployment-policy.json       | 56 ++++++++++++++++++
 .../artifacts/openstack/deployment-policy.json  | 56 ++++++++++++++++++
 .../iaases/ec2/artifacts/dep_single_group.json  | 56 ------------------
 .../single-group-v1/iaases/ec2/deploy.sh        | 53 -----------------
 .../single-group-v1/iaases/ec2/undeploy.sh      | 29 ----------
 .../kubernetes/artifacts/dep_single_group.json  | 57 ------------------
 .../artifacts/kubernetes-cluster.json           | 55 ------------------
 .../single-group-v1/iaases/kubernetes/deploy.sh | 61 --------------------
 .../iaases/kubernetes/undeploy.sh               | 33 -----------
 .../iaases/mock/artifacts/dep_single_group.json | 56 ------------------
 .../single-group-v1/iaases/mock/deploy.sh       | 53 -----------------
 .../single-group-v1/iaases/mock/undeploy.sh     | 29 ----------
 .../openstack/artifacts/dep_single_group.json   | 56 ------------------
 .../single-group-v1/iaases/openstack/deploy.sh  | 53 -----------------
 .../iaases/openstack/undeploy.sh                | 29 ----------
 .../single-group-v1/scripts/common/deploy.sh    | 43 ++++++++++++++
 .../single-group-v1/scripts/common/undeploy.sh  | 25 ++++++++
 .../single-group-v1/scripts/ec2/deploy.sh       |  9 +++
 .../single-group-v1/scripts/ec2/undeploy.sh     |  8 +++
 .../scripts/kubernetes/deploy.sh                | 15 +++++
 .../scripts/kubernetes/undeploy.sh              | 13 +++++
 .../single-group-v1/scripts/mock/deploy.sh      |  9 +++
 .../single-group-v1/scripts/mock/undeploy.sh    |  8 +++
 .../single-group-v1/scripts/openstack/deploy.sh |  9 +++
 .../scripts/openstack/undeploy.sh               |  8 +++
 33 files changed, 506 insertions(+), 691 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/README.md
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/README.md b/samples/applications/single-group-v1/README.md
index 33a7903..294a1a2 100644
--- a/samples/applications/single-group-v1/README.md
+++ b/samples/applications/single-group-v1/README.md
@@ -1,7 +1,15 @@
 single_group_v1
 ==============
 
-i) Using these artifacts you can deploy the single group application.
+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
 
-ii) You can simply run the single_group.sh script to deploy the single group application.
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/artifacts/app_single_group.json b/samples/applications/single-group-v1/artifacts/app_single_group.json
deleted file mode 100644
index cc4d5ce..0000000
--- a/samples/applications/single-group-v1/artifacts/app_single_group.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationId": "app_group_v1",
-    "alias": "mytestapp1",
-    "components": {
-        "groups": [
-            {
-                "name": "group6",
-                "alias": "mygroup6",
-                "groupMinInstances": 2,
-                "groupMaxInstances": 3,
-                "cartridges": [
-                    {
-                        "type": "tomcat2",
-                        "cartridgeMin": 1,
-                        "cartridgeMax": 1,
-                        "subscribableInfo": {
-                            "alias": "tom2group6",
-                            "autoscalingPolicy": "autoscale_policy_1",
-                            "artifactRepository":{
-                               "privateRepo":false,
-                               "repoUrl":"https://github.com/imesh/stratos-tomcat2-applications.git",
-                               "repoUsername":"",
-                               "repoPassword":""
-                            }
-                        }
-                    }
-                ]
-            }
-        ],
-        "cartridges": [
-            {
-                "type": "tomcat",
-                "cartridgeMin": 1,
-                "cartridgeMax": 1,
-                "subscribableInfo": {
-                    "alias": "mytomcat",
-                    "autoscalingPolicy": "autoscale_policy_1",
-                    "artifactRepository":{
-                       "privateRepo":false,
-                       "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
-                       "repoUsername":"",
-                       "repoPassword":""
-                    }
-                }
-            }
-        ],
-        "dependencies": {
-            "startupOrders": [
-                "group.group6,cartridge.tomcat"
-            ],
-            "terminationBehaviour": "terminate-none"
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/artifacts/application.json b/samples/applications/single-group-v1/artifacts/application.json
new file mode 100644
index 0000000..cc4d5ce
--- /dev/null
+++ b/samples/applications/single-group-v1/artifacts/application.json
@@ -0,0 +1,55 @@
+{
+    "applicationId": "app_group_v1",
+    "alias": "mytestapp1",
+    "components": {
+        "groups": [
+            {
+                "name": "group6",
+                "alias": "mygroup6",
+                "groupMinInstances": 2,
+                "groupMaxInstances": 3,
+                "cartridges": [
+                    {
+                        "type": "tomcat2",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 1,
+                        "subscribableInfo": {
+                            "alias": "tom2group6",
+                            "autoscalingPolicy": "autoscale_policy_1",
+                            "artifactRepository":{
+                               "privateRepo":false,
+                               "repoUrl":"https://github.com/imesh/stratos-tomcat2-applications.git",
+                               "repoUsername":"",
+                               "repoPassword":""
+                            }
+                        }
+                    }
+                ]
+            }
+        ],
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 1,
+                "cartridgeMax": 1,
+                "subscribableInfo": {
+                    "alias": "mytomcat",
+                    "autoscalingPolicy": "autoscale_policy_1",
+                    "artifactRepository":{
+                       "privateRepo":false,
+                       "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
+                       "repoUsername":"",
+                       "repoPassword":""
+                    }
+                }
+            }
+        ],
+        "dependencies": {
+            "startupOrders": [
+                "group.group6,cartridge.tomcat"
+            ],
+            "terminationBehaviour": "terminate-none"
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/artifacts/autoscale-policy.json b/samples/applications/single-group-v1/artifacts/autoscale-policy.json
deleted file mode 100755
index a921663..0000000
--- a/samples/applications/single-group-v1/artifacts/autoscale-policy.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscale_policy_2",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 80
-        },
-        "memoryConsumption": {
-            "threshold": 90
-        },
-        "loadAverage": {
-            "threshold": 50
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/artifacts/autoscaling-policy.json b/samples/applications/single-group-v1/artifacts/autoscaling-policy.json
new file mode 100755
index 0000000..959defc
--- /dev/null
+++ b/samples/applications/single-group-v1/artifacts/autoscaling-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscale-policy-1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 80
+        },
+        "memoryConsumption": {
+            "threshold": 90
+        },
+        "loadAverage": {
+            "threshold": 50
+        }
+    }
+}

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

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

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

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

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

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

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/iaases/ec2/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/iaases/ec2/undeploy.sh b/samples/applications/single-group-v1/iaases/ec2/undeploy.sh
deleted file mode 100644
index 3885242..0000000
--- a/samples/applications/single-group-v1/iaases/ec2/undeploy.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/undeploy
-
-sleep 30
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1
-
-# Removing groups
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1
\ No newline at end of file

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

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

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/iaases/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/iaases/kubernetes/undeploy.sh b/samples/applications/single-group-v1/iaases/kubernetes/undeploy.sh
deleted file mode 100644
index 79351ec..0000000
--- a/samples/applications/single-group-v1/iaases/kubernetes/undeploy.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/undeploy
-
-sleep 5
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1
-
-# Removing groups
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2
-
-# Removing kubernetes
-echo "Removing kubernetes cluster..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/kubernetesClusters/kubernetes-cluster-1
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1
\ No newline at end of file

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

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/iaases/mock/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/iaases/mock/undeploy.sh b/samples/applications/single-group-v1/iaases/mock/undeploy.sh
deleted file mode 100644
index c9f10d1..0000000
--- a/samples/applications/single-group-v1/iaases/mock/undeploy.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/undeploy
-
-sleep 5
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1
-
-# Removing groups
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1
\ No newline at end of file

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

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/iaases/openstack/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/iaases/openstack/undeploy.sh b/samples/applications/single-group-v1/iaases/openstack/undeploy.sh
deleted file mode 100644
index 3885242..0000000
--- a/samples/applications/single-group-v1/iaases/openstack/undeploy.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-export host_ip="localhost"
-
-set -e
-
-# Undeploying application
-echo "Undeploying application..."
-curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1/undeploy
-
-sleep 30
-
-# Deleting application
-echo "Deleting application..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_group_v1
-
-# Removing groups
-echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6
-
-# Removing cartridges
-echo "Removing cartridges..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2
-
-# Removing autoscale policies
-echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/scripts/common/deploy.sh b/samples/applications/single-group-v1/scripts/common/deploy.sh
new file mode 100755
index 0000000..2e737be
--- /dev/null
+++ b/samples/applications/single-group-v1/scripts/common/deploy.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+iaas=$1
+host_ip="localhost"
+host_port=9443
+
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+artifacts_path="${script_path}/../../artifacts"
+iaas_artifacts_path="${script_path}/../../artifacts/${iaas}"
+cartridges_path="${script_path}/../../../../cartridges/${iaas}"
+cartridges_groups_path="${script_path}/../../../../cartridges-groups"
+
+set -e
+
+if [[ -z "${iaas}" ]]; then
+    echo "Usage: deploy.sh [iaas]"
+    exit
+fi
+
+echo ${artifacts_path}/autoscale-policy.json
+echo "Adding autoscale policy..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+
+echo "Adding tomcat cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding tomcat1 cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding tomcat2 cartridge..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
+
+echo "Adding group6c5 group..."
+curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group6c5.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups
+
+sleep 1
+
+echo "Creating application..."
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
+
+echo "Deploying application..."
+curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/app_group_v1/deploy
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/scripts/common/undeploy.sh b/samples/applications/single-group-v1/scripts/common/undeploy.sh
new file mode 100644
index 0000000..5091785
--- /dev/null
+++ b/samples/applications/single-group-v1/scripts/common/undeploy.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+
+set -e
+
+echo "Undeploying application..."
+curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/app_group_v1/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/app_group_v1
+
+echo "Removing groups..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/group6
+
+echo "Removing cartridges..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat1
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat2
+
+echo "Removing autoscale policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscale-policy-1
\ No newline at end of file

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

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/scripts/kubernetes/deploy.sh b/samples/applications/single-group-v1/scripts/kubernetes/deploy.sh
new file mode 100755
index 0000000..31909af
--- /dev/null
+++ b/samples/applications/single-group-v1/scripts/kubernetes/deploy.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+iaas="kubernetes"
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+iaas_artifacts_path="${script_path}/../../artifacts/${iaas}"
+
+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
+
+pushd ${common_folder}
+bash deploy.sh ${iaas}
+popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/07cfd499/samples/applications/single-group-v1/scripts/kubernetes/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/scripts/kubernetes/undeploy.sh b/samples/applications/single-group-v1/scripts/kubernetes/undeploy.sh
new file mode 100644
index 0000000..3dc8e34
--- /dev/null
+++ b/samples/applications/single-group-v1/scripts/kubernetes/undeploy.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+host_ip="localhost"
+host_port=9443
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash undeploy.sh
+popd
+
+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/07cfd499/samples/applications/single-group-v1/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v1/scripts/mock/deploy.sh b/samples/applications/single-group-v1/scripts/mock/deploy.sh
new file mode 100755
index 0000000..a75033b
--- /dev/null
+++ b/samples/applications/single-group-v1/scripts/mock/deploy.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+iaas="mock"
+script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+common_folder="${script_path}/../common"
+
+pushd ${common_folder}
+bash deploy.sh ${iaas}
+popd
\ No newline at end of file

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

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

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


Mime
View raw message