Update missing places with network partition uuid and samples
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b7f6ac7c Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b7f6ac7c Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b7f6ac7c Branch: refs/heads/tenant-isolation Commit: b7f6ac7c99db7a45263cf1a22049db7097f05c14 Parents: c2fa842 Author: Gayan Gunarathne <[email protected]> Authored: Thu Jul 23 14:38:55 2015 +0530 Committer: Gayan Gunarathne <[email protected]> Committed: Thu Jul 23 14:38:55 2015 +0530 ---------------------------------------------------------------------- .../stratos/autoscaler/util/AutoscalerUtil.java | 2 +- .../impl/CloudControllerServiceImpl.java | 8 +- .../rest/endpoint/api/StratosApiV41Utils.java | 2 +- .../scripts/common/deploy.sh | 21 +- .../scripts/common/undeploy.sh | 16 +- .../single-cartridge-app/scripts/mock/deploy.sh | 2 +- .../scripts/mock/undeploy.sh | 2 +- .../single-group-app/scripts/common/undeploy.sh | 4 +- .../main/resources/CloudControllerService.wsdl | 758 +++++++++---------- 9 files changed, 412 insertions(+), 403 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/b7f6ac7c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java index 81113a6..03fdc14 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java @@ -403,7 +403,7 @@ public class AutoscalerUtil { for (NetworkPartitionRef networkPartition : deploymentPolicy.getNetworkPartitionRefs()) { if (networkPartition != null) { if (!networkPartitionIds.contains(networkPartition.getUuid())) { - networkPartitionIds.add(networkPartition.getId()); + networkPartitionIds.add(networkPartition.getUuid()); } } } http://git-wip-us.apache.org/repos/asf/stratos/blob/b7f6ac7c/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java index 7c699be..c2cb4e5 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java @@ -1715,13 +1715,13 @@ public class CloudControllerServiceImpl implements CloudControllerService { } @Override - public NetworkPartition getNetworkPartition(String networkPartitionId) { + public NetworkPartition getNetworkPartition(String networkPartitionUuid) { try { - return CloudControllerContext.getInstance().getNetworkPartition(networkPartitionId); + return CloudControllerContext.getInstance().getNetworkPartition(networkPartitionUuid); } catch (Exception e) { String message = String.format("Could not get network partition: [network-partition-uuid] %s " + - "[network-partition-id] %s", getNetworkPartition(networkPartitionId).getUuid(), - networkPartitionId); + "[network-partition-id] %s", getNetworkPartition(networkPartitionUuid).getUuid(), + networkPartitionUuid); log.error(message); throw new CloudControllerException(message, e); } http://git-wip-us.apache.org/repos/asf/stratos/blob/b7f6ac7c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java index 7f414c3..d7b6f9e 100644 --- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java @@ -2848,7 +2848,7 @@ public class StratosApiV41Utils { } - DeploymentPolicy[] deploymentPolicies = autoscalerServiceClient.getDeploymentPolicies(); + DeploymentPolicy[] deploymentPolicies = autoscalerServiceClient.getDeploymentPoliciesByTenant(carbonContext.getTenantId()); if (deploymentPolicies != null) { for (DeploymentPolicy deploymentPolicy : deploymentPolicies) { http://git-wip-us.apache.org/repos/asf/stratos/blob/b7f6ac7c/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh b/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh index 9643d2d..bd7f988 100755 --- a/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh +++ b/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh @@ -23,6 +23,8 @@ iaas=$1 host_ip="localhost" host_port=9443 +username="admin@test$2.com" +password="admin123" prgdir=`dirname "$0"` script_path=`cd "$prgdir"; pwd` @@ -34,6 +36,7 @@ autoscaling_policies_path=`cd "${script_path}/../../../../../autoscaling-policie network_partitions_path=`cd "${script_path}/../../../../../network-partitions/${iaas}"; pwd` deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd` application_policies_path=`cd "${script_path}/../../../../../application-policies"; pwd` +tenants_path=`cd "${script_path}/../../../../../tenants"; pwd` set -e @@ -42,27 +45,31 @@ if [[ -z "${iaas}" ]]; then exit fi +echo ${tenants_path}/tenant1.json +echo "Adding a tenant..." +curl -X POST -H "Content-Type: application/json" -d "@${tenants_path}/tenant$2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/tenants + echo ${autoscaling_policies_path}/autoscaling-policy-1.json echo "Adding autoscale policy..." -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 +curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/autoscalingPolicies echo "Adding network partitions..." -curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions +curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-1.json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/networkPartitions echo "Adding deployment policy..." -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 +curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-1.json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/deploymentPolicies echo "Adding php cartridge..." -curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges +curl -X POST -H "Content-Type: application/json" -d "@${iaas_cartridges_path}/php.json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/cartridges sleep 1 echo "Adding application policy..." -curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies +curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/applicationPolicies sleep 1 echo "Adding application..." -curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/applications sleep 1 echo "Deploying application..." -curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app/deploy/application-policy-1 +curl -X POST -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/applications/single-cartridge-app/deploy/application-policy-1 http://git-wip-us.apache.org/repos/asf/stratos/blob/b7f6ac7c/samples/applications/simple/single-cartridge-app/scripts/common/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/undeploy.sh b/samples/applications/simple/single-cartridge-app/scripts/common/undeploy.sh index d387d86..9852d4b 100644 --- a/samples/applications/simple/single-cartridge-app/scripts/common/undeploy.sh +++ b/samples/applications/simple/single-cartridge-app/scripts/common/undeploy.sh @@ -22,29 +22,31 @@ # host_ip="localhost" host_port=9443 +username="admin@test$1.com" +password="admin123" 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/single-cartridge-app/undeploy +curl -X POST -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/applications/single-cartridge-app/undeploy sleep 10 echo "Deleting application..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app +curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/applications/single-cartridge-app echo "Removing cartridges..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php +curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/cartridges/php 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 +curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${password} 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 +curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-1 echo "Removing application policies..." -curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1 +curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/applicationPolicies/application-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 ${username}:${password} https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1 http://git-wip-us.apache.org/repos/asf/stratos/blob/b7f6ac7c/samples/applications/simple/single-cartridge-app/scripts/mock/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/simple/single-cartridge-app/scripts/mock/deploy.sh b/samples/applications/simple/single-cartridge-app/scripts/mock/deploy.sh index d2dbc4c..e5f2e36 100755 --- a/samples/applications/simple/single-cartridge-app/scripts/mock/deploy.sh +++ b/samples/applications/simple/single-cartridge-app/scripts/mock/deploy.sh @@ -26,4 +26,4 @@ prgdir=`dirname "$0"` script_path=`cd "$prgdir"; pwd` common_folder=`cd "${script_path}/../common"; pwd` -bash ${common_folder}/deploy.sh ${iaas} +bash ${common_folder}/deploy.sh ${iaas} $1 http://git-wip-us.apache.org/repos/asf/stratos/blob/b7f6ac7c/samples/applications/simple/single-cartridge-app/scripts/mock/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/simple/single-cartridge-app/scripts/mock/undeploy.sh b/samples/applications/simple/single-cartridge-app/scripts/mock/undeploy.sh index aa246e6..86149e2 100755 --- a/samples/applications/simple/single-cartridge-app/scripts/mock/undeploy.sh +++ b/samples/applications/simple/single-cartridge-app/scripts/mock/undeploy.sh @@ -24,4 +24,4 @@ prgdir=`dirname "$0"` script_path=`cd "$prgdir"; pwd` common_folder=`cd "${script_path}/../common"; pwd` -bash ${common_folder}/undeploy.sh +bash ${common_folder}/undeploy.sh $1 http://git-wip-us.apache.org/repos/asf/stratos/blob/b7f6ac7c/samples/applications/simple/single-group-app/scripts/common/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/simple/single-group-app/scripts/common/undeploy.sh b/samples/applications/simple/single-group-app/scripts/common/undeploy.sh index 78f4a99..857de8c 100644 --- a/samples/applications/simple/single-group-app/scripts/common/undeploy.sh +++ b/samples/applications/simple/single-group-app/scripts/common/undeploy.sh @@ -30,7 +30,7 @@ set -e echo "Undeploying application..." curl -X POST -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/applications/cartridge-group-app/undeploy -sleep 10 +sleep 20 echo "Deleting application..." curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/applications/cartridge-group-app @@ -54,4 +54,4 @@ curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${passwo echo "Removing network partitions..." curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1 -curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2 \ No newline at end of file +curl -X DELETE -H "Content-Type: application/json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2
