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

[04/26] stratos git commit: openstack ec2 mock completed

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/more-complex-app/openstack/artifacts/group8c.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/openstack/artifacts/group8c.json b/samples/more-complex-app/openstack/artifacts/group8c.json
new file mode 100755
index 0000000..3294aec
--- /dev/null
+++ b/samples/more-complex-app/openstack/artifacts/group8c.json
@@ -0,0 +1,23 @@
+{
+    "name": "group8",
+    "groups": [
+        {
+            "name": "group9",
+            "cartridges": [
+                "tomcat1"
+            ]
+        }
+    ],
+    "cartridges": [
+        "tomcat2",
+        "tomcat1"
+    ],
+    "dependencies": {
+        "startupOrders": [
+            "group.group9,cartridge.tomcat2",
+            "group.group9,cartridge.tomcat1"
+        ],
+        "terminationBehaviour": "terminate-all"
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/more-complex-app/openstack/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/openstack/artifacts/tomcat.json b/samples/more-complex-app/openstack/artifacts/tomcat.json
new file mode 100755
index 0000000..fefc230
--- /dev/null
+++ b/samples/more-complex-app/openstack/artifacts/tomcat.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat",
+    "provider": "apache",
+    "host": "isuruh.lk",
+    "category": "data",
+    "displayName": "tomcat",
+    "description": "tomcat Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/more-complex-app/openstack/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/openstack/artifacts/tomcat1.json b/samples/more-complex-app/openstack/artifacts/tomcat1.json
new file mode 100755
index 0000000..816a0ac
--- /dev/null
+++ b/samples/more-complex-app/openstack/artifacts/tomcat1.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat1",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat1",
+    "description": "tomcat1 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/more-complex-app/openstack/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/openstack/artifacts/tomcat2.json b/samples/more-complex-app/openstack/artifacts/tomcat2.json
new file mode 100755
index 0000000..15b15e5
--- /dev/null
+++ b/samples/more-complex-app/openstack/artifacts/tomcat2.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat2",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat2",
+    "description": "tomcat2 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/more-complex-app/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/openstack/deploy.sh b/samples/more-complex-app/openstack/deploy.sh
new file mode 100755
index 0000000..6436bec
--- /dev/null
+++ b/samples/more-complex-app/openstack/deploy.sh
@@ -0,0 +1,40 @@
+#!/bin/sh 
+
+# Create autoscale policy
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+# Create tomcat cartridge
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy tomcat1 cartride
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat1.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy tomcat2 cartride
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat2.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy group
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group6c.json' -k -v -u admin:admin https://localhost:9443/api/cartridgeGroups
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group8c.json' -k -v -u admin:admin https://localhost:9443/api/cartridgeGroups
+
+sleep 5
+# Create application
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/application_definition.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 5
+# GET application
+curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin https://localhost:9443/api/applications/app_boo
+
+# Deploy application
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/deployment-policy.json' -k -v -u admin:admin https://localhost:9443/api/applications/app_boo/deploy
+
+sleep 20
+
+# Undeploy application
+# curl -X POST -H "Content-Type: application/json" -d@'artifacts/deployment-policy.json' -k -v -u admin:admin https://localhost:9443/api/applications/app_boo/undeploy
+
+sleep 5
+
+# Delete application
+# curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://localhost:9443/api/applications/app_boo
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/nested-group/openstack/artifacts/application_definition.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/openstack/artifacts/application_definition.json b/samples/nested-group/openstack/artifacts/application_definition.json
new file mode 100644
index 0000000..0dec2ad
--- /dev/null
+++ b/samples/nested-group/openstack/artifacts/application_definition.json
@@ -0,0 +1,62 @@
+{
+    "applicationId": "myapp1265",
+    "alias": "mytestapp1",
+    "components": {
+        "groups": [
+            {
+                "name": "group6",
+                "alias": "mygroup6",
+                "groupMinInstances": 1,
+                "groupMaxInstances": 1,
+                "groups": [
+                    {
+                        "name": "group7",
+                        "alias": "mygroup7",
+                        "groupMinInstances": 1,
+                        "groupMaxInstances": 1,
+                        "cartridges": [
+                            {
+                                "type": "tomcat1",
+                                "cartridgeMin": 1,
+                                "cartridgeMax": 2,
+                                "subscribableInfo": {
+                                    "alias": "group7tom",
+                                    "autoscalingPolicy": "autoscale_policy_1"
+                                }
+                            }
+                        ]
+                    }
+                ],
+                "cartridges": [
+                    {
+                        "type": "tomcat2",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "group6tom",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    }
+                ]
+            }
+        ],
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 1,
+                "cartridgeMax": 2,
+                "subscribableInfo": {
+                    "alias": "mytomcat",
+                    "autoscalingPolicy": "autoscale_policy_1"
+                }
+            }
+        ],
+        "dependencies": {
+            "startupOrders": [
+                "group.group6,cartridge.tomcat"
+            ],
+            "terminationBehaviour": "terminate-all"
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/nested-group/openstack/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/openstack/artifacts/autoscale-policy.json b/samples/nested-group/openstack/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..c8f83b3
--- /dev/null
+++ b/samples/nested-group/openstack/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscale_policy_1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "average": 50
+        },
+        "memoryConsumption": {
+            "average": 700
+        },
+        "loadAverage": {
+            "average": 1000
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/nested-group/openstack/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/openstack/artifacts/deployment-policy.json b/samples/nested-group/openstack/artifacts/deployment-policy.json
new file mode 100644
index 0000000..e0fbcd1
--- /dev/null
+++ b/samples/nested-group/openstack/artifacts/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+    "applicationId": "myapp1265",
+    "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
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/nested-group/openstack/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/openstack/artifacts/group6c.json b/samples/nested-group/openstack/artifacts/group6c.json
new file mode 100755
index 0000000..74fea79
--- /dev/null
+++ b/samples/nested-group/openstack/artifacts/group6c.json
@@ -0,0 +1,21 @@
+{
+    "name": "group6",
+    "groups": [
+        {
+            "name": "group7",
+            "cartridges": [
+                "tomcat1"
+            ]
+        }
+    ],
+    "cartridges": [
+        "tomcat2"
+    ],
+    "dependencies": {
+        "startupOrders": [
+            "group.group7,cartridge.tomcat2"
+        ],
+        "terminationBehaviour": "terminate-all"
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/nested-group/openstack/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/openstack/artifacts/tomcat.json b/samples/nested-group/openstack/artifacts/tomcat.json
new file mode 100755
index 0000000..fefc230
--- /dev/null
+++ b/samples/nested-group/openstack/artifacts/tomcat.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat",
+    "provider": "apache",
+    "host": "isuruh.lk",
+    "category": "data",
+    "displayName": "tomcat",
+    "description": "tomcat Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/nested-group/openstack/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/openstack/artifacts/tomcat1.json b/samples/nested-group/openstack/artifacts/tomcat1.json
new file mode 100755
index 0000000..816a0ac
--- /dev/null
+++ b/samples/nested-group/openstack/artifacts/tomcat1.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat1",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat1",
+    "description": "tomcat1 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/nested-group/openstack/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/openstack/artifacts/tomcat2.json b/samples/nested-group/openstack/artifacts/tomcat2.json
new file mode 100755
index 0000000..15b15e5
--- /dev/null
+++ b/samples/nested-group/openstack/artifacts/tomcat2.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat2",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat2",
+    "description": "tomcat2 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/nested-group/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/nested-group/openstack/deploy.sh b/samples/nested-group/openstack/deploy.sh
new file mode 100755
index 0000000..4176411
--- /dev/null
+++ b/samples/nested-group/openstack/deploy.sh
@@ -0,0 +1,25 @@
+#!/bin/sh 
+
+# Add autoscale policy
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+# Add tomcat cartridge
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Add tomcat1 cartride
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat1.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Add tomcat2 cartride
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat2.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Add group
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group6c.json' -k -v -u admin:admin https://localhost:9443/api/cartridgeGroups
+
+sleep 5
+# Create application
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/application_definition.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 5
+
+# Deploy application
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/deployment-policy.json' -k -v -u admin:admin https://localhost:9443/api/applications/myapp1265/deploy

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-group-scaling/openstack/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/openstack/artifacts/app_single_group.json b/samples/single-group-group-scaling/openstack/artifacts/app_single_group.json
new file mode 100644
index 0000000..77d7ec8
--- /dev/null
+++ b/samples/single-group-group-scaling/openstack/artifacts/app_single_group.json
@@ -0,0 +1,26 @@
+{
+    "applicationId": "app_group_v1",
+    "alias": "mytestapp1",
+    "components": {
+        "groups": [
+            {
+                "name": "group6",
+                "alias": "mygroup6",
+                "groupMinInstances": 1,
+                "groupMaxInstances": 3,
+                "cartridges": [
+                    {
+                        "type": "tomcat",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 4,
+                        "subscribableInfo": {
+                            "alias": "tom1group6",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    }
+                ]
+            }
+        ]
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-group-scaling/openstack/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/openstack/artifacts/autoscale-policy.json b/samples/single-group-group-scaling/openstack/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..dcebb1e
--- /dev/null
+++ b/samples/single-group-group-scaling/openstack/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscale_policy_1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 80
+        },
+        "memoryConsumption": {
+            "threshold": 40
+        },
+        "loadAverage": {
+            "threshold": 40
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-group-scaling/openstack/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/openstack/artifacts/dep_single_group.json b/samples/single-group-group-scaling/openstack/artifacts/dep_single_group.json
new file mode 100644
index 0000000..dd4d8c3
--- /dev/null
+++ b/samples/single-group-group-scaling/openstack/artifacts/dep_single_group.json
@@ -0,0 +1,41 @@
+{
+    "applicationId": "app_group_v1",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "openstack_R1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "openstack",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "RegionOne"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "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/305cbbe6/samples/single-group-group-scaling/openstack/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/openstack/artifacts/group6c.json b/samples/single-group-group-scaling/openstack/artifacts/group6c.json
new file mode 100644
index 0000000..a728456
--- /dev/null
+++ b/samples/single-group-group-scaling/openstack/artifacts/group6c.json
@@ -0,0 +1,11 @@
+{
+    "name": "group6",
+    "groupScalingEnabled": "true",
+    "cartridges": [
+        "tomcat"
+    ],
+    "dependencies": {
+        "terminationBehaviour": "terminate-all"
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-group-scaling/openstack/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/openstack/artifacts/tomcat.json b/samples/single-group-group-scaling/openstack/artifacts/tomcat.json
new file mode 100755
index 0000000..1f98f44
--- /dev/null
+++ b/samples/single-group-group-scaling/openstack/artifacts/tomcat.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat",
+    "description": "tomcat Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-group-scaling/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/openstack/deploy.sh b/samples/single-group-group-scaling/openstack/deploy.sh
new file mode 100755
index 0000000..87714d3
--- /dev/null
+++ b/samples/single-group-group-scaling/openstack/deploy.sh
@@ -0,0 +1,16 @@
+#!/bin/sh 
+
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group6c.json' -k -v -u admin:admin https://localhost:9443/api/cartridgeGroups
+
+sleep 3
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/app_single_group.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 3
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_single_group.json' -k -v -u admin:admin https://localhost:9443/api/applications/app_group_v1/deploy
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v1/openstack/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/openstack/artifacts/app_single_group.json b/samples/single-group-v1/openstack/artifacts/app_single_group.json
new file mode 100644
index 0000000..caf8596
--- /dev/null
+++ b/samples/single-group-v1/openstack/artifacts/app_single_group.json
@@ -0,0 +1,43 @@
+{
+    "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"
+                        }
+                    }
+                ]
+            }
+        ],
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 1,
+                "cartridgeMax": 1,
+                "subscribableInfo": {
+                    "alias": "mytomcat",
+                    "autoscalingPolicy": "autoscale_policy_1"
+                }
+            }
+        ],
+        "dependencies": {
+            "startupOrders": [
+                "group.group6,cartridge.tomcat"
+            ],
+            "terminationBehaviour": "terminate-none"
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v1/openstack/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/openstack/artifacts/app_single_group.json-para b/samples/single-group-v1/openstack/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/single-group-v1/openstack/artifacts/app_single_group.json-para
@@ -0,0 +1,46 @@
+{
+    "applicationId": "app_group_v1",
+    "alias": "mytestapp1",
+    "components": {
+        "groups" : [
+            {
+                "name": "group6",
+                "alias" : "mygroup6",
+                "groupMinInstances":1,
+                "groupMaxInstances":1,
+                "cartridges": [
+                    {
+                        "type": "tomcat2",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "tom2group6",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    },
+                    {
+                        "type": "tomcat1",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "tom1group6",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    }
+                ]
+            }
+        ],
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 1,
+                "cartridgeMax": 2,
+                "subscribableInfo": {
+                    "alias": "mytomcat",
+                    "autoscalingPolicy": "autoscale_policy_1"
+                }
+            }
+        ]
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v1/openstack/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/openstack/artifacts/autoscale-policy.json b/samples/single-group-v1/openstack/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/single-group-v1/openstack/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscale_policy_1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "upperLimit": 80
+        },
+        "memoryConsumption": {
+            "upperLimit": 90
+        },
+        "loadAverage": {
+            "upperLimit": 50
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v1/openstack/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/openstack/artifacts/dep_single_group.json b/samples/single-group-v1/openstack/artifacts/dep_single_group.json
new file mode 100644
index 0000000..0dcbe21
--- /dev/null
+++ b/samples/single-group-v1/openstack/artifacts/dep_single_group.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/305cbbe6/samples/single-group-v1/openstack/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/openstack/artifacts/group6c.json b/samples/single-group-v1/openstack/artifacts/group6c.json
new file mode 100644
index 0000000..8b0cac7
--- /dev/null
+++ b/samples/single-group-v1/openstack/artifacts/group6c.json
@@ -0,0 +1,11 @@
+{
+    "name": "group6",
+    "groupScalingEnabled": "true",
+    "cartridges": [
+        "tomcat1"
+    ],
+    "dependencies": {
+        "terminationBehaviour": "terminate-all"
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v1/openstack/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/openstack/artifacts/tomcat.json b/samples/single-group-v1/openstack/artifacts/tomcat.json
new file mode 100755
index 0000000..b1df07c
--- /dev/null
+++ b/samples/single-group-v1/openstack/artifacts/tomcat.json
@@ -0,0 +1,46 @@
+{
+    "type": "tomcat",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat",
+    "description": "tomcat Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v1/openstack/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/openstack/artifacts/tomcat1.json b/samples/single-group-v1/openstack/artifacts/tomcat1.json
new file mode 100755
index 0000000..816a0ac
--- /dev/null
+++ b/samples/single-group-v1/openstack/artifacts/tomcat1.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat1",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat1",
+    "description": "tomcat1 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v1/openstack/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/openstack/artifacts/tomcat2.json b/samples/single-group-v1/openstack/artifacts/tomcat2.json
new file mode 100755
index 0000000..15b15e5
--- /dev/null
+++ b/samples/single-group-v1/openstack/artifacts/tomcat2.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat2",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat2",
+    "description": "tomcat2 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v1/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/openstack/deploy.sh b/samples/single-group-v1/openstack/deploy.sh
new file mode 100755
index 0000000..e3fc05c
--- /dev/null
+++ b/samples/single-group-v1/openstack/deploy.sh
@@ -0,0 +1,16 @@
+#!/bin/sh 
+
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat1.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat2.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group6c.json' -k -v -u admin:admin https://localhost:9443/api/cartridgeGroups
+
+sleep 3
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/app_single_group.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 3
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_single_group.json' -k -v -u admin:admin https://localhost:9443/api/applications/app_group_v1/deploy
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v2/openstack/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/openstack/artifacts/app_single_group.json b/samples/single-group-v2/openstack/artifacts/app_single_group.json
new file mode 100644
index 0000000..361cdd8
--- /dev/null
+++ b/samples/single-group-v2/openstack/artifacts/app_single_group.json
@@ -0,0 +1,52 @@
+{
+    "applicationId": "app_group_v2",
+    "alias": "mytestapp1",
+    "components": {
+        "groups": [
+            {
+                "name": "group6",
+                "alias": "mygroup6",
+                "groupMinInstances": 2,
+                "groupMaxInstances": 3,
+                "cartridges": [
+                    {
+                        "type": "tomcat2",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "tom2group6",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    },
+                    {
+                        "type": "tomcat1",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "tom1group6",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    }
+                ]
+            }
+        ],
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 1,
+                "cartridgeMax": 2,
+                "subscribableInfo": {
+                    "alias": "mytomcat",
+                    "autoscalingPolicy": "autoscale_policy_1"
+                }
+            }
+        ],
+        "dependencies": {
+            "startupOrders": [
+                "group.group6,cartridge.tomcat"
+            ],
+            "terminationBehaviour": "terminate-none"
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v2/openstack/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/openstack/artifacts/app_single_group.json-para b/samples/single-group-v2/openstack/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/single-group-v2/openstack/artifacts/app_single_group.json-para
@@ -0,0 +1,46 @@
+{
+    "applicationId": "app_group_v1",
+    "alias": "mytestapp1",
+    "components": {
+        "groups" : [
+            {
+                "name": "group6",
+                "alias" : "mygroup6",
+                "groupMinInstances":1,
+                "groupMaxInstances":1,
+                "cartridges": [
+                    {
+                        "type": "tomcat2",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "tom2group6",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    },
+                    {
+                        "type": "tomcat1",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "tom1group6",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    }
+                ]
+            }
+        ],
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 1,
+                "cartridgeMax": 2,
+                "subscribableInfo": {
+                    "alias": "mytomcat",
+                    "autoscalingPolicy": "autoscale_policy_1"
+                }
+            }
+        ]
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v2/openstack/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/openstack/artifacts/autoscale-policy.json b/samples/single-group-v2/openstack/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/single-group-v2/openstack/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscale_policy_1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "upperLimit": 80
+        },
+        "memoryConsumption": {
+            "upperLimit": 90
+        },
+        "loadAverage": {
+            "upperLimit": 50
+        }
+    }
+}

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v2/openstack/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/openstack/artifacts/group6c.json b/samples/single-group-v2/openstack/artifacts/group6c.json
new file mode 100644
index 0000000..85c2106
--- /dev/null
+++ b/samples/single-group-v2/openstack/artifacts/group6c.json
@@ -0,0 +1,14 @@
+{
+    "name": "group6",
+    "cartridges": [
+        "tomcat2",
+        "tomcat1"
+    ],
+    "dependencies": {
+        "startupOrders": [
+            "cartridge.tomcat2,cartridge.tomcat1"
+        ],
+        "terminationBehaviour": "terminate-all"
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v2/openstack/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/openstack/artifacts/tomcat.json b/samples/single-group-v2/openstack/artifacts/tomcat.json
new file mode 100755
index 0000000..1f98f44
--- /dev/null
+++ b/samples/single-group-v2/openstack/artifacts/tomcat.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat",
+    "description": "tomcat Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v2/openstack/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/openstack/artifacts/tomcat1.json b/samples/single-group-v2/openstack/artifacts/tomcat1.json
new file mode 100755
index 0000000..816a0ac
--- /dev/null
+++ b/samples/single-group-v2/openstack/artifacts/tomcat1.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat1",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat1",
+    "description": "tomcat1 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v2/openstack/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/openstack/artifacts/tomcat2.json b/samples/single-group-v2/openstack/artifacts/tomcat2.json
new file mode 100755
index 0000000..15b15e5
--- /dev/null
+++ b/samples/single-group-v2/openstack/artifacts/tomcat2.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat2",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat2",
+    "description": "tomcat2 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v2/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/openstack/deploy.sh b/samples/single-group-v2/openstack/deploy.sh
new file mode 100755
index 0000000..0fde421
--- /dev/null
+++ b/samples/single-group-v2/openstack/deploy.sh
@@ -0,0 +1,17 @@
+#!/bin/sh 
+
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat1.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat2.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group6c.json' -k -v -u admin:admin https://localhost:9443/api/cartridgeGroups
+
+sleep 3
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/app_single_group.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 3
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_single_group.json' -k -v -u admin:admin https://localhost:9443/api/applications/app_group_v2/deploy
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v3/openstack/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/openstack/artifacts/app_single_group.json b/samples/single-group-v3/openstack/artifacts/app_single_group.json
new file mode 100644
index 0000000..c4cbd75
--- /dev/null
+++ b/samples/single-group-v3/openstack/artifacts/app_single_group.json
@@ -0,0 +1,27 @@
+{
+    "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"
+                        }
+                    }
+                ]
+            }
+        ]
+    }
+}
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v3/openstack/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/openstack/artifacts/app_single_group.json-para b/samples/single-group-v3/openstack/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/single-group-v3/openstack/artifacts/app_single_group.json-para
@@ -0,0 +1,46 @@
+{
+    "applicationId": "app_group_v1",
+    "alias": "mytestapp1",
+    "components": {
+        "groups" : [
+            {
+                "name": "group6",
+                "alias" : "mygroup6",
+                "groupMinInstances":1,
+                "groupMaxInstances":1,
+                "cartridges": [
+                    {
+                        "type": "tomcat2",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "tom2group6",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    },
+                    {
+                        "type": "tomcat1",
+                        "cartridgeMin": 1,
+                        "cartridgeMax": 2,
+                        "subscribableInfo": {
+                            "alias": "tom1group6",
+                            "autoscalingPolicy": "autoscale_policy_1"
+                        }
+                    }
+                ]
+            }
+        ],
+        "cartridges": [
+            {
+                "type": "tomcat",
+                "cartridgeMin": 1,
+                "cartridgeMax": 2,
+                "subscribableInfo": {
+                    "alias": "mytomcat",
+                    "autoscalingPolicy": "autoscale_policy_1"
+                }
+            }
+        ]
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v3/openstack/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/openstack/artifacts/autoscale-policy.json b/samples/single-group-v3/openstack/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/single-group-v3/openstack/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscale_policy_1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "upperLimit": 80
+        },
+        "memoryConsumption": {
+            "upperLimit": 90
+        },
+        "loadAverage": {
+            "upperLimit": 50
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v3/openstack/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/openstack/artifacts/dep_single_group.json b/samples/single-group-v3/openstack/artifacts/dep_single_group.json
new file mode 100644
index 0000000..dd4d8c3
--- /dev/null
+++ b/samples/single-group-v3/openstack/artifacts/dep_single_group.json
@@ -0,0 +1,41 @@
+{
+    "applicationId": "app_group_v1",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "openstack_R1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "openstack",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "RegionOne"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "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/305cbbe6/samples/single-group-v3/openstack/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/openstack/artifacts/group6c.json b/samples/single-group-v3/openstack/artifacts/group6c.json
new file mode 100644
index 0000000..8b0cac7
--- /dev/null
+++ b/samples/single-group-v3/openstack/artifacts/group6c.json
@@ -0,0 +1,11 @@
+{
+    "name": "group6",
+    "groupScalingEnabled": "true",
+    "cartridges": [
+        "tomcat1"
+    ],
+    "dependencies": {
+        "terminationBehaviour": "terminate-all"
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v3/openstack/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/openstack/artifacts/tomcat.json b/samples/single-group-v3/openstack/artifacts/tomcat.json
new file mode 100755
index 0000000..1f98f44
--- /dev/null
+++ b/samples/single-group-v3/openstack/artifacts/tomcat.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat",
+    "description": "tomcat Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v3/openstack/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/openstack/artifacts/tomcat1.json b/samples/single-group-v3/openstack/artifacts/tomcat1.json
new file mode 100755
index 0000000..816a0ac
--- /dev/null
+++ b/samples/single-group-v3/openstack/artifacts/tomcat1.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat1",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat1",
+    "description": "tomcat1 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v3/openstack/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/openstack/artifacts/tomcat2.json b/samples/single-group-v3/openstack/artifacts/tomcat2.json
new file mode 100755
index 0000000..15b15e5
--- /dev/null
+++ b/samples/single-group-v3/openstack/artifacts/tomcat2.json
@@ -0,0 +1,52 @@
+{
+    "type": "tomcat2",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat2",
+    "description": "tomcat2 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "name": "network-non-routable",
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "maxInstanceLimit": "2",
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "vishanth-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/305cbbe6/samples/single-group-v3/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/openstack/deploy.sh b/samples/single-group-v3/openstack/deploy.sh
new file mode 100755
index 0000000..d610e41
--- /dev/null
+++ b/samples/single-group-v3/openstack/deploy.sh
@@ -0,0 +1,15 @@
+#!/bin/sh 
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat1.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat2.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group6c.json' -k -v -u admin:admin https://localhost:9443/api/cartridgeGroups
+
+sleep 3
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/app_single_group.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 3
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_single_group.json' -k -v -u admin:admin https://localhost:9443/api/applications/app_group_v1/deploy
+