Repository: stratos
Updated Branches:
  refs/heads/master 11d714e93 -> fc2a63c85


Adding openstack artifacts


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

Branch: refs/heads/master
Commit: fc2a63c85244862274b0cfb8fc48d8986c56ce95
Parents: 11d714e
Author: sajhak <[email protected]>
Authored: Tue Jan 13 18:20:08 2015 +0530
Committer: sajhak <[email protected]>
Committed: Tue Jan 13 18:20:08 2015 +0530

----------------------------------------------------------------------
 .../artifacts/application_definition.json       | 98 ++++++++++++++++++++
 .../openstack/artifacts/autoscale-policy.json   | 14 +++
 .../openstack/artifacts/deployment-policy.json  | 71 ++++++++++++++
 .../openstack/artifacts/group6c.json            | 21 +++++
 .../openstack/artifacts/group8c.json            | 21 +++++
 .../complex-app/openstack/artifacts/tomcat.json | 52 +++++++++++
 .../openstack/artifacts/tomcat1.json            | 53 +++++++++++
 .../openstack/artifacts/tomcat2.json            | 53 +++++++++++
 samples/complex-app/openstack/deploy.sh         | 36 +++++++
 9 files changed, 419 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/fc2a63c8/samples/complex-app/openstack/artifacts/application_definition.json
----------------------------------------------------------------------
diff --git 
a/samples/complex-app/openstack/artifacts/application_definition.json 
b/samples/complex-app/openstack/artifacts/application_definition.json
new file mode 100644
index 0000000..7f344af
--- /dev/null
+++ b/samples/complex-app/openstack/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.group8,group.group6,cartridge.tomcat"
+            ],
+            "terminationBehaviour": "terminate-all"
+        }
+    }
+}
+

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/fc2a63c8/samples/complex-app/openstack/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/openstack/artifacts/deployment-policy.json 
b/samples/complex-app/openstack/artifacts/deployment-policy.json
new file mode 100644
index 0000000..173365a
--- /dev/null
+++ b/samples/complex-app/openstack/artifacts/deployment-policy.json
@@ -0,0 +1,71 @@
+{
+    "applicationId": "app_boo",
+    "applicationPolicy": {
+        "networkPartition": [
+            {
+                "id": "OS-P1",
+                "activeByDefault": "true",
+                "partitions": [
+                    {
+                        "id": "P1",
+                        "provider": "openstack",
+                        "property": [
+                            {
+                                "name": "region",
+                                "value": "RegionOne"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    },
+    "childPolicies": [
+        {
+            "alias": "mytomcat",
+            "networkPartition": [
+                {
+                    "id": "OS-P1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "mygroup6",
+            "networkPartition": [
+                {
+                    "id": "OS-P1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "alias": "mygroup8",
+            "networkPartition": [
+                {
+                    "id": "OS-P1",
+                    "partitionAlgo": "one-after-another",
+                    "partitions": [
+                        {
+                            "id": "P1",
+                            "max": 5
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
+

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/fc2a63c8/samples/complex-app/openstack/artifacts/group8c.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/openstack/artifacts/group8c.json 
b/samples/complex-app/openstack/artifacts/group8c.json
new file mode 100755
index 0000000..fac2096
--- /dev/null
+++ b/samples/complex-app/openstack/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/fc2a63c8/samples/complex-app/openstack/artifacts/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/openstack/artifacts/tomcat.json 
b/samples/complex-app/openstack/artifacts/tomcat.json
new file mode 100755
index 0000000..5b1b4ce
--- /dev/null
+++ b/samples/complex-app/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/4c812285-d761-4208-b4b3-d453eace5aff",      
+           "networkInterfaces":[
+                   {
+                      "name":"network-non-routable",
+                      "networkUuid":"b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                   }
+                ],
+            "property": [
+           {
+               "name":"instanceType",
+               "value":"RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+            },
+            {
+               "name":"keyPair",
+               "value":"sajith-key"
+            },
+            {
+               "name":"securityGroups",
+               "value":"default"
+            }
+            ]
+
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/fc2a63c8/samples/complex-app/openstack/artifacts/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/openstack/artifacts/tomcat1.json 
b/samples/complex-app/openstack/artifacts/tomcat1.json
new file mode 100755
index 0000000..8176d13
--- /dev/null
+++ b/samples/complex-app/openstack/artifacts/tomcat1.json
@@ -0,0 +1,53 @@
+{
+    "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/4c812285-d761-4208-b4b3-d453eace5aff",
+           "networkInterfaces":[
+                   {
+                   "name":"network-non-routable",
+                           "networkUuid":"b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                   }
+                ],     
+            "property": [
+            {
+               "name":"instanceType",
+               "value":"RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+            },
+            {
+               "name":"keyPair",
+               "value":"sajith-key"
+            },
+            {
+               "name":"securityGroups",
+               "value":"default"
+            }
+
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/fc2a63c8/samples/complex-app/openstack/artifacts/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/complex-app/openstack/artifacts/tomcat2.json 
b/samples/complex-app/openstack/artifacts/tomcat2.json
new file mode 100755
index 0000000..1e77430
--- /dev/null
+++ b/samples/complex-app/openstack/artifacts/tomcat2.json
@@ -0,0 +1,53 @@
+{
+    "type": "tomcat2",
+    "provider": "apache",
+    "category": "data",
+    "host": "isuruh.lk",
+    "displayName": "tomcat2",
+    "description": "tomcat2 Cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "protocol": "http",
+            "port": "22",
+            "proxyPort": "8280"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "openstack",
+            "imageId": "RegionOne/4c812285-d761-4208-b4b3-d453eace5aff",
+            "networkInterfaces":[
+               {
+                      "name":"network-non-routable",
+                              
"networkUuid":"b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+               }
+              ],
+            "property": [
+            {
+               "name":"instanceType",
+               "value":"RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+            },
+            {
+               "name":"keyPair",
+               "value":"sajith-key"
+            },
+            {
+               "name":"securityGroups",
+               "value":"default"
+            }
+
+            ]
+        }
+    ],
+    "loadBalancer": {
+        "property": {
+            "name": "no.load.balancer",
+            "value": "true"
+        }
+    },
+}
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/fc2a63c8/samples/complex-app/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/complex-app/openstack/deploy.sh 
b/samples/complex-app/openstack/deploy.sh
new file mode 100755
index 0000000..371b6d4
--- /dev/null
+++ b/samples/complex-app/openstack/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

Reply via email to