stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [1/6] stratos git commit: Adding kubernetes cluster id to network partition
Date Mon, 22 Dec 2014 03:18:50 GMT
Repository: stratos
Updated Branches:
  refs/heads/master e68f194d4 -> 9fbb7b388


Adding kubernetes cluster id to network partition


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

Branch: refs/heads/master
Commit: 9fbb7b3886f9af960dd41f309a8d00f48637f5ba
Parents: 78e8011
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Mon Dec 22 03:17:03 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Mon Dec 22 08:48:37 2014 +0530

----------------------------------------------------------------------
 .../ApplicationLevelNetworkPartition.java       | 10 +++++
 .../util/converter/ObjectConverter.java         | 19 +++++---
 .../src/main/resources/AutoScalerService.wsdl   | 47 ++++++++++----------
 3 files changed, 47 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/9fbb7b38/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ApplicationLevelNetworkPartition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ApplicationLevelNetworkPartition.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ApplicationLevelNetworkPartition.java
index f1c05b7..774bf5f 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ApplicationLevelNetworkPartition.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ApplicationLevelNetworkPartition.java
@@ -28,7 +28,9 @@ import java.util.Arrays;
 public class ApplicationLevelNetworkPartition implements Serializable {
 
     private static final long serialVersionUID = -8043298009352097370L;
+
     private String id;
+    private String kubernetesClusterId;
     private boolean activeByDefault;
     private Partition[] partitions;
 
@@ -80,4 +82,12 @@ public class ApplicationLevelNetworkPartition implements Serializable {
         }
         return null;
     }
