You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ga...@apache.org on 2015/09/02 11:55:06 UTC

[1/3] stratos git commit: Update the samples

Repository: stratos
Updated Branches:
  refs/heads/master f2beacc71 -> 23a01363c


Update the samples


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

Branch: refs/heads/master
Commit: 39de79ae5af870f69a4246a22c1b80a596a1ac0b
Parents: 08016ec
Author: gayangunarathne <ga...@wso2.com>
Authored: Wed Sep 2 14:24:37 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Wed Sep 2 14:46:17 2015 +0530

----------------------------------------------------------------------
 .../simple/single-cartridge-app/artifacts/application.json         | 2 +-
 samples/cartridges/kubernetes/php.json                             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/39de79ae/samples/applications/simple/single-cartridge-app/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/artifacts/application.json b/samples/applications/simple/single-cartridge-app/artifacts/application.json
index 14eb119..4043e4f 100644
--- a/samples/applications/simple/single-cartridge-app/artifacts/application.json
+++ b/samples/applications/simple/single-cartridge-app/artifacts/application.json
@@ -14,7 +14,7 @@
                     "deploymentPolicy": "deployment-policy-1",
                     "artifactRepository": {
                         "privateRepo": false,
-                        "repoUrl": "",
+                        "repoUrl": "https://github.com/lakwarus/single-cartridge.git",
                         "repoUsername": "",
                         "repoPassword": ""
                     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/39de79ae/samples/cartridges/kubernetes/php.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/php.json b/samples/cartridges/kubernetes/php.json
index fe2ab28..7c4aeae 100755
--- a/samples/cartridges/kubernetes/php.json
+++ b/samples/cartridges/kubernetes/php.json
@@ -12,7 +12,7 @@
         {
             "name": "http-80",
             "protocol": "http",
-            "port": "22",
+            "port": "80",
             "proxyPort": "8281",
             "kubernetesPortType":"NodePort"
         }


[2/3] stratos git commit: Update the samples

Posted by ga...@apache.org.
Update the samples


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

Branch: refs/heads/master
Commit: 08016ec9eff1bc7e3ff71398b12b1883f9f54f0a
Parents: f2beacc
Author: gayangunarathne <ga...@wso2.com>
Authored: Wed Sep 2 13:45:58 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Wed Sep 2 14:46:17 2015 +0530

----------------------------------------------------------------------
 samples/cartridges/kubernetes/php.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/08016ec9/samples/cartridges/kubernetes/php.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/php.json b/samples/cartridges/kubernetes/php.json
index 128b6da..fe2ab28 100755
--- a/samples/cartridges/kubernetes/php.json
+++ b/samples/cartridges/kubernetes/php.json
@@ -12,7 +12,7 @@
         {
             "name": "http-80",
             "protocol": "http",
-            "port": "80",
+            "port": "22",
             "proxyPort": "8281",
             "kubernetesPortType":"NodePort"
         }
@@ -23,7 +23,7 @@
     "iaasProvider": [
         {
             "type": "kubernetes",
-            "imageId": "stratos/php:4.1.",
+            "imageId": "stratos/php:4.1.2",
             "networkInterfaces": [
             ],
             "property": [


[3/3] stratos git commit: Update the application runtime with network partition id

Posted by ga...@apache.org.
Update the application runtime with network partition id


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

Branch: refs/heads/master
Commit: 23a01363c9c293d9527cafd1429761b95a81a053
Parents: 39de79a
Author: gayangunarathne <ga...@wso2.com>
Authored: Wed Sep 2 15:24:25 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Wed Sep 2 15:24:25 2015 +0530

----------------------------------------------------------------------
 .../rest/endpoint/api/StratosApiV41Utils.java   |  8 +++---
 .../util/converter/ObjectConverter.java         | 26 +++++++++++++++++---
 2 files changed, 27 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/23a01363/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 b22eacd..958f1cd 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
@@ -2098,7 +2098,7 @@ public class StratosApiV41Utils {
      * @param application             Application
      */
     private static void addGroupsInstancesToApplicationInstanceBean(ApplicationInstanceBean applicationInstanceBean,
-                                                                    Application application) {
+                                                                    Application application) throws RestAPIException {
         Collection<Group> groups = application.getGroups();
         if (groups != null && !groups.isEmpty()) {
             for (Group group : groups) {
@@ -2120,7 +2120,7 @@ public class StratosApiV41Utils {
      * @param application             Application
      */
     private static void addClustersInstancesToApplicationInstanceBean(
-            ApplicationInstanceBean applicationInstanceBean, Application application) {
+            ApplicationInstanceBean applicationInstanceBean, Application application) throws RestAPIException {
 
         Map<String, ClusterDataHolder> topLevelClusterDataMap = application.getClusterDataMap();
         if (topLevelClusterDataMap != null) {
@@ -2150,7 +2150,7 @@ public class StratosApiV41Utils {
      */
     private static void addClustersInstancesToGroupInstanceBean(
             GroupInstanceBean groupInstanceBean,
-            Group group) {
+            Group group) throws RestAPIException {
         Map<String, ClusterDataHolder> topLevelClusterDataMap = group.getClusterDataMap();
         if (topLevelClusterDataMap != null && !topLevelClusterDataMap.isEmpty()) {
             for (Map.Entry<String, ClusterDataHolder> entry : topLevelClusterDataMap.entrySet()) {
@@ -2177,7 +2177,7 @@ public class StratosApiV41Utils {
      * @param group             Group
      * @param groupInstanceBean GroupInstanceBean
      */
-    private static void setSubGroupInstances(Group group, GroupInstanceBean groupInstanceBean) {
+    private static void setSubGroupInstances(Group group, GroupInstanceBean groupInstanceBean) throws RestAPIException {
         Collection<Group> subgroups = group.getGroups();
         addClustersInstancesToGroupInstanceBean(groupInstanceBean, group);
         if (subgroups != null && !subgroups.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/23a01363/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
index 7ba6dea..eea8434 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
@@ -20,6 +20,8 @@
 package org.apache.stratos.rest.endpoint.util.converter;
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy;
 import org.apache.stratos.autoscaler.stub.deployment.policy.ApplicationPolicy;
 import org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy;
@@ -70,6 +72,8 @@ import java.util.*;
 
 public class ObjectConverter {
 
+    private static final Log log = LogFactory.getLog(ObjectConverter.class);
+
     public static final String CLUSTER_PROPERTY = "cluster";
 
     public static Cartridge convertCartridgeBeanToStubCartridgeConfig(
@@ -700,7 +704,7 @@ public class ObjectConverter {
     }
 
     public static ClusterInstanceBean convertClusterToClusterInstanceBean(String instanceId,
-                                                                          Cluster cluster, String alias) {
+                                                                          Cluster cluster, String alias) throws RestAPIException {
         ClusterInstanceBean clusterInstanceBean = new ClusterInstanceBean();
         clusterInstanceBean.setAlias(alias);
         clusterInstanceBean.setServiceName(cluster.getServiceName());
@@ -721,8 +725,24 @@ public class ObjectConverter {
                 MemberBean memberBean = new MemberBean();
                 memberBean.setClusterId(member.getClusterId());
                 memberBean.setLbClusterId(member.getLbClusterId());
-                memberBean.setNetworkPartitionId(member.getNetworkPartitionId());
-                memberBean.setPartitionId(member.getPartitionId());
+                NetworkPartition netWorkPartition=null;
+                try {
+                    netWorkPartition= CloudControllerServiceClient.getInstance().getNetworkPartition(member.getNetworkPartitionId());
+                } catch (RemoteException e) {
+                    log.error("Error when getting the network partition");
+                    throw new RestAPIException(e);
+                }
+
+                if(netWorkPartition!=null) {
+                   memberBean.setNetworkPartitionId(netWorkPartition.getId());
+                   Partition[] partition = netWorkPartition.getPartitions();
+                   for(int i=0;i<partition.length;i++){
+                       if(partition[i].getUuid().equals(member.getPartitionId())){
+                           memberBean.setPartitionId(partition[i].getId());
+                       }
+                   }
+                }
+
                 memberBean.setMemberId(member.getMemberId());
                 memberBean.setClusterInstanceId(member.getClusterInstanceId());
                 memberBean.setDefaultPrivateIP(member.getDefaultPrivateIP());