stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject stratos git commit: Merge the missing changes
Date Mon, 07 Sep 2015 08:28:52 GMT
Repository: stratos
Updated Branches:
  refs/heads/master d8e7c53c7 -> 12fdfb087


Merge the missing changes


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

Branch: refs/heads/master
Commit: 12fdfb0872c729f92b905aedb15b7c42b5aa1205
Parents: d8e7c53
Author: gayangunarathne <gayang@wso2.com>
Authored: Mon Sep 7 13:58:25 2015 +0530
Committer: gayangunarathne <gayang@wso2.com>
Committed: Mon Sep 7 13:58:25 2015 +0530

----------------------------------------------------------------------
 .../rest/endpoint/api/StratosApiV41.java        |  2 +-
 .../rest/endpoint/api/StratosApiV41Utils.java   | 26 ++++++++++++++++++++
 extensions/cep/pom.xml                          |  2 +-
 3 files changed, 28 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/12fdfb08/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 77dd8ba..9147d27 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -296,7 +296,7 @@ public class StratosApiV41 extends AbstractApi {
         PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
         int tenantId = carbonContext.getTenantId();
 
-        String cartridgeUuid =  cartridgeType + "~" +tenantId;//UUID.randomUUID().toString()
+        String cartridgeUuid =  cartridgeType + "~" +UUID.randomUUID().toString();
 
         CartridgeBean cartridgeBean = null;
         try {

http://git-wip-us.apache.org/repos/asf/stratos/blob/12fdfb08/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 958f1cd..629fdb5 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
@@ -108,6 +108,9 @@ public class StratosApiV41Utils {
     public static final String APPLICATION_STATUS_DEPLOYED = "Deployed";
     public static final String APPLICATION_STATUS_CREATED = "Created";
     public static final String APPLICATION_STATUS_UNDEPLOYING = "Undeploying";
+    public static final String KUBERNETES_SERVICE_TYPE_NODEPORT = "NodePort";
+    public static final String KUBERNETES_SERVICE_TYPE_CLUSTERIP = "ClusterIP";
+    public static final String KUBERNETES_IAAS_PROVIDER = "kubernetes";
     public static final int SUPER_TENANT_ID = -1234;
 
     private static final Log log = LogFactory.getLog(StratosApiV41Utils.class);
@@ -134,6 +137,14 @@ public class StratosApiV41Utils {
                         cartridgeBean.getType()));
             }
 
+            boolean isKubernetesIaasProviderAvailable = false;
+
+            for (IaasProviderBean providers : iaasProviders) {
+                if (providers.getType().equals(KUBERNETES_IAAS_PROVIDER)) {
+                    isKubernetesIaasProviderAvailable = true;
+                }
+            }
+
             for (PortMappingBean portMapping : cartridgeBean.getPortMapping()) {
                 if (StringUtils.isBlank(portMapping.getName())) {
                     portMapping.setName(portMapping.getProtocol() + "-" + portMapping.getPort());
@@ -143,6 +154,21 @@ public class StratosApiV41Utils {
                                 cartridgeUuid, cartridgeBean.getType(), portMapping.getName()));
                     }
                 }
+
+                String type = portMapping.getKubernetesPortType();
+
+                if (isKubernetesIaasProviderAvailable) {
+                    if (type == null) {
+                        throw new RestAPIException((String.format("Type is not found in portmapping:
%s - Possible " +
+                                        "values - %s and %s", portMapping.getName(), KUBERNETES_SERVICE_TYPE_NODEPORT,
+                                KUBERNETES_SERVICE_TYPE_CLUSTERIP)));
+                    } else if (!type.equals(KUBERNETES_SERVICE_TYPE_NODEPORT) &&
!type.equals(KUBERNETES_SERVICE_TYPE_CLUSTERIP)) {
+                        throw new RestAPIException((String.format("Type is not found in portmapping:
%s - Possible " +
+                                        "values - %s and %s", portMapping.getName(), KUBERNETES_SERVICE_TYPE_NODEPORT,
+                                KUBERNETES_SERVICE_TYPE_CLUSTERIP)));
+                    }
+                }
+
             }
 
             Cartridge cartridgeConfig = createCartridgeConfig(cartridgeBean, cartridgeUuid,
tenantId);

http://git-wip-us.apache.org/repos/asf/stratos/blob/12fdfb08/extensions/cep/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/pom.xml b/extensions/cep/pom.xml
index 285ac26..9c88138 100644
--- a/extensions/cep/pom.xml
+++ b/extensions/cep/pom.xml
@@ -33,6 +33,6 @@
 
     <modules>
         <module>modules/distribution</module>
-        <module>modules/stratos-cep-extension</module>
+
     </modules>
 </project>


Mime
View raw message