+
+    public String getKubernetesClusterId() {
+        return kubernetesClusterId;
+    }
+
+    public void setKubernetesClusterId(String kubernetesClusterId) {
+        this.kubernetesClusterId = kubernetesClusterId;
+    }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/9fbb7b38/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 0793ada..556b3c6 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
@@ -383,7 +383,7 @@ public class ObjectConverter {
                 && deploymentPolicyBean.getApplicationPolicy().getNetworkPartition()
!= null
                 && !deploymentPolicyBean.getApplicationPolicy().getNetworkPartition().isEmpty())
{
             deploymentPolicy
-                    .setApplicationLevelNetworkPartitions(convertToCCPartitionGroup(deploymentPolicyBean.getApplicationPolicy().getNetworkPartition()));
+                    .setApplicationLevelNetworkPartitions(convertApplicationLevelNetworkPartitionToStubApplicationLevelNetworkPartition(deploymentPolicyBean.getApplicationPolicy().getNetworkPartition()));
         }
 
         if (deploymentPolicyBean.getChildPolicies() != null && !deploymentPolicyBean.getChildPolicies().isEmpty())
{
@@ -541,7 +541,9 @@ public class ObjectConverter {
         return propertyBean;
     }
 
-    private static org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition[]
convertToCCPartitionGroup(List<ApplicationLevelNetworkPartition> networkPartitionBeans)
{
+    private static org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition[]
+        convertApplicationLevelNetworkPartitionToStubApplicationLevelNetworkPartition(
+            List<ApplicationLevelNetworkPartition> networkPartitionBeans) {
 
         org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition[]
                 appNWPartitions = new
@@ -551,10 +553,14 @@ public class ObjectConverter {
         for (int i = 0; i < networkPartitionBeans.size(); i++) {
             org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition
appNWPartition = new
                     org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition();
-            appNWPartition.setId(networkPartitionBeans.get(i).getId());
-            appNWPartition.setActiveByDefault(networkPartitionBeans.get(i).isActiveByDefault());
-            if (networkPartitionBeans.get(i).getPartitions() != null && !networkPartitionBeans.get(i).getPartitions().isEmpty())
{
-                appNWPartition.setPartitions(convertToCCPartitionPojos(networkPartitionBeans.get(i).getPartitions()));
+
+            ApplicationLevelNetworkPartition networkPartition = networkPartitionBeans.get(i);
+
+            appNWPartition.setId(networkPartition.getId());
+            appNWPartition.setKubernetesClusterId(networkPartition.getKubernetesClusterId());
+            appNWPartition.setActiveByDefault(networkPartition.isActiveByDefault());
+            if (networkPartition.getPartitions() != null && !networkPartition.getPartitions().isEmpty())
{
+                appNWPartition.setPartitions(convertToCCPartitionPojos(networkPartition.getPartitions()));
             }
 
             appNWPartitions[i] = appNWPartition;
@@ -880,6 +886,7 @@ public class ObjectConverter {
         }
 
         networkPartitionBean.setId(stubApplicationLevelNetworkPartition.getId());
+        networkPartitionBean.setKubernetesClusterId(stubApplicationLevelNetworkPartition.getKubernetesClusterId());
         networkPartitionBean.setActiveByDefault(stubApplicationLevelNetworkPartition.getActiveByDefault());
 
         //FIXME update with new deployment policy pattern

http://git-wip-us.apache.org/repos/asf/stratos/blob/9fbb7b38/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl
b/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl
index 7c069b4..b866ee8 100644
--- a/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl
+++ b/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns="http://api.autoscaler.stratos.apache.org" xmlns:ax27="http://common.stratos.apache.org/xsd"
xmlns:ax25="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"
xmlns:ax23="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax217="http://exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax21="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ax214="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd"
xmlns:ax220="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax212="http://application.exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax222="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/a
 ddressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://api.autoscaler.stratos.apache.org">
+<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns="http://api.autoscaler.stratos.apache.org" xmlns:ax27="http://common.stratos.apache.org/xsd"
xmlns:ax25="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"
xmlns:ax23="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax217="http://exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax21="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ax214="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd"
xmlns:ax220="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax212="http://application.exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax222="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/a
 ddressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://api.autoscaler.stratos.apache.org">
     <wsdl:types>
         <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd">
             <xs:complexType name="AutoscalePolicy">
@@ -8,15 +8,15 @@
                     <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
                     <xs:element minOccurs="0" name="instanceRoundingFactor" type="xs:float"/>
                     <xs:element minOccurs="0" name="isPublic" type="xs:boolean"/>
-                    <xs:element minOccurs="0" name="loadThresholds" nillable="true" type="ax23:LoadThresholds"/>
+                    <xs:element minOccurs="0" name="loadThresholds" nillable="true" type="ax21:LoadThresholds"/>
                     <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="LoadThresholds">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="loadAverage" nillable="true" type="ax23:LoadAverageThresholds"/>
-                    <xs:element minOccurs="0" name="memoryConsumption" nillable="true"
type="ax23:MemoryConsumptionThresholds"/>
-                    <xs:element minOccurs="0" name="requestsInFlight" nillable="true"
type="ax23:RequestsInFlightThresholds"/>
+                    <xs:element minOccurs="0" name="loadAverage" nillable="true" type="ax21:LoadAverageThresholds"/>
+                    <xs:element minOccurs="0" name="memoryConsumption" nillable="true"
type="ax21:MemoryConsumptionThresholds"/>
+                    <xs:element minOccurs="0" name="requestsInFlight" nillable="true"
type="ax21:RequestsInFlightThresholds"/>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="LoadAverageThresholds">
@@ -161,6 +161,7 @@
                 <xs:sequence>
                     <xs:element minOccurs="0" name="activeByDefault" type="xs:boolean"/>
                     <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true"
type="xs:string"/>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions"
nillable="true" type="ax26:Partition"/>
                 </xs:sequence>
             </xs:complexType>
@@ -200,9 +201,9 @@
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
-        <xs:schema xmlns:ax24="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd"
xmlns:ax216="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax22="http://policy.exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax219="http://common.stratos.apache.org/xsd" xmlns:ax218="http://exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax221="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax213="http://application.exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax223="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax210="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"
xmlns:ax211="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://api.autoscaler.stratos.apache.org">
-            <xs:import namespace="http://policy.exception.autoscaler.stratos.apache.org/xsd"/>
+        <xs:schema xmlns:ax24="http://policy.exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax216="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax22="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd"
xmlns:ax219="http://common.stratos.apache.org/xsd" xmlns:ax218="http://exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax221="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax213="http://application.exception.autoscaler.stratos.apache.org/xsd"
xmlns:ax223="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax210="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"
xmlns:ax211="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://api.autoscaler.stratos.apache.org">
             <xs:import namespace="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
+            <xs:import namespace="http://policy.exception.autoscaler.stratos.apache.org/xsd"/>
             <xs:import namespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
             <xs:import namespace="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
             <xs:import namespace="http://application.exception.autoscaler.stratos.apache.org/xsd"/>
@@ -211,17 +212,29 @@
             <xs:import namespace="http://common.stratos.apache.org/xsd"/>
             <xs:import namespace="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd"/>
             <xs:import namespace="http://pojo.autoscaler.stratos.apache.org/xsd"/>
+            <xs:element name="getAutoScalingPolicies">
+                <xs:complexType>
+                    <xs:sequence/>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getAutoScalingPoliciesResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return"
nillable="true" type="ax21:AutoscalePolicy"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
             <xs:element name="AutoScalerServiceInvalidPolicyException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="InvalidPolicyException" nillable="true"
type="ax21:InvalidPolicyException"/>
+                        <xs:element minOccurs="0" name="InvalidPolicyException" nillable="true"
type="ax23:InvalidPolicyException"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="addAutoScalingPolicy">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="autoscalePolicy" nillable="true"
type="ax23:AutoscalePolicy"/>
+                        <xs:element minOccurs="0" name="autoscalePolicy" nillable="true"
type="ax21:AutoscalePolicy"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -235,7 +248,7 @@
             <xs:element name="updateAutoScalingPolicy">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="autoscalePolicy" nillable="true"
type="ax23:AutoscalePolicy"/>
+                        <xs:element minOccurs="0" name="autoscalePolicy" nillable="true"
type="ax21:AutoscalePolicy"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -270,7 +283,7 @@
             <xs:element name="getAutoscalingPolicyResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax23:AutoscalePolicy"/>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax21:AutoscalePolicy"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -447,18 +460,6 @@
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
-            <xs:element name="getAutoScalingPolicies">
-                <xs:complexType>
-                    <xs:sequence/>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getAutoScalingPoliciesResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return"
nillable="true" type="ax23:AutoscalePolicy"/>
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
         </xs:schema>
         <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://policy.exception.autoscaler.stratos.apache.org/xsd">
             <xs:complexType name="InvalidPolicyException">


Mime
View raw message