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

[06/50] [abbrv] stratos git commit: re-arranging samples to new format

re-arranging samples to new format


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

Branch: refs/heads/docker-grouping-merge
Commit: 36f0d3a6f2848be360c22589a518eb8112941f49
Parents: 909b0de
Author: R-Rajkumar <rr...@gmail.com>
Authored: Thu Feb 26 20:17:43 2015 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Fri Feb 27 19:42:44 2015 +0530

----------------------------------------------------------------------
 .../artifacts/autoscaling-policy.json           | 14 -----
 .../artifacts/deployment-policy.json            | 15 ------
 .../artifacts/ec2/deployment-policy.json        | 55 -------------------
 .../artifacts/kubernetes/deployment-policy.json | 55 -------------------
 .../kubernetes/kubernetes-cluster.json          | 56 --------------------
 .../artifacts/mock/deployment-policy.json       | 55 -------------------
 .../artifacts/network-partition-2.json          | 15 ------
 .../artifacts/network-partition.json            | 15 ------
 .../artifacts/openstack/deployment-policy.json  | 55 -------------------
 .../scripts/common/deploy.sh                    | 13 +++--
 .../scripts/common/undeploy.sh                  | 10 +++-
 .../scripts/kubernetes/deploy.sh                |  5 +-
 .../artifacts/autoscaling-policy.json           | 14 -----
 .../artifacts/deployment-policy.json            | 15 ------
 .../artifacts/ec2/deployment-policy.json        | 55 -------------------
 .../artifacts/kubernetes/deployment-policy.json | 55 -------------------
 .../kubernetes/kubernetes-cluster.json          | 56 --------------------
 .../artifacts/mock/deployment-policy.json       | 55 -------------------
 .../artifacts/network-partition-2.json          | 15 ------
 .../artifacts/network-partition.json            | 15 ------
 .../artifacts/openstack/deployment-policy.json  | 55 -------------------
 .../scripts/common/deploy.sh                    | 13 +++--
 .../scripts/common/undeploy.sh                  | 10 +++-
 .../scripts/kubernetes/deploy.sh                |  5 +-
 .../wordpress/scripts/kubernetes/deploy.sh      |  5 +-
 .../ec2/network-partition-1.json                | 15 ++++++
 .../ec2/network-partition-2.json                | 15 ++++++
 .../kubernetes/network-partition-1.json         | 15 ++++++
 .../kubernetes/network-partition-2.json         | 15 ++++++
 .../openstack/network-partition-1.json          | 15 ++++++
 .../openstack/network-partition-2.json          | 15 ++++++
 31 files changed, 133 insertions(+), 688 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/autoscaling-policy.json b/samples/applications/wordpress-extended-v1/artifacts/autoscaling-policy.json
