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/11 14:44:58 UTC
[1/4] stratos git commit: Moving sample applications to stratos git
repository, refactoring the folder structure, formatting json files
Repository: stratos
Updated Branches:
refs/heads/master 7795f034e -> 704db4b7c
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v2/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/mock/artifacts/tomcat.json b/samples/single-group-v2/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..7531ba6
--- /dev/null
+++ b/samples/single-group-v2/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v2/mock/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/mock/artifacts/tomcat1.json b/samples/single-group-v2/mock/artifacts/tomcat1.json
new file mode 100755
index 0000000..eb57815
--- /dev/null
+++ b/samples/single-group-v2/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v2/mock/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/mock/artifacts/tomcat2.json b/samples/single-group-v2/mock/artifacts/tomcat2.json
new file mode 100755
index 0000000..63b4429
--- /dev/null
+++ b/samples/single-group-v2/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v2/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/mock/deploy.sh b/samples/single-group-v2/mock/deploy.sh
new file mode 100755
index 0000000..e45312f
--- /dev/null
+++ b/samples/single-group-v2/mock/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/groups
+
+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/704db4b7/samples/single-group-v3/ec2/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/ec2/artifacts/app_single_group.json-para b/samples/single-group-v3/ec2/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/single-group-v3/ec2/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/704db4b7/samples/single-group-v3/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/ec2/deploy.sh b/samples/single-group-v3/ec2/deploy.sh
new file mode 100755
index 0000000..6bbf43e
--- /dev/null
+++ b/samples/single-group-v3/ec2/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/groups
+
+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/704db4b7/samples/single-group-v3/mock/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/mock/artifacts/app_single_group.json b/samples/single-group-v3/mock/artifacts/app_single_group.json
new file mode 100644
index 0000000..c4cbd75
--- /dev/null
+++ b/samples/single-group-v3/mock/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/704db4b7/samples/single-group-v3/mock/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/mock/artifacts/app_single_group.json-para b/samples/single-group-v3/mock/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/single-group-v3/mock/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/704db4b7/samples/single-group-v3/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/mock/artifacts/autoscale-policy.json b/samples/single-group-v3/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/single-group-v3/mock/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/704db4b7/samples/single-group-v3/mock/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/mock/artifacts/dep_single_group.json b/samples/single-group-v3/mock/artifacts/dep_single_group.json
new file mode 100644
index 0000000..4ac69f9
--- /dev/null
+++ b/samples/single-group-v3/mock/artifacts/dep_single_group.json
@@ -0,0 +1,41 @@
+{
+ "applicationId": "app_group_v1",
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "mock",
+ "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/704db4b7/samples/single-group-v3/mock/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/mock/artifacts/group6c.json b/samples/single-group-v3/mock/artifacts/group6c.json
new file mode 100644
index 0000000..7c4e90b
--- /dev/null
+++ b/samples/single-group-v3/mock/artifacts/group6c.json
@@ -0,0 +1,11 @@
+{
+ "name": "group6",
+ "isGroupScalingEnabled": "true",
+ "cartridges": [
+ "tomcat1"
+ ],
+ "dependencies": {
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v3/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/mock/artifacts/tomcat.json b/samples/single-group-v3/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..7531ba6
--- /dev/null
+++ b/samples/single-group-v3/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v3/mock/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/mock/artifacts/tomcat1.json b/samples/single-group-v3/mock/artifacts/tomcat1.json
new file mode 100755
index 0000000..eb57815
--- /dev/null
+++ b/samples/single-group-v3/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v3/mock/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/mock/artifacts/tomcat2.json b/samples/single-group-v3/mock/artifacts/tomcat2.json
new file mode 100755
index 0000000..63b4429
--- /dev/null
+++ b/samples/single-group-v3/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v3/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-v3/mock/deploy.sh b/samples/single-group-v3/mock/deploy.sh
new file mode 100755
index 0000000..6bbf43e
--- /dev/null
+++ b/samples/single-group-v3/mock/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/groups
+
+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
+
[2/4] stratos git commit: Moving sample applications to stratos git
repository, refactoring the folder structure, formatting json files
Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/ec2/artifacts/application_definition.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/ec2/artifacts/application_definition.json b/samples/nested-group/ec2/artifacts/application_definition.json
new file mode 100644
index 0000000..afb34a1
--- /dev/null
+++ b/samples/nested-group/ec2/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.mygroup6,cartridge.mytomcat"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/ec2/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/ec2/artifacts/autoscale-policy.json b/samples/nested-group/ec2/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..c8f83b3
--- /dev/null
+++ b/samples/nested-group/ec2/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/704db4b7/samples/nested-group/ec2/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/ec2/artifacts/deployment-policy.json b/samples/nested-group/ec2/artifacts/deployment-policy.json
new file mode 100644
index 0000000..9bdfaa3
--- /dev/null
+++ b/samples/nested-group/ec2/artifacts/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationId": "myapp1265",
+ "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/704db4b7/samples/nested-group/ec2/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/ec2/artifacts/group6c.json b/samples/nested-group/ec2/artifacts/group6c.json
new file mode 100755
index 0000000..74fea79
--- /dev/null
+++ b/samples/nested-group/ec2/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/704db4b7/samples/nested-group/ec2/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/ec2/artifacts/tomcat.json b/samples/nested-group/ec2/artifacts/tomcat.json
new file mode 100755
index 0000000..1779e62
--- /dev/null
+++ b/samples/nested-group/ec2/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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/ec2/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/ec2/artifacts/tomcat1.json b/samples/nested-group/ec2/artifacts/tomcat1.json
new file mode 100755
index 0000000..9cafdb9
--- /dev/null
+++ b/samples/nested-group/ec2/artifacts/tomcat1.json
@@ -0,0 +1,47 @@
+{
+ "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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/ec2/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/ec2/artifacts/tomcat2.json b/samples/nested-group/ec2/artifacts/tomcat2.json
new file mode 100755
index 0000000..cf7b0be
--- /dev/null
+++ b/samples/nested-group/ec2/artifacts/tomcat2.json
@@ -0,0 +1,47 @@
+{
+ "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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/nested-group/ec2/deploy.sh b/samples/nested-group/ec2/deploy.sh
new file mode 100755
index 0000000..5fa350f
--- /dev/null
+++ b/samples/nested-group/ec2/deploy.sh
@@ -0,0 +1,25 @@
+#!/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/groups
+
+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/704db4b7/samples/nested-group/mock/artifacts/application_definition.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/mock/artifacts/application_definition.json b/samples/nested-group/mock/artifacts/application_definition.json
new file mode 100644
index 0000000..afb34a1
--- /dev/null
+++ b/samples/nested-group/mock/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.mygroup6,cartridge.mytomcat"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/mock/artifacts/autoscale-policy.json b/samples/nested-group/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..c8f83b3
--- /dev/null
+++ b/samples/nested-group/mock/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/704db4b7/samples/nested-group/mock/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/mock/artifacts/deployment-policy.json b/samples/nested-group/mock/artifacts/deployment-policy.json
new file mode 100644
index 0000000..2ab3665
--- /dev/null
+++ b/samples/nested-group/mock/artifacts/deployment-policy.json
@@ -0,0 +1,55 @@
+{
+ "applicationId": "myapp1265",
+ "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
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/mock/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/mock/artifacts/group6c.json b/samples/nested-group/mock/artifacts/group6c.json
new file mode 100755
index 0000000..74fea79
--- /dev/null
+++ b/samples/nested-group/mock/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/704db4b7/samples/nested-group/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/mock/artifacts/tomcat.json b/samples/nested-group/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..96a0c1e
--- /dev/null
+++ b/samples/nested-group/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/mock/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/mock/artifacts/tomcat1.json b/samples/nested-group/mock/artifacts/tomcat1.json
new file mode 100755
index 0000000..eb57815
--- /dev/null
+++ b/samples/nested-group/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/mock/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/nested-group/mock/artifacts/tomcat2.json b/samples/nested-group/mock/artifacts/tomcat2.json
new file mode 100755
index 0000000..63b4429
--- /dev/null
+++ b/samples/nested-group/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/README.md
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/README.md b/samples/single-cartridge/README.md
new file mode 100644
index 0000000..7025dff
--- /dev/null
+++ b/samples/single-cartridge/README.md
@@ -0,0 +1,8 @@
+single_cartridge
+================
+i) In this artifact sample you can find we have listed them as mock and openstack.
+
+ii) In this sample artifact, it deployed simple tomcat cartridge and start it.
+
+iii) You can choose the IaaS and navigate to it and simply run the single_cartridge.sh file. It'll deploy the relevant artifacts and start the application.
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/ec2/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/ec2/artifacts/app_single_group.json b/samples/single-cartridge/ec2/artifacts/app_single_group.json
new file mode 100644
index 0000000..b6a9843
--- /dev/null
+++ b/samples/single-cartridge/ec2/artifacts/app_single_group.json
@@ -0,0 +1,19 @@
+{
+ "applicationId": "app_cartridge_v1",
+ "alias": "mytestapp1",
+ "components": {
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 1,
+ "cartridgeMax": 5,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1",
+ "repoUrl": "https://github.com/manulachathurika/Apache_Stratos_Tomcat_Applications.git"
+ }
+ }
+ ]
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/ec2/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/ec2/artifacts/autoscale-policy.json b/samples/single-cartridge/ec2/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..0444120
--- /dev/null
+++ b/samples/single-cartridge/ec2/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 20
+ },
+ "memoryConsumption": {
+ "threshold": 20
+ },
+ "loadAverage": {
+ "threshold": 40
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/ec2/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/ec2/artifacts/dep_single_group.json b/samples/single-cartridge/ec2/artifacts/dep_single_group.json
new file mode 100644
index 0000000..d70278d
--- /dev/null
+++ b/samples/single-cartridge/ec2/artifacts/dep_single_group.json
@@ -0,0 +1,41 @@
+{
+ "applicationId": "app_cartridge_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": 8
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/ec2/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/ec2/artifacts/tomcat.json b/samples/single-cartridge/ec2/artifacts/tomcat.json
new file mode 100755
index 0000000..1779e62
--- /dev/null
+++ b/samples/single-cartridge/ec2/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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/ec2/deploy.sh b/samples/single-cartridge/ec2/deploy.sh
new file mode 100755
index 0000000..87ba258
--- /dev/null
+++ b/samples/single-cartridge/ec2/deploy.sh
@@ -0,0 +1,11 @@
+#!/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
+
+sleep 5
+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 5
+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_cartridge_v1/deploy
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/mock/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/mock/artifacts/app_single_group.json b/samples/single-cartridge/mock/artifacts/app_single_group.json
new file mode 100644
index 0000000..9e996c2
--- /dev/null
+++ b/samples/single-cartridge/mock/artifacts/app_single_group.json
@@ -0,0 +1,18 @@
+{
+ "applicationId": "app_cartridge_v1",
+ "alias": "mytestapp1",
+ "components": {
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/mock/artifacts/autoscale-policy.json b/samples/single-cartridge/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..9e9ad99
--- /dev/null
+++ b/samples/single-cartridge/mock/artifacts/autoscale-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/704db4b7/samples/single-cartridge/mock/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/mock/artifacts/dep_single_group.json b/samples/single-cartridge/mock/artifacts/dep_single_group.json
new file mode 100644
index 0000000..629d024
--- /dev/null
+++ b/samples/single-cartridge/mock/artifacts/dep_single_group.json
@@ -0,0 +1,42 @@
+{
+ "applicationId": "app_cartridge_v1",
+ "applicationPolicy": {
+ "applicationId": "app_cartridge_v1",
+ "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": 8
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/mock/artifacts/tomcat.json b/samples/single-cartridge/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..7531ba6
--- /dev/null
+++ b/samples/single-cartridge/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/mock/deploy.sh b/samples/single-cartridge/mock/deploy.sh
new file mode 100755
index 0000000..d57b104
--- /dev/null
+++ b/samples/single-cartridge/mock/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
+
+sleep 5
+
+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 5
+
+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_cartridge_v1/deploy
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/openstack/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/openstack/artifacts/app_single_group.json b/samples/single-cartridge/openstack/artifacts/app_single_group.json
new file mode 100644
index 0000000..9e996c2
--- /dev/null
+++ b/samples/single-cartridge/openstack/artifacts/app_single_group.json
@@ -0,0 +1,18 @@
+{
+ "applicationId": "app_cartridge_v1",
+ "alias": "mytestapp1",
+ "components": {
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 2,
+ "cartridgeMax": 5,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/openstack/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/openstack/artifacts/autoscale-policy.json b/samples/single-cartridge/openstack/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..0444120
--- /dev/null
+++ b/samples/single-cartridge/openstack/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 20
+ },
+ "memoryConsumption": {
+ "threshold": 20
+ },
+ "loadAverage": {
+ "threshold": 40
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/openstack/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/openstack/artifacts/dep_single_group.json b/samples/single-cartridge/openstack/artifacts/dep_single_group.json
new file mode 100644
index 0000000..4558a68
--- /dev/null
+++ b/samples/single-cartridge/openstack/artifacts/dep_single_group.json
@@ -0,0 +1,41 @@
+{
+ "applicationId": "app_cartridge_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": 8
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/openstack/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/openstack/artifacts/tomcat.json b/samples/single-cartridge/openstack/artifacts/tomcat.json
new file mode 100755
index 0000000..98ba685
--- /dev/null
+++ b/samples/single-cartridge/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/a63609be-61df-436f-80bc-d2b6068a4c3a",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-cartridge/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-cartridge/openstack/deploy.sh b/samples/single-cartridge/openstack/deploy.sh
new file mode 100755
index 0000000..a01342a
--- /dev/null
+++ b/samples/single-cartridge/openstack/deploy.sh
@@ -0,0 +1,12 @@
+#!/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
+
+sleep 5
+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 5
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_single_group.json' -k -v -u admin:admin https://localhost:9443/api/application/app_cartridge_v1/deploy
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-group-scaling/mock/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/mock/artifacts/app_single_group.json b/samples/single-group-group-scaling/mock/artifacts/app_single_group.json
new file mode 100644
index 0000000..77d7ec8
--- /dev/null
+++ b/samples/single-group-group-scaling/mock/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/704db4b7/samples/single-group-group-scaling/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/mock/artifacts/autoscale-policy.json b/samples/single-group-group-scaling/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..dcebb1e
--- /dev/null
+++ b/samples/single-group-group-scaling/mock/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/704db4b7/samples/single-group-group-scaling/mock/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/mock/artifacts/dep_single_group.json b/samples/single-group-group-scaling/mock/artifacts/dep_single_group.json
new file mode 100644
index 0000000..4ac69f9
--- /dev/null
+++ b/samples/single-group-group-scaling/mock/artifacts/dep_single_group.json
@@ -0,0 +1,41 @@
+{
+ "applicationId": "app_group_v1",
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "mock",
+ "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/704db4b7/samples/single-group-group-scaling/mock/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/mock/artifacts/group6c.json b/samples/single-group-group-scaling/mock/artifacts/group6c.json
new file mode 100644
index 0000000..a5bc46a
--- /dev/null
+++ b/samples/single-group-group-scaling/mock/artifacts/group6c.json
@@ -0,0 +1,11 @@
+{
+ "name": "group6",
+ "isGroupScalingEnabled": "true",
+ "cartridges": [
+ "tomcat"
+ ],
+ "dependencies": {
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-group-scaling/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/mock/artifacts/tomcat.json b/samples/single-group-group-scaling/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..7531ba6
--- /dev/null
+++ b/samples/single-group-group-scaling/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-group-scaling/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-group-scaling/mock/deploy.sh b/samples/single-group-group-scaling/mock/deploy.sh
new file mode 100755
index 0000000..dd00607
--- /dev/null
+++ b/samples/single-group-group-scaling/mock/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/groups
+
+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/704db4b7/samples/single-group-v1/README.md
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/README.md b/samples/single-group-v1/README.md
new file mode 100644
index 0000000..33a7903
--- /dev/null
+++ b/samples/single-group-v1/README.md
@@ -0,0 +1,7 @@
+single_group_v1
+==============
+
+i) Using these artifacts you can deploy the single group application.
+
+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/704db4b7/samples/single-group-v1/ec2/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/ec2/artifacts/app_single_group.json b/samples/single-group-v1/ec2/artifacts/app_single_group.json
new file mode 100644
index 0000000..121a7c0
--- /dev/null
+++ b/samples/single-group-v1/ec2/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.mygroup6,cartridge.mytomcat"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/ec2/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/ec2/artifacts/app_single_group.json-para b/samples/single-group-v1/ec2/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/single-group-v1/ec2/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/704db4b7/samples/single-group-v1/ec2/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/ec2/artifacts/autoscale-policy.json b/samples/single-group-v1/ec2/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/single-group-v1/ec2/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/704db4b7/samples/single-group-v1/ec2/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/ec2/artifacts/dep_single_group.json b/samples/single-group-v1/ec2/artifacts/dep_single_group.json
new file mode 100644
index 0000000..a7bd03e
--- /dev/null
+++ b/samples/single-group-v1/ec2/artifacts/dep_single_group.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/704db4b7/samples/single-group-v1/ec2/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/ec2/artifacts/group6c.json b/samples/single-group-v1/ec2/artifacts/group6c.json
new file mode 100644
index 0000000..7c4e90b
--- /dev/null
+++ b/samples/single-group-v1/ec2/artifacts/group6c.json
@@ -0,0 +1,11 @@
+{
+ "name": "group6",
+ "isGroupScalingEnabled": "true",
+ "cartridges": [
+ "tomcat1"
+ ],
+ "dependencies": {
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/ec2/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/ec2/artifacts/tomcat.json b/samples/single-group-v1/ec2/artifacts/tomcat.json
new file mode 100755
index 0000000..1779e62
--- /dev/null
+++ b/samples/single-group-v1/ec2/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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/ec2/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/ec2/artifacts/tomcat1.json b/samples/single-group-v1/ec2/artifacts/tomcat1.json
new file mode 100755
index 0000000..9cafdb9
--- /dev/null
+++ b/samples/single-group-v1/ec2/artifacts/tomcat1.json
@@ -0,0 +1,47 @@
+{
+ "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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/ec2/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/ec2/artifacts/tomcat2.json b/samples/single-group-v1/ec2/artifacts/tomcat2.json
new file mode 100755
index 0000000..cf7b0be
--- /dev/null
+++ b/samples/single-group-v1/ec2/artifacts/tomcat2.json
@@ -0,0 +1,47 @@
+{
+ "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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/ec2/deploy.sh b/samples/single-group-v1/ec2/deploy.sh
new file mode 100755
index 0000000..57a38bf
--- /dev/null
+++ b/samples/single-group-v1/ec2/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/groups
+
+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/704db4b7/samples/single-group-v1/mock/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/mock/artifacts/app_single_group.json b/samples/single-group-v1/mock/artifacts/app_single_group.json
new file mode 100644
index 0000000..121a7c0
--- /dev/null
+++ b/samples/single-group-v1/mock/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.mygroup6,cartridge.mytomcat"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/mock/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/mock/artifacts/app_single_group.json-para b/samples/single-group-v1/mock/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/single-group-v1/mock/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/704db4b7/samples/single-group-v1/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/mock/artifacts/autoscale-policy.json b/samples/single-group-v1/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/single-group-v1/mock/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/704db4b7/samples/single-group-v1/mock/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/mock/artifacts/dep_single_group.json b/samples/single-group-v1/mock/artifacts/dep_single_group.json
new file mode 100644
index 0000000..d52e9b9
--- /dev/null
+++ b/samples/single-group-v1/mock/artifacts/dep_single_group.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/704db4b7/samples/single-group-v1/mock/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/mock/artifacts/group6c.json b/samples/single-group-v1/mock/artifacts/group6c.json
new file mode 100644
index 0000000..7c4e90b
--- /dev/null
+++ b/samples/single-group-v1/mock/artifacts/group6c.json
@@ -0,0 +1,11 @@
+{
+ "name": "group6",
+ "isGroupScalingEnabled": "true",
+ "cartridges": [
+ "tomcat1"
+ ],
+ "dependencies": {
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/mock/artifacts/tomcat.json b/samples/single-group-v1/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..c376d92
--- /dev/null
+++ b/samples/single-group-v1/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/mock/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/mock/artifacts/tomcat1.json b/samples/single-group-v1/mock/artifacts/tomcat1.json
new file mode 100755
index 0000000..eb57815
--- /dev/null
+++ b/samples/single-group-v1/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/mock/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/mock/artifacts/tomcat2.json b/samples/single-group-v1/mock/artifacts/tomcat2.json
new file mode 100755
index 0000000..63b4429
--- /dev/null
+++ b/samples/single-group-v1/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v1/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-v1/mock/deploy.sh b/samples/single-group-v1/mock/deploy.sh
new file mode 100755
index 0000000..57a38bf
--- /dev/null
+++ b/samples/single-group-v1/mock/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/groups
+
+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/704db4b7/samples/single-group-v2/README.md
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/README.md b/samples/single-group-v2/README.md
new file mode 100644
index 0000000..5fe5709
--- /dev/null
+++ b/samples/single-group-v2/README.md
@@ -0,0 +1,7 @@
+single_group_v2
+===============
+
+i) Using these artifacts you can deploy the single group application.
+
+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/704db4b7/samples/single-group-v2/ec2/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/ec2/artifacts/app_single_group.json-para b/samples/single-group-v2/ec2/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/single-group-v2/ec2/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/704db4b7/samples/single-group-v2/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/ec2/deploy.sh b/samples/single-group-v2/ec2/deploy.sh
new file mode 100755
index 0000000..e45312f
--- /dev/null
+++ b/samples/single-group-v2/ec2/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/groups
+
+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/704db4b7/samples/single-group-v2/mock/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/mock/artifacts/app_single_group.json b/samples/single-group-v2/mock/artifacts/app_single_group.json
new file mode 100644
index 0000000..afd6b11
--- /dev/null
+++ b/samples/single-group-v2/mock/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.mygroup6,cartridge.mytomcat"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v2/mock/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/mock/artifacts/app_single_group.json-para b/samples/single-group-v2/mock/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/single-group-v2/mock/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/704db4b7/samples/single-group-v2/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/mock/artifacts/autoscale-policy.json b/samples/single-group-v2/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/single-group-v2/mock/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/704db4b7/samples/single-group-v2/mock/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/mock/artifacts/dep_single_group.json b/samples/single-group-v2/mock/artifacts/dep_single_group.json
new file mode 100644
index 0000000..c5c4d4d
--- /dev/null
+++ b/samples/single-group-v2/mock/artifacts/dep_single_group.json
@@ -0,0 +1,56 @@
+{
+ "applicationId": "app_group_v2",
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "mock",
+ "property": [
+ {
+ "name": "region",
+ "value": "RegionOne"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mytomcat",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mygroup6",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/single-group-v2/mock/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/single-group-v2/mock/artifacts/group6c.json b/samples/single-group-v2/mock/artifacts/group6c.json
new file mode 100644
index 0000000..85c2106
--- /dev/null
+++ b/samples/single-group-v2/mock/artifacts/group6c.json
@@ -0,0 +1,14 @@
+{
+ "name": "group6",
+ "cartridges": [
+ "tomcat2",
+ "tomcat1"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "cartridge.tomcat2,cartridge.tomcat1"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
[3/4] stratos git commit: Moving sample applications to stratos git
repository, refactoring the folder structure, formatting json files
Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/mock/artifacts/autoscale-policy.json b/samples/dependency-scaling/sample-groups/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..d1d3134
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/mock/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 50
+ },
+ "memoryConsumption": {
+ "threshold": 70
+ },
+ "loadAverage": {
+ "threshold": 1000
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/mock/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/mock/artifacts/dep_single_group.json b/samples/dependency-scaling/sample-groups/mock/artifacts/dep_single_group.json
new file mode 100644
index 0000000..c5c4d4d
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/mock/artifacts/dep_single_group.json
@@ -0,0 +1,56 @@
+{
+ "applicationId": "app_group_v2",
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "mock",
+ "property": [
+ {
+ "name": "region",
+ "value": "RegionOne"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mytomcat",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mygroup6",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/mock/artifacts/esb.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/mock/artifacts/esb.json b/samples/dependency-scaling/sample-groups/mock/artifacts/esb.json
new file mode 100755
index 0000000..0c24f9e
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/mock/artifacts/esb.json
@@ -0,0 +1,46 @@
+{
+ "type": "esb",
+ "provider": "wso2",
+ "category": "data",
+ "host": "isuruh.lk",
+ "displayName": "esb",
+ "description": "esb Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/mock/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/mock/artifacts/group6c.json b/samples/dependency-scaling/sample-groups/mock/artifacts/group6c.json
new file mode 100644
index 0000000..d11c8fc
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/mock/artifacts/group6c.json
@@ -0,0 +1,15 @@
+{
+ "name": "group6",
+ "isGroupScalingEnabled": "true",
+ "cartridges": [
+ "esb",
+ "php"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "cartridge.esb,cartridge.php"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/mock/artifacts/php.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/mock/artifacts/php.json b/samples/dependency-scaling/sample-groups/mock/artifacts/php.json
new file mode 100755
index 0000000..5bc14b6
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/mock/artifacts/php.json
@@ -0,0 +1,52 @@
+{
+ "type": "php",
+ "provider": "apache",
+ "category": "data",
+ "host": "isuruh.lk",
+ "displayName": "php",
+ "description": "php Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/mock/artifacts/tomcat.json b/samples/dependency-scaling/sample-groups/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..7531ba6
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/mock/deploy.sh b/samples/dependency-scaling/sample-groups/mock/deploy.sh
new file mode 100755
index 0000000..39a99ed
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/mock/deploy.sh
@@ -0,0 +1,18 @@
+#!/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/esb.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/php.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/groups
+
+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/704db4b7/samples/group-scaling-v1/mock/artifacts/app_deployment_policy.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/app_deployment_policy.json b/samples/group-scaling-v1/mock/artifacts/app_deployment_policy.json
new file mode 100644
index 0000000..671c9af
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/app_deployment_policy.json
@@ -0,0 +1,67 @@
+{
+ "applicationId": "appscaling",
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "mock",
+ "property": [
+ {
+ "name": "region",
+ "value": "RegionOne"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id": "openstack_R2",
+ "activeByDefault": "false",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "mock",
+ "property": [
+ {
+ "name": "region",
+ "value": "RegionOne"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mygroup2",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 2
+ }
+ ]
+ },
+ {
+ "id": "openstack_R2",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 2
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c1.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c1.json b/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c1.json
new file mode 100755
index 0000000..dacdeeb
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c1.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_c1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 80
+ },
+ "memoryConsumption": {
+ "threshold": 20
+ },
+ "loadAverage": {
+ "threshold": 50
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c2.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c2.json b/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c2.json
new file mode 100755
index 0000000..b908013
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c2.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_c2",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 90
+ },
+ "memoryConsumption": {
+ "threshold": 5
+ },
+ "loadAverage": {
+ "threshold": 50
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c3.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c3.json b/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c3.json
new file mode 100755
index 0000000..f2942a0
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c3.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_c3",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 100
+ },
+ "memoryConsumption": {
+ "threshold": 10
+ },
+ "loadAverage": {
+ "threshold": 50
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c4.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c4.json b/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c4.json
new file mode 100755
index 0000000..4b6db88
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/autoscale-policy-c4.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_c4",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 50
+ },
+ "memoryConsumption": {
+ "threshold": 28
+ },
+ "loadAverage": {
+ "threshold": 75
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/c1.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/c1.json b/samples/group-scaling-v1/mock/artifacts/c1.json
new file mode 100755
index 0000000..55408a9
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/c1.json
@@ -0,0 +1,46 @@
+{
+ "type": "c1",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c1",
+ "description": "c1 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/c2.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/c2.json b/samples/group-scaling-v1/mock/artifacts/c2.json
new file mode 100755
index 0000000..99f9a6e
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/c2.json
@@ -0,0 +1,46 @@
+{
+ "type": "c2",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c2",
+ "description": "c2 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/c3.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/c3.json b/samples/group-scaling-v1/mock/artifacts/c3.json
new file mode 100755
index 0000000..60eebe4
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/c3.json
@@ -0,0 +1,46 @@
+{
+ "type": "c3",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c3",
+ "description": "c3 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/c4.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/c4.json b/samples/group-scaling-v1/mock/artifacts/c4.json
new file mode 100755
index 0000000..9190082
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/c4.json
@@ -0,0 +1,46 @@
+{
+ "type": "c4",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c4",
+ "description": "c4 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/composite_application.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/composite_application.json b/samples/group-scaling-v1/mock/artifacts/composite_application.json
new file mode 100644
index 0000000..54dbe33
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/composite_application.json
@@ -0,0 +1,35 @@
+{
+ "applicationId": "appscaling",
+ "alias": "appscaling",
+ "components": {
+ "groups": [
+ {
+ "name": "group2",
+ "alias": "mygroup2",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 2,
+ "cartridges": [
+ {
+ "type": "c2",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "group2c2",
+ "autoscalingPolicy": "autoscale_policy_c2"
+ }
+ },
+ {
+ "type": "c3",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group2c3",
+ "autoscalingPolicy": "autoscale_policy_c3"
+ }
+ }
+ ]
+ }
+ ]
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/artifacts/group1.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/artifacts/group1.json b/samples/group-scaling-v1/mock/artifacts/group1.json
new file mode 100644
index 0000000..65ab8b6
--- /dev/null
+++ b/samples/group-scaling-v1/mock/artifacts/group1.json
@@ -0,0 +1,18 @@
+{
+ "name": "group2",
+ "isGroupScalingEnabled": "true",
+ "cartridges": [
+ "c2",
+ "c3"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "cartridge.c3,cartridge.c2"
+ ],
+ "scalingDependants": [
+ "cartridge.c3, cartridge.c2"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling-v1/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/group-scaling-v1/mock/deploy.sh b/samples/group-scaling-v1/mock/deploy.sh
new file mode 100755
index 0000000..db07ba9
--- /dev/null
+++ b/samples/group-scaling-v1/mock/deploy.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# Create autoscale policy
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy-c1.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy-c2.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy-c3.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy-c4.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+# Deploy c3 cartridge
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/c3.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy c4 cartridge
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/c4.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy c1 cartride
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/c1.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy c2 cartride
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/c2.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy group
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group1.json' -k -v -u admin:admin https://localhost:9443/api/groups
+
+sleep 3
+# Create application
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/composite_application.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 3
+# Deploy application
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/app_deployment_policy.json' -k -v -u admin:admin https://localhost:9443/api/application/appscaling/deploy
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/app_deployment_policy.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/app_deployment_policy.json b/samples/group-scaling/mock/artifacts/app_deployment_policy.json
new file mode 100644
index 0000000..e0b7b99
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/app_deployment_policy.json
@@ -0,0 +1,71 @@
+{
+ "applicationId": "appscaling",
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "mock",
+ "property": [
+ {
+ "name": "region",
+ "value": "RegionOne"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "myc4",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 2
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "group1c1",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 4
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mygroup2",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 2
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/autoscale-policy-c1.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/autoscale-policy-c1.json b/samples/group-scaling/mock/artifacts/autoscale-policy-c1.json
new file mode 100755
index 0000000..78d280c
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/autoscale-policy-c1.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_c1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 80
+ },
+ "memoryConsumption": {
+ "threshold": 80
+ },
+ "loadAverage": {
+ "threshold": 50
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/autoscale-policy-c2.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/autoscale-policy-c2.json b/samples/group-scaling/mock/artifacts/autoscale-policy-c2.json
new file mode 100755
index 0000000..b908013
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/autoscale-policy-c2.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_c2",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 90
+ },
+ "memoryConsumption": {
+ "threshold": 5
+ },
+ "loadAverage": {
+ "threshold": 50
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/autoscale-policy-c3.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/autoscale-policy-c3.json b/samples/group-scaling/mock/artifacts/autoscale-policy-c3.json
new file mode 100755
index 0000000..f2942a0
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/autoscale-policy-c3.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_c3",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 100
+ },
+ "memoryConsumption": {
+ "threshold": 10
+ },
+ "loadAverage": {
+ "threshold": 50
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/autoscale-policy-c4.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/autoscale-policy-c4.json b/samples/group-scaling/mock/artifacts/autoscale-policy-c4.json
new file mode 100755
index 0000000..ce596b4
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/autoscale-policy-c4.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_c4",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 50
+ },
+ "memoryConsumption": {
+ "threshold": 85
+ },
+ "loadAverage": {
+ "threshold": 75
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/c1.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/c1.json b/samples/group-scaling/mock/artifacts/c1.json
new file mode 100755
index 0000000..55408a9
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/c1.json
@@ -0,0 +1,46 @@
+{
+ "type": "c1",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c1",
+ "description": "c1 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/c2.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/c2.json b/samples/group-scaling/mock/artifacts/c2.json
new file mode 100755
index 0000000..99f9a6e
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/c2.json
@@ -0,0 +1,46 @@
+{
+ "type": "c2",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c2",
+ "description": "c2 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/c3.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/c3.json b/samples/group-scaling/mock/artifacts/c3.json
new file mode 100755
index 0000000..60eebe4
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/c3.json
@@ -0,0 +1,46 @@
+{
+ "type": "c3",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c3",
+ "description": "c3 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/c4.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/c4.json b/samples/group-scaling/mock/artifacts/c4.json
new file mode 100755
index 0000000..9190082
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/c4.json
@@ -0,0 +1,46 @@
+{
+ "type": "c4",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c4",
+ "description": "c4 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/composite_application.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/composite_application.json b/samples/group-scaling/mock/artifacts/composite_application.json
new file mode 100644
index 0000000..bfb100b
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/composite_application.json
@@ -0,0 +1,71 @@
+{
+ "applicationId": "appscaling",
+ "alias": "appscaling",
+ "components": {
+ "groups": [
+ {
+ "name": "group1",
+ "alias": "mygroup1",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "groups": [
+ {
+ "name": "group2",
+ "alias": "mygroup2",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 2,
+ "cartridges": [
+ {
+ "type": "c2",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "group2c2",
+ "autoscalingPolicy": "autoscale_policy_c2"
+ }
+ },
+ {
+ "type": "c3",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group2c3",
+ "autoscalingPolicy": "autoscale_policy_c3"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "c1",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "group1c1",
+ "autoscalingPolicy": "autoscale_policy_c1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "c4",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "myc4",
+ "autoscalingPolicy": "autoscale_policy_c4"
+ }
+ }
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.mygroup1,cartridge.myc4"
+ ],
+ "terminationBehaviour": "terminate-dependents"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/artifacts/group1.json
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/artifacts/group1.json b/samples/group-scaling/mock/artifacts/group1.json
new file mode 100644
index 0000000..31a9dcd
--- /dev/null
+++ b/samples/group-scaling/mock/artifacts/group1.json
@@ -0,0 +1,35 @@
+{
+ "name": "group1",
+ "groups": [
+ {
+ "name": "group2",
+ "isGroupScalingEnabled": "true",
+ "cartridges": [
+ "c2",
+ "c3"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "cartridge.c3,cartridge.c2"
+ ],
+ "scalingDependants": [
+ "cartridge.c3, cartridge.c2"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+ }
+ ],
+ "cartridges": [
+ "c1"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "cartridge.c1, group.group2"
+ ],
+ "scalingDependants": [
+ "cartridge.c1, group.group2"
+ ],
+ "terminationBehaviour": "terminate-dependents"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/group-scaling/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/group-scaling/mock/deploy.sh b/samples/group-scaling/mock/deploy.sh
new file mode 100755
index 0000000..df4c236
--- /dev/null
+++ b/samples/group-scaling/mock/deploy.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Create autoscale policy
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy-c1.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy-c2.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy-c3.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy-c4.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+# Deploy c3 cartridge
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/c3.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy c4 cartridge
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/c4.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy c1 cartride
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/c1.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy c2 cartride
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/c2.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy group
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group1.json' -k -v -u admin:admin https://localhost:9443/api/groups
+
+sleep 3
+# Create application
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/composite_application.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 3
+# Deploy application
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/app_deployment_policy.json' -k -v -u admin:admin https://localhost:9443/api/application/appscaling/deploy
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/README.md
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/README.md b/samples/more-complex-app/README.md
new file mode 100644
index 0000000..b3a08ac
--- /dev/null
+++ b/samples/more-complex-app/README.md
@@ -0,0 +1,11 @@
+more-complex-app
+================
+
+i) Using these artifacts you can deploy the more complex application.
+
+ii) In this deployment scenario, it deployed two groups which are nested.
+
+iii) In the groups we have added more that one startup orders.
+
+iv) You can simply run the test.sh and deploy this complex application.
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/ec2/artifacts/application_definition.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/ec2/artifacts/application_definition.json b/samples/more-complex-app/ec2/artifacts/application_definition.json
new file mode 100644
index 0000000..4cfc2a6
--- /dev/null
+++ b/samples/more-complex-app/ec2/artifacts/application_definition.json
@@ -0,0 +1,141 @@
+{
+ "applicationId": "app_boo",
+ "alias": "app_boo_r2",
+ "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": "group7tom1",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "tomcat2",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group7tom2",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ },
+ {
+ "name": "group8",
+ "alias": "mygroup8",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "cartridges": [
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group8tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat2",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group6tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ },
+ {
+ "name": "group8",
+ "alias": "mygroup88",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "groups": [
+ {
+ "name": "group9",
+ "alias": "mygroup9",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "cartridges": [
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group9tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group8tom1",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "tomcat2",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group8tom2",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "mytomcat1",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "mytomcat2",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.mygroup6,group.mygroup88,cartridge.mytomcat1"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/ec2/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/ec2/artifacts/autoscale-policy.json b/samples/more-complex-app/ec2/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/more-complex-app/ec2/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/704db4b7/samples/more-complex-app/ec2/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/ec2/artifacts/deployment-policy.json b/samples/more-complex-app/ec2/artifacts/deployment-policy.json
new file mode 100644
index 0000000..9592a35
--- /dev/null
+++ b/samples/more-complex-app/ec2/artifacts/deployment-policy.json
@@ -0,0 +1,87 @@
+{
+ "applicationId": "app_boo",
+ "applicationPolicy": {
+ "applicationId": "app_boo_r4",
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "ec2",
+ "property": [
+ {
+ "name": "region",
+ "value": "ap-southeast-1"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mytomcat2",
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mytomcat1",
+ "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
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mygroup88",
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/ec2/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/ec2/artifacts/group6c.json b/samples/more-complex-app/ec2/artifacts/group6c.json
new file mode 100755
index 0000000..6a64b18
--- /dev/null
+++ b/samples/more-complex-app/ec2/artifacts/group6c.json
@@ -0,0 +1,34 @@
+{
+ "name": "group6",
+ "groups": [
+ {
+ "name": "group7",
+ "cartridges": [
+ "tomcat1",
+ "tomcat2"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "cartridge.tomcat1,cartridge.tomcat2"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+ },
+ {
+ "name": "group8",
+ "cartridges": [
+ "tomcat1"
+ ]
+ }
+ ],
+ "cartridges": [
+ "tomcat2"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.group7,cartridge.tomcat2,group.group8"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/ec2/artifacts/group8c.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/ec2/artifacts/group8c.json b/samples/more-complex-app/ec2/artifacts/group8c.json
new file mode 100755
index 0000000..3294aec
--- /dev/null
+++ b/samples/more-complex-app/ec2/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/704db4b7/samples/more-complex-app/ec2/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/ec2/artifacts/tomcat.json b/samples/more-complex-app/ec2/artifacts/tomcat.json
new file mode 100755
index 0000000..1779e62
--- /dev/null
+++ b/samples/more-complex-app/ec2/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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/ec2/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/ec2/artifacts/tomcat1.json b/samples/more-complex-app/ec2/artifacts/tomcat1.json
new file mode 100755
index 0000000..9cafdb9
--- /dev/null
+++ b/samples/more-complex-app/ec2/artifacts/tomcat1.json
@@ -0,0 +1,47 @@
+{
+ "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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/ec2/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/ec2/artifacts/tomcat2.json b/samples/more-complex-app/ec2/artifacts/tomcat2.json
new file mode 100755
index 0000000..cf7b0be
--- /dev/null
+++ b/samples/more-complex-app/ec2/artifacts/tomcat2.json
@@ -0,0 +1,47 @@
+{
+ "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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/ec2/deploy.sh b/samples/more-complex-app/ec2/deploy.sh
new file mode 100755
index 0000000..eabe69e
--- /dev/null
+++ b/samples/more-complex-app/ec2/deploy.sh
@@ -0,0 +1,26 @@
+#!/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/groups
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group8c.json' -k -v -u admin:admin https://localhost:9443/api/groups
+
+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 3
+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
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/mock/artifacts/application_definition.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/mock/artifacts/application_definition.json b/samples/more-complex-app/mock/artifacts/application_definition.json
new file mode 100644
index 0000000..4cfc2a6
--- /dev/null
+++ b/samples/more-complex-app/mock/artifacts/application_definition.json
@@ -0,0 +1,141 @@
+{
+ "applicationId": "app_boo",
+ "alias": "app_boo_r2",
+ "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": "group7tom1",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "tomcat2",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group7tom2",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ },
+ {
+ "name": "group8",
+ "alias": "mygroup8",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "cartridges": [
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group8tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat2",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group6tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ },
+ {
+ "name": "group8",
+ "alias": "mygroup88",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "groups": [
+ {
+ "name": "group9",
+ "alias": "mygroup9",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "cartridges": [
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group9tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group8tom1",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "tomcat2",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group8tom2",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "mytomcat1",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "mytomcat2",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.mygroup6,group.mygroup88,cartridge.mytomcat1"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/mock/artifacts/autoscale-policy.json b/samples/more-complex-app/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/more-complex-app/mock/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/704db4b7/samples/more-complex-app/mock/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/mock/artifacts/deployment-policy.json b/samples/more-complex-app/mock/artifacts/deployment-policy.json
new file mode 100644
index 0000000..f432026
--- /dev/null
+++ b/samples/more-complex-app/mock/artifacts/deployment-policy.json
@@ -0,0 +1,87 @@
+{
+ "applicationId": "app_boo",
+ "applicationPolicy": {
+ "applicationId": "app_boo_r4",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "mock",
+ "property": [
+ {
+ "name": "region",
+ "value": "RegionOne"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mytomcat2",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mytomcat1",
+ "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
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mygroup88",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/mock/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/mock/artifacts/group6c.json b/samples/more-complex-app/mock/artifacts/group6c.json
new file mode 100755
index 0000000..6a64b18
--- /dev/null
+++ b/samples/more-complex-app/mock/artifacts/group6c.json
@@ -0,0 +1,34 @@
+{
+ "name": "group6",
+ "groups": [
+ {
+ "name": "group7",
+ "cartridges": [
+ "tomcat1",
+ "tomcat2"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "cartridge.tomcat1,cartridge.tomcat2"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+ },
+ {
+ "name": "group8",
+ "cartridges": [
+ "tomcat1"
+ ]
+ }
+ ],
+ "cartridges": [
+ "tomcat2"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.group7,cartridge.tomcat2,group.group8"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/mock/artifacts/group8c.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/mock/artifacts/group8c.json b/samples/more-complex-app/mock/artifacts/group8c.json
new file mode 100755
index 0000000..3294aec
--- /dev/null
+++ b/samples/more-complex-app/mock/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/704db4b7/samples/more-complex-app/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/mock/artifacts/tomcat.json b/samples/more-complex-app/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..96a0c1e
--- /dev/null
+++ b/samples/more-complex-app/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/mock/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/mock/artifacts/tomcat1.json b/samples/more-complex-app/mock/artifacts/tomcat1.json
new file mode 100755
index 0000000..eb57815
--- /dev/null
+++ b/samples/more-complex-app/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/mock/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/mock/artifacts/tomcat2.json b/samples/more-complex-app/mock/artifacts/tomcat2.json
new file mode 100755
index 0000000..63b4429
--- /dev/null
+++ b/samples/more-complex-app/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/more-complex-app/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/more-complex-app/mock/deploy.sh b/samples/more-complex-app/mock/deploy.sh
new file mode 100755
index 0000000..3d371e6
--- /dev/null
+++ b/samples/more-complex-app/mock/deploy.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Create autoscale policy
+curl -X POST -H "Content-Type: application/json" -d @'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 @'tomcat.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy tomcat1 cartride
+curl -X POST -H "Content-Type: application/json" -d @'tomcat1.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy tomcat2 cartride
+curl -X POST -H "Content-Type: application/json" -d @'tomcat2.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+# Deploy group
+curl -X POST -H "Content-Type: application/json" -d @'group6c.json' -k -v -u admin:admin https://localhost:9443/api/groups
+
+curl -X POST -H "Content-Type: application/json" -d @'group8c.json' -k -v -u admin:admin https://localhost:9443/api/groups
+
+# GET group
+#curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin https://localhost:9443/api/groups/group6
+
+
+sleep 5
+# Create application
+curl -X POST -H "Content-Type: application/json" -d @'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/myapp1265
+
+# Deploy application
+#curl -X POST -H "Content-Type: application/json" -d@'deployment-policy.json' -k -v -u admin:admin https://localhost:9443/api/applicationDeployments
+
+# Undeploy application
+#curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://localhost:9443/api/applicationDeployments/myapp1265
+
+# Delete application
+#curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://localhost:9443/api/applications/app_boo
+
+sleep 3
+#curl -X POST -H "Content-Type: application/json" -d@'grouping/dep_single_group.json' -k -v -u admin:admin https://localhost:9443/api/application/app_boo/deploy
+curl -X POST -H "Content-Type: application/json" -d@'deployment-policy.json' -k -v -u admin:admin https://localhost:9443/api/applications/app_boo/deploy
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/README.md
----------------------------------------------------------------------
diff --git a/samples/nested-group/README.md b/samples/nested-group/README.md
new file mode 100644
index 0000000..03c5e4e
--- /dev/null
+++ b/samples/nested-group/README.md
@@ -0,0 +1,8 @@
+nested-group
+============
+
+i) This artifact supports for the nested group deployment.
+
+ii) Once you browse the group6c.json file you can see that the group7 is nested inside the group6.
+
+iii) You can simply run the test.sh script file and deploy the necessary nested group artifacts.
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/nested-group/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/nested-group/deploy.sh b/samples/nested-group/deploy.sh
new file mode 100755
index 0000000..e00fd4a
--- /dev/null
+++ b/samples/nested-group/deploy.sh
@@ -0,0 +1,25 @@
+#!/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/group
+
+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/704db4b7/samples/nested-group/ec2/README.md
----------------------------------------------------------------------
diff --git a/samples/nested-group/ec2/README.md b/samples/nested-group/ec2/README.md
new file mode 100644
index 0000000..03c5e4e
--- /dev/null
+++ b/samples/nested-group/ec2/README.md
@@ -0,0 +1,8 @@
+nested-group
+============
+
+i) This artifact supports for the nested group deployment.
+
+ii) Once you browse the group6c.json file you can see that the group7 is nested inside the group6.
+
+iii) You can simply run the test.sh script file and deploy the necessary nested group artifacts.
[4/4] stratos git commit: Moving sample applications to stratos git
repository, refactoring the folder structure, formatting json files
Posted by im...@apache.org.
Moving sample applications to stratos git repository, refactoring the folder structure, formatting json files
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/704db4b7
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/704db4b7
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/704db4b7
Branch: refs/heads/master
Commit: 704db4b7ca71e91e780b1ddfa4a535af5d51bd5f
Parents: 7795f03
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Jan 11 19:14:30 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Jan 11 19:14:31 2015 +0530
----------------------------------------------------------------------
samples/README.md | 6 +
samples/complex-app/README.md | 6 +
.../ec2/artifacts/application_definition.json | 98 +++++++++++++
.../ec2/artifacts/autoscale-policy.json | 14 ++
.../ec2/artifacts/deployment-policy.json | 71 ++++++++++
samples/complex-app/ec2/artifacts/group6c.json | 21 +++
samples/complex-app/ec2/artifacts/group8c.json | 21 +++
samples/complex-app/ec2/artifacts/tomcat.json | 46 ++++++
samples/complex-app/ec2/artifacts/tomcat1.json | 47 +++++++
samples/complex-app/ec2/artifacts/tomcat2.json | 47 +++++++
samples/complex-app/ec2/deploy.sh | 36 +++++
.../mock/artifacts/application_definition.json | 98 +++++++++++++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/deployment-policy.json | 71 ++++++++++
samples/complex-app/mock/artifacts/group6c.json | 21 +++
samples/complex-app/mock/artifacts/group8c.json | 21 +++
samples/complex-app/mock/artifacts/tomcat.json | 46 ++++++
samples/complex-app/mock/artifacts/tomcat1.json | 52 +++++++
samples/complex-app/mock/artifacts/tomcat2.json | 52 +++++++
samples/complex-app/mock/deploy.sh | 35 +++++
.../ec2/artifacts/app_dependency_scaling.json | 32 +++++
.../ec2/artifacts/autoscale-policy.json | 14 ++
.../ec2/artifacts/dep_dependency_scaling.json | 56 ++++++++
.../sample-cartridges/ec2/artifacts/tomcat.json | 46 ++++++
.../ec2/artifacts/tomcat1.json | 47 +++++++
.../sample-cartridges/ec2/deploy.sh | 14 ++
.../mock/artifacts/app_dependency_scaling.json | 32 +++++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/dep_dependency_scaling.json | 55 ++++++++
.../sample-cartridges/mock/artifacts/php.json | 46 ++++++
.../mock/artifacts/tomcat.json | 46 ++++++
.../sample-cartridges/mock/deploy.sh | 19 +++
.../artifacts/app_dependency_scaling.json | 32 +++++
.../openstack/artifacts/autoscale-policy.json | 14 ++
.../artifacts/dep_dependency_scaling.json | 56 ++++++++
.../openstack/artifacts/tomcat.json | 51 +++++++
.../openstack/artifacts/tomcat1.json | 52 +++++++
.../sample-cartridges/openstack/deploy.sh | 19 +++
.../ec2/artifacts/app_single_group.json | 52 +++++++
.../ec2/artifacts/autoscale-policy.json | 14 ++
.../ec2/artifacts/dep_single_group.json | 56 ++++++++
.../sample-groups/ec2/artifacts/esb.json | 40 ++++++
.../sample-groups/ec2/artifacts/group6c.json | 15 ++
.../sample-groups/ec2/artifacts/php.json | 46 ++++++
.../sample-groups/ec2/artifacts/tomcat.json | 46 ++++++
.../sample-groups/ec2/deploy.sh | 17 +++
.../mock/artifacts/app_single_group.json | 52 +++++++
.../mock/artifacts/app_single_group.json-para | 46 ++++++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/dep_single_group.json | 56 ++++++++
.../sample-groups/mock/artifacts/esb.json | 46 ++++++
.../sample-groups/mock/artifacts/group6c.json | 15 ++
.../sample-groups/mock/artifacts/php.json | 52 +++++++
.../sample-groups/mock/artifacts/tomcat.json | 52 +++++++
.../sample-groups/mock/deploy.sh | 18 +++
.../mock/artifacts/app_deployment_policy.json | 67 +++++++++
.../mock/artifacts/autoscale-policy-c1.json | 14 ++
.../mock/artifacts/autoscale-policy-c2.json | 14 ++
.../mock/artifacts/autoscale-policy-c3.json | 14 ++
.../mock/artifacts/autoscale-policy-c4.json | 14 ++
samples/group-scaling-v1/mock/artifacts/c1.json | 46 ++++++
samples/group-scaling-v1/mock/artifacts/c2.json | 46 ++++++
samples/group-scaling-v1/mock/artifacts/c3.json | 46 ++++++
samples/group-scaling-v1/mock/artifacts/c4.json | 46 ++++++
.../mock/artifacts/composite_application.json | 35 +++++
.../group-scaling-v1/mock/artifacts/group1.json | 18 +++
samples/group-scaling-v1/mock/deploy.sh | 31 ++++
.../mock/artifacts/app_deployment_policy.json | 71 ++++++++++
.../mock/artifacts/autoscale-policy-c1.json | 14 ++
.../mock/artifacts/autoscale-policy-c2.json | 14 ++
.../mock/artifacts/autoscale-policy-c3.json | 14 ++
.../mock/artifacts/autoscale-policy-c4.json | 14 ++
samples/group-scaling/mock/artifacts/c1.json | 46 ++++++
samples/group-scaling/mock/artifacts/c2.json | 46 ++++++
samples/group-scaling/mock/artifacts/c3.json | 46 ++++++
samples/group-scaling/mock/artifacts/c4.json | 46 ++++++
.../mock/artifacts/composite_application.json | 71 ++++++++++
.../group-scaling/mock/artifacts/group1.json | 35 +++++
samples/group-scaling/mock/deploy.sh | 30 ++++
samples/more-complex-app/README.md | 11 ++
.../ec2/artifacts/application_definition.json | 141 +++++++++++++++++++
.../ec2/artifacts/autoscale-policy.json | 14 ++
.../ec2/artifacts/deployment-policy.json | 87 ++++++++++++
.../more-complex-app/ec2/artifacts/group6c.json | 34 +++++
.../more-complex-app/ec2/artifacts/group8c.json | 23 +++
.../more-complex-app/ec2/artifacts/tomcat.json | 46 ++++++
.../more-complex-app/ec2/artifacts/tomcat1.json | 47 +++++++
.../more-complex-app/ec2/artifacts/tomcat2.json | 47 +++++++
samples/more-complex-app/ec2/deploy.sh | 26 ++++
.../mock/artifacts/application_definition.json | 141 +++++++++++++++++++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/deployment-policy.json | 87 ++++++++++++
.../mock/artifacts/group6c.json | 34 +++++
.../mock/artifacts/group8c.json | 23 +++
.../more-complex-app/mock/artifacts/tomcat.json | 52 +++++++
.../mock/artifacts/tomcat1.json | 52 +++++++
.../mock/artifacts/tomcat2.json | 52 +++++++
samples/more-complex-app/mock/deploy.sh | 44 ++++++
samples/nested-group/README.md | 8 ++
samples/nested-group/deploy.sh | 25 ++++
samples/nested-group/ec2/README.md | 8 ++
.../ec2/artifacts/application_definition.json | 62 ++++++++
.../ec2/artifacts/autoscale-policy.json | 14 ++
.../ec2/artifacts/deployment-policy.json | 55 ++++++++
samples/nested-group/ec2/artifacts/group6c.json | 21 +++
samples/nested-group/ec2/artifacts/tomcat.json | 46 ++++++
samples/nested-group/ec2/artifacts/tomcat1.json | 47 +++++++
samples/nested-group/ec2/artifacts/tomcat2.json | 47 +++++++
samples/nested-group/ec2/deploy.sh | 25 ++++
.../mock/artifacts/application_definition.json | 62 ++++++++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/deployment-policy.json | 55 ++++++++
.../nested-group/mock/artifacts/group6c.json | 21 +++
samples/nested-group/mock/artifacts/tomcat.json | 52 +++++++
.../nested-group/mock/artifacts/tomcat1.json | 52 +++++++
.../nested-group/mock/artifacts/tomcat2.json | 52 +++++++
samples/single-cartridge/README.md | 8 ++
.../ec2/artifacts/app_single_group.json | 19 +++
.../ec2/artifacts/autoscale-policy.json | 14 ++
.../ec2/artifacts/dep_single_group.json | 41 ++++++
.../single-cartridge/ec2/artifacts/tomcat.json | 46 ++++++
samples/single-cartridge/ec2/deploy.sh | 11 ++
.../mock/artifacts/app_single_group.json | 18 +++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/dep_single_group.json | 42 ++++++
.../single-cartridge/mock/artifacts/tomcat.json | 52 +++++++
samples/single-cartridge/mock/deploy.sh | 15 ++
.../openstack/artifacts/app_single_group.json | 18 +++
.../openstack/artifacts/autoscale-policy.json | 14 ++
.../openstack/artifacts/dep_single_group.json | 41 ++++++
.../openstack/artifacts/tomcat.json | 52 +++++++
samples/single-cartridge/openstack/deploy.sh | 12 ++
.../mock/artifacts/app_single_group.json | 26 ++++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/dep_single_group.json | 41 ++++++
.../mock/artifacts/group6c.json | 11 ++
.../mock/artifacts/tomcat.json | 52 +++++++
.../single-group-group-scaling/mock/deploy.sh | 16 +++
samples/single-group-v1/README.md | 7 +
.../ec2/artifacts/app_single_group.json | 43 ++++++
.../ec2/artifacts/app_single_group.json-para | 46 ++++++
.../ec2/artifacts/autoscale-policy.json | 14 ++
.../ec2/artifacts/dep_single_group.json | 56 ++++++++
.../single-group-v1/ec2/artifacts/group6c.json | 11 ++
.../single-group-v1/ec2/artifacts/tomcat.json | 46 ++++++
.../single-group-v1/ec2/artifacts/tomcat1.json | 47 +++++++
.../single-group-v1/ec2/artifacts/tomcat2.json | 47 +++++++
samples/single-group-v1/ec2/deploy.sh | 16 +++
.../mock/artifacts/app_single_group.json | 43 ++++++
.../mock/artifacts/app_single_group.json-para | 46 ++++++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/dep_single_group.json | 56 ++++++++
.../single-group-v1/mock/artifacts/group6c.json | 11 ++
.../single-group-v1/mock/artifacts/tomcat.json | 46 ++++++
.../single-group-v1/mock/artifacts/tomcat1.json | 52 +++++++
.../single-group-v1/mock/artifacts/tomcat2.json | 52 +++++++
samples/single-group-v1/mock/deploy.sh | 16 +++
samples/single-group-v2/README.md | 7 +
.../ec2/artifacts/app_single_group.json-para | 46 ++++++
samples/single-group-v2/ec2/deploy.sh | 17 +++
.../mock/artifacts/app_single_group.json | 52 +++++++
.../mock/artifacts/app_single_group.json-para | 46 ++++++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/dep_single_group.json | 56 ++++++++
.../single-group-v2/mock/artifacts/group6c.json | 14 ++
.../single-group-v2/mock/artifacts/tomcat.json | 52 +++++++
.../single-group-v2/mock/artifacts/tomcat1.json | 52 +++++++
.../single-group-v2/mock/artifacts/tomcat2.json | 52 +++++++
samples/single-group-v2/mock/deploy.sh | 17 +++
.../ec2/artifacts/app_single_group.json-para | 46 ++++++
samples/single-group-v3/ec2/deploy.sh | 15 ++
.../mock/artifacts/app_single_group.json | 27 ++++
.../mock/artifacts/app_single_group.json-para | 46 ++++++
.../mock/artifacts/autoscale-policy.json | 14 ++
.../mock/artifacts/dep_single_group.json | 41 ++++++
.../single-group-v3/mock/artifacts/group6c.json | 11 ++
.../single-group-v3/mock/artifacts/tomcat.json | 52 +++++++
.../single-group-v3/mock/artifacts/tomcat1.json | 52 +++++++
.../single-group-v3/mock/artifacts/tomcat2.json | 52 +++++++
samples/single-group-v3/mock/deploy.sh | 15 ++
180 files changed, 6626 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/README.md
----------------------------------------------------------------------
diff --git a/samples/README.md b/samples/README.md
new file mode 100644
index 0000000..370b030
--- /dev/null
+++ b/samples/README.md
@@ -0,0 +1,6 @@
+Stratos Sample Applications
+===========================
+
+This folder contains sample applications which demonstrate stratos features. In each sample there is a set of
+artifacts and a deploy.sh file. Run the deploy.sh file to deploy the sample application in a stratos instance
+running on the localhost.
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/README.md
----------------------------------------------------------------------
diff --git a/samples/complex-app/README.md b/samples/complex-app/README.md
new file mode 100644
index 0000000..117e787
--- /dev/null
+++ b/samples/complex-app/README.md
@@ -0,0 +1,6 @@
+complex-app
+===========
+
+- Using these artifacts you can deploy the complex application.
+- In this deployment scenario, it deployed two groups which are nested.
+- Run the deploy.sh to deploy this complex application.
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/ec2/artifacts/application_definition.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/ec2/artifacts/application_definition.json b/samples/complex-app/ec2/artifacts/application_definition.json
new file mode 100644
index 0000000..9424b2f
--- /dev/null
+++ b/samples/complex-app/ec2/artifacts/application_definition.json
@@ -0,0 +1,98 @@
+{
+ "applicationId": "app_boo",
+ "alias": "app_boo_r2",
+ "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"
+ }
+ }
+ ]
+ },
+ {
+ "name": "group8",
+ "alias": "mygroup8",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "groups": [
+ {
+ "name": "group9",
+ "alias": "mygroup9",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "cartridges": [
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group9tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat2",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group8tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.mygroup8,group.mygroup6,cartridge.mytomcat"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/ec2/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/ec2/artifacts/autoscale-policy.json b/samples/complex-app/ec2/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/complex-app/ec2/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/704db4b7/samples/complex-app/ec2/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/ec2/artifacts/deployment-policy.json b/samples/complex-app/ec2/artifacts/deployment-policy.json
new file mode 100644
index 0000000..2aac579
--- /dev/null
+++ b/samples/complex-app/ec2/artifacts/deployment-policy.json
@@ -0,0 +1,71 @@
+{
+ "applicationId": "app_boo",
+ "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
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mygroup8",
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/ec2/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/ec2/artifacts/group6c.json b/samples/complex-app/ec2/artifacts/group6c.json
new file mode 100755
index 0000000..74fea79
--- /dev/null
+++ b/samples/complex-app/ec2/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/704db4b7/samples/complex-app/ec2/artifacts/group8c.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/ec2/artifacts/group8c.json b/samples/complex-app/ec2/artifacts/group8c.json
new file mode 100755
index 0000000..fac2096
--- /dev/null
+++ b/samples/complex-app/ec2/artifacts/group8c.json
@@ -0,0 +1,21 @@
+{
+ "name": "group8",
+ "groups": [
+ {
+ "name": "group9",
+ "cartridges": [
+ "tomcat1"
+ ]
+ }
+ ],
+ "cartridges": [
+ "tomcat2"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.group9,cartridge.tomcat2"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/ec2/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/ec2/artifacts/tomcat.json b/samples/complex-app/ec2/artifacts/tomcat.json
new file mode 100755
index 0000000..1779e62
--- /dev/null
+++ b/samples/complex-app/ec2/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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/ec2/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/ec2/artifacts/tomcat1.json b/samples/complex-app/ec2/artifacts/tomcat1.json
new file mode 100755
index 0000000..9cafdb9
--- /dev/null
+++ b/samples/complex-app/ec2/artifacts/tomcat1.json
@@ -0,0 +1,47 @@
+{
+ "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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/ec2/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/ec2/artifacts/tomcat2.json b/samples/complex-app/ec2/artifacts/tomcat2.json
new file mode 100755
index 0000000..cf7b0be
--- /dev/null
+++ b/samples/complex-app/ec2/artifacts/tomcat2.json
@@ -0,0 +1,47 @@
+{
+ "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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/complex-app/ec2/deploy.sh b/samples/complex-app/ec2/deploy.sh
new file mode 100755
index 0000000..371b6d4
--- /dev/null
+++ b/samples/complex-app/ec2/deploy.sh
@@ -0,0 +1,36 @@
+#!/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/groups
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group8c.json' -k -v -u admin:admin https://localhost:9443/api/groups
+
+# GET group
+#curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin https://localhost:9443/api/groups/group6
+
+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/myapp1265
+
+# Deploy application
+
+sleep 3
+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
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/mock/artifacts/application_definition.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/mock/artifacts/application_definition.json b/samples/complex-app/mock/artifacts/application_definition.json
new file mode 100644
index 0000000..9424b2f
--- /dev/null
+++ b/samples/complex-app/mock/artifacts/application_definition.json
@@ -0,0 +1,98 @@
+{
+ "applicationId": "app_boo",
+ "alias": "app_boo_r2",
+ "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"
+ }
+ }
+ ]
+ },
+ {
+ "name": "group8",
+ "alias": "mygroup8",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "groups": [
+ {
+ "name": "group9",
+ "alias": "mygroup9",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 1,
+ "cartridges": [
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group9tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat2",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "group8tom",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.mygroup8,group.mygroup6,cartridge.mytomcat"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/mock/artifacts/autoscale-policy.json b/samples/complex-app/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..e6572e7
--- /dev/null
+++ b/samples/complex-app/mock/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/704db4b7/samples/complex-app/mock/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/mock/artifacts/deployment-policy.json b/samples/complex-app/mock/artifacts/deployment-policy.json
new file mode 100644
index 0000000..a2d0e3a
--- /dev/null
+++ b/samples/complex-app/mock/artifacts/deployment-policy.json
@@ -0,0 +1,71 @@
+{
+ "applicationId": "app_boo",
+ "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
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mygroup8",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/mock/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/mock/artifacts/group6c.json b/samples/complex-app/mock/artifacts/group6c.json
new file mode 100755
index 0000000..74fea79
--- /dev/null
+++ b/samples/complex-app/mock/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/704db4b7/samples/complex-app/mock/artifacts/group8c.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/mock/artifacts/group8c.json b/samples/complex-app/mock/artifacts/group8c.json
new file mode 100755
index 0000000..fac2096
--- /dev/null
+++ b/samples/complex-app/mock/artifacts/group8c.json
@@ -0,0 +1,21 @@
+{
+ "name": "group8",
+ "groups": [
+ {
+ "name": "group9",
+ "cartridges": [
+ "tomcat1"
+ ]
+ }
+ ],
+ "cartridges": [
+ "tomcat2"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "group.group9,cartridge.tomcat2"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/mock/artifacts/tomcat.json b/samples/complex-app/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..7237b20
--- /dev/null
+++ b/samples/complex-app/mock/artifacts/tomcat.json
@@ -0,0 +1,46 @@
+{
+ "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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/mock/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/mock/artifacts/tomcat1.json b/samples/complex-app/mock/artifacts/tomcat1.json
new file mode 100755
index 0000000..eb57815
--- /dev/null
+++ b/samples/complex-app/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/mock/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/mock/artifacts/tomcat2.json b/samples/complex-app/mock/artifacts/tomcat2.json
new file mode 100755
index 0000000..63b4429
--- /dev/null
+++ b/samples/complex-app/mock/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": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/complex-app/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/complex-app/mock/deploy.sh b/samples/complex-app/mock/deploy.sh
new file mode 100755
index 0000000..9e9ffcd
--- /dev/null
+++ b/samples/complex-app/mock/deploy.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# Create autoscale policy
+curl -X POST -H "Content-Type: application/json" -d @'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 @'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/groups
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/group8c.json' -k -v -u admin:admin https://localhost:9443/api/groups
+
+# GET group
+#curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin https://localhost:9443/api/groups/group6
+
+
+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/myapp1265
+
+# Deploy application
+
+sleep 3
+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
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/ec2/artifacts/app_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/ec2/artifacts/app_dependency_scaling.json b/samples/dependency-scaling/sample-cartridges/ec2/artifacts/app_dependency_scaling.json
new file mode 100644
index 0000000..97b53be
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/ec2/artifacts/app_dependency_scaling.json
@@ -0,0 +1,32 @@
+{
+ "applicationId": "app_group_v1",
+ "alias": "mytestapp1",
+ "components": {
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "mytomcat1",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ],
+ "dependencies": {
+ "scalingDependants": [
+ "cartridge.mytomcat, cartridge.mytomcat1"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/ec2/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/ec2/artifacts/autoscale-policy.json b/samples/dependency-scaling/sample-cartridges/ec2/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..bf2499e
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/ec2/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 40
+ },
+ "memoryConsumption": {
+ "threshold": 70
+ },
+ "loadAverage": {
+ "threshold": 100
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/ec2/artifacts/dep_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/ec2/artifacts/dep_dependency_scaling.json b/samples/dependency-scaling/sample-cartridges/ec2/artifacts/dep_dependency_scaling.json
new file mode 100644
index 0000000..cc08ec3
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/ec2/artifacts/dep_dependency_scaling.json
@@ -0,0 +1,56 @@
+{
+ "applicationId": "app_group_v1",
+ "applicationPolicy": {
+ "applicationId": "app_group_v1",
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "ec2",
+ "property": [
+ {
+ "name": "region",
+ "value": "ap-southeast-1"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mytomcat",
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mytomcat1",
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 10
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/ec2/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/ec2/artifacts/tomcat.json b/samples/dependency-scaling/sample-cartridges/ec2/artifacts/tomcat.json
new file mode 100755
index 0000000..1779e62
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/ec2/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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/ec2/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/ec2/artifacts/tomcat1.json b/samples/dependency-scaling/sample-cartridges/ec2/artifacts/tomcat1.json
new file mode 100755
index 0000000..9cafdb9
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/ec2/artifacts/tomcat1.json
@@ -0,0 +1,47 @@
+{
+ "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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/ec2/deploy.sh b/samples/dependency-scaling/sample-cartridges/ec2/deploy.sh
new file mode 100755
index 0000000..5a72510
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/ec2/deploy.sh
@@ -0,0 +1,14 @@
+#!/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
+
+sleep 2
+
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/app_dependency_scaling.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 2
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_dependency_scaling.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/704db4b7/samples/dependency-scaling/sample-cartridges/mock/artifacts/app_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/mock/artifacts/app_dependency_scaling.json b/samples/dependency-scaling/sample-cartridges/mock/artifacts/app_dependency_scaling.json
new file mode 100644
index 0000000..e875a20
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/mock/artifacts/app_dependency_scaling.json
@@ -0,0 +1,32 @@
+{
+ "applicationId": "app_group_v1",
+ "alias": "mytestapp1",
+ "components": {
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "php",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "myphp",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ],
+ "dependencies": {
+ "scalingDependants": [
+ "cartridge.mytomcat, cartridge.myphp"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/mock/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/mock/artifacts/autoscale-policy.json b/samples/dependency-scaling/sample-cartridges/mock/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..f065167
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/mock/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 40
+ },
+ "memoryConsumption": {
+ "threshold": 40
+ },
+ "loadAverage": {
+ "threshold": 40
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/mock/artifacts/dep_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/mock/artifacts/dep_dependency_scaling.json b/samples/dependency-scaling/sample-cartridges/mock/artifacts/dep_dependency_scaling.json
new file mode 100644
index 0000000..05b3a04
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/mock/artifacts/dep_dependency_scaling.json
@@ -0,0 +1,55 @@
+{
+ "applicationId": "app_group_v1",
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "mock",
+ "property": [
+ {
+ "name": "region",
+ "value": "RegionOne"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mytomcat",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "myphp",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 10
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/mock/artifacts/php.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/mock/artifacts/php.json b/samples/dependency-scaling/sample-cartridges/mock/artifacts/php.json
new file mode 100755
index 0000000..272e6e8
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/mock/artifacts/php.json
@@ -0,0 +1,46 @@
+{
+ "type": "php",
+ "provider": "apache",
+ "category": "data",
+ "host": "isuruh.lk",
+ "displayName": "php",
+ "description": "php Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/mock/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/mock/artifacts/tomcat.json b/samples/dependency-scaling/sample-cartridges/mock/artifacts/tomcat.json
new file mode 100755
index 0000000..f2c9d5b
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/mock/artifacts/tomcat.json
@@ -0,0 +1,46 @@
+{
+ "type": "tomcat",
+ "provider": "apache",
+ "category": "data",
+ "host": "isuruh.lk",
+ "displayName": "tomcatdisplayName",
+ "description": "tomcat Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "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": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/mock/deploy.sh b/samples/dependency-scaling/sample-cartridges/mock/deploy.sh
new file mode 100755
index 0000000..eb4caba
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/mock/deploy.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+echo "Adding autoscaling policy..."
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+echo "Adding tomcat cartridge..."
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+echo "Adding php cartridge..."
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/php.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+sleep 3
+echo "Creating application..."
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/app_dependency_scaling.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 3
+echo "Deploying application..."
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_dependency_scaling.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/704db4b7/samples/dependency-scaling/sample-cartridges/openstack/artifacts/app_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/openstack/artifacts/app_dependency_scaling.json b/samples/dependency-scaling/sample-cartridges/openstack/artifacts/app_dependency_scaling.json
new file mode 100644
index 0000000..97b53be
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/openstack/artifacts/app_dependency_scaling.json
@@ -0,0 +1,32 @@
+{
+ "applicationId": "app_group_v1",
+ "alias": "mytestapp1",
+ "components": {
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "tomcat1",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "mytomcat1",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ],
+ "dependencies": {
+ "scalingDependants": [
+ "cartridge.mytomcat, cartridge.mytomcat1"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/openstack/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/openstack/artifacts/autoscale-policy.json b/samples/dependency-scaling/sample-cartridges/openstack/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..bf2499e
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/openstack/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 40
+ },
+ "memoryConsumption": {
+ "threshold": 70
+ },
+ "loadAverage": {
+ "threshold": 100
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/openstack/artifacts/dep_dependency_scaling.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/openstack/artifacts/dep_dependency_scaling.json b/samples/dependency-scaling/sample-cartridges/openstack/artifacts/dep_dependency_scaling.json
new file mode 100644
index 0000000..67fdcc1
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/openstack/artifacts/dep_dependency_scaling.json
@@ -0,0 +1,56 @@
+{
+ "applicationId": "app_group_v1",
+ "applicationPolicy": {
+ "applicationId": "app_group_v1",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "openstack",
+ "property": [
+ {
+ "name": "region",
+ "value": "RegionOne"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mytomcat",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mytomcat1",
+ "networkPartition": [
+ {
+ "id": "openstack_R1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 10
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/openstack/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/openstack/artifacts/tomcat.json b/samples/dependency-scaling/sample-cartridges/openstack/artifacts/tomcat.json
new file mode 100755
index 0000000..39afc04
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/openstack/artifacts/tomcat.json
@@ -0,0 +1,51 @@
+{
+ "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/a63609be-61df-436f-80bc-d2b6068a4c3a",
+ "networkInterfaces": [
+ {
+ "name": "network-non-routable",
+ "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+ }
+ ],
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+ },
+ {
+ "name": "keyPair",
+ "value": "lahiru-key"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/openstack/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/openstack/artifacts/tomcat1.json b/samples/dependency-scaling/sample-cartridges/openstack/artifacts/tomcat1.json
new file mode 100755
index 0000000..3976048
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/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/a63609be-61df-436f-80bc-d2b6068a4c3a",
+ "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": "lahiru-key"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-cartridges/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-cartridges/openstack/deploy.sh b/samples/dependency-scaling/sample-cartridges/openstack/deploy.sh
new file mode 100755
index 0000000..7aef755
--- /dev/null
+++ b/samples/dependency-scaling/sample-cartridges/openstack/deploy.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+echo "Adding autoscaling policy..."
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/autoscale-policy.json' -k -v -u admin:admin https://localhost:9443/api/autoscalingPolicies
+
+echo "Adding tomcat cartridge..."
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+echo "Adding tomcat1 cartridge..."
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/tomcat1.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+
+sleep 2
+echo "Creating application..."
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/app_dependency_scaling.json' -k -v -u admin:admin https://localhost:9443/api/applications
+
+sleep 2
+echo "Deploying application..."
+curl -X POST -H "Content-Type: application/json" -d@'artifacts/dep_dependency_scaling.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/704db4b7/samples/dependency-scaling/sample-groups/ec2/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/ec2/artifacts/app_single_group.json b/samples/dependency-scaling/sample-groups/ec2/artifacts/app_single_group.json
new file mode 100644
index 0000000..d29a191
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/ec2/artifacts/app_single_group.json
@@ -0,0 +1,52 @@
+{
+ "applicationId": "app_group_v2",
+ "alias": "mytestapp1",
+ "components": {
+ "groups": [
+ {
+ "name": "group6",
+ "alias": "mygroup6",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 2,
+ "cartridges": [
+ {
+ "type": "esb",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "esbgroup6",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "php",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "phpgroup6",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ],
+ "dependencies": {
+ "scalingDependants": [
+ "group.mygroup6,cartridge.mytomcat"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/ec2/artifacts/autoscale-policy.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/ec2/artifacts/autoscale-policy.json b/samples/dependency-scaling/sample-groups/ec2/artifacts/autoscale-policy.json
new file mode 100755
index 0000000..d1d3134
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/ec2/artifacts/autoscale-policy.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscale_policy_1",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 50
+ },
+ "memoryConsumption": {
+ "threshold": 70
+ },
+ "loadAverage": {
+ "threshold": 1000
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/ec2/artifacts/dep_single_group.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/ec2/artifacts/dep_single_group.json b/samples/dependency-scaling/sample-groups/ec2/artifacts/dep_single_group.json
new file mode 100644
index 0000000..1e927ca
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/ec2/artifacts/dep_single_group.json
@@ -0,0 +1,56 @@
+{
+ "applicationId": "app_group_v2",
+ "applicationPolicy": {
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "activeByDefault": "true",
+ "partitions": [
+ {
+ "id": "P1",
+ "provider": "ec2",
+ "property": [
+ {
+ "name": "region",
+ "value": "ap-southeast-1"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "childPolicies": [
+ {
+ "alias": "mytomcat",
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "alias": "mygroup6",
+ "networkPartition": [
+ {
+ "id": "EC2-P1",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "P1",
+ "max": 5
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/ec2/artifacts/esb.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/ec2/artifacts/esb.json b/samples/dependency-scaling/sample-groups/ec2/artifacts/esb.json
new file mode 100755
index 0000000..2a44e75
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/ec2/artifacts/esb.json
@@ -0,0 +1,40 @@
+{
+ "type": "esb",
+ "provider": "wso2",
+ "category": "data",
+ "host": "isuruh.lk",
+ "displayName": "esb",
+ "description": "esb Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/ec2/artifacts/group6c.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/ec2/artifacts/group6c.json b/samples/dependency-scaling/sample-groups/ec2/artifacts/group6c.json
new file mode 100644
index 0000000..d11c8fc
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/ec2/artifacts/group6c.json
@@ -0,0 +1,15 @@
+{
+ "name": "group6",
+ "isGroupScalingEnabled": "true",
+ "cartridges": [
+ "esb",
+ "php"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ "cartridge.esb,cartridge.php"
+ ],
+ "terminationBehaviour": "terminate-all"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/ec2/artifacts/php.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/ec2/artifacts/php.json b/samples/dependency-scaling/sample-groups/ec2/artifacts/php.json
new file mode 100755
index 0000000..008c8ff
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/ec2/artifacts/php.json
@@ -0,0 +1,46 @@
+{
+ "type": "php",
+ "provider": "apache",
+ "category": "data",
+ "host": "isuruh.lk",
+ "displayName": "php",
+ "description": "php Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/ec2/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/ec2/artifacts/tomcat.json b/samples/dependency-scaling/sample-groups/ec2/artifacts/tomcat.json
new file mode 100755
index 0000000..1779e62
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/ec2/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": "ec2",
+ "imageId": "ap-southeast-1/ami-3c0f5d6e",
+ "maxInstanceLimit": "2",
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "m1.medium"
+ },
+ {
+ "name": "keyPair",
+ "value": "manula"
+ },
+ {
+ "name": "securityGroups",
+ "value": "s2-2.0.0-rc1"
+ }
+ ]
+ }
+ ],
+ "loadBalancer": {
+ "property": {
+ "name": "no.load.balancer",
+ "value": "true"
+ }
+ },
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/ec2/deploy.sh b/samples/dependency-scaling/sample-groups/ec2/deploy.sh
new file mode 100755
index 0000000..3a2e600
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/ec2/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/esb.json' -k -v -u admin:admin https://localhost:9443/api/cartridges
+curl -X POST -H "Content-Type: application/json" -d @'artifacts/php.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/groups
+
+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/704db4b7/samples/dependency-scaling/sample-groups/mock/artifacts/app_single_group.json
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/mock/artifacts/app_single_group.json b/samples/dependency-scaling/sample-groups/mock/artifacts/app_single_group.json
new file mode 100644
index 0000000..76be30f
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/mock/artifacts/app_single_group.json
@@ -0,0 +1,52 @@
+{
+ "applicationId": "app_group_v2",
+ "alias": "mytestapp1",
+ "components": {
+ "groups": [
+ {
+ "name": "group6",
+ "alias": "mygroup6",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 2,
+ "cartridges": [
+ {
+ "type": "esb",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "esbgroup6",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ },
+ {
+ "type": "php",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "phpgroup6",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "mytomcat",
+ "autoscalingPolicy": "autoscale_policy_1"
+ }
+ }
+ ],
+ "dependencies": {
+ "scalingDependants": [
+ "group.group6, cartridge.tomcat"
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/704db4b7/samples/dependency-scaling/sample-groups/mock/artifacts/app_single_group.json-para
----------------------------------------------------------------------
diff --git a/samples/dependency-scaling/sample-groups/mock/artifacts/app_single_group.json-para b/samples/dependency-scaling/sample-groups/mock/artifacts/app_single_group.json-para
new file mode 100644
index 0000000..3ca673d
--- /dev/null
+++ b/samples/dependency-scaling/sample-groups/mock/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"
+ }
+ }
+ ]
+ }
+}
+