Repository: stratos Updated Branches: refs/heads/master 7a46e4af7 -> 2234c32e4
Restructuring complex-app sample and updating deploy.sh file Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2234c32e Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2234c32e Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2234c32e Branch: refs/heads/master Commit: 2234c32e4443d629244f3eda5ae852744f1cbdb7 Parents: 7a46e4a Author: Imesh Gunaratne <[email protected]> Authored: Thu Jan 29 15:52:02 2015 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Thu Jan 29 15:52:16 2015 +0530 ---------------------------------------------------------------------- samples/applications/complex-app/README.md | 6 +- .../artifacts/application-definition.json | 4 +- .../artifacts/ec2/deployment-policy.json | 71 +++++++++++++++++++ .../artifacts/kubernetes/deployment-policy.json | 72 ++++++++++++++++++++ .../kubernetes/kubernetes-cluster.json | 55 +++++++++++++++ .../artifacts/mock/deployment-policy.json | 71 +++++++++++++++++++ .../artifacts/openstack/deployment-policy.json | 71 +++++++++++++++++++ .../iaases/ec2/artifacts/deployment-policy.json | 71 ------------------- .../complex-app/iaases/ec2/deploy.sh | 56 --------------- .../complex-app/iaases/ec2/undeploy.sh | 30 -------- .../kubernetes/artifacts/deployment-policy.json | 72 -------------------- .../artifacts/kubernetes-cluster.json | 55 --------------- .../complex-app/iaases/kubernetes/deploy.sh | 66 ------------------ .../complex-app/iaases/kubernetes/undeploy.sh | 34 --------- .../mock/artifacts/deployment-policy.json | 71 ------------------- .../complex-app/iaases/mock/deploy.sh | 56 --------------- .../complex-app/iaases/mock/undeploy.sh | 30 -------- .../openstack/artifacts/deployment-policy.json | 71 ------------------- .../complex-app/iaases/openstack/deploy.sh | 56 --------------- .../complex-app/iaases/openstack/undeploy.sh | 30 -------- .../complex-app/scripts/ec2/deploy.sh | 42 ++++++++++++ .../complex-app/scripts/ec2/undeploy.sh | 30 ++++++++ .../complex-app/scripts/kubernetes/deploy.sh | 45 ++++++++++++ .../complex-app/scripts/kubernetes/undeploy.sh | 34 +++++++++ .../complex-app/scripts/mock/deploy.sh | 42 ++++++++++++ .../complex-app/scripts/mock/undeploy.sh | 26 +++++++ .../complex-app/scripts/openstack/deploy.sh | 42 ++++++++++++ .../complex-app/scripts/openstack/undeploy.sh | 30 ++++++++ 28 files changed, 635 insertions(+), 704 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/README.md ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/README.md b/samples/applications/complex-app/README.md index 117e787..e6de773 100644 --- a/samples/applications/complex-app/README.md +++ b/samples/applications/complex-app/README.md @@ -1,6 +1,4 @@ -complex-app +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. +TODO: Add an description about the application http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/artifacts/application-definition.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/artifacts/application-definition.json b/samples/applications/complex-app/artifacts/application-definition.json index caa9668..83d2835 100644 --- a/samples/applications/complex-app/artifacts/application-definition.json +++ b/samples/applications/complex-app/artifacts/application-definition.json @@ -1,6 +1,6 @@ { - "applicationId": "app_boo", - "alias": "app_boo_r2", + "applicationId": "complex-app", + "alias": "complex-app-v1", "components": { "groups": [ { http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/artifacts/ec2/deployment-policy.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/artifacts/ec2/deployment-policy.json b/samples/applications/complex-app/artifacts/ec2/deployment-policy.json new file mode 100644 index 0000000..edd4981 --- /dev/null +++ b/samples/applications/complex-app/artifacts/ec2/deployment-policy.json @@ -0,0 +1,71 @@ +{ + "applicationId": "complex-app", + "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/2234c32e/samples/applications/complex-app/artifacts/kubernetes/deployment-policy.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/artifacts/kubernetes/deployment-policy.json b/samples/applications/complex-app/artifacts/kubernetes/deployment-policy.json new file mode 100644 index 0000000..ced3a44 --- /dev/null +++ b/samples/applications/complex-app/artifacts/kubernetes/deployment-policy.json @@ -0,0 +1,72 @@ +{ + "applicationId": "complex-app", + "applicationPolicy": { + "networkPartition": [ + { + "id":"network-p1", + "kubernetesClusterId":"kubernetes-cluster-1", + "activeByDefault": "true", + "partitions": [ + { + "id": "P1", + "provider": "mock", + "property": [ + { + "name": "region", + "value": "default" + } + ] + } + ] + } + ] + }, + "childPolicies": [ + { + "alias": "mytomcat", + "networkPartition": [ + { + "id": "network-p1", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "P1", + "max": 5 + } + ] + } + ] + }, + { + "alias": "mygroup6", + "networkPartition": [ + { + "id": "network-p1", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "P1", + "max": 5 + } + ] + } + ] + }, + { + "alias": "mygroup8", + "networkPartition": [ + { + "id": "network-p1", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "P1", + "max": 5 + } + ] + } + ] + } + ] +} + http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/artifacts/kubernetes/kubernetes-cluster.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/complex-app/artifacts/kubernetes/kubernetes-cluster.json new file mode 100644 index 0000000..228eeb3 --- /dev/null +++ b/samples/applications/complex-app/artifacts/kubernetes/kubernetes-cluster.json @@ -0,0 +1,55 @@ +{ + "clusterId": "kubernetes-cluster-1", + "description": "Kubernetes CoreOS cluster", + "kubernetesMaster": { + "hostId" : "KubHostMaster1", + "hostname" : "master.dev.kubernetes.example.org", + "hostIpAddress" : "172.17.8.100", + "property" : [ + ] + }, + + "portRange" : { + "upper": "5000", + "lower": "4500" + }, + + "kubernetesHosts": [ + { + "hostId" : "KubHostSlave1", + "hostname" : "slave1.dev.kubernetes.example.org", + "hostIpAddress" : "172.17.8.101", + "property" : [ + ] + }, + { + "hostId" : "KubHostSlave2", + "hostname" : "slave2.dev.kubernetes.example.org", + "hostIpAddress" : "172.17.8.102", + "property" : [ + ] + } + ], + "property":[ + { + "name":"payload_parameter.MB_IP", + "value":"172.17.8.1" + }, + { + "name":"payload_parameter.MB_PORT", + "value":"1883" + }, + { + "name":"payload_parameter.CEP_IP", + "value":"172.17.8.1" + }, + { + "name":"payload_parameter.CEP_PORT", + "value":"7711" + }, + { + "name":"payload_parameter.LOG_LEVEL", + "value":"DEBUG" + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/artifacts/mock/deployment-policy.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/artifacts/mock/deployment-policy.json b/samples/applications/complex-app/artifacts/mock/deployment-policy.json new file mode 100644 index 0000000..80459db --- /dev/null +++ b/samples/applications/complex-app/artifacts/mock/deployment-policy.json @@ -0,0 +1,71 @@ +{ + "applicationId": "complex-app", + "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/2234c32e/samples/applications/complex-app/artifacts/openstack/deployment-policy.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/artifacts/openstack/deployment-policy.json b/samples/applications/complex-app/artifacts/openstack/deployment-policy.json new file mode 100644 index 0000000..14873ff --- /dev/null +++ b/samples/applications/complex-app/artifacts/openstack/deployment-policy.json @@ -0,0 +1,71 @@ +{ + "applicationId": "complex-app", + "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/2234c32e/samples/applications/complex-app/iaases/ec2/artifacts/deployment-policy.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/ec2/artifacts/deployment-policy.json b/samples/applications/complex-app/iaases/ec2/artifacts/deployment-policy.json deleted file mode 100644 index 2aac579..0000000 --- a/samples/applications/complex-app/iaases/ec2/artifacts/deployment-policy.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "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/2234c32e/samples/applications/complex-app/iaases/ec2/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/ec2/deploy.sh b/samples/applications/complex-app/iaases/ec2/deploy.sh deleted file mode 100755 index 022760d..0000000 --- a/samples/applications/complex-app/iaases/ec2/deploy.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -export iaas="ec2" #[openstack, ec2, mock, kubernetes] -export host_ip="localhost" - -export artifacts_path="../../artifacts" -export cartridges_path="../../../../cartridges/${iaas}" -export cartridges_groups_path="../../../../cartridges-groups" - -set -e - -# Adding autoscale policy -pushd ${artifacts_path} -echo "Adding autoscale policy..." -curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies -popd - -# Adding cartridges -pushd ${cartridges_path} - # Adding tomcat cartridge -echo "Adding tomcat cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges - - # Adding tomcat1 cartridge -echo "Adding tomcat1 cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat1.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges - - # Adding tomcat2 cartridge -echo "Adding tomcat2 cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat2.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges -popd - -# Adding groups -pushd ${cartridges_groups_path} - # Adding group6c -echo "Adding group6c group..." -curl -X POST -H "Content-Type: application/json" -d @'group6c.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups - - # Adding group8c -echo "Adding group8c group..." -curl -X POST -H "Content-Type: application/json" -d @'group8c.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups -popd - -sleep 5 - -# Creating application -pushd ${artifacts_path} -echo "Creating application..." -curl -X POST -H "Content-Type: application/json" -d @'application-definition.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications -popd - -sleep 5 - -# Deploy application -echo "Deploying application..." -curl -X POST -H "Content-Type: application/json" -d@'artifacts/deployment-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo/deploy http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/iaases/ec2/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/ec2/undeploy.sh b/samples/applications/complex-app/iaases/ec2/undeploy.sh deleted file mode 100644 index b41be8a..0000000 --- a/samples/applications/complex-app/iaases/ec2/undeploy.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -export host_ip="localhost" - -set -e - -# Undeploying application -echo "Undeploying application..." -curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo/undeploy - -sleep 10 - -# Deleting application -echo "Deleting application..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo - -# Removing groups -echo "Removing groups..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group8 -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6 - -# Removing cartridges -echo "Removing cartridges..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1 -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2 - -# Removing autoscale policies -echo "Removing autoscale policies..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/iaases/kubernetes/artifacts/deployment-policy.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/kubernetes/artifacts/deployment-policy.json b/samples/applications/complex-app/iaases/kubernetes/artifacts/deployment-policy.json deleted file mode 100644 index 82a3b40..0000000 --- a/samples/applications/complex-app/iaases/kubernetes/artifacts/deployment-policy.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "applicationId": "app_boo", - "applicationPolicy": { - "networkPartition": [ - { - "id":"network-p1", - "kubernetesClusterId":"kubernetes-cluster-1", - "activeByDefault": "true", - "partitions": [ - { - "id": "P1", - "provider": "mock", - "property": [ - { - "name": "region", - "value": "default" - } - ] - } - ] - } - ] - }, - "childPolicies": [ - { - "alias": "mytomcat", - "networkPartition": [ - { - "id": "network-p1", - "partitionAlgo": "one-after-another", - "partitions": [ - { - "id": "P1", - "max": 5 - } - ] - } - ] - }, - { - "alias": "mygroup6", - "networkPartition": [ - { - "id": "network-p1", - "partitionAlgo": "one-after-another", - "partitions": [ - { - "id": "P1", - "max": 5 - } - ] - } - ] - }, - { - "alias": "mygroup8", - "networkPartition": [ - { - "id": "network-p1", - "partitionAlgo": "one-after-another", - "partitions": [ - { - "id": "P1", - "max": 5 - } - ] - } - ] - } - ] -} - http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/iaases/kubernetes/artifacts/kubernetes-cluster.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/kubernetes/artifacts/kubernetes-cluster.json b/samples/applications/complex-app/iaases/kubernetes/artifacts/kubernetes-cluster.json deleted file mode 100644 index 228eeb3..0000000 --- a/samples/applications/complex-app/iaases/kubernetes/artifacts/kubernetes-cluster.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "clusterId": "kubernetes-cluster-1", - "description": "Kubernetes CoreOS cluster", - "kubernetesMaster": { - "hostId" : "KubHostMaster1", - "hostname" : "master.dev.kubernetes.example.org", - "hostIpAddress" : "172.17.8.100", - "property" : [ - ] - }, - - "portRange" : { - "upper": "5000", - "lower": "4500" - }, - - "kubernetesHosts": [ - { - "hostId" : "KubHostSlave1", - "hostname" : "slave1.dev.kubernetes.example.org", - "hostIpAddress" : "172.17.8.101", - "property" : [ - ] - }, - { - "hostId" : "KubHostSlave2", - "hostname" : "slave2.dev.kubernetes.example.org", - "hostIpAddress" : "172.17.8.102", - "property" : [ - ] - } - ], - "property":[ - { - "name":"payload_parameter.MB_IP", - "value":"172.17.8.1" - }, - { - "name":"payload_parameter.MB_PORT", - "value":"1883" - }, - { - "name":"payload_parameter.CEP_IP", - "value":"172.17.8.1" - }, - { - "name":"payload_parameter.CEP_PORT", - "value":"7711" - }, - { - "name":"payload_parameter.LOG_LEVEL", - "value":"DEBUG" - } - ] -} http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/iaases/kubernetes/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/kubernetes/deploy.sh b/samples/applications/complex-app/iaases/kubernetes/deploy.sh deleted file mode 100755 index 751c9a7..0000000 --- a/samples/applications/complex-app/iaases/kubernetes/deploy.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -export iaas="ec2" #[openstack, ec2, mock, kubernetes] -export host_ip="localhost" - -export artifacts_path="../../artifacts" -export cartridges_path="../../../../cartridges/${iaas}" -export cartridges_groups_path="../../../../cartridges-groups" - -set -e - -# Adding autoscale policy -pushd ${artifacts_path} -echo "Adding autoscale policy..." -curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies -popd - -# Adding cartridges -pushd ${cartridges_path} - # Adding tomcat cartridge -echo "Adding tomcat cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges - - # Adding tomcat1 cartridge -echo "Adding tomcat1 cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat1.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges - - # Adding tomcat2 cartridge -echo "Adding tomcat2 cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat2.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges -popd - - -sleep 5 - -# Adding kubernetes cluster -echo "Adding kubernetes cluster..." -curl -X POST -H "Content-Type: application/json" -d @'artifacts/kubernetes-cluster.json' -k -u admin:admin https://${host_ip}:9443/api/kubernetesClusters - -sleep 2 - - -# Adding groups -pushd ${cartridges_groups_path} - # Adding group6c -echo "Adding group6c group..." -curl -X POST -H "Content-Type: application/json" -d @'group6c.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups - - # Adding group8c -echo "Adding group8c group..." -curl -X POST -H "Content-Type: application/json" -d @'group8c.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups -popd - -sleep 5 - -# Creating application -pushd ${artifacts_path} -echo "Creating application..." -curl -X POST -H "Content-Type: application/json" -d @'application-definition.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications -popd - -sleep 5 - -# Deploy application -echo "Deploying application..." -curl -X POST -H "Content-Type: application/json" -d@'artifacts/deployment-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo/deploy http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/iaases/kubernetes/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/kubernetes/undeploy.sh b/samples/applications/complex-app/iaases/kubernetes/undeploy.sh deleted file mode 100644 index 9eda009..0000000 --- a/samples/applications/complex-app/iaases/kubernetes/undeploy.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -export host_ip="localhost" - -set -e - -# Undeploying application -echo "Undeploying application..." -curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo/undeploy - -sleep 5 - -# Deleting application -echo "Deleting application..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo - -# Removing groups -echo "Removing groups..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group8 -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6 - -# Removing cartridges -echo "Removing cartridges..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1 -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2 - -# Removing kubernetes -echo "Removing kubernetes cluster..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/kubernetesClusters/kubernetes-cluster-1 - -# Removing autoscale policies -echo "Removing autoscale policies..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/iaases/mock/artifacts/deployment-policy.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/mock/artifacts/deployment-policy.json b/samples/applications/complex-app/iaases/mock/artifacts/deployment-policy.json deleted file mode 100644 index a2d0e3a..0000000 --- a/samples/applications/complex-app/iaases/mock/artifacts/deployment-policy.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "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/2234c32e/samples/applications/complex-app/iaases/mock/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/mock/deploy.sh b/samples/applications/complex-app/iaases/mock/deploy.sh deleted file mode 100755 index b20c178..0000000 --- a/samples/applications/complex-app/iaases/mock/deploy.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -export iaas="mock" #[openstack, ec2, mock, kubernetes] -export host_ip="localhost" - -export artifacts_path="../../artifacts" -export cartridges_path="../../../../cartridges/${iaas}" -export cartridges_groups_path="../../../../cartridges-groups" - -set -e - -# Adding autoscale policy -pushd ${artifacts_path} -echo "Adding autoscale policy..." -curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies -popd - -# Adding cartridges -pushd ${cartridges_path} - # Adding tomcat cartridge -echo "Adding tomcat cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges - - # Adding tomcat1 cartridge -echo "Adding tomcat1 cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat1.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges - - # Adding tomcat2 cartridge -echo "Adding tomcat2 cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat2.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges -popd - -# Adding groups -pushd ${cartridges_groups_path} - # Adding group6c -echo "Adding group6c group..." -curl -X POST -H "Content-Type: application/json" -d @'group6c.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups - - # Adding group8c -echo "Adding group8c group..." -curl -X POST -H "Content-Type: application/json" -d @'group8c.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups -popd - -sleep 5 - -# Creating application -pushd ${artifacts_path} -echo "Creating application..." -curl -X POST -H "Content-Type: application/json" -d @'application-definition.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications -popd - -sleep 5 - -# Deploy application -echo "Deploying application..." -curl -X POST -H "Content-Type: application/json" -d@'artifacts/deployment-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo/deploy http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/iaases/mock/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/mock/undeploy.sh b/samples/applications/complex-app/iaases/mock/undeploy.sh deleted file mode 100644 index c582ac7..0000000 --- a/samples/applications/complex-app/iaases/mock/undeploy.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -export host_ip="localhost" - -set -e - -# Undeploying application -echo "Undeploying application..." -curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo/undeploy - -sleep 5 - -# Deleting application -echo "Deleting application..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo - -# Removing groups -echo "Removing groups..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group8 -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6 - -# Removing cartridges -echo "Removing cartridges..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1 -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2 - -# Removing autoscale policies -echo "Removing autoscale policies..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/iaases/openstack/artifacts/deployment-policy.json ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/openstack/artifacts/deployment-policy.json b/samples/applications/complex-app/iaases/openstack/artifacts/deployment-policy.json deleted file mode 100644 index 173365a..0000000 --- a/samples/applications/complex-app/iaases/openstack/artifacts/deployment-policy.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "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/2234c32e/samples/applications/complex-app/iaases/openstack/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/openstack/deploy.sh b/samples/applications/complex-app/iaases/openstack/deploy.sh deleted file mode 100755 index f2d6bc3..0000000 --- a/samples/applications/complex-app/iaases/openstack/deploy.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -export iaas="openstack" #[openstack, ec2, mock, kubernetes] -export host_ip="localhost" - -export artifacts_path="../../artifacts" -export cartridges_path="../../../../cartridges/${iaas}" -export cartridges_groups_path="../../../../cartridges-groups" - -set -e - -# Adding autoscale policy -pushd ${artifacts_path} -echo "Adding autoscale policy..." -curl -X POST -H "Content-Type: application/json" -d @'autoscale-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies -popd - -# Adding cartridges -pushd ${cartridges_path} - # Adding tomcat cartridge -echo "Adding tomcat cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges - - # Adding tomcat1 cartridge -echo "Adding tomcat1 cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat1.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges - - # Adding tomcat2 cartridge -echo "Adding tomcat2 cartridge..." -curl -X POST -H "Content-Type: application/json" -d @'tomcat2.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridges -popd - -# Adding groups -pushd ${cartridges_groups_path} - # Adding group6c -echo "Adding group6c group..." -curl -X POST -H "Content-Type: application/json" -d @'group6c.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups - - # Adding group8c -echo "Adding group8c group..." -curl -X POST -H "Content-Type: application/json" -d @'group8c.json' -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups -popd - -sleep 5 - -# Creating application -pushd ${artifacts_path} -echo "Creating application..." -curl -X POST -H "Content-Type: application/json" -d @'application-definition.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications -popd - -sleep 5 - -# Deploy application -echo "Deploying application..." -curl -X POST -H "Content-Type: application/json" -d@'artifacts/deployment-policy.json' -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo/deploy http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/iaases/openstack/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/iaases/openstack/undeploy.sh b/samples/applications/complex-app/iaases/openstack/undeploy.sh deleted file mode 100644 index 2f2fbf7..0000000 --- a/samples/applications/complex-app/iaases/openstack/undeploy.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -export host_ip="localhost" - -set -e - -# Undeploying application -echo "Undeploying application..." -curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo/undeploy - -sleep 30 - -# Deleting application -echo "Deleting application..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/app_boo - -# Removing groups -echo "Removing groups..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group8 -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6 - -# Removing cartridges -echo "Removing cartridges..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1 -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2 - -# Removing autoscale policies -echo "Removing autoscale policies..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/scripts/ec2/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/scripts/ec2/deploy.sh b/samples/applications/complex-app/scripts/ec2/deploy.sh new file mode 100755 index 0000000..e211950 --- /dev/null +++ b/samples/applications/complex-app/scripts/ec2/deploy.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +iaas="ec2" +host_ip="localhost" +host_port=9443 + +script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`" +artifacts_path="${script_path}/../../artifacts" +iaas_artifacts_path="${script_path}/../../artifacts/${iaas}" +cartridges_path="${script_path}/../../../../cartridges/${iaas}" +cartridges_groups_path="${script_path}/../../../../cartridges-groups" + +set -e + +echo ${artifacts_path}/autoscale-policy.json +echo "Adding autoscale policy..." +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscale-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies + +echo "Adding tomcat cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding tomcat1 cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding tomcat2 cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding group6c group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group6c.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +echo "Adding group8c group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group8c.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +sleep 5 + +echo "Creating application..." +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application-definition.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications + +sleep 5 + +echo "Deploying application..." +curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/complex-app/deploy http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/scripts/ec2/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/scripts/ec2/undeploy.sh b/samples/applications/complex-app/scripts/ec2/undeploy.sh new file mode 100644 index 0000000..c4f0e02 --- /dev/null +++ b/samples/applications/complex-app/scripts/ec2/undeploy.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +export host_ip="localhost" + +set -e + +# Undeploying application +echo "Undeploying application..." +curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/complex-app/undeploy + +sleep 10 + +# Deleting application +echo "Deleting application..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/complex-app + +# Removing groups +echo "Removing groups..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group8 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6 + +# Removing cartridges +echo "Removing cartridges..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2 + +# Removing autoscale policies +echo "Removing autoscale policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/scripts/kubernetes/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/scripts/kubernetes/deploy.sh b/samples/applications/complex-app/scripts/kubernetes/deploy.sh new file mode 100755 index 0000000..39edc26 --- /dev/null +++ b/samples/applications/complex-app/scripts/kubernetes/deploy.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +iaas="mock" +host_ip="localhost" +host_port=9443 + +script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`" +artifacts_path="${script_path}/../../artifacts" +iaas_artifacts_path="${script_path}/../../artifacts/${iaas}" +cartridges_path="${script_path}/../../../../cartridges/${iaas}" +cartridges_groups_path="${script_path}/../../../../cartridges-groups" + +set -e + +echo "Adding kubernetes cluster..." +curl -X POST -H "Content-Type: application/json" -d @'artifacts/kubernetes-cluster.json' -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters + +echo ${artifacts_path}/autoscale-policy.json +echo "Adding autoscale policy..." +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscale-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies + +echo "Adding tomcat cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding tomcat1 cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding tomcat2 cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding group6c group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group6c.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +echo "Adding group8c group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group8c.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +sleep 5 + +echo "Creating application..." +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application-definition.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications + +sleep 5 + +echo "Deploying application..." +curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/complex-app/deploy http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/scripts/kubernetes/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/scripts/kubernetes/undeploy.sh b/samples/applications/complex-app/scripts/kubernetes/undeploy.sh new file mode 100644 index 0000000..6064db1 --- /dev/null +++ b/samples/applications/complex-app/scripts/kubernetes/undeploy.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +export host_ip="localhost" + +set -e + +# Undeploying application +echo "Undeploying application..." +curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/complex-app/undeploy + +sleep 5 + +# Deleting application +echo "Deleting application..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/complex-app + +# Removing groups +echo "Removing groups..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group8 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6 + +# Removing cartridges +echo "Removing cartridges..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2 + +# Removing kubernetes +echo "Removing kubernetes cluster..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/kubernetesClusters/kubernetes-cluster-1 + +# Removing autoscale policies +echo "Removing autoscale policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/scripts/mock/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/scripts/mock/deploy.sh b/samples/applications/complex-app/scripts/mock/deploy.sh new file mode 100755 index 0000000..c93b60d --- /dev/null +++ b/samples/applications/complex-app/scripts/mock/deploy.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +iaas="mock" +host_ip="localhost" +host_port=9443 + +script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`" +artifacts_path="${script_path}/../../artifacts" +iaas_artifacts_path="${script_path}/../../artifacts/${iaas}" +cartridges_path="${script_path}/../../../../cartridges/${iaas}" +cartridges_groups_path="${script_path}/../../../../cartridges-groups" + +set -e + +echo ${artifacts_path}/autoscale-policy.json +echo "Adding autoscale policy..." +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscale-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies + +echo "Adding tomcat cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding tomcat1 cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding tomcat2 cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding group6c group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group6c.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +echo "Adding group8c group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group8c.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +sleep 5 + +echo "Creating application..." +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application-definition.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications + +sleep 5 + +echo "Deploying application..." +curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/complex-app/deploy http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/scripts/mock/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/scripts/mock/undeploy.sh b/samples/applications/complex-app/scripts/mock/undeploy.sh new file mode 100644 index 0000000..eaa4522 --- /dev/null +++ b/samples/applications/complex-app/scripts/mock/undeploy.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +host_ip="localhost" +host_port=9443 + +set -e + +echo "Undeploying application..." +curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/complex-app/undeploy + +sleep 5 + +echo "Deleting application..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/complex-app + +echo "Removing groups..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/group8 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/group6 + +echo "Removing cartridges..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat1 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat2 + +echo "Removing autoscale policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscale_policy_1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/scripts/openstack/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/scripts/openstack/deploy.sh b/samples/applications/complex-app/scripts/openstack/deploy.sh new file mode 100755 index 0000000..df6657e --- /dev/null +++ b/samples/applications/complex-app/scripts/openstack/deploy.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +iaas="openstack" +host_ip="localhost" +host_port=9443 + +script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`" +artifacts_path="${script_path}/../../artifacts" +iaas_artifacts_path="${script_path}/../../artifacts/${iaas}" +cartridges_path="${script_path}/../../../../cartridges/${iaas}" +cartridges_groups_path="${script_path}/../../../../cartridges-groups" + +set -e + +echo ${artifacts_path}/autoscale-policy.json +echo "Adding autoscale policy..." +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscale-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies + +echo "Adding tomcat cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding tomcat1 cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding tomcat2 cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding group6c group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group6c.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +echo "Adding group8c group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/group8c.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +sleep 5 + +echo "Creating application..." +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application-definition.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications + +sleep 5 + +echo "Deploying application..." +curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/complex-app/deploy http://git-wip-us.apache.org/repos/asf/stratos/blob/2234c32e/samples/applications/complex-app/scripts/openstack/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/complex-app/scripts/openstack/undeploy.sh b/samples/applications/complex-app/scripts/openstack/undeploy.sh new file mode 100644 index 0000000..2a3fdfd --- /dev/null +++ b/samples/applications/complex-app/scripts/openstack/undeploy.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +export host_ip="localhost" + +set -e + +# Undeploying application +echo "Undeploying application..." +curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/complex-app/undeploy + +sleep 30 + +# Deleting application +echo "Deleting application..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/applications/complex-app + +# Removing groups +echo "Removing groups..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group8 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridgeGroups/group6 + +# Removing cartridges +echo "Removing cartridges..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat1 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/cartridges/tomcat2 + +# Removing autoscale policies +echo "Removing autoscale policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:9443/api/autoscalingPolicies/autoscale_policy_1 \ No newline at end of file