deleted file mode 100755
index b41726e..0000000
--- a/samples/applications/wordpress-extended-v1/artifacts/autoscaling-policy.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscaling-policy-1",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 80
-        },
-        "memoryConsumption": {
-            "threshold": 90
-        },
-        "loadAverage": {
-            "threshold": 50
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/deployment-policy.json
deleted file mode 100644
index 666c299..0000000
--- a/samples/applications/wordpress-extended-v1/artifacts/deployment-policy.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-   "id": "deployment-policy-1",
-   "networkPartition": [
-      {
-         "id": "network-partition-1",
-         "partitionAlgo": "one-after-another",
-         "partitions": [
-            {
-               "id": "partition-1",
-               "max": 5
-            }
-         ]
-      }
-   ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/ec2/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/ec2/deployment-policy.json
deleted file mode 100644
index 67f5a5f..0000000
--- a/samples/applications/wordpress-extended-v1/artifacts/ec2/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "ec2",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mysql",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "php",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/kubernetes/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/kubernetes/deployment-policy.json
deleted file mode 100644
index cb72ffd..0000000
--- a/samples/applications/wordpress-extended-v1/artifacts/kubernetes/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "kubernetes",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mysql",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "php",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/wordpress-extended-v1/artifacts/kubernetes/kubernetes-cluster.json
deleted file mode 100644
index 2988ed1..0000000
--- a/samples/applications/wordpress-extended-v1/artifacts/kubernetes/kubernetes-cluster.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "clusterId": "kubernetes-cluster-1",
-    "description": "Kubernetes CoreOS cluster",
-    "kubernetesMaster": {
-        "hostId": "KubHostMaster1",
-        "hostname": "master.dev.kubernetes.example.org",
-        "privateIPAddress": "172.17.8.100",
-        "publicIPAddress": "172.17.8.100",
-        "property": [
-        ]
-    },
-    "portRange": {
-        "upper": "5000",
-        "lower": "4500"
-    },
-    "kubernetesHosts": [
-        {
-            "hostId": "KubHostSlave1",
-            "hostname": "slave1.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.101",
-            "publicIPAddress": "172.17.8.101",
-            "property": [
-            ]
-        },
-        {
-            "hostId": "KubHostSlave2",
-            "hostname": "slave2.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.102",
-            "publicIPAddress": "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/36f0d3a6/samples/applications/wordpress-extended-v1/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/mock/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/mock/deployment-policy.json
deleted file mode 100644
index a9548fd..0000000
--- a/samples/applications/wordpress-extended-v1/artifacts/mock/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mysql-php-group1",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "tomcat1",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/artifacts/network-partition-2.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/network-partition-2.json b/samples/applications/wordpress-extended-v1/artifacts/network-partition-2.json
deleted file mode 100644
index 0d07838..0000000
--- a/samples/applications/wordpress-extended-v1/artifacts/network-partition-2.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "id": "network-partition-2",
-    "partitions": [
-        {
-            "id": "partition-2",
-            "provider": "mock",
-            "property": [
-                {
-                    "name": "region",
-                    "value": "default"
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/artifacts/network-partition.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/network-partition.json b/samples/applications/wordpress-extended-v1/artifacts/network-partition.json
deleted file mode 100644
index 2a5b7ec..0000000
--- a/samples/applications/wordpress-extended-v1/artifacts/network-partition.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "id": "network-partition-1",
-    "partitions": [
-        {
-            "id": "partition-1",
-            "provider": "mock",
-            "property": [
-                {
-                    "name": "region",
-                    "value": "default"
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/artifacts/openstack/deployment-policy.json b/samples/applications/wordpress-extended-v1/artifacts/openstack/deployment-policy.json
deleted file mode 100644
index a2d1e8c..0000000
--- a/samples/applications/wordpress-extended-v1/artifacts/openstack/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "openstack",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mysql",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "php",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh b/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh
index 4672be7..d87660e 100755
--- a/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh
+++ b/samples/applications/wordpress-extended-v1/scripts/common/deploy.sh
@@ -11,6 +11,9 @@ artifacts_path=`cd "${script_path}/../../artifacts"; pwd`
 iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
 cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
 cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
+autoscaling_policies_path=`cd "${script_path}/../../../../autoscaling-policies"; pwd`
+network_partitions_path=`cd "${script_path}/../../../../network-partitions/${iaas}"; pwd`
+deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd`
 
 set -e
 
@@ -19,16 +22,16 @@ if [[ -z "${iaas}" ]]; then
     exit
 fi
 
-echo ${artifacts_path}/autoscaling-policy.json
+echo ${autoscaling_policies_path}/autoscaling-policy-1.json
 echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
 
 echo "Adding network partitions..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
 
 echo "Adding deployment policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
 
 echo "Adding mysql cartridge..."
 curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/mysql.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/common/undeploy.sh b/samples/applications/wordpress-extended-v1/scripts/common/undeploy.sh
index 410c429..c82fcae 100644
--- a/samples/applications/wordpress-extended-v1/scripts/common/undeploy.sh
+++ b/samples/applications/wordpress-extended-v1/scripts/common/undeploy.sh
@@ -22,4 +22,12 @@ curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://
 curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat
 
 echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
\ No newline at end of file
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
+
+echo "Removing deployment policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-1
+
+echo "Removing network partitions..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v1/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v1/scripts/kubernetes/deploy.sh b/samples/applications/wordpress-extended-v1/scripts/kubernetes/deploy.sh
index 32eff3c..0d614cc 100755
--- a/samples/applications/wordpress-extended-v1/scripts/kubernetes/deploy.sh
+++ b/samples/applications/wordpress-extended-v1/scripts/kubernetes/deploy.sh
@@ -8,8 +8,9 @@ prgdir=`dirname "$0"`
 script_path=`cd "$prgdir"; pwd`
 common_folder=`cd "${script_path}/../common"; pwd`
 iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+kubernetes_clusters_path=`cd "${script_path}/../../../../kubernets-clusters"; pwd`
 
 echo "Adding kubernetes cluster..."
-curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/kubernetes-cluster.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
+curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-1.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
 
-bash ${common_folder}/deploy.sh ${iaas}
\ No newline at end of file
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/autoscaling-policy.json b/samples/applications/wordpress-extended-v2/artifacts/autoscaling-policy.json
deleted file mode 100755
index b41726e..0000000
--- a/samples/applications/wordpress-extended-v2/artifacts/autoscaling-policy.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscaling-policy-1",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 80
-        },
-        "memoryConsumption": {
-            "threshold": 90
-        },
-        "loadAverage": {
-            "threshold": 50
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/deployment-policy.json b/samples/applications/wordpress-extended-v2/artifacts/deployment-policy.json
deleted file mode 100644
index 666c299..0000000
--- a/samples/applications/wordpress-extended-v2/artifacts/deployment-policy.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-   "id": "deployment-policy-1",
-   "networkPartition": [
-      {
-         "id": "network-partition-1",
-         "partitionAlgo": "one-after-another",
-         "partitions": [
-            {
-               "id": "partition-1",
-               "max": 5
-            }
-         ]
-      }
-   ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/ec2/deployment-policy.json b/samples/applications/wordpress-extended-v2/artifacts/ec2/deployment-policy.json
deleted file mode 100644
index 67f5a5f..0000000
--- a/samples/applications/wordpress-extended-v2/artifacts/ec2/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "ec2",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mysql",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "php",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/kubernetes/deployment-policy.json b/samples/applications/wordpress-extended-v2/artifacts/kubernetes/deployment-policy.json
deleted file mode 100644
index cb72ffd..0000000
--- a/samples/applications/wordpress-extended-v2/artifacts/kubernetes/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "kubernetes",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mysql",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "php",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/wordpress-extended-v2/artifacts/kubernetes/kubernetes-cluster.json
deleted file mode 100644
index 2988ed1..0000000
--- a/samples/applications/wordpress-extended-v2/artifacts/kubernetes/kubernetes-cluster.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "clusterId": "kubernetes-cluster-1",
-    "description": "Kubernetes CoreOS cluster",
-    "kubernetesMaster": {
-        "hostId": "KubHostMaster1",
-        "hostname": "master.dev.kubernetes.example.org",
-        "privateIPAddress": "172.17.8.100",
-        "publicIPAddress": "172.17.8.100",
-        "property": [
-        ]
-    },
-    "portRange": {
-        "upper": "5000",
-        "lower": "4500"
-    },
-    "kubernetesHosts": [
-        {
-            "hostId": "KubHostSlave1",
-            "hostname": "slave1.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.101",
-            "publicIPAddress": "172.17.8.101",
-            "property": [
-            ]
-        },
-        {
-            "hostId": "KubHostSlave2",
-            "hostname": "slave2.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.102",
-            "publicIPAddress": "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/36f0d3a6/samples/applications/wordpress-extended-v2/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/mock/deployment-policy.json b/samples/applications/wordpress-extended-v2/artifacts/mock/deployment-policy.json
deleted file mode 100644
index a9548fd..0000000
--- a/samples/applications/wordpress-extended-v2/artifacts/mock/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mysql-php-group1",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "tomcat1",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/artifacts/network-partition-2.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/network-partition-2.json b/samples/applications/wordpress-extended-v2/artifacts/network-partition-2.json
deleted file mode 100644
index 0d07838..0000000
--- a/samples/applications/wordpress-extended-v2/artifacts/network-partition-2.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "id": "network-partition-2",
-    "partitions": [
-        {
-            "id": "partition-2",
-            "provider": "mock",
-            "property": [
-                {
-                    "name": "region",
-                    "value": "default"
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/artifacts/network-partition.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/network-partition.json b/samples/applications/wordpress-extended-v2/artifacts/network-partition.json
deleted file mode 100644
index 2a5b7ec..0000000
--- a/samples/applications/wordpress-extended-v2/artifacts/network-partition.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "id": "network-partition-1",
-    "partitions": [
-        {
-            "id": "partition-1",
-            "provider": "mock",
-            "property": [
-                {
-                    "name": "region",
-                    "value": "default"
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/artifacts/openstack/deployment-policy.json b/samples/applications/wordpress-extended-v2/artifacts/openstack/deployment-policy.json
deleted file mode 100644
index a2d1e8c..0000000
--- a/samples/applications/wordpress-extended-v2/artifacts/openstack/deployment-policy.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "openstack",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mysql",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "php",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/common/deploy.sh b/samples/applications/wordpress-extended-v2/scripts/common/deploy.sh
index 4672be7..d87660e 100755
--- a/samples/applications/wordpress-extended-v2/scripts/common/deploy.sh
+++ b/samples/applications/wordpress-extended-v2/scripts/common/deploy.sh
@@ -11,6 +11,9 @@ artifacts_path=`cd "${script_path}/../../artifacts"; pwd`
 iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
 cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
 cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
+autoscaling_policies_path=`cd "${script_path}/../../../../autoscaling-policies"; pwd`
+network_partitions_path=`cd "${script_path}/../../../../network-partitions/${iaas}"; pwd`
+deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd`
 
 set -e
 
@@ -19,16 +22,16 @@ if [[ -z "${iaas}" ]]; then
     exit
 fi
 
-echo ${artifacts_path}/autoscaling-policy.json
+echo ${autoscaling_policies_path}/autoscaling-policy-1.json
 echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
 
 echo "Adding network partitions..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
 
 echo "Adding deployment policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
 
 echo "Adding mysql cartridge..."
 curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/mysql.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/common/undeploy.sh b/samples/applications/wordpress-extended-v2/scripts/common/undeploy.sh
index 410c429..c82fcae 100644
--- a/samples/applications/wordpress-extended-v2/scripts/common/undeploy.sh
+++ b/samples/applications/wordpress-extended-v2/scripts/common/undeploy.sh
@@ -22,4 +22,12 @@ curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://
 curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/tomcat
 
 echo "Removing autoscale policies..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
\ No newline at end of file
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1
+
+echo "Removing deployment policies..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-1
+
+echo "Removing network partitions..."
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1
+curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress-extended-v2/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress-extended-v2/scripts/kubernetes/deploy.sh b/samples/applications/wordpress-extended-v2/scripts/kubernetes/deploy.sh
index 32eff3c..0d614cc 100755
--- a/samples/applications/wordpress-extended-v2/scripts/kubernetes/deploy.sh
+++ b/samples/applications/wordpress-extended-v2/scripts/kubernetes/deploy.sh
@@ -8,8 +8,9 @@ prgdir=`dirname "$0"`
 script_path=`cd "$prgdir"; pwd`
 common_folder=`cd "${script_path}/../common"; pwd`
 iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+kubernetes_clusters_path=`cd "${script_path}/../../../../kubernets-clusters"; pwd`
 
 echo "Adding kubernetes cluster..."
-curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/kubernetes-cluster.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
+curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-1.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
 
-bash ${common_folder}/deploy.sh ${iaas}
\ No newline at end of file
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/applications/wordpress/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/wordpress/scripts/kubernetes/deploy.sh b/samples/applications/wordpress/scripts/kubernetes/deploy.sh
index 32eff3c..0d614cc 100755
--- a/samples/applications/wordpress/scripts/kubernetes/deploy.sh
+++ b/samples/applications/wordpress/scripts/kubernetes/deploy.sh
@@ -8,8 +8,9 @@ prgdir=`dirname "$0"`
 script_path=`cd "$prgdir"; pwd`
 common_folder=`cd "${script_path}/../common"; pwd`
 iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+kubernetes_clusters_path=`cd "${script_path}/../../../../kubernets-clusters"; pwd`
 
 echo "Adding kubernetes cluster..."
-curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/kubernetes-cluster.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
+curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-1.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
 
-bash ${common_folder}/deploy.sh ${iaas}
\ No newline at end of file
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/network-partitions/ec2/network-partition-1.json
----------------------------------------------------------------------
diff --git a/samples/network-partitions/ec2/network-partition-1.json b/samples/network-partitions/ec2/network-partition-1.json
new file mode 100644
index 0000000..2a5b7ec
--- /dev/null
+++ b/samples/network-partitions/ec2/network-partition-1.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-1",
+    "partitions": [
+        {
+            "id": "partition-1",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/network-partitions/ec2/network-partition-2.json
----------------------------------------------------------------------
diff --git a/samples/network-partitions/ec2/network-partition-2.json b/samples/network-partitions/ec2/network-partition-2.json
new file mode 100644
index 0000000..0d07838
--- /dev/null
+++ b/samples/network-partitions/ec2/network-partition-2.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-2",
+    "partitions": [
+        {
+            "id": "partition-2",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/network-partitions/kubernetes/network-partition-1.json
----------------------------------------------------------------------
diff --git a/samples/network-partitions/kubernetes/network-partition-1.json b/samples/network-partitions/kubernetes/network-partition-1.json
new file mode 100644
index 0000000..2a5b7ec
--- /dev/null
+++ b/samples/network-partitions/kubernetes/network-partition-1.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-1",
+    "partitions": [
+        {
+            "id": "partition-1",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/network-partitions/kubernetes/network-partition-2.json
----------------------------------------------------------------------
diff --git a/samples/network-partitions/kubernetes/network-partition-2.json b/samples/network-partitions/kubernetes/network-partition-2.json
new file mode 100644
index 0000000..0d07838
--- /dev/null
+++ b/samples/network-partitions/kubernetes/network-partition-2.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-2",
+    "partitions": [
+        {
+            "id": "partition-2",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/network-partitions/openstack/network-partition-1.json
----------------------------------------------------------------------
diff --git a/samples/network-partitions/openstack/network-partition-1.json b/samples/network-partitions/openstack/network-partition-1.json
new file mode 100644
index 0000000..2a5b7ec
--- /dev/null
+++ b/samples/network-partitions/openstack/network-partition-1.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-1",
+    "partitions": [
+        {
+            "id": "partition-1",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/36f0d3a6/samples/network-partitions/openstack/network-partition-2.json
----------------------------------------------------------------------
diff --git a/samples/network-partitions/openstack/network-partition-2.json b/samples/network-partitions/openstack/network-partition-2.json
new file mode 100644
index 0000000..0d07838
--- /dev/null
+++ b/samples/network-partitions/openstack/network-partition-2.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-2",
+    "partitions": [
+        {
+            "id": "partition-2",
+            "provider": "mock",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}