Repository: stratos Updated Branches: refs/heads/STRATOS-910 dd6c34756 -> 1e2fe6f11
Fixing https://issues.apache.org/jira/browse/STRATOS-910 - this needs to be properly tested with latest Kubernetes binaries. Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1e2fe6f1 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1e2fe6f1 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1e2fe6f1 Branch: refs/heads/STRATOS-910 Commit: 1e2fe6f111dacf1f70e62b45436576384ac6fa1e Parents: dd6c347 Author: Nirmal Fernando <[email protected]> Authored: Sun Oct 26 18:41:12 2014 +0100 Committer: Nirmal Fernando <[email protected]> Committed: Sun Oct 26 18:41:12 2014 +0100 ---------------------------------------------------------------------- ...inerClusterContextToKubernetesContainer.java | 10 +- ...tainerClusterContextToKubernetesService.java | 57 +++++-- .../impl/CloudControllerServiceImpl.java | 115 ++++++++----- .../cloud/controller/pojo/ClusterContext.java | 2 +- .../pojo/KubernetesClusterContext.java | 12 +- .../cloud/controller/pojo/MemberContext.java | 52 ++++-- .../cloud/controller/pojo/PortMapping.java | 25 +++ .../controller/topology/TopologyBuilder.java | 16 +- .../controller/util/CloudControllerUtil.java | 23 ++- .../common/constants/StratosConstants.java | 1 + .../main/resources/CloudControllerService.wsdl | 165 ++++++++++++------- 11 files changed, 331 insertions(+), 147 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java index 8837406..a510e41 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java @@ -43,12 +43,12 @@ import com.google.common.base.Function; */ public class ContainerClusterContextToKubernetesContainer implements Function<ContainerClusterContext, Container> { - private static final Log log = LogFactory.getLog(ContainerClusterContextToKubernetesContainer.class); + private static final Log LOG = LogFactory.getLog(ContainerClusterContextToKubernetesContainer.class); private FasterLookUpDataHolder dataHolder = FasterLookUpDataHolder.getInstance(); @Override - public Container apply(ContainerClusterContext memberContext) { - String clusterId = memberContext.getClusterId(); + public Container apply(ContainerClusterContext context) { + String clusterId = context.getClusterId(); ClusterContext clusterContext = dataHolder.getClusterContext(clusterId); Container container = new Container(); @@ -57,7 +57,7 @@ public class ContainerClusterContextToKubernetesContainer implements Function<Co Cartridge cartridge = dataHolder.getCartridge(clusterContext.getCartridgeType()); if (cartridge == null) { - log.error("Cannot find a Cartridge of type : " + clusterContext.getCartridgeType()); + LOG.error("Container extraction failed from "+context+". Cannot find a Cartridge of type : " + clusterContext.getCartridgeType()); return null; } @@ -65,7 +65,7 @@ public class ContainerClusterContextToKubernetesContainer implements Function<Co container.setPorts(getPorts(clusterContext, cartridge)); - container.setEnv(getEnvironmentVars(memberContext, clusterContext)); + container.setEnv(getEnvironmentVars(context, clusterContext)); return container; } http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesService.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesService.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesService.java index 61fe0ee..610f23e 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesService.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesService.java @@ -18,9 +18,16 @@ */ package org.apache.stratos.cloud.controller.functions; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.stratos.cloud.controller.pojo.Cartridge; import org.apache.stratos.cloud.controller.pojo.ClusterContext; import org.apache.stratos.cloud.controller.pojo.ContainerClusterContext; import org.apache.stratos.cloud.controller.pojo.KubernetesClusterContext; +import org.apache.stratos.cloud.controller.pojo.PortMapping; import org.apache.stratos.cloud.controller.runtime.FasterLookUpDataHolder; import org.apache.stratos.cloud.controller.util.CloudControllerUtil; import org.apache.stratos.common.constants.StratosConstants; @@ -30,35 +37,55 @@ import org.apache.stratos.kubernetes.client.model.Service; import com.google.common.base.Function; /** - * Is responsible for converting a {@link ContainerClusterContext} object to a Kubernetes - * {@link Service} Object. + * Is responsible for converting a {@link ContainerClusterContext} object to a list of Kubernetes + * {@link Service} Objects. */ -public class ContainerClusterContextToKubernetesService implements Function<ContainerClusterContext, Service> { +public class ContainerClusterContextToKubernetesService implements Function<ContainerClusterContext, List<Service>> { + private static final Log LOG = LogFactory.getLog(ContainerClusterContextToKubernetesService.class); private FasterLookUpDataHolder dataHolder = FasterLookUpDataHolder.getInstance(); @Override - public Service apply(ContainerClusterContext memberContext) { + public List<Service> apply(ContainerClusterContext context) { - String clusterId = memberContext.getClusterId(); + List<Service> services = new ArrayList<Service>(); + String clusterId = context.getClusterId(); ClusterContext clusterContext = dataHolder.getClusterContext(clusterId); + + Cartridge cartridge = dataHolder.getCartridge(clusterContext.getCartridgeType()); + + if (cartridge == null) { + LOG.error("Cannot find a Cartridge of type : " + clusterContext.getCartridgeType()); + return services; + } String kubernetesClusterId = CloudControllerUtil.getProperty( clusterContext.getProperties(), StratosConstants.KUBERNETES_CLUSTER_ID); KubernetesClusterContext kubClusterContext = dataHolder .getKubernetesClusterContext(kubernetesClusterId); - Service service = new Service(); - service.setApiVersion("v1beta1"); - service.setId(CloudControllerUtil.getCompatibleId(clusterId)); - service.setKind("Service"); - int hostPort = kubClusterContext.getAnAvailableHostPort(); - service.setPort(hostPort); - Selector selector = new Selector(); - selector.setName(clusterId); - service.setSelector(selector); + // For each Cartridge port, we generate a Kubernetes service proxy + for (PortMapping portMapping : cartridge.getPortMappings()) { + // gets the container port + String containerPort = portMapping.getPort(); + + // build the Service + Service service = new Service(); + service.setApiVersion("v1beta1"); + // id of the service generated using "clusterId-containerPort" + service.setId(CloudControllerUtil.getCompatibleId(clusterId+"-"+containerPort)); + service.setKind("Service"); + service.setContainerPort(containerPort); + int hostPort = kubClusterContext.getAnAvailableHostPort(); + service.setPort(hostPort); + Selector selector = new Selector(); + selector.setName(clusterId); + service.setSelector(selector); + + services.add(service); + } - return service; + return services; } } http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java index 227790a..21684fd 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java @@ -1348,25 +1348,31 @@ public class CloudControllerServiceImpl implements CloudControllerService { + controller + " via Kubernetes layer."); } - // secondly let's create a kubernetes service proxy to load balance these containers + // secondly let's create a kubernetes service proxies to load balance these containers ContainerClusterContextToKubernetesService serviceFunction = new ContainerClusterContextToKubernetesService(); - Service service = serviceFunction.apply(containerClusterContext); + List<Service> services = serviceFunction.apply(containerClusterContext); - if (LOG.isDebugEnabled()) { - LOG.debug("Cloud Controller is delegating request to start a service "+service+ - " for "+ containerClusterContext + " to Kubernetes layer."); + if (services.isEmpty()) { + LOG.error("No Kubernetes Service Proxy generated for "+containerClusterContext); } - kubApi.createService(service); + for (Service service : services) { + if (LOG.isDebugEnabled()) { + LOG.debug("Cloud Controller is delegating request to start a service "+service+ + " for "+ containerClusterContext + " to Kubernetes layer."); + } + + kubApi.createService(service); + // add service port into the context + updateAllocatedServiceHostPortProperty(ctxt, service.getContainerPort(), service.getPort()); + + if (LOG.isDebugEnabled()) { + LOG.debug("Cloud Controller successfully started the service " + + service + " via Kubernetes layer."); + } + } - // set host port and update - ctxt.addProperty(StratosConstants.ALLOCATED_SERVICE_HOST_PORT, service.getPort()); - dataHolder.addClusterContext(ctxt); - if (LOG.isDebugEnabled()) { - LOG.debug("Cloud Controller successfully started the service " - + controller + " via Kubernetes layer."); - } // create a label query Label l = new Label(); @@ -1409,10 +1415,11 @@ public class CloudControllerServiceImpl implements CloudControllerService { MemberContext context = podToMemberContextFunc.apply(pod); context.setCartridgeType(cartridgeType); context.setClusterId(clusterId); - - context.setProperties(CloudControllerUtil.addProperty(context - .getProperties(), StratosConstants.ALLOCATED_SERVICE_HOST_PORT, - String.valueOf(service.getPort()))); + Object portMap = CloudControllerUtil.getPropertyObject(ctxt.getProperties(), + StratosConstants.ALLOCATED_SERVICE_HOST_PORT); + @SuppressWarnings("unchecked") + List<PortMapping> map = (List<PortMapping>) portMap; + context.setPortToServicePortMappings(map != null ? map.toArray(new PortMapping[0]) : new PortMapping[0]); dataHolder.addMemberContext(context); @@ -1440,7 +1447,26 @@ public class CloudControllerServiceImpl implements CloudControllerService { } } - private String validateProperty(String property, ClusterContext ctxt) { + @SuppressWarnings("unchecked") + private void updateAllocatedServiceHostPortProperty(ClusterContext ctxt, String containerPort, int servicePort) { + List<PortMapping> ports; + Object value; + String key = StratosConstants.ALLOCATED_SERVICE_HOST_PORT; + if ((value = CloudControllerUtil.getPropertyObject(ctxt.getProperties(), key)) != null) { + ports = (List<PortMapping>) value; + } else { + ports = new ArrayList<PortMapping>(); + } + PortMapping mapping = new PortMapping(); + mapping.setPort(containerPort); + mapping.setProxyPort(String.valueOf(servicePort)); + ports.add(mapping); + ctxt.addProperty(key, ports); + + dataHolder.addClusterContext(ctxt); + } + + private String validateProperty(String property, ClusterContext ctxt) { String propVal = CloudControllerUtil.getProperty(ctxt.getProperties(), property); handleNullObject(propVal, "Property validation failed. Cannot find '"+property+"' in " + ctxt); @@ -1492,15 +1518,24 @@ public class CloudControllerServiceImpl implements CloudControllerService { KubernetesClusterContext kubClusterContext = dataHolder.getKubernetesClusterContext(kubernetesClusterId); handleNullObject(kubClusterContext, "Kubernetes units termination failed. Cannot find a matching Kubernetes Cluster for cluster id: " +kubernetesClusterId); + + Object portMap = CloudControllerUtil.getPropertyObject(ctxt.getProperties(), + StratosConstants.ALLOCATED_SERVICE_HOST_PORT); + @SuppressWarnings("unchecked") + List<PortMapping> portMappings = (List<PortMapping>) portMap; KubernetesApiClient kubApi = kubClusterContext.getKubApi(); - // delete the service - try { - kubApi.deleteService(CloudControllerUtil.getCompatibleId(clusterId)); - } catch (KubernetesClientException e) { - // we're not going to throw this error, but proceed with other deletions - LOG.error("Failed to delete Kubernetes service with id: "+clusterId, e); - } + + for (PortMapping portMapping : portMappings) { + // delete the service + String id = CloudControllerUtil.getCompatibleId(clusterId+"-"+portMapping.getPort()); + try { + kubApi.deleteService(id); + } catch (KubernetesClientException e) { + // we're not going to throw this error, but proceed with other deletions + LOG.error("Failed to delete Kubernetes service with id: "+id, e); + } + } // set replicas=0 for the replication controller try { @@ -1541,15 +1576,18 @@ public class CloudControllerServiceImpl implements CloudControllerService { throw new InvalidClusterException(msg, e); } - String allocatedPort = CloudControllerUtil.getProperty(ctxt.getProperties(), - StratosConstants.ALLOCATED_SERVICE_HOST_PORT); + List<Integer> allocatedPorts = new ArrayList<Integer>(); + + for (PortMapping portMapping : portMappings) { + if (portMapping.getProxyPort() != null) { + allocatedPorts.add(Integer.parseInt(portMapping.getProxyPort())); + } + } - if (allocatedPort != null) { - kubClusterContext.deallocateHostPort(Integer - .parseInt(allocatedPort)); + if (!allocatedPorts.isEmpty()) { + kubClusterContext.deallocateHostPorts(allocatedPorts); } else { - LOG.warn("Host port dealloacation failed due to a missing property: " - + StratosConstants.ALLOCATED_SERVICE_HOST_PORT); + LOG.warn("No allocated Service host ports found."); } List<MemberContext> membersToBeRemoved = dataHolder.getMemberContextsOfClusterId(clusterId); @@ -1640,7 +1678,7 @@ public class CloudControllerServiceImpl implements CloudControllerService { if (LOG.isDebugEnabled()) { - LOG.debug(String.format("Pods created : %s for cluster : %s",allPods.length, clusterId)); + LOG.debug(String.format("Pods count : %s for cluster : %s",allPods.length, clusterId)); } List<MemberContext> memberContexts = new ArrayList<MemberContext>(); @@ -1656,10 +1694,11 @@ public class CloudControllerServiceImpl implements CloudControllerService { context.setCartridgeType(cartridgeType); context.setClusterId(clusterId); - context.setProperties(CloudControllerUtil.addProperty(context - .getProperties(), StratosConstants.ALLOCATED_SERVICE_HOST_PORT, - CloudControllerUtil.getProperty(ctxt.getProperties(), - StratosConstants.ALLOCATED_SERVICE_HOST_PORT))); + Object portMap = CloudControllerUtil.getPropertyObject(ctxt.getProperties(), + StratosConstants.ALLOCATED_SERVICE_HOST_PORT); + @SuppressWarnings("unchecked") + List<PortMapping> map = (List<PortMapping>) portMap; + context.setPortToServicePortMappings(map != null ? map.toArray(new PortMapping[0]) : new PortMapping[0]); // wait till Pod status turns to running and send member spawned. ScheduledThreadExecutor exec = ScheduledThreadExecutor.getInstance(); @@ -1694,7 +1733,7 @@ public class CloudControllerServiceImpl implements CloudControllerService { // persist in registry persist(); - LOG.info("Kubernetes entities are successfully starting up. "+memberContexts); + LOG.info("Kubernetes entities are successfully updated. "+memberContexts); return memberContexts.toArray(new MemberContext[0]); http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/ClusterContext.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/ClusterContext.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/ClusterContext.java index cb48739..0755465 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/ClusterContext.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/ClusterContext.java @@ -122,7 +122,7 @@ public class ClusterContext implements Serializable{ this.properties = properties; } - public void addProperty(String key, int value) { + public void addProperty(String key, Object value) { this.properties.put(key, value); } http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/KubernetesClusterContext.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/KubernetesClusterContext.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/KubernetesClusterContext.java index 0976eb0..307e53f 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/KubernetesClusterContext.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/KubernetesClusterContext.java @@ -99,8 +99,8 @@ public class KubernetesClusterContext implements Serializable { ports = portBoundaries(); } catch (Exception ignore) { // on an exception, we use the default range - log.warn("Unable to find a port range, hence using the default. [4000-5000]" - + " Exception"); + log.warn("Unable to find a port range, hence using the default: [4000-5000]." + + " Exception: "+ignore.getMessage()); } // populate the ports @@ -115,6 +115,14 @@ public class KubernetesClusterContext implements Serializable { availableHostPorts.add(port); } } + + public void deallocateHostPorts (List<Integer> ports) { + for (Integer port : ports) { + if (!availableHostPorts.contains(port)) { + availableHostPorts.add(port); + } + } + } private void populatePorts(int i, int j) { http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/MemberContext.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/MemberContext.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/MemberContext.java index 72b4914..8818bea 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/MemberContext.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/MemberContext.java @@ -21,6 +21,8 @@ package org.apache.stratos.cloud.controller.pojo; import org.apache.stratos.cloud.controller.deployment.partition.Partition; import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; /** * Holds information about a Member. @@ -53,6 +55,8 @@ public class MemberContext implements Serializable { private String lbClusterId; //network partition id private String networkPartitionId; + // port to kubernetes proxy port mappings + private PortMapping[] portToServicePortMappings; private Properties properties; @@ -70,6 +74,7 @@ public class MemberContext implements Serializable { private void init() { this.properties = new Properties(); this.properties.setProperties(new Property[0]); + this.setPortToServicePortMappings(new PortMapping[0]); } public String getMemberId() { @@ -167,28 +172,37 @@ public class MemberContext implements Serializable { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } MemberContext other = (MemberContext) obj; if (clusterId == null) { - if (other.clusterId != null) + if (other.clusterId != null) { return false; - } else if (!clusterId.equals(other.clusterId)) + } + } else if (!clusterId.equals(other.clusterId)) { return false; + } if (memberId == null) { - if (other.memberId != null) + if (other.memberId != null) { return false; - } else if (!memberId.equals(other.memberId)) + } + } else if (!memberId.equals(other.memberId)) { return false; + } if (nodeId == null) { - if (other.nodeId != null) + if (other.nodeId != null) { return false; - } else if (!nodeId.equals(other.nodeId)) + } + } else if (!nodeId.equals(other.nodeId)) { return false; + } return true; } @@ -210,12 +224,20 @@ public class MemberContext implements Serializable { @Override public String toString() { - return "MemberContext [memberId=" + memberId + ", nodeId=" + nodeId + ", instanceId=" - + instanceId + ", clusterId=" + clusterId + ", partition=" + partition - + ", cartridgeType=" + cartridgeType + ", privateIpAddress=" + privateIpAddress - + ", publicIpAddress=" + publicIpAddress + ", allocatedIpAddress=" - + allocatedIpAddress + ", initTime=" + initTime + ", lbClusterId=" + lbClusterId - + ", networkPartitionId=" + networkPartitionId + ", properties=" + properties + "]"; + return "MemberContext [memberId=" + memberId + ", nodeId=" + nodeId + ", instanceId=" + instanceId + + ", clusterId=" + clusterId + ", partition=" + partition + ", cartridgeType=" + cartridgeType + + ", privateIpAddress=" + privateIpAddress + ", publicIpAddress=" + publicIpAddress + + ", allocatedIpAddress=" + allocatedIpAddress + ", initTime=" + initTime + ", lbClusterId=" + + lbClusterId + ", networkPartitionId=" + networkPartitionId + ", properties=" + properties + + ", portToServicePortMappings=" + portToServicePortMappings + "]"; + } + + public PortMapping[] getPortToServicePortMappings() { + return portToServicePortMappings; + } + + public void setPortToServicePortMappings(PortMapping[] portToServicePortMappings) { + this.portToServicePortMappings = portToServicePortMappings; } } http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/PortMapping.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/PortMapping.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/PortMapping.java index 63e222b..3aa20ed 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/PortMapping.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/PortMapping.java @@ -66,4 +66,29 @@ public class PortMapping implements Serializable{ return "Protocol: " + protocol + ", Port: " + port + ", Proxy Port: " + proxyPort; } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((port == null) ? 0 : port.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + PortMapping other = (PortMapping) obj; + if (port == null) { + if (other.port != null) + return false; + } else if (!port.equals(other.port)) + return false; + return true; + } + } http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java index aa98e5d..bb06a72 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java @@ -18,6 +18,7 @@ */ package org.apache.stratos.cloud.controller.topology; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -38,6 +39,8 @@ import org.apache.stratos.messaging.event.topology.MemberMaintenanceModeEvent; import org.apache.stratos.messaging.event.topology.MemberReadyToShutdownEvent; import org.apache.stratos.messaging.util.Constants; +import edu.emory.mathcs.backport.java.util.Arrays; + import java.util.List; import java.util.Map; import java.util.Properties; @@ -259,11 +262,13 @@ public class TopologyBuilder { member.setProperties(CloudControllerUtil.toJavaUtilProperties(context.getProperties())); try { // Update port mappings with generated service proxy port - // TODO: Need to properly fix with the latest Kubernetes version - String serviceHostPortStr = CloudControllerUtil.getProperty(context.getProperties(), StratosConstants.ALLOCATED_SERVICE_HOST_PORT); - if(StringUtils.isEmpty(serviceHostPortStr)) { + PortMapping[] portToServicePorts = context.getPortToServicePortMappings(); + if(ArrayUtils.isEmpty(portToServicePorts)) { log.warn("Kubernetes service host port not found for member: [member-id] " + memberId); } + + @SuppressWarnings("unchecked") + List<PortMapping> portToServicePortList = (List<PortMapping>) Arrays.asList(portToServicePorts); Cartridge cartridge = FasterLookUpDataHolder.getInstance(). getCartridge(serviceName); @@ -271,9 +276,10 @@ public class TopologyBuilder { Port port; // Adding ports to the member for (PortMapping portMapping : portMappings) { - if (cluster.isKubernetesCluster() && (StringUtils.isNotEmpty(serviceHostPortStr))) { + if (cluster.isKubernetesCluster() && !portToServicePortList.isEmpty() && portToServicePortList.contains(portMapping)) { + PortMapping portToServicePort = portToServicePortList.get(portToServicePortList.indexOf(portMapping)); port = new Port(portMapping.getProtocol(), - Integer.parseInt(serviceHostPortStr), + Integer.parseInt(portToServicePort.getProxyPort()), Integer.parseInt(portMapping.getProxyPort())); member.addPort(port); } else { http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java index fe2493d..5834428 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java @@ -306,6 +306,21 @@ public class CloudControllerUtil { return null; } + public static Object getPropertyObject(Properties properties, String key) { + if (key != null && properties != null) { + for (Iterator<Entry<Object, Object>> iterator = properties.entrySet().iterator(); iterator.hasNext();) { + Entry<Object, Object> type = (Entry<Object, Object>) iterator.next(); + String propName = type.getKey().toString(); + Object propValue = type.getValue(); + if (key.equals(propName)) { + return propValue; + } + } + } + + return null; + } + public static String getProperty(org.apache.stratos.cloud.controller.pojo.Properties properties, String key) { Properties props = toJavaUtilProperties(properties); @@ -397,10 +412,10 @@ public class CloudControllerUtil { return "[" +partitionStr+ "]"; } - public static String getCompatibleId(String clusterId) { - if (clusterId.indexOf('.') != -1) { - clusterId = clusterId.replace('.', '-'); + public static String getCompatibleId(String id) { + if (id.indexOf('.') != -1) { + id = id.replace('.', '-'); } - return clusterId; + return id; } } http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java index 95ff6e3..08fbbd6 100644 --- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java +++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java @@ -152,6 +152,7 @@ public class StratosConstants { public static final String KUBERNETES_MIN_REPLICAS = "KUBERNETES_REPLICAS_MIN"; public static final String KUBERNETES_MAX_REPLICAS = "KUBERNETES_REPLICAS_MAX"; public static final String KUBERNETES_PORT_RANGE = "KUBERNETES_PORT_RANGE"; + // value of following property is a List<PortMapping> public static final String ALLOCATED_SERVICE_HOST_PORT = "ALLOCATED_SERVICE_HOST_PORT"; //drools related constants http://git-wip-us.apache.org/repos/asf/stratos/blob/1e2fe6f1/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl ---------------------------------------------------------------------- diff --git a/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl b/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl index 26ecead..9416746 100644 --- a/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl +++ b/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl @@ -1,4 +1,4 @@ -<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://impl.controller.cloud.stratos.apache.org" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax228="http://util.java/xsd" xmlns:ax220="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax222="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" xmlns:ax223="http://pojo.controller.cloud.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://impl.controller.cloud.stratos.apache.org"> +<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://impl.controller.cloud.stratos.apache.org" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax229="http://util.java/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax221="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:ax223="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax224="http://pojo.controller.cloud.stratos.apache.org/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://impl.controller.cloud.stratos.apache.org"> <wsdl:documentation>CloudControllerService</wsdl:documentation> <wsdl:types> <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://util.java/xsd"> @@ -53,21 +53,21 @@ </xs:sequence> </xs:complexType> </xs:schema> - <xs:schema xmlns:ax221="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:ax227="http://pojo.controller.cloud.stratos.apache.org/xsd" xmlns:ax225="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.controller.cloud.stratos.apache.org"> + <xs:schema xmlns:ax228="http://pojo.controller.cloud.stratos.apache.org/xsd" xmlns:ax222="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:ax226="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.controller.cloud.stratos.apache.org"> <xs:import namespace="http://exception.controller.cloud.stratos.apache.org/xsd"></xs:import> <xs:import namespace="http://partition.deployment.controller.cloud.stratos.apache.org/xsd"></xs:import> <xs:import namespace="http://pojo.controller.cloud.stratos.apache.org/xsd"></xs:import> <xs:element name="CloudControllerServiceInvalidPartitionException"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax220:InvalidPartitionException"></xs:element> + <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax221:InvalidPartitionException"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="validatePartition"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="partition" nillable="true" type="ax222:Partition"></xs:element> + <xs:element minOccurs="0" name="partition" nillable="true" type="ax223:Partition"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -81,7 +81,7 @@ <xs:element name="CloudControllerServiceInvalidCartridgeTypeException"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="InvalidCartridgeTypeException" nillable="true" type="ax220:InvalidCartridgeTypeException"></xs:element> + <xs:element minOccurs="0" name="InvalidCartridgeTypeException" nillable="true" type="ax221:InvalidCartridgeTypeException"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -89,7 +89,7 @@ <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"></xs:element> - <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions" nillable="true" type="ax222:Partition"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions" nillable="true" type="ax223:Partition"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -103,7 +103,7 @@ <xs:element name="CloudControllerServiceUnregisteredCartridgeException"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="UnregisteredCartridgeException" nillable="true" type="ax220:UnregisteredCartridgeException"></xs:element> + <xs:element minOccurs="0" name="UnregisteredCartridgeException" nillable="true" type="ax221:UnregisteredCartridgeException"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -118,14 +118,14 @@ <xs:element name="updateContainersResponse"> <xs:complexType> <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax223:MemberContext"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax224:MemberContext"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="CloudControllerServiceUnregisteredClusterException"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="UnregisteredClusterException" nillable="true" type="ax220:UnregisteredClusterException"></xs:element> + <xs:element minOccurs="0" name="UnregisteredClusterException" nillable="true" type="ax221:UnregisteredClusterException"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -153,7 +153,7 @@ <xs:element name="CloudControllerServiceInvalidMemberException"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="InvalidMemberException" nillable="true" type="ax220:InvalidMemberException"></xs:element> + <xs:element minOccurs="0" name="InvalidMemberException" nillable="true" type="ax221:InvalidMemberException"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -167,7 +167,7 @@ <xs:element name="CloudControllerServiceMemberTerminationFailedException"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="MemberTerminationFailedException" nillable="true" type="ax220:MemberTerminationFailedException"></xs:element> + <xs:element minOccurs="0" name="MemberTerminationFailedException" nillable="true" type="ax221:MemberTerminationFailedException"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -178,10 +178,17 @@ </xs:sequence> </xs:complexType> </xs:element> + <xs:element name="terminateContainerResponse"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" name="return" nillable="true" type="ax224:MemberContext"></xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> <xs:element name="CloudControllerServiceInvalidClusterException"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="InvalidClusterException" nillable="true" type="ax220:InvalidClusterException"></xs:element> + <xs:element minOccurs="0" name="InvalidClusterException" nillable="true" type="ax221:InvalidClusterException"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -199,45 +206,52 @@ </xs:sequence> </xs:complexType> </xs:element> + <xs:element name="terminateAllContainersResponse"> + <xs:complexType> + <xs:sequence> + <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax224:MemberContext"></xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> <xs:element name="CloudControllerServiceInvalidIaasProviderException"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="InvalidIaasProviderException" nillable="true" type="ax220:InvalidIaasProviderException"></xs:element> + <xs:element minOccurs="0" name="InvalidIaasProviderException" nillable="true" type="ax221:InvalidIaasProviderException"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="startInstance"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="memberContext" nillable="true" type="ax223:MemberContext"></xs:element> + <xs:element minOccurs="0" name="memberContext" nillable="true" type="ax224:MemberContext"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="startInstanceResponse"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="return" nillable="true" type="ax223:MemberContext"></xs:element> + <xs:element minOccurs="0" name="return" nillable="true" type="ax224:MemberContext"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="startContainers"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="containerClusterContext" nillable="true" type="ax223:ContainerClusterContext"></xs:element> + <xs:element minOccurs="0" name="containerClusterContext" nillable="true" type="ax224:ContainerClusterContext"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="startContainersResponse"> <xs:complexType> <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax223:MemberContext"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax224:MemberContext"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="registerService"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="registrant" nillable="true" type="ax223:Registrant"></xs:element> + <xs:element minOccurs="0" name="registrant" nillable="true" type="ax224:Registrant"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -270,7 +284,7 @@ <xs:element name="getClusterContextResponse"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="return" nillable="true" type="ax223:ClusterContext"></xs:element> + <xs:element minOccurs="0" name="return" nillable="true" type="ax224:ClusterContext"></xs:element> </xs:sequence> </xs:complexType> </xs:element> @@ -284,31 +298,31 @@ <xs:element name="getCartridgeInfoResponse"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="return" nillable="true" type="ax223:CartridgeInfo"></xs:element> + <xs:element minOccurs="0" name="return" nillable="true" type="ax224:CartridgeInfo"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="CloudControllerServiceInvalidCartridgeDefinitionException"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="InvalidCartridgeDefinitionException" nillable="true" type="ax220:InvalidCartridgeDefinitionException"></xs:element> + <xs:element minOccurs="0" name="InvalidCartridgeDefinitionException" nillable="true" type="ax221:InvalidCartridgeDefinitionException"></xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="deployCartridgeDefinition"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="cartridgeConfig" nillable="true" type="ax223:CartridgeConfig"></xs:element> + <xs:element minOccurs="0" name="cartridgeConfig" nillable="true" type="ax224:CartridgeConfig"></xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> - <xs:schema xmlns:ax229="http://util.java/xsd" xmlns:ax226="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.controller.cloud.stratos.apache.org/xsd"> + <xs:schema xmlns:ax230="http://util.java/xsd" xmlns:ax227="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.controller.cloud.stratos.apache.org/xsd"> <xs:import namespace="http://partition.deployment.controller.cloud.stratos.apache.org/xsd"></xs:import> <xs:import namespace="http://util.java/xsd"></xs:import> <xs:complexType name="Properties"> <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax223:Property"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax224:Property"></xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="Property"> @@ -328,16 +342,24 @@ <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="nodeId" nillable="true" type="xs:string"></xs:element> - <xs:element minOccurs="0" name="partition" nillable="true" type="ax222:Partition"></xs:element> + <xs:element minOccurs="0" name="partition" nillable="true" type="ax223:Partition"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="portToServicePortMappings" nillable="true" type="ax224:PortMapping"></xs:element> <xs:element minOccurs="0" name="privateIpAddress" nillable="true" type="xs:string"></xs:element> - <xs:element minOccurs="0" name="properties" nillable="true" type="ax223:Properties"></xs:element> + <xs:element minOccurs="0" name="properties" nillable="true" type="ax224:Properties"></xs:element> <xs:element minOccurs="0" name="publicIpAddress" nillable="true" type="xs:string"></xs:element> </xs:sequence> </xs:complexType> + <xs:complexType name="PortMapping"> + <xs:sequence> + <xs:element minOccurs="0" name="port" nillable="true" type="xs:string"></xs:element> + <xs:element minOccurs="0" name="protocol" nillable="true" type="xs:string"></xs:element> + <xs:element minOccurs="0" name="proxyPort" nillable="true" type="xs:string"></xs:element> + </xs:sequence> + </xs:complexType> <xs:complexType name="ContainerClusterContext"> <xs:sequence> <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"></xs:element> - <xs:element minOccurs="0" name="properties" nillable="true" type="ax223:Properties"></xs:element> + <xs:element minOccurs="0" name="properties" nillable="true" type="ax224:Properties"></xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="Registrant"> @@ -348,15 +370,15 @@ <xs:element minOccurs="0" name="deploymentPolicyName" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="payload" nillable="true" type="xs:string"></xs:element> - <xs:element minOccurs="0" name="persistence" nillable="true" type="ax223:Persistence"></xs:element> - <xs:element minOccurs="0" name="properties" nillable="true" type="ax223:Properties"></xs:element> + <xs:element minOccurs="0" name="persistence" nillable="true" type="ax224:Persistence"></xs:element> + <xs:element minOccurs="0" name="properties" nillable="true" type="ax224:Properties"></xs:element> <xs:element minOccurs="0" name="tenantRange" nillable="true" type="xs:string"></xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="Persistence"> <xs:sequence> <xs:element minOccurs="0" name="persistanceRequired" type="xs:boolean"></xs:element> - <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax223:Volume"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax224:Volume"></xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="Volume"> @@ -378,15 +400,15 @@ <xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="lbCluster" type="xs:boolean"></xs:element> <xs:element minOccurs="0" name="payload" nillable="true" type="xs:string"></xs:element> - <xs:element minOccurs="0" name="properties" nillable="true" type="ax229:Properties"></xs:element> + <xs:element minOccurs="0" name="properties" nillable="true" type="ax230:Properties"></xs:element> <xs:element minOccurs="0" name="timeoutInMillis" type="xs:long"></xs:element> <xs:element minOccurs="0" name="volumeRequired" type="xs:boolean"></xs:element> - <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax223:Volume"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax224:Volume"></xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="CartridgeInfo"> <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="appTypes" nillable="true" type="ax223:AppType"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="appTypes" nillable="true" type="ax224:AppType"></xs:element> <xs:element minOccurs="0" name="baseDir" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="defaultAutoscalingPolicy" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="defaultDeploymentPolicy" nillable="true" type="xs:string"></xs:element> @@ -395,11 +417,11 @@ <xs:element minOccurs="0" name="displayName" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="isPublic" type="xs:boolean"></xs:element> - <xs:element minOccurs="0" name="lbConfig" nillable="true" type="ax223:LoadbalancerConfig"></xs:element> + <xs:element minOccurs="0" name="lbConfig" nillable="true" type="ax224:LoadbalancerConfig"></xs:element> <xs:element minOccurs="0" name="multiTenant" type="xs:boolean"></xs:element> - <xs:element minOccurs="0" name="persistence" nillable="true" type="ax223:Persistence"></xs:element> - <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax223:PortMapping"></xs:element> - <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax223:Property"></xs:element> + <xs:element minOccurs="0" name="persistence" nillable="true" type="ax224:Persistence"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax224:PortMapping"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax224:Property"></xs:element> <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="serviceGroup" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"></xs:element> @@ -414,21 +436,14 @@ </xs:complexType> <xs:complexType name="LoadbalancerConfig"> <xs:sequence> - <xs:element minOccurs="0" name="properties" nillable="true" type="ax223:Properties"></xs:element> + <xs:element minOccurs="0" name="properties" nillable="true" type="ax224:Properties"></xs:element> <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"></xs:element> </xs:sequence> </xs:complexType> - <xs:complexType name="PortMapping"> - <xs:sequence> - <xs:element minOccurs="0" name="port" nillable="true" type="xs:string"></xs:element> - <xs:element minOccurs="0" name="protocol" nillable="true" type="xs:string"></xs:element> - <xs:element minOccurs="0" name="proxyPort" nillable="true" type="xs:string"></xs:element> - </xs:sequence> - </xs:complexType> <xs:complexType name="CartridgeConfig"> <xs:sequence> <xs:element minOccurs="0" name="baseDir" nillable="true" type="xs:string"></xs:element> - <xs:element minOccurs="0" name="container" nillable="true" type="ax223:Container"></xs:element> + <xs:element minOccurs="0" name="container" nillable="true" type="ax224:Container"></xs:element> <xs:element minOccurs="0" name="defaultAutoscalingPolicy" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="defaultDeploymentPolicy" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="deployerType" nillable="true" type="xs:string"></xs:element> @@ -436,13 +451,13 @@ <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="displayName" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"></xs:element> - <xs:element maxOccurs="unbounded" minOccurs="0" name="iaasConfigs" nillable="true" type="ax223:IaasConfig"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="iaasConfigs" nillable="true" type="ax224:IaasConfig"></xs:element> <xs:element minOccurs="0" name="isPublic" type="xs:boolean"></xs:element> - <xs:element minOccurs="0" name="lbConfig" nillable="true" type="ax223:LoadbalancerConfig"></xs:element> + <xs:element minOccurs="0" name="lbConfig" nillable="true" type="ax224:LoadbalancerConfig"></xs:element> <xs:element minOccurs="0" name="multiTenant" type="xs:boolean"></xs:element> - <xs:element minOccurs="0" name="persistence" nillable="true" type="ax223:Persistence"></xs:element> - <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax223:PortMapping"></xs:element> - <xs:element minOccurs="0" name="properties" nillable="true" type="ax223:Properties"></xs:element> + <xs:element minOccurs="0" name="persistence" nillable="true" type="ax224:Persistence"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax224:PortMapping"></xs:element> + <xs:element minOccurs="0" name="properties" nillable="true" type="ax224:Properties"></xs:element> <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="serviceGroup" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"></xs:element> @@ -464,16 +479,16 @@ <xs:element minOccurs="0" name="imageId" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="maxInstanceLimit" type="xs:int"></xs:element> <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"></xs:element> - <xs:element minOccurs="0" name="networkInterfaces" nillable="true" type="ax223:NetworkInterfaces"></xs:element> + <xs:element minOccurs="0" name="networkInterfaces" nillable="true" type="ax224:NetworkInterfaces"></xs:element> <xs:element minOccurs="0" name="payload" nillable="true" type="xs:base64Binary"></xs:element> - <xs:element minOccurs="0" name="properties" nillable="true" type="ax223:Properties"></xs:element> + <xs:element minOccurs="0" name="properties" nillable="true" type="ax224:Properties"></xs:element> <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"></xs:element> <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"></xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="NetworkInterfaces"> <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="networkInterfaces" nillable="true" type="ax223:NetworkInterface"></xs:element> + <xs:element maxOccurs="unbounded" minOccurs="0" name="networkInterfaces" nillable="true" type="ax224:NetworkInterface"></xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="NetworkInterface"> @@ -484,7 +499,7 @@ </xs:sequence> </xs:complexType> </xs:schema> - <xs:schema xmlns:ax224="http://pojo.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.deployment.controller.cloud.stratos.apache.org/xsd"> + <xs:schema xmlns:ax225="http://pojo.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.deployment.controller.cloud.stratos.apache.org/xsd"> <xs:import namespace="http://pojo.controller.cloud.stratos.apache.org/xsd"></xs:import> <xs:complexType name="Partition"> <xs:sequence> @@ -493,7 +508,7 @@ <xs:element minOccurs="0" name="isPublic" type="xs:boolean"></xs:element> <xs:element minOccurs="0" name="partitionMax" type="xs:int"></xs:element> <xs:element minOccurs="0" name="partitionMin" type="xs:int"></xs:element> - <xs:element minOccurs="0" name="properties" nillable="true" type="ax223:Properties"></xs:element> + <xs:element minOccurs="0" name="properties" nillable="true" type="ax224:Properties"></xs:element> <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"></xs:element> </xs:sequence> </xs:complexType> @@ -511,6 +526,9 @@ <wsdl:message name="terminateContainerRequest"> <wsdl:part name="parameters" element="ns:terminateContainer"></wsdl:part> </wsdl:message> + <wsdl:message name="terminateContainerResponse"> + <wsdl:part name="parameters" element="ns:terminateContainerResponse"></wsdl:part> + </wsdl:message> <wsdl:message name="CloudControllerServiceMemberTerminationFailedException"> <wsdl:part name="parameters" element="ns:CloudControllerServiceMemberTerminationFailedException"></wsdl:part> </wsdl:message> @@ -563,6 +581,9 @@ <wsdl:message name="terminateAllContainersRequest"> <wsdl:part name="parameters" element="ns:terminateAllContainers"></wsdl:part> </wsdl:message> + <wsdl:message name="terminateAllContainersResponse"> + <wsdl:part name="parameters" element="ns:terminateAllContainersResponse"></wsdl:part> + </wsdl:message> <wsdl:message name="CloudControllerServiceInvalidClusterException"> <wsdl:part name="parameters" element="ns:CloudControllerServiceInvalidClusterException"></wsdl:part> </wsdl:message> @@ -615,6 +636,7 @@ </wsdl:operation> <wsdl:operation name="terminateContainer"> <wsdl:input message="ns:terminateContainerRequest" wsaw:Action="urn:terminateContainer"></wsdl:input> + <wsdl:output message="ns:terminateContainerResponse" wsaw:Action="urn:terminateContainerResponse"></wsdl:output> <wsdl:fault message="ns:CloudControllerServiceMemberTerminationFailedException" name="CloudControllerServiceMemberTerminationFailedException" wsaw:Action="urn:terminateContainerCloudControllerServiceMemberTerminationFailedException"></wsdl:fault> </wsdl:operation> <wsdl:operation name="validateDeploymentPolicy"> @@ -651,6 +673,7 @@ </wsdl:operation> <wsdl:operation name="terminateAllContainers"> <wsdl:input message="ns:terminateAllContainersRequest" wsaw:Action="urn:terminateAllContainers"></wsdl:input> + <wsdl:output message="ns:terminateAllContainersResponse" wsaw:Action="urn:terminateAllContainersResponse"></wsdl:output> <wsdl:fault message="ns:CloudControllerServiceInvalidClusterException" name="CloudControllerServiceInvalidClusterException" wsaw:Action="urn:terminateAllContainersCloudControllerServiceInvalidClusterException"></wsdl:fault> </wsdl:operation> <wsdl:operation name="unregisterService"> @@ -710,6 +733,9 @@ <wsdl:input> <soap:body use="literal"></soap:body> </wsdl:input> + <wsdl:output> + <soap:body use="literal"></soap:body> + </wsdl:output> <wsdl:fault name="CloudControllerServiceMemberTerminationFailedException"> <soap:fault use="literal" name="CloudControllerServiceMemberTerminationFailedException"></soap:fault> </wsdl:fault> @@ -797,6 +823,9 @@ <wsdl:input> <soap:body use="literal"></soap:body> </wsdl:input> + <wsdl:output> + <soap:body use="literal"></soap:body> + </wsdl:output> <wsdl:fault name="CloudControllerServiceInvalidClusterException"> <soap:fault use="literal" name="CloudControllerServiceInvalidClusterException"></soap:fault> </wsdl:fault> @@ -908,6 +937,9 @@ <wsdl:input> <soap12:body use="literal"></soap12:body> </wsdl:input> + <wsdl:output> + <soap12:body use="literal"></soap12:body> + </wsdl:output> <wsdl:fault name="CloudControllerServiceMemberTerminationFailedException"> <soap12:fault use="literal" name="CloudControllerServiceMemberTerminationFailedException"></soap12:fault> </wsdl:fault> @@ -995,6 +1027,9 @@ <wsdl:input> <soap12:body use="literal"></soap12:body> </wsdl:input> + <wsdl:output> + <soap12:body use="literal"></soap12:body> + </wsdl:output> <wsdl:fault name="CloudControllerServiceInvalidClusterException"> <soap12:fault use="literal" name="CloudControllerServiceInvalidClusterException"></soap12:fault> </wsdl:fault> @@ -1103,6 +1138,9 @@ <wsdl:input> <mime:content type="text/xml" part="parameters"></mime:content> </wsdl:input> + <wsdl:output> + <mime:content type="text/xml" part="parameters"></mime:content> + </wsdl:output> </wsdl:operation> <wsdl:operation name="validateDeploymentPolicy"> <http:operation location="validateDeploymentPolicy"></http:operation> @@ -1160,6 +1198,9 @@ <wsdl:input> <mime:content type="text/xml" part="parameters"></mime:content> </wsdl:input> + <wsdl:output> + <mime:content type="text/xml" part="parameters"></mime:content> + </wsdl:output> </wsdl:operation> <wsdl:operation name="unregisterService"> <http:operation location="unregisterService"></http:operation> @@ -1230,22 +1271,22 @@ </wsdl:binding> <wsdl:service name="CloudControllerService"> <wsdl:port name="CloudControllerServiceHttpSoap11Endpoint" binding="ns:CloudControllerServiceSoap11Binding"> - <soap:address location="http://172.17.8.1:9763/services/CloudControllerService.CloudControllerServiceHttpSoap11Endpoint/"></soap:address> + <soap:address location="http://172.29.76.209:9763/services/CloudControllerService.CloudControllerServiceHttpSoap11Endpoint/"></soap:address> </wsdl:port> <wsdl:port name="CloudControllerServiceHttpsSoap11Endpoint" binding="ns:CloudControllerServiceSoap11Binding"> - <soap:address location="https://172.17.8.1:9443/services/CloudControllerService.CloudControllerServiceHttpsSoap11Endpoint/"></soap:address> + <soap:address location="https://172.29.76.209:9443/services/CloudControllerService.CloudControllerServiceHttpsSoap11Endpoint/"></soap:address> </wsdl:port> <wsdl:port name="CloudControllerServiceHttpSoap12Endpoint" binding="ns:CloudControllerServiceSoap12Binding"> - <soap12:address location="http://172.17.8.1:9763/services/CloudControllerService.CloudControllerServiceHttpSoap12Endpoint/"></soap12:address> + <soap12:address location="http://172.29.76.209:9763/services/CloudControllerService.CloudControllerServiceHttpSoap12Endpoint/"></soap12:address> </wsdl:port> <wsdl:port name="CloudControllerServiceHttpsSoap12Endpoint" binding="ns:CloudControllerServiceSoap12Binding"> - <soap12:address location="https://172.17.8.1:9443/services/CloudControllerService.CloudControllerServiceHttpsSoap12Endpoint/"></soap12:address> + <soap12:address location="https://172.29.76.209:9443/services/CloudControllerService.CloudControllerServiceHttpsSoap12Endpoint/"></soap12:address> </wsdl:port> <wsdl:port name="CloudControllerServiceHttpEndpoint" binding="ns:CloudControllerServiceHttpBinding"> - <http:address location="http://172.17.8.1:9763/services/CloudControllerService.CloudControllerServiceHttpEndpoint/"></http:address> + <http:address location="http://172.29.76.209:9763/services/CloudControllerService.CloudControllerServiceHttpEndpoint/"></http:address> </wsdl:port> <wsdl:port name="CloudControllerServiceHttpsEndpoint" binding="ns:CloudControllerServiceHttpBinding"> - <http:address location="https://172.17.8.1:9443/services/CloudControllerService.CloudControllerServiceHttpsEndpoint/"></http:address> + <http:address location="https://172.29.76.209:9443/services/CloudControllerService.CloudControllerServiceHttpsEndpoint/"></http:address> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file
