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/01 14:29:39 UTC
[01/50] [abbrv] stratos git commit: Adding queue to executer service
Repository: stratos
Updated Branches:
refs/heads/master d5f11fc22 -> 238c3c48c
Adding queue to executer service
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2f2debf5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2f2debf5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2f2debf5
Branch: refs/heads/master
Commit: 2f2debf5b60d08e21edabd7aa04b5af32955468c
Parents: 3ab657a
Author: gayangunarathne <ga...@wso2.com>
Authored: Thu Aug 20 21:10:48 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Thu Aug 20 21:10:48 2015 +0530
----------------------------------------------------------------------
.../common/threading/StratosThreadPool.java | 12 ++-
.../application-policy-3.json.orig | 18 ----
...-G123-1-application-update-test-v1.json.orig | 91 --------------------
.../application.json.orig | 89 -------------------
4 files changed, 11 insertions(+), 199 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2f2debf5/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
index c72499f..45da339 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
@@ -51,9 +51,19 @@ public class StratosThreadPool {
synchronized (executorServiceMapLock) {
if (executorService == null) {
final BlockingQueue<Runnable> queue = new ArrayBlockingQueue(threadPoolSize);
- executorService =new ThreadPoolExecutor(threadPoolSize, 1000,
+ ThreadPoolExecutor threadPool=new ThreadPoolExecutor(threadPoolSize, 1000,
0L, TimeUnit.MILLISECONDS,
queue);// Executors.newFixedThreadPool(threadPoolSize);
+ threadPool.setRejectedExecutionHandler(new RejectedExecutionHandler() {
+ public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
+ try {
+ executor.getQueue().put(r);
+ } catch (InterruptedException e) {
+ log.error("Failed to add the rejected jobs to executor service blocking queue",e);
+ }
+ }
+ });
+ executorService=threadPool;
executorServiceMap.put(identifier, executorService);
log.info(String.format("Thread pool created: [type] Executor Service [id] %s [size] %d", identifier, threadPoolSize));
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2f2debf5/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json.orig
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json.orig b/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json.orig
deleted file mode 100644
index a461844..0000000
--- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json.orig
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "id": "application-policy-3",
- "algorithm": "one-after-another",
- "networkPartitions": [
- "network-partition-9",
- "network-partition-10"
- ],
- "properties": [
- {
- "name": "key-1",
- "value": "network-partition-9|network-partition-10"
- },
- {
- "name": "key-2",
- "value": "value-2"
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2f2debf5/products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json.orig
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json.orig b/products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json.orig
deleted file mode 100644
index b3ba80e..0000000
--- a/products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json.orig
+++ /dev/null
@@ -1,91 +0,0 @@
-{
- "alias": "g-sc-G123-1-application-update-test",
- "applicationId": "g-sc-G123-1-application-update-test",
- "components": {
- "cartridges": [],
- "groups": [
- {
- "name": "G1-application-update-test",
- "groupMaxInstances": 1,
- "groupMinInstances": 1,
- "alias": "group1-application-update-test",
- "cartridges": [
- {
- "cartridgeMin": 2,
- "cartridgeMax": 3,
- "type": "c1-application-update-test",
- "subscribableInfo": {
- "alias": "c1-1x0-application-update-test",
- "deploymentPolicy": "deployment-policy-application-update-test",
- "artifactRepository": {
- "repoUsername": "user",
- "repoUrl": "http://stratos.apache.org:10080/git/default.git",
- "privateRepo": true,
- "repoPassword": "c-policy"
- },
- "autoscalingPolicy": "autoscaling-policy-application-update-test"
- }
- }
- ],
- "groups": [
- {
- "name": "G2-application-update-test",
- "groupMaxInstances": 1,
- "groupMinInstances": 1,
- "alias": "group2-application-update-test",
- "cartridges": [
- {
- "cartridgeMin": 2,
- "cartridgeMax": 4,
- "type": "c2-application-update-test",
- "subscribableInfo": {
- "alias": "c2-1x0-application-update-test",
- "deploymentPolicy": "deployment-policy-application-update-test",
- "artifactRepository": {
- "repoUsername": "user",
- "repoUrl": "http://stratos.apache.org:10080/git/default.git",
- "privateRepo": true,
- "repoPassword": "c-policy"
- },
- "autoscalingPolicy": "autoscaling-policy-application-update-test"
- }
- }
- ],
- "groups": [
- {
- "name": "G3-application-update-test",
- "groupMaxInstances": 3,
- "groupMinInstances": 2,
-<<<<<<< HEAD:products/stratos/modules/integration/src/test/resources/sample-applications-test/applications/g-sc-G123-1-v1.json
- "deploymentPolicy": "deployment-policy-1",
- "alias": "group3",
-=======
- "deploymentPolicy": "deployment-policy-application-update-test",
- "alias": "group3-application-update-test",
->>>>>>> f78ab82... Restructuring the integration test and adding more test cases:products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json
- "cartridges": [
- {
- "cartridgeMin": 2,
- "cartridgeMax": 3,
- "type": "c3-application-update-test",
- "subscribableInfo": {
- "alias": "c3-1x0-application-update-test",
- "artifactRepository": {
- "repoUsername": "user",
- "repoUrl": "http://stratos.apache.org:10080/git/default.git",
- "privateRepo": true,
- "repoPassword": "c-policy"
- },
- "autoscalingPolicy": "autoscaling-policy-application-update-test"
- }
- }
- ],
- "groups": []
- }
- ]
- }
- ]
- }
- ]
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2f2debf5/products/stratos/modules/integration/src/test/resources/group-startup-order-test/startup-order-termination-behavior/application.json.orig
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/group-startup-order-test/startup-order-termination-behavior/application.json.orig b/products/stratos/modules/integration/src/test/resources/group-startup-order-test/startup-order-termination-behavior/application.json.orig
deleted file mode 100644
index b28c017..0000000
--- a/products/stratos/modules/integration/src/test/resources/group-startup-order-test/startup-order-termination-behavior/application.json.orig
+++ /dev/null
@@ -1,89 +0,0 @@
-{
- "alias": "sub-G1-G2-G3-1-G4",
- "applicationId": "sub-G1-G2-G3-1-G4",
- "components": {
- "cartridges": [],
- "groups": [
- {
- "name": "G1",
- "groupMaxInstances": 1,
- "groupMinInstances": 1,
- "alias": "group1",
- "cartridges": [
- {
- "cartridgeMin": 1,
- "cartridgeMax": 1,
- "type": "c1",
- "subscribableInfo": {
- "alias": "c1-1x0",
- "deploymentPolicy": "static-1",
- "artifactRepository": {
- "repoUsername": "user",
- "repoUrl": "http://octl.qmog.cisco.com:10080/git/default.git",
- "privateRepo": true,
- "repoPassword": "c-policy"
- },
- "autoscalingPolicy": "economyPolicy"
- }
- }
-
- ],
- "groups": [
- {
- "name": "G2",
- "groupMaxInstances": 1,
- "groupMinInstances": 1,
- "alias": "group2",
- "cartridges": [
- {
- "cartridgeMin": 1,
- "cartridgeMax": 1,
- "type": "c2",
- "subscribableInfo": {
- "alias": "c2-1x0",
- "deploymentPolicy": "static-1",
- "artifactRepository": {
- "repoUsername": "user",
- "repoUrl": "http://octl.qmog.cisco.com:10080/git/default.git",
- "privateRepo": true,
- "repoPassword": "c-policy"
- },
- "autoscalingPolicy": "economyPolicy"
- }
- }
- ],
- "groups": [
- {
- "name": "G3",
- "groupMaxInstances": 1,
- "groupMinInstances": 1,
- "alias": "group3",
- "cartridges": [
- {
- "cartridgeMin": 1,
- "cartridgeMax": 1,
- "type": "c3",
- "subscribableInfo": {
- "alias": "c3-1x1",
- "deploymentPolicy": "static-1",
- "artifactRepository": {
- "repoUsername": "user",
- "repoUrl": "http://octl.qmog.cisco.com:10080/git/default.git",
- "privateRepo": true,
- "repoPassword": "c-policy"
- },
- "autoscalingPolicy": "economyPolicy"
- }
- }
- ],
- "groups": []
- }
- ]
- }
-
- ]
- }
- ]
- }
-}
-
[11/50] [abbrv] stratos git commit: Adding DAS thrift configuratio to
thrift-client-config.xml
Posted by ga...@apache.org.
Adding DAS thrift configuratio to thrift-client-config.xml
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/78da0efa
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/78da0efa
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/78da0efa
Branch: refs/heads/master
Commit: 78da0efa339ae2e7e51857d3196471eb1be4d949
Parents: 02eafdf
Author: Thanuja <th...@wso2.com>
Authored: Wed Aug 19 10:13:19 2015 +0530
Committer: Thanuja <th...@wso2.com>
Committed: Fri Aug 21 16:20:31 2015 +0530
----------------------------------------------------------------------
.../publisher/ThriftClientConfig.java | 34 +++++++--
.../publisher/ThriftClientConfigParser.java | 77 ++++++++++++++------
.../publisher/ThriftStatisticsPublisher.java | 9 ++-
.../cep/WSO2CEPHealthStatisticsPublisher.java | 3 +-
.../cep/WSO2CEPInFlightRequestPublisher.java | 3 +-
.../test/ThriftClientConfigParserTest.java | 18 +++--
.../src/test/resources/thrift-client-config.xml | 20 +++--
products/stratos/conf/thrift-client-config.xml | 20 +++--
8 files changed, 133 insertions(+), 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/78da0efa/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfig.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfig.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfig.java
index 25ee897..7f6d8c4 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfig.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfig.java
@@ -28,9 +28,11 @@ import org.apache.commons.lang.StringUtils;
public class ThriftClientConfig {
public static final String THRIFT_CLIENT_CONFIG_FILE_PATH = "thrift.client.config.file.path";
+ public static final String CEP_THRIFT_CLIENT_NAME = "cep";
+ public static final String DAS_THRIFT_CLIENT_NAME = "das";
private static volatile ThriftClientConfig instance;
- private ThriftClientInfo thriftClientInfo;
+ private ThriftClientInfo cepThriftClientInfo, dasThriftClientInfo;
/*
* A private Constructor prevents any other
@@ -63,19 +65,37 @@ public class ThriftClientConfig {
* <p/>
* This method is used to return the assigned values in ThriftClientInfo Object
*
+ * @param thriftClientName Thrift Client Name
* @return ThriftClientInfo object which consists of username,password,ip and port values
*/
- public ThriftClientInfo getThriftClientInfo() {
- return thriftClientInfo;
+ public ThriftClientInfo getThriftClientInfo(String thriftClientName) {
+ if (CEP_THRIFT_CLIENT_NAME.equals(thriftClientName)) {
+ return cepThriftClientInfo;
+ } else if (DAS_THRIFT_CLIENT_NAME.equals(thriftClientName)) {
+ return dasThriftClientInfo;
+ }
+ return null;
}
/**
- * Parsed values will be assigned to ThriftClientInfo object. Required fields will be taken
+ * Parsed values will be assigned to dasThriftClientInfo object. Required fields will be taken
* from thrift-client-config.xml file.
*
- * @param thriftClientInfo Object of the ThriftClientInfo
+ * @param thriftClientInfo DAS Thrift Client Information
*/
- public void setThriftClientInfo(ThriftClientInfo thriftClientInfo) {
- this.thriftClientInfo = thriftClientInfo;
+
+ public void setDASThriftClientInfo(ThriftClientInfo thriftClientInfo) {
+ this.dasThriftClientInfo = thriftClientInfo;
+ }
+
+ /**
+ * Parsed values will be assigned to cepThriftClientInfo object. Required fields will be taken
+ * from thrift-client-config.xml file.
+ *
+ * @param thriftClientInfo CEP Thrift Client Information
+ */
+
+ public void setCEPThriftClientInfo(ThriftClientInfo thriftClientInfo) {
+ this.cepThriftClientInfo = thriftClientInfo;
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/78da0efa/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java
index aa05d6f..e2684ac 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java
@@ -39,11 +39,15 @@ public class ThriftClientConfigParser {
/**
* Fields to be read from the thrift-client-config.xml file
*/
+ private static final String NAME_ELEMENT = "name";
private static final String USERNAME_ELEMENT = "username";
private static final String PASSWORD_ELEMENT = "password";
private static final String IP_ELEMENT = "ip";
private static final String PORT_ELEMENT = "port";
+ private static final String CEP_NAME_ELEMENT = "cep";
+ private static final String DAS_NAME_ELEMENT = "das";
+
/**
* This method reads thrift-client-config.xml file and assign necessary credential
* values into thriftClientInfo object. A singleton design has been implemented
@@ -61,8 +65,8 @@ public class ThriftClientConfigParser {
}
ThriftClientConfig thriftClientIConfig = new ThriftClientConfig();
- ThriftClientInfo thriftClientInfo = new ThriftClientInfo();
- thriftClientIConfig.setThriftClientInfo(thriftClientInfo);
+ ThriftClientInfo cepThriftClientInfo = new ThriftClientInfo();
+ ThriftClientInfo dasThriftClientInfo = new ThriftClientInfo();
File configFile = new File(filePath);
if (!configFile.exists()) {
@@ -74,6 +78,7 @@ public class ThriftClientConfigParser {
//Initialize the SecretResolver providing the configuration element.
SecretResolver secretResolver = SecretResolverFactory.create(document, false);
+ String nameValuesStr = null;
String userNameValuesStr = null;
String passwordValueStr = null;
String ipValuesStr = null;
@@ -85,36 +90,57 @@ public class ThriftClientConfigParser {
// Iterate the thrift-client-config.xml file and read child element
// consists of credential information necessary for ThriftStatisticsPublisher
while (thriftClientIterator.hasNext()) {
- OMElement thriftClientElement = (OMElement) thriftClientIterator.next();
+ OMElement thriftClientConfig = (OMElement) thriftClientIterator.next();
+ Iterator thriftClientConfigIterator = thriftClientConfig.getChildElements();
+ ThriftClientInfo thriftClientInfo = new ThriftClientInfo();
+ log.info("Client Config: " + thriftClientConfigIterator.toString());
+
+ while (thriftClientConfigIterator.hasNext()) {
+ OMElement thriftClientConfigElement = (OMElement) thriftClientConfigIterator.next();
+ log.info("Client Config Element: " + thriftClientConfigElement);
+
+ if (NAME_ELEMENT.equals(thriftClientConfigElement.getQName().getLocalPart())) {
+ nameValuesStr = thriftClientConfigElement.getText();
+ if (CEP_NAME_ELEMENT.equals(nameValuesStr)) {
+ cepThriftClientInfo = thriftClientInfo;
+ } else if (DAS_NAME_ELEMENT.equals(nameValuesStr)) {
+ dasThriftClientInfo = thriftClientInfo;
+ }
+ }
- if (USERNAME_ELEMENT.equals(thriftClientElement.getQName().getLocalPart())) {
- userNameValuesStr = thriftClientElement.getText();
- thriftClientInfo.setUsername(userNameValuesStr);
- }
- //password field protected using Secure vault
- if (PASSWORD_ELEMENT.equals(thriftClientElement.getQName().getLocalPart())) {
- if ((secretResolver != null) && (secretResolver.isInitialized())) {
- if (secretResolver.isTokenProtected(secretAlias)) {
- passwordValueStr = secretResolver.resolve(secretAlias);
+ if (USERNAME_ELEMENT.equals(thriftClientConfigElement.getQName().getLocalPart())) {
+ userNameValuesStr = thriftClientConfigElement.getText();
+ thriftClientInfo.setUsername(userNameValuesStr);
+ }
+
+ //password field protected using Secure vault
+ if (PASSWORD_ELEMENT.equals(thriftClientConfigElement.getQName().getLocalPart())) {
+ if ((secretResolver != null) && (secretResolver.isInitialized())) {
+ if (secretResolver.isTokenProtected(secretAlias)) {
+ passwordValueStr = secretResolver.resolve(secretAlias);
+ } else {
+ passwordValueStr = thriftClientConfigElement.getText();
+ }
} else {
- passwordValueStr = thriftClientElement.getText();
+ passwordValueStr = thriftClientConfigElement.getText();
}
- } else {
- passwordValueStr = thriftClientElement.getText();
+ thriftClientInfo.setPassword(passwordValueStr);
}
- thriftClientInfo.setPassword(passwordValueStr);
- }
- if (IP_ELEMENT.equals(thriftClientElement.getQName().getLocalPart())) {
- ipValuesStr = thriftClientElement.getText();
- thriftClientInfo.setIp(ipValuesStr);
- }
+ if (IP_ELEMENT.equals(thriftClientConfigElement.getQName().getLocalPart())) {
+ ipValuesStr = thriftClientConfigElement.getText();
+ thriftClientInfo.setIp(ipValuesStr);
+ }
- if (PORT_ELEMENT.equals(thriftClientElement.getQName().getLocalPart())) {
- portValueStr = thriftClientElement.getText();
- thriftClientInfo.setPort(portValueStr);
+ if (PORT_ELEMENT.equals(thriftClientConfigElement.getQName().getLocalPart())) {
+ portValueStr = thriftClientConfigElement.getText();
+ thriftClientInfo.setPort(portValueStr);
+ }
}
}
+ if (nameValuesStr == null) {
+ throw new RuntimeException("Name value not found in thrift client configuration ");
+ }
if (userNameValuesStr == null) {
throw new RuntimeException("Username value not found in thrift client configuration");
@@ -131,6 +157,9 @@ public class ThriftClientConfigParser {
throw new RuntimeException("Port not found in thrift client configuration ");
}
+ thriftClientIConfig.setCEPThriftClientInfo(cepThriftClientInfo);
+ thriftClientIConfig.setDASThriftClientInfo(dasThriftClientInfo);
+
return thriftClientIConfig;
} catch (Exception e) {
throw new RuntimeException("Could not parse thrift client configuration", e);
http://git-wip-us.apache.org/repos/asf/stratos/blob/78da0efa/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
index 6a9e955..9242e41 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
@@ -49,11 +49,14 @@ public class ThriftStatisticsPublisher implements StatisticsPublisher {
* Credential information stored inside thrift-client-config.xml file
* is parsed and assigned into ip,port,username and password fields
*
- * @param streamDefinition Thrift Event Stream Definition
+ * @param streamDefinition Thrift Event Stream Definition
+ * @param statsPublisherEnabled Whether thrift statistics publisher is enabled
+ * @param thriftClientName Thrift Client Name
*/
- public ThriftStatisticsPublisher(StreamDefinition streamDefinition, String statsPublisherEnabled) {
+ public ThriftStatisticsPublisher(StreamDefinition streamDefinition, String statsPublisherEnabled,
+ String thriftClientName) {
ThriftClientConfig thriftClientConfig = ThriftClientConfig.getInstance();
- ThriftClientInfo thriftClientInfo = thriftClientConfig.getThriftClientInfo();
+ ThriftClientInfo thriftClientInfo = thriftClientConfig.getThriftClientInfo(thriftClientName);
this.streamDefinition = streamDefinition;
this.ip = thriftClientInfo.getIp();
http://git-wip-us.apache.org/repos/asf/stratos/blob/78da0efa/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
index 33cf0b5..6a856c1 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
@@ -40,9 +40,10 @@ public class WSO2CEPHealthStatisticsPublisher extends ThriftStatisticsPublisher
private static final String STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
private static final String DATA_STREAM_NAME = "cartridge_agent_health_stats";
private static final String VERSION = "1.0.0";
+ public static final String CEP_THRIFT_CLIENT_NAME = "cep";
public WSO2CEPHealthStatisticsPublisher() {
- super(createStreamDefinition(), STATS_PUBLISHER_ENABLED);
+ super(createStreamDefinition(), STATS_PUBLISHER_ENABLED, CEP_THRIFT_CLIENT_NAME);
}
private static StreamDefinition createStreamDefinition() {
http://git-wip-us.apache.org/repos/asf/stratos/blob/78da0efa/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
index f853f23..aa64270 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
@@ -42,9 +42,10 @@ public class WSO2CEPInFlightRequestPublisher extends ThriftStatisticsPublisher i
private static final String STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
private static final String DATA_STREAM_NAME = "in_flight_requests";
private static final String VERSION = "1.0.0";
+ public static final String CEP_THRIFT_CLIENT_NAME = "cep";
public WSO2CEPInFlightRequestPublisher() {
- super(createStreamDefinition(), STATS_PUBLISHER_ENABLED);
+ super(createStreamDefinition(), STATS_PUBLISHER_ENABLED, CEP_THRIFT_CLIENT_NAME);
}
private static StreamDefinition createStreamDefinition() {
http://git-wip-us.apache.org/repos/asf/stratos/blob/78da0efa/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java b/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java
index 352041d..c51fa7e 100644
--- a/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java
+++ b/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java
@@ -42,11 +42,19 @@ public class ThriftClientConfigParserTest extends TestCase {
URL configFileUrl = ThriftClientConfigParserTest.class.getResource("/thrift-client-config.xml");
System.setProperty(ThriftClientConfig.THRIFT_CLIENT_CONFIG_FILE_PATH, configFileUrl.getPath());
ThriftClientConfig thriftClientConfig = ThriftClientConfig.getInstance();
- ThriftClientInfo thriftClientInfo = thriftClientConfig.getThriftClientInfo();
+ ThriftClientInfo cepThriftClientInfo = thriftClientConfig.getThriftClientInfo(
+ ThriftClientConfig.CEP_THRIFT_CLIENT_NAME);
+ ThriftClientInfo dasThriftClientInfo = thriftClientConfig.getThriftClientInfo(
+ ThriftClientConfig.DAS_THRIFT_CLIENT_NAME);
- assertEquals("Incorrect Username", "admin", thriftClientInfo.getUsername());
- assertEquals("Incorrect Password", "1234", thriftClientInfo.getPassword());
- assertEquals("Incorrect IP", "192.168.10.10", thriftClientInfo.getIp());
- assertEquals("Incorrect Port", "9300", thriftClientInfo.getPort());
+ assertEquals("Incorrect Username", "admin", cepThriftClientInfo.getUsername());
+ assertEquals("Incorrect Password", "1234", cepThriftClientInfo.getPassword());
+ assertEquals("Incorrect IP", "192.168.10.10", cepThriftClientInfo.getIp());
+ assertEquals("Incorrect Port", "9300", cepThriftClientInfo.getPort());
+
+ assertEquals("Incorrect Username", "admin1", dasThriftClientInfo.getUsername());
+ assertEquals("Incorrect Password", "12345", dasThriftClientInfo.getPassword());
+ assertEquals("Incorrect IP", "192.168.10.11", dasThriftClientInfo.getIp());
+ assertEquals("Incorrect Port", "9301", dasThriftClientInfo.getPort());
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/78da0efa/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml b/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml
index 7e9ff39..80d5796 100644
--- a/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml
+++ b/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml
@@ -18,10 +18,20 @@
~ under the License.
-->
-<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
+<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP and WSO2 DAS -->
<thriftClientConfiguration>
- <username>admin</username>
- <password>1234</password>
- <ip>192.168.10.10</ip>
- <port>9300</port>
+ <config>
+ <name>cep</name>
+ <username>admin</username>
+ <password>1234</password>
+ <ip>192.168.10.10</ip>
+ <port>9300</port>
+ </config>
+ <config>
+ <name>das</name>
+ <username>admin1</username>
+ <password>12345</password>
+ <ip>192.168.10.11</ip>
+ <port>9301</port>
+ </config>
</thriftClientConfiguration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/78da0efa/products/stratos/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/products/stratos/conf/thrift-client-config.xml b/products/stratos/conf/thrift-client-config.xml
index 5cacada..4b3b5b9 100644
--- a/products/stratos/conf/thrift-client-config.xml
+++ b/products/stratos/conf/thrift-client-config.xml
@@ -18,10 +18,20 @@
~ under the License.
-->
-<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
+<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP and WSO2 DAS-->
<thriftClientConfiguration>
- <username>admin</username>
- <password>admin</password>
- <ip>localhost</ip>
- <port>7611</port>
+ <config>
+ <name>cep</name>
+ <username>admin</username>
+ <password>admin</password>
+ <ip>localhost</ip>
+ <port>7611</port>
+ </config>
+ <config>
+ <name>das</name>
+ <username>admin</username>
+ <password>admin</password>
+ <ip>localhost</ip>
+ <port>7612</port>
+ </config>
</thriftClientConfiguration>
\ No newline at end of file
[13/50] [abbrv] stratos git commit: Changing public variable to
private
Posted by ga...@apache.org.
Changing public variable to private
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/81ec4e27
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/81ec4e27
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/81ec4e27
Branch: refs/heads/master
Commit: 81ec4e271c343cb79d3252fbec52d54b1fa278d5
Parents: 0917055
Author: Thanuja <th...@wso2.com>
Authored: Fri Aug 21 11:23:09 2015 +0530
Committer: Thanuja <th...@wso2.com>
Committed: Fri Aug 21 16:21:23 2015 +0530
----------------------------------------------------------------------
.../publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java | 2 +-
.../publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/81ec4e27/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
index c8517f6..86a7af6 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
@@ -40,7 +40,7 @@ public class WSO2CEPHealthStatisticsPublisher extends ThriftStatisticsPublisher
private static final String STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
private static final String DATA_STREAM_NAME = "cartridge_agent_health_stats";
private static final String VERSION = "1.0.0";
- public static final String CEP_THRIFT_CLIENT_NAME = "cep";
+ private static final String CEP_THRIFT_CLIENT_NAME = "cep";
public WSO2CEPHealthStatisticsPublisher() {
super(createStreamDefinition(), STATS_PUBLISHER_ENABLED, CEP_THRIFT_CLIENT_NAME);
http://git-wip-us.apache.org/repos/asf/stratos/blob/81ec4e27/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
index aa64270..c7bb52a 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
@@ -42,7 +42,7 @@ public class WSO2CEPInFlightRequestPublisher extends ThriftStatisticsPublisher i
private static final String STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
private static final String DATA_STREAM_NAME = "in_flight_requests";
private static final String VERSION = "1.0.0";
- public static final String CEP_THRIFT_CLIENT_NAME = "cep";
+ private static final String CEP_THRIFT_CLIENT_NAME = "cep";
public WSO2CEPInFlightRequestPublisher() {
super(createStreamDefinition(), STATS_PUBLISHER_ENABLED, CEP_THRIFT_CLIENT_NAME);
[19/50] [abbrv] stratos git commit: Disabling DAS thrift stats
publisher
Posted by ga...@apache.org.
Disabling DAS thrift stats publisher
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f10b71ec
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f10b71ec
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f10b71ec
Branch: refs/heads/master
Commit: f10b71ec3055c25e5faf4d86bf005dc11f622b39
Parents: 65b1b2a
Author: Thanuja <th...@wso2.com>
Authored: Sat Aug 22 22:58:25 2015 +0530
Committer: Thanuja <th...@wso2.com>
Committed: Sat Aug 22 22:58:25 2015 +0530
----------------------------------------------------------------------
products/stratos/conf/thrift-client-config.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/f10b71ec/products/stratos/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/products/stratos/conf/thrift-client-config.xml b/products/stratos/conf/thrift-client-config.xml
index e5ea9c8..f730c42 100644
--- a/products/stratos/conf/thrift-client-config.xml
+++ b/products/stratos/conf/thrift-client-config.xml
@@ -30,7 +30,7 @@
</config>
<config>
<name>das</name>
- <statsPublisherEnabled>true</statsPublisherEnabled>
+ <statsPublisherEnabled>false</statsPublisherEnabled>
<username>admin</username>
<password>admin</password>
<ip>localhost</ip>
[02/50] [abbrv] stratos git commit: Updating logs to display uuid and
tenantId
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/eb0d28f4/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 cf3a864..c967572 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,858 +1,858 @@
-<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://impl.services.controller.cloud.stratos.apache.org" xmlns:ax27="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax25="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:ax21="http://domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax22="http://common.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax212="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax210="http://domain.common.stratos.apache.org/xsd" 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://impl.services.controller.cloud.stratos.apache.org">
+<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax29="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:ns="http://impl.services.controller.cloud.stratos.apache.org" xmlns:ax27="http://domain.common.stratos.apache.org/xsd" xmlns:ax23="http://domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax24="http://common.stratos.apache.org/xsd" xmlns:ax21="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax211="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" 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://impl.services.controller.cloud.stratos.apache.org">
<wsdl:types>
- <xs:schema xmlns:ax29="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax213="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:ax26="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:ax24="http://domain.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.controller.cloud.stratos.apache.org">
- <xs:import namespace="http://domain.controller.cloud.stratos.apache.org/xsd"/>
+ <xs:schema xmlns:ax213="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax210="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:ax26="http://domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax22="http://exception.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.controller.cloud.stratos.apache.org">
<xs:import namespace="http://exception.controller.cloud.stratos.apache.org/xsd"/>
- <xs:import namespace="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://domain.controller.cloud.stratos.apache.org/xsd"/>
<xs:import namespace="http://topology.domain.messaging.stratos.apache.org/xsd"/>
- <xs:element name="getNetworkPartitionUuid">
+ <xs:import namespace="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd"/>
+ <xs:element name="CloudControllerServiceInvalidCartridgeDefinitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="InvalidCartridgeDefinitionException" nillable="true" type="ax21:InvalidCartridgeDefinitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitionUuidResponse">
+ <xs:element name="CloudControllerServiceInvalidIaasProviderException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="InvalidIaasProviderException" nillable="true" type="ax21:InvalidIaasProviderException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getPartitionsByNetworkPartition">
+ <xs:element name="CloudControllerServiceCartridgeDefinitionNotExistsException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="CartridgeDefinitionNotExistsException" nillable="true" type="ax21:CartridgeDefinitionNotExistsException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getPartitionsByNetworkPartitionResponse">
+ <xs:element name="updateCartridge">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:Partition"/>
+ <xs:element minOccurs="0" name="cartridge" nillable="true" type="ax26:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceNonExistingKubernetesClusterException">
+ <xs:element name="updateCartridgeResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NonExistingKubernetesClusterException" nillable="true" type="ax25:NonExistingKubernetesClusterException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeKubernetesCluster">
+ <xs:element name="CloudControllerServiceInvalidCartridgeTypeException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="groupUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="InvalidCartridgeTypeException" nillable="true" type="ax21:InvalidCartridgeTypeException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeKubernetesClusterResponse">
+ <xs:element name="removeCartridge">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeCartridgeResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceNonExistingKubernetesHostException">
+ <xs:element name="CloudControllerServiceInvalidServiceGroupException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NonExistingKubernetesHostException" nillable="true" type="ax25:NonExistingKubernetesHostException"/>
+ <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax21:InvalidServiceGroupException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeKubernetesHost">
+ <xs:element name="addServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesHostId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax26:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeKubernetesHostResponse">
+ <xs:element name="addServiceGroupResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidKubernetesMasterException">
+ <xs:element name="removeServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidKubernetesMasterException" nillable="true" type="ax25:InvalidKubernetesMasterException"/>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceNonExistingKubernetesMasterException">
+ <xs:element name="removeServiceGroupResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NonExistingKubernetesMasterException" nillable="true" type="ax25:NonExistingKubernetesMasterException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesMaster">
+ <xs:element name="getServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax29:KubernetesMaster"/>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesMasterResponse">
+ <xs:element name="getServiceGroupResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceNetworkPartitionAlreadyExistsException">
+ <xs:element name="getServiceGroupSubGroups">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NetworkPartitionAlreadyExistsException" nillable="true" type="ax25:NetworkPartitionAlreadyExistsException"/>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidNetworkPartitionException">
+ <xs:element name="getServiceGroupSubGroupsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidNetworkPartitionException" nillable="true" type="ax25:InvalidNetworkPartitionException"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addNetworkPartition">
+ <xs:element name="getServiceGroupCartridges">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="networkPartition" nillable="true" type="ax24:NetworkPartition"/>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addNetworkPartitionResponse">
+ <xs:element name="getServiceGroupCartridgesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceNetworkPartitionNotExistsException">
+ <xs:element name="getServiceGroupDependencies">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NetworkPartitionNotExistsException" nillable="true" type="ax25:NetworkPartitionNotExistsException"/>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeNetworkPartition">
+ <xs:element name="getServiceGroupDependenciesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:Dependencies"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeNetworkPartitionResponse">
+ <xs:element name="CloudControllerServiceInvalidPartitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax21:InvalidPartitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateNetworkPartition">
+ <xs:element name="validatePartition">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="networkPartition" nillable="true" type="ax24:NetworkPartition"/>
+ <xs:element minOccurs="0" name="partition" nillable="true" type="ax26:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateNetworkPartitionResponse">
+ <xs:element name="validatePartitionResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitions">
+ <xs:element name="validateDeploymentPolicyNetworkPartition">
<xs:complexType>
- <xs:sequence/>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitionsResponse">
+ <xs:element name="validateDeploymentPolicyNetworkPartitionResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:NetworkPartition"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitionsByTenant">
+ <xs:element name="CloudControllerServiceCartridgeNotFoundException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax21:CartridgeNotFoundException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitionsByTenantResponse">
+ <xs:element name="registerService">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:NetworkPartition"/>
+ <xs:element minOccurs="0" name="registrant" nillable="true" type="ax26:Registrant"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartition">
+ <xs:element name="registerServiceResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitionResponse">
+ <xs:element name="CloudControllerServiceCloudControllerException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:NetworkPartition"/>
+ <xs:element minOccurs="0" name="CloudControllerException" nillable="true" type="ax21:CloudControllerException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCartridgesByTenant">
+ <xs:element name="startInstances">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="instanceContexts" nillable="true" type="ax26:InstanceContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCartridgesByTenantResponse">
+ <xs:element name="startInstancesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:Cartridge"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:MemberContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitionByTenant">
+ <xs:element name="CloudControllerServiceInvalidMemberException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="InvalidMemberException" nillable="true" type="ax21:InvalidMemberException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitionByTenantResponse">
+ <xs:element name="terminateInstance">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:NetworkPartition"/>
+ <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceCartridgeNotFoundException">
+ <xs:element name="terminateInstanceResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax25:CartridgeNotFoundException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidIaasProviderException">
+ <xs:element name="terminateInstanceForcefully">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidIaasProviderException" nillable="true" type="ax25:InvalidIaasProviderException"/>
+ <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceCloudControllerException">
+ <xs:element name="terminateInstanceForcefullyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CloudControllerException" nillable="true" type="ax25:CloudControllerException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="startInstance">
+ <xs:element name="CloudControllerServiceInvalidClusterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="instanceContext" nillable="true" type="ax24:InstanceContext"/>
+ <xs:element minOccurs="0" name="InvalidClusterException" nillable="true" type="ax21:InvalidClusterException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="startInstanceResponse">
+ <xs:element name="terminateInstances">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:MemberContext"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getIaasProviders">
+ <xs:element name="terminateInstancesResponse">
<xs:complexType>
- <xs:sequence/>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getIaasProvidersResponse">
+ <xs:element name="updateClusterStatus">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="serviceName" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="status" nillable="true" type="ax29:ClusterStatus"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidCartridgeDefinitionException">
+ <xs:element name="updateClusterStatusResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidCartridgeDefinitionException" nillable="true" type="ax25:InvalidCartridgeDefinitionException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceCartridgeAlreadyExistsException">
+ <xs:element name="CloudControllerServiceUnregisteredClusterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeAlreadyExistsException" nillable="true" type="ax25:CartridgeAlreadyExistsException"/>
+ <xs:element minOccurs="0" name="UnregisteredClusterException" nillable="true" type="ax21:UnregisteredClusterException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addCartridge">
+ <xs:element name="unregisterService">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeConfig" nillable="true" type="ax24:Cartridge"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addCartridgeResponse">
+ <xs:element name="unregisterServiceResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceCartridgeDefinitionNotExistsException">
+ <xs:element name="getCartridgeByTenant">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeDefinitionNotExistsException" nillable="true" type="ax25:CartridgeDefinitionNotExistsException"/>
+ <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateCartridge">
+ <xs:element name="getCartridgeByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridge" nillable="true" type="ax24:Cartridge"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateCartridgeResponse">
+ <xs:element name="getCartridges">
+ <xs:complexType>
+ <xs:sequence/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getCartridgesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidCartridgeTypeException">
+ <xs:element name="getClusterContext">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidCartridgeTypeException" nillable="true" type="ax25:InvalidCartridgeTypeException"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeCartridge">
+ <xs:element name="getClusterContextResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ClusterContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeCartridgeResponse">
+ <xs:element name="CloudControllerServiceApplicationClusterRegistrationException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="ApplicationClusterRegistrationException" nillable="true" type="ax21:ApplicationClusterRegistrationException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidServiceGroupException">
+ <xs:element name="createApplicationClusters">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax25:InvalidServiceGroupException"/>
+ <xs:element minOccurs="0" name="appUuid" nillable="true" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="appClustersContexts" nillable="true" type="ax26:ApplicationClusterContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addServiceGroup">
+ <xs:element name="createApplicationClustersResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax24:ServiceGroup"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addServiceGroupResponse">
+ <xs:element name="CloudControllerServiceClusterInstanceCreationException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="ClusterInstanceCreationException" nillable="true" type="ax21:ClusterInstanceCreationException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeServiceGroup">
+ <xs:element name="createClusterInstance">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="serviceUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="partitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeServiceGroupResponse">
+ <xs:element name="createClusterInstanceResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroup">
+ <xs:element name="getKubernetesClusters">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupResponse">
+ <xs:element name="getKubernetesClustersResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:ServiceGroup"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax213:KubernetesCluster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupSubGroups">
+ <xs:element name="CloudControllerServiceNonExistingKubernetesClusterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="NonExistingKubernetesClusterException" nillable="true" type="ax21:NonExistingKubernetesClusterException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupSubGroupsResponse">
+ <xs:element name="getKubernetesCluster">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="kubernetesClusterUuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupCartridges">
+ <xs:element name="getKubernetesClusterResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax213:KubernetesCluster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupCartridgesResponse">
+ <xs:element name="getKubernetesClusterByTenant">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupDependencies">
+ <xs:element name="getKubernetesClusterByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax213:KubernetesCluster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupDependenciesResponse">
+ <xs:element name="getMasterForKubernetesCluster">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:Dependencies"/>
+ <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidPartitionException">
+ <xs:element name="getMasterForKubernetesClusterResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax25:InvalidPartitionException"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax213:KubernetesMaster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validateDeploymentPolicyNetworkPartition">
+ <xs:element name="getHostsForKubernetesCluster">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validateDeploymentPolicyNetworkPartitionResponse">
+ <xs:element name="getHostsForKubernetesClusterResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax213:KubernetesHost"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validatePartition">
+ <xs:element name="CloudControllerServiceInvalidKubernetesClusterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="partition" nillable="true" type="ax24:Partition"/>
+ <xs:element minOccurs="0" name="InvalidKubernetesClusterException" nillable="true" type="ax21:InvalidKubernetesClusterException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validatePartitionResponse">
+ <xs:element name="CloudControllerServiceKubernetesClusterAlreadyExistsException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="KubernetesClusterAlreadyExistsException" nillable="true" type="ax21:KubernetesClusterAlreadyExistsException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="registerService">
+ <xs:element name="addKubernetesCluster">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="registrant" nillable="true" type="ax24:Registrant"/>
+ <xs:element minOccurs="0" name="kubernetesCluster" nillable="true" type="ax213:KubernetesCluster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="registerServiceResponse">
+ <xs:element name="addKubernetesClusterResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="startInstances">
+ <xs:element name="updateKubernetesCluster">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="instanceContexts" nillable="true" type="ax24:InstanceContext"/>
+ <xs:element minOccurs="0" name="kubernetesCluster" nillable="true" type="ax213:KubernetesCluster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="startInstancesResponse">
+ <xs:element name="updateKubernetesClusterResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:MemberContext"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidMemberException">
+ <xs:element name="CloudControllerServiceInvalidKubernetesHostException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidMemberException" nillable="true" type="ax25:InvalidMemberException"/>
+ <xs:element minOccurs="0" name="InvalidKubernetesHostException" nillable="true" type="ax21:InvalidKubernetesHostException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="terminateInstance">
+ <xs:element name="addKubernetesHost">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="groupUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax213:KubernetesHost"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="terminateInstanceResponse">
+ <xs:element name="addKubernetesHostResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="terminateInstanceForcefully">
+ <xs:element name="CloudControllerServiceNonExistingKubernetesHostException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="NonExistingKubernetesHostException" nillable="true" type="ax21:NonExistingKubernetesHostException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="terminateInstanceForcefullyResponse">
+ <xs:element name="updateKubernetesHost">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax213:KubernetesHost"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidClusterException">
+ <xs:element name="updateKubernetesHostResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidClusterException" nillable="true" type="ax25:InvalidClusterException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="terminateInstances">
+ <xs:element name="removeKubernetesCluster">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="groupUuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="terminateInstancesResponse">
+ <xs:element name="removeKubernetesClusterResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateClusterStatus">
+ <xs:element name="removeKubernetesHost">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="serviceName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="status" nillable="true" type="ax212:ClusterStatus"/>
+ <xs:element minOccurs="0" name="kubernetesHostId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateClusterStatusResponse">
+ <xs:element name="removeKubernetesHostResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceUnregisteredClusterException">
+ <xs:element name="CloudControllerServiceInvalidKubernetesMasterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="UnregisteredClusterException" nillable="true" type="ax25:UnregisteredClusterException"/>
+ <xs:element minOccurs="0" name="InvalidKubernetesMasterException" nillable="true" type="ax21:InvalidKubernetesMasterException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="unregisterService">
+ <xs:element name="CloudControllerServiceNonExistingKubernetesMasterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="NonExistingKubernetesMasterException" nillable="true" type="ax21:NonExistingKubernetesMasterException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="unregisterServiceResponse">
+ <xs:element name="updateKubernetesMaster">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax213:KubernetesMaster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCartridge">
+ <xs:element name="updateKubernetesMasterResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCartridgeResponse">
+ <xs:element name="CloudControllerServiceNetworkPartitionAlreadyExistsException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:Cartridge"/>
+ <xs:element minOccurs="0" name="NetworkPartitionAlreadyExistsException" nillable="true" type="ax21:NetworkPartitionAlreadyExistsException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCartridgeByTenant">
+ <xs:element name="CloudControllerServiceInvalidNetworkPartitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="InvalidNetworkPartitionException" nillable="true" type="ax21:InvalidNetworkPartitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCartridgeByTenantResponse">
+ <xs:element name="addNetworkPartition">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:Cartridge"/>
+ <xs:element minOccurs="0" name="networkPartition" nillable="true" type="ax26:NetworkPartition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCartridges">
- <xs:complexType>
- <xs:sequence/>
- </xs:complexType>
- </xs:element>
- <xs:element name="getCartridgesResponse">
+ <xs:element name="addNetworkPartitionResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getClusterContext">
+ <xs:element name="CloudControllerServiceNetworkPartitionNotExistsException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="NetworkPartitionNotExistsException" nillable="true" type="ax21:NetworkPartitionNotExistsException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getClusterContextResponse">
+ <xs:element name="removeNetworkPartition">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:ClusterContext"/>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceApplicationClusterRegistrationException">
+ <xs:element name="removeNetworkPartitionResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="ApplicationClusterRegistrationException" nillable="true" type="ax25:ApplicationClusterRegistrationException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="createApplicationClusters">
+ <xs:element name="updateNetworkPartition">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="appUuid" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="appClustersContexts" nillable="true" type="ax24:ApplicationClusterContext"/>
+ <xs:element minOccurs="0" name="networkPartition" nillable="true" type="ax26:NetworkPartition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="createApplicationClustersResponse">
+ <xs:element name="updateNetworkPartitionResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceClusterInstanceCreationException">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="ClusterInstanceCreationException" nillable="true" type="ax25:ClusterInstanceCreationException"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="createClusterInstance">
+ <xs:element name="getNetworkPartitions">
<xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="serviceUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="partitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
- </xs:sequence>
+ <xs:sequence/>
</xs:complexType>
</xs:element>
- <xs:element name="createClusterInstanceResponse">
+ <xs:element name="getNetworkPartitionsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesClusters">
+ <xs:element name="getNetworkPartitionsByTenant">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesClustersResponse">
+ <xs:element name="getNetworkPartitionsByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:KubernetesCluster"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesCluster">
+ <xs:element name="getNetworkPartition">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesClusterResponse">
+ <xs:element name="getNetworkPartitionResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax29:KubernetesCluster"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesClusterByTenant">
+ <xs:element name="getCartridgesByTenant">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesClusterByTenantResponse">
+ <xs:element name="getCartridgesByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax29:KubernetesCluster"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getMasterForKubernetesCluster">
+ <xs:element name="getNetworkPartitionByTenant">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getMasterForKubernetesClusterResponse">
+ <xs:element name="getNetworkPartitionByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax29:KubernetesMaster"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getHostsForKubernetesCluster">
+ <xs:element name="startInstance">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="instanceContext" nillable="true" type="ax26:InstanceContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getHostsForKubernetesClusterResponse">
+ <xs:element name="startInstanceResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:KubernetesHost"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:MemberContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidKubernetesClusterException">
+ <xs:element name="getNetworkPartitionUuid">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidKubernetesClusterException" nillable="true" type="ax25:InvalidKubernetesClusterException"/>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceKubernetesClusterAlreadyExistsException">
+ <xs:element name="getNetworkPartitionUuidResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="KubernetesClusterAlreadyExistsException" nillable="true" type="ax25:KubernetesClusterAlreadyExistsException"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addKubernetesCluster">
+ <xs:element name="getPartitionsByNetworkPartition">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesCluster" nillable="true" type="ax29:KubernetesCluster"/>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addKubernetesClusterResponse">
+ <xs:element name="getPartitionsByNetworkPartitionResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesCluster">
+ <xs:element name="getIaasProviders">
<xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="kubernetesCluster" nillable="true" type="ax29:KubernetesCluster"/>
- </xs:sequence>
+ <xs:sequence/>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesClusterResponse">
+ <xs:element name="getIaasProvidersResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidKubernetesHostException">
+ <xs:element name="CloudControllerServiceCartridgeAlreadyExistsException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidKubernetesHostException" nillable="true" type="ax25:InvalidKubernetesHostException"/>
+ <xs:element minOccurs="0" name="CartridgeAlreadyExistsException" nillable="true" type="ax21:CartridgeAlreadyExistsException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addKubernetesHost">
+ <xs:element name="addCartridge">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="groupUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax29:KubernetesHost"/>
+ <xs:element minOccurs="0" name="cartridgeConfig" nillable="true" type="ax26:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addKubernetesHostResponse">
+ <xs:element name="addCartridgeResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesHost">
+ <xs:element name="getCartridge">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax29:KubernetesHost"/>
+ <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesHostResponse">
+ <xs:element name="getCartridgeResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -871,7 +871,7 @@
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.stratos.apache.org/xsd">
<xs:complexType name="Properties">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax22:Property"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax24:Property"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Property">
@@ -882,49 +882,41 @@
</xs:complexType>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://exception.controller.cloud.stratos.apache.org/xsd">
- <xs:complexType name="NonExistingKubernetesClusterException">
+ <xs:complexType name="InvalidCartridgeDefinitionException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="NonExistingKubernetesHostException">
+ <xs:complexType name="InvalidIaasProviderException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidKubernetesMasterException">
+ <xs:complexType name="CartridgeDefinitionNotExistsException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="NonExistingKubernetesMasterException">
+ <xs:complexType name="InvalidCartridgeTypeException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="NetworkPartitionAlreadyExistsException">
+ <xs:complexType name="InvalidServiceGroupException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidNetworkPartitionException">
+ <xs:complexType name="InvalidPartitionException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="NetworkPartitionNotExistsException">
- <xs:sequence/>
- </xs:complexType>
<xs:complexType name="CartridgeNotFoundException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidIaasProviderException">
- <xs:sequence>
- <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
<xs:complexType name="CloudControllerException">
<xs:complexContent>
<xs:extension base="xs:RuntimeException">
@@ -932,120 +924,113 @@
</xs:extension>
</xs:complexContent>
</xs:complexType>
- <xs:complexType name="InvalidCartridgeDefinitionException">
+ <xs:complexType name="InvalidMemberException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="CartridgeAlreadyExistsException">
- <xs:sequence/>
- </xs:complexType>
- <xs:complexType name="CartridgeDefinitionNotExistsException">
+ <xs:complexType name="InvalidClusterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidCartridgeTypeException">
+ <xs:complexType name="UnregisteredClusterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidServiceGroupException">
+ <xs:complexType name="ApplicationClusterRegistrationException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidPartitionException">
+ <xs:complexType name="ClusterInstanceCreationException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidMemberException">
+ <xs:complexType name="NonExistingKubernetesClusterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidClusterException">
+ <xs:complexType name="InvalidKubernetesClusterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="UnregisteredClusterException">
+ <xs:complexType name="KubernetesClusterAlreadyExistsException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="ApplicationClusterRegistrationException">
+ <xs:complexType name="InvalidKubernetesHostException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="ClusterInstanceCreationException">
+ <xs:complexType name="NonExistingKubernetesHostException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidKubernetesClusterException">
+ <xs:complexType name="InvalidKubernetesMasterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="KubernetesClusterAlreadyExistsException">
+ <xs:complexType name="NonExistingKubernetesMasterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidKubernetesHostException">
+ <xs:complexType name="NetworkPartitionAlreadyExistsException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- </xs:schema>
- <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.common.stratos.apache.org/xsd">
- <xs:complexType name="NameValuePair">
+ <xs:complexType name="InvalidNetworkPartitionException">
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="value" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="LoadBalancingIPType">
- <xs:complexContent>
- <xs:extension base="xs:Enum">
- <xs:sequence/>
- </xs:extension>
- </xs:complexContent>
+ <xs:complexType name="NetworkPartitionNotExistsException">
+ <xs:sequence/>
+ </xs:complexType>
+ <xs:complexType name="CartridgeAlreadyExistsException">
+ <xs:sequence/>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax28="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd">
+ <xs:schema xmlns:ax212="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd">
<xs:import namespace="http://common.stratos.apache.org/xsd"/>
+ <xs:complexType name="KubernetesCluster">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="clusterUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="kubernetesHosts" nillable="true" type="ax211:KubernetesHost"/>
+ <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax211:KubernetesMaster"/>
+ <xs:element minOccurs="0" name="portRange" nillable="true" type="ax211:PortRange"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax212:Properties"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
<xs:complexType name="KubernetesHost">
<xs:sequence>
<xs:element minOccurs="0" name="hostId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="hostname" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="privateIPAddress" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax28:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax212:Properties"/>
<xs:element minOccurs="0" name="publicIPAddress" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="KubernetesMaster">
<xs:complexContent>
- <xs:extension base="ax27:KubernetesHost">
+ <xs:extension base="ax211:KubernetesHost">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
- <xs:complexType name="KubernetesCluster">
- <xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="clusterUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="kubernetesHosts" nillable="true" type="ax27:KubernetesHost"/>
- <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax27:KubernetesMaster"/>
- <xs:element minOccurs="0" name="portRange" nillable="true" type="ax27:PortRange"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax28:Properties"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
- </xs:sequence>
- </xs:complexType>
<xs:complexType name="PortRange">
<xs:sequence>
<xs:element minOccurs="0" name="lower" type="xs:int"/>
@@ -1053,37 +1038,27 @@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax211="http://domain.common.stratos.apache.org/xsd" xmlns:ax23="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.controller.cloud.stratos.apache.org/xsd">
- <xs:import namespace="http://common.stratos.apache.org/xsd"/>
- <xs:import namespace="http://domain.common.stratos.apache.org/xsd"/>
- <xs:complexType name="Partition">
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.common.stratos.apache.org/xsd">
+ <xs:complexType name="NameValuePair">
<xs:sequence>
- <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="isPublic" type="xs:boolean"/>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="partitionMax" type="xs:int"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
- <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
- <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="value" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="NetworkPartition">
- <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="partitionAlgo" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions" nillable="true" type="ax21:Partition"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
- <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
- <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
- </xs:sequence>
+ <xs:complexType name="LoadBalancingIPType">
+ <xs:complexContent>
+ <xs:extension base="xs:Enum">
+ <xs:sequence/>
+ </xs:extension>
+ </xs:complexContent>
</xs:complexType>
+ </xs:schema>
+ <xs:schema xmlns:ax28="http://domain.common.stratos.apache.org/xsd" xmlns:ax25="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.controller.cloud.stratos.apache.org/xsd">
+ <xs:import namespace="http://common.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://domain.common.stratos.apache.org/xsd"/>
<xs:complexType name="Cartridge">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="appTypeMappings" nillable="true" type="ax21:AppType"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="appTypeMappings" nillable="true" type="ax23:AppType"/>
<xs:element minOccurs="0" name="baseDir" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="category" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="deploymentDirs" nillable="true" type="xs:string"/>
@@ -1091,14 +1066,14 @@
<xs:element minOccurs="0" name="displayName" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="exportingProperties" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="iaasConfigs" nillable="true" type="ax21:IaasConfig"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="iaasConfigs" nillable="true" type="ax23:IaasConfig"/>
<xs:element minOccurs="0" name="isPublic" type="xs:boolean"/>
<xs:element minOccurs="0" name="loadBalancingIPType" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="metadataKeys" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="multiTenant" type="xs:boolean"/>
- <xs:element minOccurs="0" name="persistence" nillable="true" type="ax21:Persistence"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax21:PortMapping"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
+ <xs:element minOccurs="0" name="persistence" nillable="true" type="ax23:Persistence"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax23:PortMapping"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
<xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="tenantPartitions" nillable="true" type="xs:string"/>
@@ -1120,29 +1095,29 @@
<xs:element minOccurs="0" name="identity" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="imageId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="networkInterfaces" nillable="true" type="ax21:NetworkInterfaces"/>
+ <xs:element minOccurs="0" name="networkInterfaces" nillable="true" type="ax23:NetworkInterfaces"/>
<xs:element minOccurs="0" name="payload" nillable="true" type="xs:base64Binary"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
<TRUNCATED>
[28/50] [abbrv] stratos git commit: Upgrading fabric8 kubernetes api
version to 2.2.16 and removing forked code
Posted by ga...@apache.org.
Upgrading fabric8 kubernetes api version to 2.2.16 and removing forked code
Conflicts:
dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/AbstractWatcher.java
dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/ExceptionResponseMapper.java
dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesApiException.java
dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Watcher.java
dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/Dockerfile
dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.html
dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.raml
dependencies/fabric8/kubernetes-api/src/main/resources/log4j.properties
dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuilds.java
dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuildsExample.java
dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchPodsExample.java
dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchServicesExample.java
dependencies/fabric8/kubernetes-api/src/test/resources/config.yml
dependencies/fabric8/kubernetes-api/src/test/resources/glance-api-service.yaml
dependencies/fabric8/kubernetes-model/pom.xml
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesBaseConfig.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesConfig.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/OpenshiftConfig.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/HasMetadata.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesKind.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesList.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesResource.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/resource/Quantity.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/util/IntOrString.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataComparator.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataSet.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/KubernetesDeserializer.java
dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/openshift/api/model/template/Template.java
dependencies/fabric8/kubernetes-model/src/main/resources/log4j.properties
dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/InlineTest.java
dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/KubernetesListTest.java
dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/UnmarshallTest.java
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/12c0ea00
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/12c0ea00
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/12c0ea00
Branch: refs/heads/master
Commit: 12c0ea00691ecbfce920db3022816aa8752ac3b5
Parents: ad9b2c2
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Jul 26 05:42:14 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Thu Aug 27 16:42:54 2015 +0530
----------------------------------------------------------------------
.../org.apache.stratos.cloud.controller/pom.xml | 2 +-
.../iaases/kubernetes/KubernetesIaas.java | 12 +-
.../pom.xml | 4 +-
.../kubernetes/client/KubernetesApiClient.java | 31 +-
.../kubernetes/client/KubernetesConstants.java | 1 +
.../KubernetesAPIClientInterface.java | 8 +-
.../client/live/AbstractLiveTest.java | 15 +-
dependencies/fabric8/kubernetes-api/README.md | 10 +-
dependencies/fabric8/kubernetes-api/pom.xml | 68 +-
.../fabric8/kubernetes/api/AbstractWatcher.java | 61 -
.../io/fabric8/kubernetes/api/Controller.java | 850 ----
.../java/io/fabric8/kubernetes/api/Entity.java | 28 -
.../kubernetes/api/ExceptionResponseMapper.java | 69 -
.../io/fabric8/kubernetes/api/Kubernetes.java | 283 --
.../kubernetes/api/KubernetesApiException.java | 11 -
.../kubernetes/api/KubernetesClient.java | 1618 ------
.../kubernetes/api/KubernetesExtensions.java | 226 -
.../kubernetes/api/KubernetesFactory.java | 384 --
.../api/KubernetesGlobalExtensions.java | 56 -
.../kubernetes/api/KubernetesHelper.java | 1724 -------
.../fabric8/kubernetes/api/PodStatusType.java | 25 -
.../io/fabric8/kubernetes/api/ServiceNames.java | 58 -
.../api/UserConfigurationCompare.java | 201 -
.../java/io/fabric8/kubernetes/api/Watcher.java | 13 -
.../api/builders/ListEnvVarBuilder.java | 43 -
.../api/builds/BuildFinishedEvent.java | 64 -
.../kubernetes/api/builds/BuildListener.java | 30 -
.../kubernetes/api/builds/BuildWatcher.java | 121 -
.../fabric8/kubernetes/api/builds/Builds.java | 199 -
.../io/fabric8/kubernetes/api/builds/Links.java | 35 -
.../kubernetes/api/extensions/Configs.java | 117 -
.../kubernetes/api/extensions/Templates.java | 225 -
.../api/support/KindToClassMapping.java | 264 -
.../src/main/kubernetes/api/Dockerfile | 5 -
.../api/examples/controller-list.json | 35 -
.../kubernetes/api/examples/controller.json | 24 -
.../api/examples/external-service.json | 13 -
.../src/main/kubernetes/api/examples/list.json | 98 -
.../api/examples/pod-list-empty-results.json | 19 -
.../main/kubernetes/api/examples/pod-list.json | 93 -
.../src/main/kubernetes/api/examples/pod.json | 34 -
.../kubernetes/api/examples/service-list.json | 28 -
.../main/kubernetes/api/examples/service.json | 33 -
.../main/kubernetes/api/examples/template.json | 146 -
.../src/main/kubernetes/api/kubernetes.html | 1636 ------
.../src/main/kubernetes/api/kubernetes.raml | 185 -
.../src/main/resources/log4j.properties | 8 -
.../java/io/fabric8/kubernetes/api/Apply.java | 48 -
.../kubernetes/api/ConfigComparePodTest.java | 243 -
.../ConfigCompareReplicationControllerTest.java | 530 --
.../api/ConfigCompareServiceTest.java | 235 -
.../kubernetes/api/ConfigFileParseTest.java | 58 -
.../java/io/fabric8/kubernetes/api/Example.java | 134 -
.../api/FindOpenShiftNamespaceTest.java | 41 -
.../kubernetes/api/KubernetesHelperTest.java | 71 -
.../kubernetes/api/ParseDateTimeTest.java | 36 -
.../kubernetes/api/ParseExamplesTest.java | 128 -
.../kubernetes/api/ParseServiceTest.java | 65 -
.../io/fabric8/kubernetes/api/ParseTest.java | 157 -
.../PodIdToReplicationControllerIDExample.java | 42 -
.../api/ProcessTemplateLocallyTest.java | 54 -
.../fabric8/kubernetes/api/TemplatesTest.java | 50 -
.../io/fabric8/kubernetes/api/TriggerBuild.java | 45 -
.../kubernetes/api/UsingBadAddressTest.java | 47 -
.../fabric8/kubernetes/api/ViewEndpoints.java | 88 -
.../io/fabric8/kubernetes/api/ViewNodes.java | 61 -
.../fabric8/kubernetes/api/ViewServiceIPs.java | 45 -
.../io/fabric8/kubernetes/api/WatchBuilds.java | 52 -
.../kubernetes/api/WatchBuildsExample.java | 23 -
.../kubernetes/api/WatchPodsExample.java | 23 -
.../kubernetes/api/WatchServicesExample.java | 23 -
.../src/test/resources/config.yml | 52 -
.../src/test/resources/errorexample.json | 77 -
.../src/test/resources/fmq-service.json | 20 -
.../src/test/resources/glance-api-service.yaml | 7 -
.../src/test/resources/log4j.properties | 25 -
dependencies/fabric8/kubernetes-model/README.md | 7 -
dependencies/fabric8/kubernetes-model/pom.xml | 176 -
.../io/fabric8/config/KubernetesBaseConfig.java | 14 -
.../io/fabric8/config/KubernetesConfig.java | 81 -
.../java/io/fabric8/config/OpenshiftConfig.java | 67 -
.../kubernetes/api/model/HasMetadata.java | 7 -
.../kubernetes/api/model/KubernetesKind.java | 71 -
.../kubernetes/api/model/KubernetesList.java | 49 -
.../api/model/KubernetesResource.java | 8 -
.../kubernetes/api/model/resource/Quantity.java | 135 -
.../kubernetes/api/model/util/IntOrString.java | 195 -
.../internal/HasMetadataComparator.java | 30 -
.../kubernetes/internal/HasMetadataSet.java | 25 -
.../internal/KubernetesDeserializer.java | 33 -
.../openshift/api/model/template/Template.java | 306 --
.../src/main/resources/log4j.properties | 8 -
.../src/main/resources/schema/kube-schema.json | 4692 ------------------
.../kubernetes/api/model/InlineTest.java | 18 -
.../api/model/KubernetesListTest.java | 85 -
.../kubernetes/api/model/UnmarshallTest.java | 66 -
.../src/test/resources/service-list.json | 239 -
.../src/test/resources/simple-list.json | 64 -
.../src/test/resources/simple-template.json | 45 -
.../src/test/resources/valid-pod.json | 22 -
dependencies/fabric8/pom.xml | 1 -
.../pom.xml | 10 +-
pom.xml | 2 +
103 files changed, 61 insertions(+), 18088 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/components/org.apache.stratos.cloud.controller/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/pom.xml b/components/org.apache.stratos.cloud.controller/pom.xml
index 1e5ff3f..8828226 100644
--- a/components/org.apache.stratos.cloud.controller/pom.xml
+++ b/components/org.apache.stratos.cloud.controller/pom.xml
@@ -317,7 +317,7 @@
<dependency>
<groupId>org.apache.stratos</groupId>
<artifactId>kubernetes-api</artifactId>
- <version>2.1.11-stratosv1</version>
+ <version>${kubernetes.api.stratos.version}</version>
</dependency>
</dependencies>
<properties>
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
index 387d67d..4dcc472 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
@@ -520,13 +520,13 @@ public class KubernetesIaas extends Iaas {
}
// Create kubernetes service for port mapping
- int servicePort = clusterPortMapping.getKubernetesServicePort();
+ int nodePort = clusterPortMapping.getKubernetesServicePort();
String containerPortName = KubernetesIaasUtil.preparePortNameFromPortMapping(clusterPortMapping);
try {
// Services need to use minions private IP addresses for creating iptable rules
- kubernetesApi.createService(serviceId, serviceLabel, servicePort, containerPortName,
- containerPort, minionPrivateIPList, sessionAffinity);
+ kubernetesApi.createService(serviceId, serviceLabel, nodePort, containerPortName,
+ containerPort, sessionAffinity);
} finally {
// Persist kubernetes service sequence no
CloudControllerContext.getInstance().persist();
@@ -541,7 +541,7 @@ public class KubernetesIaas extends Iaas {
KubernetesService kubernetesService = new KubernetesService();
kubernetesService.setId(service.getMetadata().getName());
- kubernetesService.setPortalIP(service.getSpec().getPortalIP());
+ kubernetesService.setPortalIP(service.getSpec().getClusterIP());
// Expose minions public IP addresses as they need to be accessed by external networks
String[] minionPublicIPArray = minionPublicIPList.toArray(new String[minionPublicIPList.size()]);
kubernetesService.setPublicIPs(minionPublicIPArray);
@@ -552,8 +552,8 @@ public class KubernetesIaas extends Iaas {
if (log.isInfoEnabled()) {
log.info(String.format("Kubernetes service successfully created: [cluster] %s [service] %s " +
- "[protocol] %s [service-port] %d [container-port] %s", clusterId,
- serviceId, clusterPortMapping.getProtocol(), servicePort, containerPort));
+ "[protocol] %s [node-port] %d [container-port] %s", clusterId,
+ serviceId, clusterPortMapping.getProtocol(), nodePort, containerPort));
}
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/components/org.apache.stratos.kubernetes.client/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/pom.xml b/components/org.apache.stratos.kubernetes.client/pom.xml
index 4f5cd8e..287688b 100644
--- a/components/org.apache.stratos.kubernetes.client/pom.xml
+++ b/components/org.apache.stratos.kubernetes.client/pom.xml
@@ -52,7 +52,7 @@
<dependency>
<groupId>org.apache.stratos</groupId>
<artifactId>kubernetes-api</artifactId>
- <version>2.1.11-stratosv1</version>
+ <version>${kubernetes.api.stratos.version}</version>
</dependency>
</dependencies>
@@ -71,7 +71,7 @@
org.apache.stratos.kubernetes.client.exceptions,
</Export-Package>
<Import-Package>
- io.fabric8.kubernetes.api.*;version=2.1.11-stratosv1,
+ io.fabric8.kubernetes.api.*;version=${kubernetes.api.stratos.version},
*;resolution:=optional
</Import-Package>
<DynamicImport-Package>*</DynamicImport-Package>
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesApiClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesApiClient.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesApiClient.java
index 112f843..f176cd9 100644
--- a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesApiClient.java
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesApiClient.java
@@ -22,8 +22,6 @@ package org.apache.stratos.kubernetes.client;
import io.fabric8.kubernetes.api.KubernetesClient;
import io.fabric8.kubernetes.api.model.*;
-import io.fabric8.kubernetes.api.model.resource.Quantity;
-import io.fabric8.kubernetes.api.model.util.IntOrString;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.stratos.kubernetes.client.exceptions.KubernetesClientException;
@@ -71,7 +69,7 @@ public class KubernetesApiClient implements KubernetesAPIClientInterface {
// Create pod definition
Pod pod = new Pod();
- pod.setApiVersion(Pod.ApiVersion.V_1_BETA_3);
+ pod.setApiVersion(Pod.ApiVersion.V_1);
pod.setKind(KubernetesConstants.KIND_POD);
pod.setSpec(new PodSpec());
@@ -157,23 +155,21 @@ public class KubernetesApiClient implements KubernetesAPIClientInterface {
*
* @param serviceId Service id
* @param serviceLabel Service name to be used by the label name
- * @param servicePort Port to be exposed by the service
+ * @param nodePort Port to be exposed by the kubernetes node
* @param containerPortName Container port name defined in the port label
* @param containerPort Container port
- * @param publicIPs Public IP addresses of the minions
* @param sessionAffinity Session affinity configuration
* @throws KubernetesClientException
*/
@Override
- public void createService(String serviceId, String serviceLabel, int servicePort,
- String containerPortName, int containerPort, List<String> publicIPs,
- String sessionAffinity)
+ public void createService(String serviceId, String serviceLabel, int nodePort,
+ String containerPortName, int containerPort, String sessionAffinity)
throws KubernetesClientException {
try {
if (log.isDebugEnabled()) {
log.debug(String.format("Creating kubernetes service: [service-id] %s [service-name] %s [service-port] %d " +
- "[container-port-name] %s", serviceId, serviceLabel, servicePort,
+ "[container-port-name] %s", serviceId, serviceLabel, nodePort,
containerPortName));
}
@@ -182,19 +178,20 @@ public class KubernetesApiClient implements KubernetesAPIClientInterface {
service.setSpec(new ServiceSpec());
service.setMetadata(new ObjectMeta());
- service.setApiVersion(Service.ApiVersion.V_1_BETA_3);
+ service.setApiVersion(Service.ApiVersion.V_1);
service.setKind(KubernetesConstants.KIND_SERVICE);
service.getMetadata().setName(serviceId);
- service.getSpec().setPublicIPs(publicIPs);
service.getSpec().setSessionAffinity(sessionAffinity);
+ service.getSpec().setType(KubernetesConstants.NODE_PORT);
// Set port
List<ServicePort> ports = new ArrayList<ServicePort>();
ServicePort port = new ServicePort();
port.setName(containerPortName);
- port.setPort(servicePort);
+ port.setPort(containerPort);
port.setTargetPort(new IntOrString(containerPort));
+ port.setNodePort(nodePort);
ports.add(port);
service.getSpec().setPorts(ports);
@@ -212,12 +209,14 @@ public class KubernetesApiClient implements KubernetesAPIClientInterface {
kubernetesClient.createService(service);
if (log.isDebugEnabled()) {
- log.debug(String.format("Kubernetes service created successfully: [service-id] %s [service-name] %s [service-port] %d " +
- "[container-port-name] %s", serviceId, serviceLabel, servicePort, containerPortName));
+ log.debug(String.format("Kubernetes service created successfully: [service-id] %s [service-name] %s " +
+ "[node-port] %d [container-port-name] %s [container-port] %d", serviceId, serviceLabel,
+ nodePort, containerPortName, containerPort));
}
} catch (Exception e) {
- String message = String.format("Could not create kubernetes service: [service-id] %s [service-name] %s [service-port] %d " +
- "[container-port-name] %s", serviceId, serviceLabel, servicePort, containerPortName);
+ String message = String.format("Could not create kubernetes service: [service-id] %s [service-name] %s " +
+ "[node-port] %d [container-port-name] %s [container-port] %d", serviceId, serviceLabel,
+ nodePort, containerPortName, containerPort);
log.error(message, e);
throw new KubernetesClientException(message, e);
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesConstants.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesConstants.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesConstants.java
index 4b5210a..9c8fc7a 100644
--- a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesConstants.java
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesConstants.java
@@ -32,4 +32,5 @@ public class KubernetesConstants {
public static final String LABEL_NAME = "name";
public static final String RESOURCE_CPU = "cpu";
public static final String RESOURCE_MEMORY = "memory";
+ public static final String NODE_PORT = "NodePort";
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java
index 26772fc..6741d6b 100644
--- a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java
@@ -76,16 +76,14 @@ public interface KubernetesAPIClientInterface {
*
* @param serviceId
* @param serviceLabel
- * @param servicePort
+ * @param nodePort
* @param containerPortName
* @param containerPort
- * @param publicIPs
* @param sessionAffinity
* @throws KubernetesClientException
*/
- public void createService(String serviceId, String serviceLabel, int servicePort,
- String containerPortName, int containerPort, List<String> publicIPs,
- String sessionAffinity)
+ public void createService(String serviceId, String serviceLabel, int nodePort,
+ String containerPortName, int containerPort, String sessionAffinity)
throws KubernetesClientException;
/**
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/components/org.apache.stratos.kubernetes.client/src/test/java/org/apache/stratos/kubernetes/client/live/AbstractLiveTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/test/java/org/apache/stratos/kubernetes/client/live/AbstractLiveTest.java b/components/org.apache.stratos.kubernetes.client/src/test/java/org/apache/stratos/kubernetes/client/live/AbstractLiveTest.java
index 29b7ed4..293723c 100644
--- a/components/org.apache.stratos.kubernetes.client/src/test/java/org/apache/stratos/kubernetes/client/live/AbstractLiveTest.java
+++ b/components/org.apache.stratos.kubernetes.client/src/test/java/org/apache/stratos/kubernetes/client/live/AbstractLiveTest.java
@@ -19,11 +19,7 @@
package org.apache.stratos.kubernetes.client.live;
-import io.fabric8.kubernetes.api.model.Container;
-import io.fabric8.kubernetes.api.model.ContainerPort;
-import io.fabric8.kubernetes.api.model.Pod;
-import io.fabric8.kubernetes.api.model.Service;
-import io.fabric8.kubernetes.api.model.resource.Quantity;
+import io.fabric8.kubernetes.api.model.*;
import junit.framework.TestCase;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@@ -53,7 +49,7 @@ public class AbstractLiveTest extends TestCase {
protected static final String DEFAULT_DOCKER_IMAGE = "fnichol/uhttpd";
protected static final int DEFAULT_CONTAINER_PORT = 80;
- protected static final int SERVICE_PORT = 4500;
+ protected static final int SERVICE_PORT = 30001;
protected static final int POD_ACTIVATION_WAIT_TIME = 10000; // 10 seconds
protected static final String KUBERNETES_API_ENDPOINT = "kubernetes.api.endpoint";
@@ -62,6 +58,7 @@ public class AbstractLiveTest extends TestCase {
protected static final String CONTAINER_PORT = "container.port";
protected static final String TEST_SERVICE_SOCKET = "test.service.socket";
protected static final String TEST_POD_ACTIVATION = "test.pod.activation";
+ protected static final String PROTOCOL_TCP = "TCP";
protected KubernetesApiClient client;
protected String dockerImage;
@@ -199,10 +196,10 @@ public class AbstractLiveTest extends TestCase {
}
}
- protected void createService(String serviceId, String serviceName, int servicePort, String containerPortName,
+ protected void createService(String serviceId, String serviceName, int nodePort, String containerPortName,
int containerPort, List<String> publicIPs) throws KubernetesClientException, InterruptedException, IOException {
log.info("Creating service...");
- client.createService(serviceId, serviceName, servicePort, containerPortName, containerPort, publicIPs,
+ client.createService(serviceId, serviceName, nodePort, containerPortName, containerPort,
KubernetesConstants.SESSION_AFFINITY_CLIENT_IP);
serviceIdList.add(serviceId);
@@ -248,7 +245,7 @@ public class AbstractLiveTest extends TestCase {
ContainerPort port = new ContainerPort();
port.setName(containerPortName);
port.setContainerPort(containerPort);
- port.setProtocol("tcp");
+ port.setProtocol(PROTOCOL_TCP);
ports.add(port);
return ports;
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/README.md
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/README.md b/dependencies/fabric8/kubernetes-api/README.md
index 1f8c473..1573883 100644
--- a/dependencies/fabric8/kubernetes-api/README.md
+++ b/dependencies/fabric8/kubernetes-api/README.md
@@ -1,7 +1,5 @@
-## Fabric8 Kubernetes Client API
-
-Fabric8 Kubernetes Client API 2.1.11 has been forked to fix issue [1]. The fix has been merged to master branch,
-once the next Fabric8 release is published to Nexus this fork can be removed.
-
-[1] [origin-schema-generator/pull/50] (https://github.com/fabric8io/origin-schema-generator/pull/50)
+## Fabric8 Kubernetes API
+This is a wrapper bundle for Fabric8 Kubernetes API for exposing proper bundle import
+& export statements and packaging apache cxf dependencies which cannot be imported into
+carbon runtime as separate bundles at the moment.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/pom.xml b/dependencies/fabric8/kubernetes-api/pom.xml
index 936935a..feec23b 100644
--- a/dependencies/fabric8/kubernetes-api/pom.xml
+++ b/dependencies/fabric8/kubernetes-api/pom.xml
@@ -27,21 +27,31 @@
</parent>
<artifactId>kubernetes-api</artifactId>
- <version>2.1.11-stratosv1</version>
+ <version>${kubernetes.api.stratos.version}</version>
<packaging>bundle</packaging>
<name>Fabric8 :: Kubernetes API</name>
+ <description>
+ This is a wrapper bundle for Fabric8 Kubernetes API for exposing proper bundle import
+ & export statements and packaging apache cxf dependencies which cannot be imported into
+ carbon runtime as separate bundles at the moment.
+ </description>
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
+ <artifactId>kubernetes-api</artifactId>
+ <version>${kubernetes.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fabric8</groupId>
<artifactId>cxf-utils</artifactId>
- <version>2.1.11</version>
+ <version>${fabric8-version}</version>
</dependency>
<dependency>
- <groupId>org.apache.stratos</groupId>
+ <groupId>io.fabric8</groupId>
<artifactId>kubernetes-model</artifactId>
- <version>2.1.11-stratosv1</version>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
@@ -98,11 +108,6 @@
<artifactId>jetty-util</artifactId>
<version>9.1.5.v20140505</version>
</dependency>
- <!-- dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <version>2.0.1</version>
- </dependency -->
<!-- testing -->
<dependency>
<groupId>org.assertj</groupId>
@@ -120,7 +125,7 @@
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-codegen</artifactId>
- <version>2.1.11</version>
+ <version>${fabric8-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -136,7 +141,7 @@
<instructions>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Export-Package>
- io.fabric8.kubernetes.api.*,
+ io.fabric8.kubernetes.api.*;version=${kubernetes.api.stratos.version},
</Export-Package>
<Import-Package>
!javax.xml.bind.annotation.adapters,
@@ -144,7 +149,6 @@
*;resolution:=optional
</Import-Package>
<DynamicImport-Package>*</DynamicImport-Package>
- <!-- Embedding apache cxf dependencies as they cannot be imported into carbon runtime at the moment -->
<Embed-Dependency>
jackson-annotations,jackson-core,jackson-databind,jackson-jaxrs-base,jackson-jaxrs-json-provider,
jackson-module-jaxb-annotations,jackson-dataformat-yaml,javax.annotation-api,javax.ws.rs-api,
@@ -174,41 +178,7 @@
</plugins>
</build>
-
- <profiles>
- <profile>
- <id>trigger</id>
- <properties>
- <build>console-build</build>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>${exec-maven-plugin.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>exec</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <executable>java</executable>
- <classpathScope>test</classpathScope>
- <!-- TODO for some reason this fails when running inside maven - wacky! -->
- <arguments>
- <argument>-classpath</argument>
- <classpath />
- <argument>io.fabric8.kubernetes.api.TriggerBuild</argument>
- <argument>${build}</argument>
- </arguments>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ <properties>
+ <fabric8-version>2.2.16</fabric8-version>
+ </properties>
</project>
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/AbstractWatcher.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/AbstractWatcher.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/AbstractWatcher.java
deleted file mode 100644
index 68793bc..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/AbstractWatcher.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package io.fabric8.kubernetes.api;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import io.fabric8.kubernetes.api.model.HasMetadata;
-import io.fabric8.kubernetes.api.watch.WatchEvent;
-import org.eclipse.jetty.websocket.api.Session;
-import org.eclipse.jetty.websocket.api.UpgradeException;
-import org.eclipse.jetty.websocket.api.WebSocketAdapter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public abstract class AbstractWatcher<T extends HasMetadata> extends WebSocketAdapter implements Watcher<T> {
-
- private static final transient Logger LOG = LoggerFactory.getLogger(KubernetesClient.class);
-
- private ObjectMapper objectMapper;
-
- @Override
- public void onWebSocketConnect(Session sess) {
- super.onWebSocketConnect(sess);
- LOG.debug("Got connect: {}", sess);
- objectMapper = KubernetesFactory.createObjectMapper();
- }
-
- @Override
- public void onWebSocketClose(int statusCode, String reason) {
- super.onWebSocketClose(statusCode, reason);
- LOG.debug("Connection closed: {} - {}", statusCode, reason);
- objectMapper = null;
- }
-
- @Override
- public void onWebSocketText(String message) {
- LOG.trace("Received message: {}", message);
- if (message != null && message.length() > 0) {
- try {
- WatchEvent event = objectMapper.reader(WatchEvent.class).readValue(message);
- T obj = (T) event.getObject();
- Action action = Action.valueOf(event.getType());
- eventReceived(action, obj);
- } catch (IOException e) {
- LOG.error("Could not deserialize watch event: {}", message, e);
- } catch (ClassCastException e) {
- LOG.error("Received wrong type of object for watch", e);
- } catch (IllegalArgumentException e) {
- LOG.error("Invalid event type", e);
- }
- }
- }
-
- public void onWebSocketError(Throwable cause) {
- if (cause instanceof UpgradeException) {
- LOG.error("WebSocketError: Could not upgrade connection: {}", (((UpgradeException) cause).getResponseStatusCode()), cause);
- } else {
- LOG.error("WebSocketError: {}", cause);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Controller.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Controller.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Controller.java
deleted file mode 100644
index 3e90776..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Controller.java
+++ /dev/null
@@ -1,850 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import io.fabric8.kubernetes.api.extensions.Templates;
-import io.fabric8.kubernetes.api.model.HasMetadata;
-import io.fabric8.kubernetes.api.model.KubernetesList;
-import io.fabric8.kubernetes.api.model.Namespace;
-import io.fabric8.kubernetes.api.model.Pod;
-import io.fabric8.kubernetes.api.model.PodSpec;
-import io.fabric8.kubernetes.api.model.PodTemplateSpec;
-import io.fabric8.kubernetes.api.model.ReplicationController;
-import io.fabric8.kubernetes.api.model.ReplicationControllerSpec;
-import io.fabric8.kubernetes.api.model.SecretVolumeSource;
-import io.fabric8.kubernetes.api.model.Service;
-import io.fabric8.kubernetes.api.model.Volume;
-import io.fabric8.openshift.api.model.BuildConfig;
-import io.fabric8.openshift.api.model.DeploymentConfig;
-import io.fabric8.openshift.api.model.ImageStream;
-import io.fabric8.openshift.api.model.OAuthClient;
-import io.fabric8.openshift.api.model.Route;
-import io.fabric8.openshift.api.model.template.Template;
-import io.fabric8.utils.Files;
-import io.fabric8.utils.IOHelpers;
-import io.fabric8.utils.Objects;
-import io.fabric8.utils.Strings;
-import org.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.yaml.snakeyaml.Yaml;
-
-import javax.ws.rs.WebApplicationException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-
-import static io.fabric8.kubernetes.api.KubernetesHelper.getName;
-import static io.fabric8.kubernetes.api.KubernetesHelper.getObjectId;
-import static io.fabric8.kubernetes.api.KubernetesHelper.getOrCreateMetadata;
-import static io.fabric8.kubernetes.api.KubernetesHelper.getPodMap;
-import static io.fabric8.kubernetes.api.KubernetesHelper.getReplicationControllerMap;
-import static io.fabric8.kubernetes.api.KubernetesHelper.getServiceMap;
-import static io.fabric8.kubernetes.api.KubernetesHelper.loadJson;
-import static io.fabric8.kubernetes.api.KubernetesHelper.summaryText;
-import static io.fabric8.kubernetes.api.KubernetesHelper.toItemList;
-
-/**
- * Applies DTOs to the current Kubernetes master
- */
-public class Controller {
- private static final transient Logger LOG = LoggerFactory.getLogger(Controller.class);
-
- private final KubernetesClient kubernetes;
- private Map<String, Pod> podMap;
- private Map<String, ReplicationController> replicationControllerMap;
- private Map<String, Service> serviceMap;
- private boolean throwExceptionOnError = true;
- private boolean allowCreate = true;
- private boolean recreateMode;
- private boolean servicesOnlyMode;
- private boolean ignoreServiceMode;
- private boolean ignoreRunningOAuthClients = true;
- private boolean processTemplatesLocally;
- private File logJsonDir;
- private File basedir;
-
- public Controller() {
- this(new KubernetesClient());
- }
-
- public Controller(KubernetesClient kubernetes) {
- this.kubernetes = kubernetes;
- }
-
- public String apply(File file) throws Exception {
- String ext = Files.getFileExtension(file);
-
- if ("yaml".equalsIgnoreCase(ext)) {
- return applyYaml(file);
- } else if ("json".equalsIgnoreCase(ext)) {
- return applyJson(file);
- } else {
- throw new IllegalArgumentException("Unknown file type " + ext);
- }
- }
-
- /**
- * Applies the given JSON to the underlying REST APIs in a single operation without needing to explicitly parse first.
- */
- public String applyJson(byte[] json) throws Exception {
- Object dto = loadJson(json);
- apply(dto, "REST call");
- return "";
- }
-
- /**
- * Applies the given JSON to the underlying REST APIs in a single operation without needing to explicitly parse first.
- */
- public String applyJson(String json) throws Exception {
- Object dto = loadJson(json);
- apply(dto, "REST call");
- return "";
- }
-
- /**
- * Applies the given JSON to the underlying REST APIs in a single operation without needing to explicitly parse first.
- */
- public String applyJson(File json) throws Exception {
- Object dto = loadJson(json);
- apply(dto, "REST call");
- return "";
- }
-
- /**
- * Applies the given YAML to the underlying REST APIs in a single operation without needing to explicitly parse first.
- */
- public String applyYaml(String yaml) throws Exception {
- String json = convertYamlToJson(yaml);
- Object dto = loadJson(json);
- apply(dto, "REST call");
- return "";
- }
-
- /**
- * Applies the given YAML to the underlying REST APIs in a single operation without needing to explicitly parse first.
- */
- public String applyYaml(File yaml) throws Exception {
- String json = convertYamlToJson(yaml);
- Object dto = loadJson(json);
- apply(dto, "REST call");
- return "";
- }
-
- private String convertYamlToJson(String yamlString) throws FileNotFoundException {
- Yaml yaml = new Yaml();
-
- Map<String, Object> map = (Map<String, Object>) yaml.load(yamlString);
- JSONObject jsonObject = new JSONObject(map);
-
- return jsonObject.toString();
- }
-
- private String convertYamlToJson(File yamlFile) throws FileNotFoundException {
- Yaml yaml = new Yaml();
- FileInputStream fstream = new FileInputStream(yamlFile);
-
- Map<String, Object> map = (Map<String, Object>) yaml.load(fstream);
- JSONObject jsonObject = new JSONObject(map);
-
- return jsonObject.toString();
- }
-
- /**
- * Applies the given JSON to the underlying REST APIs in a single operation without needing to explicitly parse first.
- */
- public String applyJson(InputStream json) throws Exception {
- Object dto = loadJson(json);
- apply(dto, "REST call");
- return "";
- }
-
- /**
- * Applies the given DTOs onto the Kubernetes master
- */
- public void apply(Object dto, String sourceName) throws Exception {
- if (dto instanceof List) {
- List list = (List) dto;
- for (Object element : list) {
- if (dto == element) {
- LOG.warn("Found recursive nested object for " + dto + " of class: " + dto.getClass().getName());
- continue;
- }
- apply(element, sourceName);
- }
- } else if (dto instanceof KubernetesList) {
- applyList((KubernetesList) dto, sourceName);
- } else if (dto != null) {
- applyEntity(dto, sourceName);
- }
- }
-
- /**
- * Applies the given DTOs onto the Kubernetes master
- */
- public void applyEntity(Object dto, String sourceName) throws Exception {
- if (dto instanceof Pod) {
- applyPod((Pod) dto, sourceName);
- } else if (dto instanceof ReplicationController) {
- applyReplicationController((ReplicationController) dto, sourceName);
- } else if (dto instanceof Service) {
- applyService((Service) dto, sourceName);
- } else if (dto instanceof Namespace) {
- applyNamespace((Namespace) dto);
- } else if (dto instanceof Route) {
- applyRoute((Route) dto, sourceName);
- } else if (dto instanceof BuildConfig) {
- applyBuildConfig((BuildConfig) dto, sourceName);
- } else if (dto instanceof DeploymentConfig) {
- applyDeploymentConfig((DeploymentConfig) dto, sourceName);
- } else if (dto instanceof ImageStream) {
- applyImageStream((ImageStream) dto, sourceName);
- } else if (dto instanceof OAuthClient) {
- applyOAuthClient((OAuthClient) dto, sourceName);
- } else if (dto instanceof Template) {
- applyTemplate((Template) dto, sourceName);
- } else {
- throw new IllegalArgumentException("Unknown entity type " + dto);
- }
- }
-
- public void applyOAuthClient(OAuthClient entity, String sourceName) {
- String id = getName(entity);
- Objects.notNull(id, "No name for " + entity + " " + sourceName);
- if (isServicesOnlyMode()) {
- LOG.debug("Only processing Services right now so ignoring OAuthClient: " + id);
- return;
- }
- OAuthClient old = kubernetes.getOAuthClient(id);
- if (isRunning(old)) {
- if (isIgnoreRunningOAuthClients()) {
- LOG.info("Not updating the OAuthClient which are shared across namespaces as its already running");
- return;
- }
- if (UserConfigurationCompare.configEqual(entity, old)) {
- LOG.info("OAuthClient hasn't changed so not doing anything");
- } else {
- if (isRecreateMode()) {
- kubernetes.deleteOAuthClient(id);
- doCreateOAuthClient(entity, sourceName);
- } else {
- try {
- Object answer = kubernetes.updateOAuthClient(id, entity);
- LOG.info("Updated pod result: " + answer);
- } catch (Exception e) {
- onApplyError("Failed to update pod from " + sourceName + ". " + e + ". " + entity, e);
- }
- }
- }
- } else {
- if (!isAllowCreate()) {
- LOG.warn("Creation disabled so not creating an OAuthClient from " + sourceName + " name " + getName(entity));
- } else {
- doCreateOAuthClient(entity, sourceName);
- }
- }
- }
-
- protected void doCreateOAuthClient(OAuthClient entity, String sourceName) {
- Object result = null;
- try {
- result = kubernetes.createOAuthClient(entity);
- } catch (Exception e) {
- onApplyError("Failed to create OAuthClient from " + sourceName + ". " + e + ". " + entity, e);
- }
- }
-
- /**
- * Creates/updates the template and processes it returning the processed DTOs
- */
- public Object applyTemplate(Template entity, String sourceName) throws Exception {
- if (!isProcessTemplatesLocally()) {
- String namespace = getNamespace();
- String id = getName(entity);
- Objects.notNull(id, "No name for " + entity + " " + sourceName);
- Template old = kubernetes.getTemplate(id, namespace);
- if (isRunning(old)) {
- if (UserConfigurationCompare.configEqual(entity, old)) {
- LOG.info("Template hasn't changed so not doing anything");
- } else {
- boolean recreateMode = isRecreateMode();
- // TODO seems you can't update templates right now
- recreateMode = true;
- if (recreateMode) {
- kubernetes.deleteTemplate(id, namespace);
- doCreateTemplate(entity, namespace, sourceName);
- } else {
- LOG.info("Updating a entity from " + sourceName);
- try {
- Object answer = kubernetes.updateTemplate(id, entity, namespace);
- LOG.info("Updated entity: " + answer);
- } catch (Exception e) {
- onApplyError("Failed to update controller from " + sourceName + ". " + e + ". " + entity, e);
- }
- }
- }
- } else {
- if (!isAllowCreate()) {
- LOG.warn("Creation disabled so not creating a entity from " + sourceName + " namespace " + namespace + " name " + getName(entity));
- } else {
- doCreateTemplate(entity, namespace, sourceName);
- }
- }
- }
- return processTemplate(entity, sourceName);
- }
-
- protected void doCreateTemplate(Template entity, String namespace, String sourceName) {
- LOG.info("Creating a template from " + sourceName + " namespace " + namespace + " name " + getName(entity));
- try {
- Object answer = kubernetes.createTemplate(entity, namespace);
- logGeneratedEntity("Created template: ", namespace, entity, answer);
- } catch (Exception e) {
- onApplyError("Failed to template entity from " + sourceName + ". " + e + ". " + entity, e);
- }
- }
-
- protected void logGeneratedEntity(String message, String namespace, HasMetadata entity, Object result) {
- if (logJsonDir != null) {
- File namespaceDir = new File(logJsonDir, namespace);
- namespaceDir.mkdirs();
- String kind = KubernetesHelper.getKind(entity);
- String name = KubernetesHelper.getName(entity);
- if (Strings.isNotBlank(kind)) {
- name = kind.toLowerCase() + "-" + name;
- }
- if (Strings.isNullOrBlank(name)) {
- LOG.warn("No name for the entity " + entity);
- } else {
- String fileName = name + ".json";
- File file = new File(namespaceDir, fileName);
- if (file.exists()) {
- int idx = 1;
- while (true) {
- fileName = name + "-" + idx++ + ".json";
- file = new File(namespaceDir, fileName);
- if (!file.exists()) {
- break;
- }
- }
- }
- String text;
- if (result instanceof String) {
- text = result.toString();
- } else {
- try {
- text = KubernetesHelper.toJson(result);
- } catch (JsonProcessingException e) {
- LOG.warn("Could not convert " + result + " to JSON: " + e, e);
- if (result != null) {
- text = result.toString();
- } else {
- text = "null";
- }
- }
- }
- try {
- IOHelpers.writeFully(file, text);
- Object fileLocation = file;
- if (basedir != null) {
- String path = Files.getRelativePath(basedir, file);
- if (path != null) {
- fileLocation = Strings.stripPrefix(path, "/");
- }
- }
- LOG.info(message + fileLocation);
- } catch (IOException e) {
- LOG.warn("Failed to write to file " + file + ". " + e, e);
- }
- return;
- }
- }
- LOG.info(message + result);
- }
-
- public Object processTemplate(Template entity, String sourceName) {
- if (isProcessTemplatesLocally()) {
- try {
- return Templates.processTemplatesLocally(entity);
- } catch (IOException e) {
- onApplyError("Failed to process template " + sourceName + ". " + e + ". " + entity, e);
- return null;
- }
- } else {
- String id = getName(entity);
- Objects.notNull(id, "No name for " + entity + " " + sourceName);
- String namespace = KubernetesHelper.getNamespace(entity);
- LOG.info("Creating Template " + namespace + ":" + id + " " + summaryText(entity));
- Object result = null;
- try {
- String json = kubernetes.processTemplate(entity, namespace);
- logGeneratedEntity("Template processed into: ", namespace, entity, json);
- result = loadJson(json);
- printSummary(result);
- } catch (Exception e) {
- onApplyError("Failed to create controller from " + sourceName + ". " + e + ". " + entity, e);
- }
- return result;
- }
- }
-
-
- protected void printSummary(Object kubeResource) throws IOException {
- if (kubeResource != null) {
- LOG.debug(" " + kubeResource.getClass().getSimpleName() + " " + kubeResource);
- }
- if (kubeResource instanceof Template) {
- Template template = (Template) kubeResource;
- String id = getName(template);
- LOG.info(" Template " + id + " " + summaryText(template));
- printSummary(template.getObjects());
- return;
- }
- List<HasMetadata> list = toItemList(kubeResource);
- for (HasMetadata object : list) {
- if (object != null) {
- if (object == list) {
- LOG.warn("Ignoring recursive list " + list);
- continue;
- } else if (object instanceof List) {
- printSummary(object);
- } else {
- String kind = object.getClass().getSimpleName();
- String id = getObjectId(object);
- LOG.info(" " + kind + " " + id + " " + summaryText(object));
- }
- }
- }
- }
-
- public void applyRoute(Route entity, String sourceName) {
- String id = getName(entity);
- Objects.notNull(id, "No name for " + entity + " " + sourceName);
- String namespace = KubernetesHelper.getNamespace(entity);
- if (Strings.isNullOrBlank(namespace)) {
- namespace = kubernetes.getNamespace();
- }
- Route route = kubernetes.findRoute(id, namespace);
- if (route == null) {
- try {
- LOG.info("Creating Route " + namespace + ":" + id + " " + KubernetesHelper.summaryText(entity));
- kubernetes.createRoute(entity, namespace);
- } catch (WebApplicationException e) {
- if (e.getResponse().getStatus() == 404) {
- // could be OpenShift 0.4.x which has the old style REST API - lets try that...
- LOG.warn("Got a 404 - could be an old Kubernetes/OpenShift environment - lets try the old style REST API...");
- try {
- kubernetes.createRouteOldAPi(entity, namespace);
- } catch (Exception e1) {
- onApplyError("Failed to create Route from " + sourceName + ". " + e1 + ". " + entity, e1);
- }
- } else {
- onApplyError("Failed to create Route from " + sourceName + ". " + e + ". " + entity, e);
- }
- } catch (Exception e) {
- onApplyError("Failed to create Route from " + sourceName + ". " + e + ". " + entity, e);
- }
- }
- }
-
- public void applyBuildConfig(BuildConfig entity, String sourceName) {
- String id = getName(entity);
- Objects.notNull(id, "No name for " + entity + " " + sourceName);
- String namespace = KubernetesHelper.getNamespace(entity);
- if (Strings.isNullOrBlank(namespace)) {
- namespace = kubernetes.getNamespace();
- }
- BuildConfig old = kubernetes.getBuildConfig(id, namespace);
- if (isRunning(old)) {
- if (UserConfigurationCompare.configEqual(entity, old)) {
- LOG.info("BuildConfig hasn't changed so not doing anything");
- } else {
- if (isRecreateMode()) {
- kubernetes.deleteBuildConfig(id, namespace);
- doCreateBuildConfig(entity, namespace, sourceName);
- } else {
- LOG.info("Updating BuildConfig from " + sourceName);
- try {
- String resourceVersion = KubernetesHelper.getResourceVersion(old);
- KubernetesHelper.getOrCreateMetadata(entity).setResourceVersion(resourceVersion);
- Object answer = kubernetes.updateBuildConfig(id, entity, namespace);
- logGeneratedEntity("Updated BuildConfig: ", namespace, entity, answer);
- } catch (Exception e) {
- onApplyError("Failed to update BuildConfig from " + sourceName + ". " + e + ". " + entity, e);
- }
- }
- }
- } else {
- if (!isAllowCreate()) {
- LOG.warn("Creation disabled so not creating BuildConfig from " + sourceName + " namespace " + namespace + " name " + getName(entity));
- } else {
- doCreateBuildConfig(entity, namespace, sourceName);
- }
- }
- }
-
- public void doCreateBuildConfig(BuildConfig entity, String namespace ,String sourceName) {
- try {
- kubernetes.createBuildConfig(entity, namespace);
- } catch (Exception e) {
- onApplyError("Failed to create BuildConfig from " + sourceName + ". " + e, e);
- }
- }
-
- public void applyDeploymentConfig(DeploymentConfig entity, String sourceName) {
- try {
- kubernetes.createDeploymentConfig(entity, getNamespace());
- } catch (Exception e) {
- onApplyError("Failed to create DeploymentConfig from " + sourceName + ". " + e, e);
- }
- }
-
- public void applyImageStream(ImageStream entity, String sourceName) {
- try {
- kubernetes.createImageStream(entity, getNamespace());
- } catch (Exception e) {
- onApplyError("Failed to create BuildConfig from " + sourceName + ". " + e, e);
- }
- }
-
- public void applyList(KubernetesList list, String sourceName) throws Exception {
- List<HasMetadata> entities = list.getItems();
- if (entities != null) {
- for (Object entity : entities) {
- applyEntity(entity, sourceName);
- }
- }
- }
-
- public void applyService(Service service, String sourceName) throws Exception {
- String namespace = getNamespace();
- String id = getName(service);
- Objects.notNull(id, "No name for " + service + " " + sourceName);
- if (isIgnoreServiceMode()) {
- LOG.debug("Ignoring Service: " + namespace + ":" + id);
- return;
- }
- if (serviceMap == null) {
- serviceMap = getServiceMap(kubernetes, namespace);
- }
- Service old = serviceMap.get(id);
- if (isRunning(old)) {
- if (UserConfigurationCompare.configEqual(service, old)) {
- LOG.info("Service hasn't changed so not doing anything");
- } else {
- if (isRecreateMode()) {
- kubernetes.deleteService(service, namespace);
- doCreateService(service, namespace, sourceName);
- } else {
- LOG.info("Updating a service from " + sourceName);
- try {
- Object answer = kubernetes.updateService(id, service, namespace);
- logGeneratedEntity("Updated service: ", namespace, service, answer);
- } catch (Exception e) {
- onApplyError("Failed to update controller from " + sourceName + ". " + e + ". " + service, e);
- }
- }
- }
- } else {
- if (!isAllowCreate()) {
- LOG.warn("Creation disabled so not creating a service from " + sourceName + " namespace " + namespace + " name " + getName(service));
- } else {
- doCreateService(service, namespace, sourceName);
- }
- }
- }
-
- protected void doCreateService(Service service, String namespace, String sourceName) {
- LOG.info("Creating a service from " + sourceName + " namespace " + namespace + " name " + getName(service));
- try {
- Object answer;
- if (Strings.isNotBlank(namespace)) {
- answer = kubernetes.createService(service, namespace);
- } else {
- answer = kubernetes.createService(service);
- }
- logGeneratedEntity("Created service: ", namespace, service, answer);
- } catch (Exception e) {
- onApplyError("Failed to create service from " + sourceName + ". " + e + ". " + service, e);
- }
- }
-
- public void applyNamespace(Namespace entity) {
- String namespace = getOrCreateMetadata(entity).getName();
- LOG.info("Creating a namespace " + namespace);
- try {
- Object answer = kubernetes.createNamespace(entity);
- logGeneratedEntity("Created namespace: ", namespace, entity, answer);
- } catch (Exception e) {
- onApplyError("Failed to create namespace. " + e + ". " + entity, e);
- }
- }
-
- public void applyReplicationController(ReplicationController replicationController, String sourceName) throws Exception {
- String namespace = getNamespace();
- String id = getName(replicationController);
- Objects.notNull(id, "No name for " + replicationController + " " + sourceName);
- if (isServicesOnlyMode()) {
- LOG.debug("Only processing Services right now so ignoring ReplicationController: " + namespace + ":" + id);
- return;
- }
- if (replicationControllerMap == null) {
- replicationControllerMap = getReplicationControllerMap(kubernetes, namespace);
- }
- ReplicationController old = replicationControllerMap.get(id);
- if (isRunning(old)) {
- if (UserConfigurationCompare.configEqual(replicationController, old)) {
- LOG.info("ReplicationController hasn't changed so not doing anything");
- } else {
- if (isRecreateMode()) {
- kubernetes.deleteReplicationControllerAndPods(replicationController, namespace);
- doCreateReplicationController(replicationController, namespace, sourceName);
- } else {
- LOG.info("Updating replicationController from " + sourceName + " namespace " + namespace + " name " + getName(replicationController));
- try {
- Object answer = kubernetes.updateReplicationController(id, replicationController);
- logGeneratedEntity("Updated replicationController: ", namespace, replicationController, answer);
- } catch (Exception e) {
- onApplyError("Failed to update replicationController from " + sourceName + ". " + e + ". " + replicationController, e);
- }
- }
- }
- } else {
- if (!isAllowCreate()) {
- LOG.warn("Creation disabled so not creating a replicationController from " + sourceName + " namespace " + namespace + " name " + getName(replicationController));
- } else {
- doCreateReplicationController(replicationController, namespace, sourceName);
- }
- }
- }
-
- protected void doCreateReplicationController(ReplicationController replicationController, String namespace, String sourceName) {
- LOG.info("Creating a replicationController from " + sourceName + " namespace " + namespace + " name " + getName(replicationController));
- try {
- // lets check that if secrets are required they exist
- ReplicationControllerSpec spec = replicationController.getSpec();
- if (spec != null) {
- PodTemplateSpec template = spec.getTemplate();
- if (template != null) {
- PodSpec podSpec = template.getSpec();
- validatePodSpec(podSpec, namespace);
- }
- }
- Object answer;
- if (Strings.isNotBlank(namespace)) {
- answer = kubernetes.createReplicationController(replicationController, namespace);
- } else {
- answer = kubernetes.createReplicationController(replicationController);
- }
- logGeneratedEntity("Created replicationController: ", namespace, replicationController, answer);
- } catch (Exception e) {
- onApplyError("Failed to create replicationController from " + sourceName + ". " + e + ". " + replicationController, e);
- }
- }
-
- /**
- * Lets verify that any dependencies are available; such as volumes or secrets
- */
- protected void validatePodSpec(PodSpec podSpec, String namespace) {
- List<Volume> volumes = podSpec.getVolumes();
- if (volumes != null) {
- for (Volume volume : volumes) {
- SecretVolumeSource secret = volume.getSecret();
- if (secret != null) {
- String secretName = secret.getSecretName();
- if (Strings.isNotBlank(secretName)) {
- KubernetesHelper.validateSecretExists(kubernetes, namespace, secretName);
- }
- }
- }
- }
- }
-
- public void applyPod(Pod pod, String sourceName) throws Exception {
- String namespace = getNamespace();
- String id = getName(pod);
- Objects.notNull(id, "No name for " + pod + " " + sourceName);
- if (isServicesOnlyMode()) {
- LOG.debug("Only processing Services right now so ignoring Pod: " + namespace + ":" + id);
- return;
- }
- if (podMap == null) {
- podMap = getPodMap(kubernetes, namespace);
- }
- Pod old = podMap.get(id);
- if (isRunning(old)) {
- if (UserConfigurationCompare.configEqual(pod, old)) {
- LOG.info("Pod hasn't changed so not doing anything");
- } else {
- if (isRecreateMode()) {
- kubernetes.deletePod(pod, namespace);
- doCreatePod(pod, namespace, sourceName);
- } else {
- LOG.info("Updating a pod from " + sourceName + " namespace " + namespace + " name " + getName(pod));
- try {
- Object answer = kubernetes.updatePod(id, pod);
- LOG.info("Updated pod result: " + answer);
- } catch (Exception e) {
- onApplyError("Failed to update pod from " + sourceName + ". " + e + ". " + pod, e);
- }
- }
- }
- } else {
- if (!isAllowCreate()) {
- LOG.warn("Creation disabled so not creating a pod from " + sourceName + " namespace " + namespace + " name " + getName(pod));
- } else {
- doCreatePod(pod, namespace, sourceName);
- }
- }
- }
-
- protected void doCreatePod(Pod pod, String namespace, String sourceName) {
- LOG.info("Creating a pod from " + sourceName + " namespace " + namespace + " name " + getName(pod));
- try {
- PodSpec podSpec = pod.getSpec();
- if (podSpec != null) {
- validatePodSpec(podSpec, namespace);
- }
- Object answer;
- if (Strings.isNotBlank(namespace)) {
- answer = kubernetes.createPod(pod, namespace);
- } else {
- answer = kubernetes.createPod(pod);
- }
- LOG.info("Created pod result: " + answer);
- } catch (Exception e) {
- onApplyError("Failed to create pod from " + sourceName + ". " + e + ". " + pod, e);
- }
- }
-
- public String getNamespace() {
- return kubernetes.getNamespace();
- }
-
- public void setNamespace(String namespace) {
- kubernetes.setNamespace(namespace);
- }
-
- public boolean isThrowExceptionOnError() {
- return throwExceptionOnError;
- }
-
- public void setThrowExceptionOnError(boolean throwExceptionOnError) {
- this.throwExceptionOnError = throwExceptionOnError;
- }
-
- public boolean isProcessTemplatesLocally() {
- return processTemplatesLocally;
- }
-
- public void setProcessTemplatesLocally(boolean processTemplatesLocally) {
- this.processTemplatesLocally = processTemplatesLocally;
- }
-
- public File getLogJsonDir() {
- return logJsonDir;
- }
-
- /**
- * Lets you configure the directory where JSON logging files should go
- */
- public void setLogJsonDir(File logJsonDir) {
- this.logJsonDir = logJsonDir;
- }
-
- public File getBasedir() {
- return basedir;
- }
-
- public void setBasedir(File basedir) {
- this.basedir = basedir;
- }
-
- protected boolean isRunning(HasMetadata entity) {
- return entity != null;
- }
-
-
- /**
- * Logs an error applying some JSON to Kubernetes and optionally throws an exception
- */
- protected void onApplyError(String message, Exception e) {
- LOG.error(message, e);
- if (throwExceptionOnError) {
- throw new RuntimeException(message, e);
- }
- }
-
- /**
- * Returns true if this controller allows new resources to be created in the given namespace
- */
- public boolean isAllowCreate() {
- return allowCreate;
- }
-
- public void setAllowCreate(boolean allowCreate) {
- this.allowCreate = allowCreate;
- }
-
- /**
- * If enabled then updates are performed by deleting the resource first then creating it
- */
- public boolean isRecreateMode() {
- return recreateMode;
- }
-
- public void setRecreateMode(boolean recreateMode) {
- this.recreateMode = recreateMode;
- }
-
- public void setServicesOnlyMode(boolean servicesOnlyMode) {
- this.servicesOnlyMode = servicesOnlyMode;
- }
-
- /**
- * If enabled then only services are created/updated to allow services to be created/updated across
- * a number of apps before any pods/replication controllers are updated
- */
- public boolean isServicesOnlyMode() {
- return servicesOnlyMode;
- }
-
- /**
- * If enabled then all services are ignored to avoid them being recreated. This is useful if you want to
- * recreate ReplicationControllers and Pods but leave Services as they are to avoid the portalIP addresses
- * changing
- */
- public boolean isIgnoreServiceMode() {
- return ignoreServiceMode;
- }
-
- public void setIgnoreServiceMode(boolean ignoreServiceMode) {
- this.ignoreServiceMode = ignoreServiceMode;
- }
-
- public boolean isIgnoreRunningOAuthClients() {
- return ignoreRunningOAuthClients;
- }
-
- public void setIgnoreRunningOAuthClients(boolean ignoreRunningOAuthClients) {
- this.ignoreRunningOAuthClients = ignoreRunningOAuthClients;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Entity.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Entity.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Entity.java
deleted file mode 100644
index 1b37892..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Entity.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-/**
- * The base interface for all entities which have an ID and a kind
- */
-public interface Entity {
-
- String getId();
-
- String getKind();
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/ExceptionResponseMapper.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/ExceptionResponseMapper.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/ExceptionResponseMapper.java
deleted file mode 100644
index 263dfee..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/ExceptionResponseMapper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package io.fabric8.kubernetes.api;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import io.fabric8.kubernetes.api.model.base.Status;
-import io.fabric8.utils.IOHelpers;
-import io.fabric8.utils.Strings;
-import org.apache.cxf.jaxrs.client.ResponseExceptionMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class ExceptionResponseMapper implements ResponseExceptionMapper<Exception> {
- private static final transient Logger LOG = LoggerFactory.getLogger(ExceptionResponseMapper.class);
-
- @Override
- public Exception fromResponse(Response response) {
- try {
- Object entity = response.getEntity();
- String message = extractErrorMessage(entity);
- message = "HTTP " + response.getStatus() + " " + message;
- return new WebApplicationException(message, response);
- } catch (Exception ex) {
- return new Exception(
- "Could not deserialize server side exception: " + ex.getMessage());
- }
- }
-
- public static String extractErrorMessage(Object entity) {
- String message = "No message";
- ObjectMapper mapper = KubernetesFactory.createObjectMapper();
- try {
- String json = null;
- if (entity instanceof InputStream) {
- InputStream inputStream = (InputStream) entity;
- json = IOHelpers.readFully(inputStream);
- } else if (entity != null) {
- json = entity.toString();
- }
- if (Strings.isNotBlank(json)) {
- message = json;
- if (textLooksLikeJsonObject(json)) {
- try {
- Status error = mapper.readValue(json, Status.class);
- if (error != null) {
- message = error.getMessage();
- if (Strings.isNullOrBlank(message)) {
- message = error.getReason();
- }
- }
- } catch (IOException e) {
- LOG.warn("Failed to parse Status from JSON:" + json + ". Reason: " + e, e);
- }
- }
- }
- } catch (Exception e) {
- message = "Failed to extract message from request: " + e;
- }
- return message;
- }
-
- protected static boolean textLooksLikeJsonObject(String text) {
- text = text.trim();
- return text.startsWith("{") && text.endsWith("}");
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Kubernetes.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Kubernetes.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Kubernetes.java
deleted file mode 100644
index 49a34ef..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Kubernetes.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.Endpoints;
-import io.fabric8.kubernetes.api.model.EndpointsList;
-import io.fabric8.kubernetes.api.model.Namespace;
-import io.fabric8.kubernetes.api.model.NamespaceList;
-import io.fabric8.kubernetes.api.model.Node;
-import io.fabric8.kubernetes.api.model.NodeList;
-import io.fabric8.kubernetes.api.model.Pod;
-import io.fabric8.kubernetes.api.model.PodList;
-import io.fabric8.kubernetes.api.model.ReplicationController;
-import io.fabric8.kubernetes.api.model.ReplicationControllerList;
-import io.fabric8.kubernetes.api.model.Secret;
-import io.fabric8.kubernetes.api.model.SecretList;
-import io.fabric8.kubernetes.api.model.Service;
-import io.fabric8.kubernetes.api.model.ServiceList;
-
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-
-/**
- * Represents the Remote API to working with <a href="http://kubernetes.io/">Kubernetes</a> providing a facade
- * over the generated JAXRS client.
- */
-@Path(Kubernetes.ROOT_API_PATH)
-@Produces("application/json")
-@Consumes("application/json")
-public interface Kubernetes {
-
- static final String ROOT_API_PATH = "api/v1beta3";
-
- static final String NAMESPACE_ALL = "";
- static final String NAMESPACE_DEFAULT = "default";
-
- static final String SERVICE_ACCOUNT_TOKEN_FILE = "/var/run/secrets/kubernetes.io/servicaccount/token";
-
- /**
- * List all namespaces on this cluster
- */
- @GET
- @Path("namespaces")
- NamespaceList getNamespaces();
-
-
- @POST
- @Path("namespaces")
- @Consumes("application/json")
- String createNamespace(Namespace entity) throws Exception;
-
- /**
- * Get a specific Namespace
- */
- @GET
- @Path("namespaces/{name}")
- Namespace getNamespace(@PathParam("name") @NotNull String name);
-
- /**
- * Update a namespace
- * @param namespaceId
- * @param entity
- */
- @PUT
- @Path("namespaces/{name}")
- @Consumes("application/json")
- String updateNamespace(@PathParam("name") @NotNull String namespaceId, Namespace entity) throws Exception;
-
- @DELETE
- @Path("namespaces/{name}")
- @Consumes("text/plain")
- String deleteNamespace(@PathParam("name") @NotNull String name) throws Exception;
-
- /**
- * List all pods on this cluster
- * @param namespace
- */
- @GET
- @Path("namespaces/{namespace}/pods")
- PodList getPods(@PathParam("namespace") String namespace);
-
- @POST
- @Path("namespaces/{namespace}/pods")
- @Consumes("application/json")
- String createPod(Pod entity, @PathParam("namespace") String namespace) throws Exception;
-
- /**
- * Get a specific pod
- *
- * @param podId
- * @param namespace
- */
- @GET
- @Path("namespaces/{namespace}/pods/{podId}")
- Pod getPod(@PathParam("podId") @NotNull String podId, @PathParam("namespace") String namespace);
-
- /**
- * Update a pod
- * @param podId
- * @param entity
- * @param namespace
- */
- @PUT
- @Path("namespaces/{namespace}/pods/{podId}")
- @Consumes("application/json")
- String updatePod(@PathParam("podId") @NotNull String podId, Pod entity, @PathParam("namespace") String namespace) throws Exception;
-
- @DELETE
- @Path("namespaces/{namespace}/pods/{podId}")
- @Consumes("text/plain")
- String deletePod(@PathParam("podId") @NotNull String podId, @PathParam("namespace") String namespace) throws Exception;
-
- /**
- * List all services on this cluster
- * @param namespace
- */
- @Path("namespaces/{namespace}/services")
- @GET
- @Produces("application/json")
- ServiceList getServices(@PathParam("namespace") String namespace);
-
- @Path("namespaces/{namespace}/services")
- @POST
- @Consumes("application/json")
- String createService(Service entity, @PathParam("namespace") String namespace) throws Exception;
-
- /**
- * Get a specific service
- *
- * @param serviceId
- * @param namespace
- */
- @GET
- @Path("namespaces/{namespace}/services/{serviceId}")
- @Produces("application/json")
- Service getService(@PathParam("serviceId") @NotNull String serviceId, @PathParam("namespace") String namespace);
-
- /**
- * Update a service
- */
- @PUT
- @Path("namespaces/{namespace}/services/{serviceId}")
- @Consumes("application/json")
- String updateService(@PathParam("serviceId") @NotNull String serviceId, Service entity, @PathParam("namespace") String namespace) throws Exception;
-
- @DELETE
- @Path("namespaces/{namespace}/services/{serviceId}")
- @Produces("application/json")
- @Consumes("text/plain")
- String deleteService(@PathParam("serviceId") @NotNull String serviceId, @PathParam("namespace") String namespace) throws Exception;
-
- /**
- * List all replicationControllers on this cluster
- * @param namespace
- */
- @Path("namespaces/{namespace}/replicationcontrollers")
- @GET
- @Produces("application/json")
- ReplicationControllerList getReplicationControllers(@PathParam("namespace") String namespace);
-
- @Path("namespaces/{namespace}/replicationcontrollers")
- @POST
- @Consumes("application/json")
- String createReplicationController(ReplicationController entity, @PathParam("namespace") String namespace) throws Exception;
-
- @PUT
- @Path("namespaces/{namespace}/replicationcontrollers/{controllerId}")
- @Consumes("application/json")
- String updateReplicationController(@PathParam("controllerId") @NotNull String controllerId, ReplicationController entity, @PathParam("namespace") String namespace) throws Exception;
-
- /**
- * Get a specific controller
- *
- * @param controllerId
- * @param namespace
- */
- @GET
- @Path("namespaces/{namespace}/replicationcontrollers/{controllerId}")
- @Produces("application/json")
- ReplicationController getReplicationController(@PathParam("controllerId") @NotNull String controllerId, @PathParam("namespace") String namespace);
-
- /**
- * Delete a specific controller
- *
- * @param controllerId
- */
- @DELETE
- @Path("namespaces/{namespace}/replicationcontrollers/{controllerId}")
- @Produces("application/json")
- @Consumes("text/plain")
- String deleteReplicationController(@PathParam("controllerId") @NotNull String controllerId, @PathParam("namespace") String namespace) throws Exception;
-
- /**
- * List all service endpoints on this cluster
- */
- @GET
- @Path("namespaces/{namespace}/endpoints")
- EndpointsList getEndpoints(@PathParam("namespace") String namespace);
-
- /**
- * List all endpoints for a service
- */
- @GET
- @Path("namespaces/{namespace}/endpoints/{serviceId}")
- Endpoints endpointsForService(@PathParam("serviceId") @NotNull String serviceId, @PathParam("namespace") String namespace);
-
-
- /**
- * List all secrets on this cluster
- * @param namespace
- */
- @Path("namespaces/{namespace}/secrets")
- @GET
- @Produces("application/json")
- SecretList getSecrets(@PathParam("namespace") String namespace);
-
- @Path("namespaces/{namespace}/secrets")
- @POST
- @Consumes("application/json")
- String createSecret(Secret entity, @PathParam("namespace") String namespace) throws Exception;
-
- /**
- * Get a specific secret
- *
- * @param secretId
- * @param namespace
- */
- @GET
- @Path("namespaces/{namespace}/secrets/{secretId}")
- @Produces("application/json")
- Secret getSecret(@PathParam("secretId") @NotNull String secretId, @PathParam("namespace") String namespace);
-
- /**
- * Update a secret
- */
- @PUT
- @Path("namespaces/{namespace}/secrets/{secretId}")
- @Consumes("application/json")
- String updateSecret(@PathParam("secretId") @NotNull String secretId, Secret entity, @PathParam("namespace") String namespace) throws Exception;
-
- @DELETE
- @Path("namespaces/{namespace}/secrets/{secretId}")
- @Produces("application/json")
- @Consumes("text/plain")
- String deleteSecret(@PathParam("secretId") @NotNull String secretId, @PathParam("namespace") String namespace) throws Exception;
-
-
-
- /**
- * List all the minions on this cluster
- */
- @GET
- @Path("nodes")
- NodeList getNodes();
-
- /**
- * List all endpoints for a service
- */
- @GET
- @Path("nodes/{nodeId}")
- Node node(@PathParam("nodeId") @NotNull String nodeId);
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesApiException.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesApiException.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesApiException.java
deleted file mode 100644
index d04c863..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesApiException.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package io.fabric8.kubernetes.api;
-
-public class KubernetesApiException extends Exception {
-
- public KubernetesApiException() {
- }
-
- public KubernetesApiException(String msg) {
- super(msg);
- }
-}
[16/50] [abbrv] stratos git commit: Fixing the issue when adding a
cartridgeGroup with a name of a subgroup in another cartridge group
Posted by ga...@apache.org.
Fixing the issue when adding a cartridgeGroup with a name of a subgroup in another cartridge group
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/ad9b2c29
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/ad9b2c29
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/ad9b2c29
Branch: refs/heads/master
Commit: ad9b2c29d77fd265ac432e4451616ae64fbac8ce
Parents: c987f4d
Author: Dinithi <di...@wso2.com>
Authored: Fri Aug 21 17:59:37 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Fri Aug 21 17:59:37 2015 +0530
----------------------------------------------------------------------
.../parser/DefaultApplicationParser.java | 2 +-
.../services/impl/AutoscalerServiceImpl.java | 19 ++
.../common/client/AutoscalerServiceClient.java | 5 +
.../rest/endpoint/api/StratosApiV41.java | 5 +-
.../rest/endpoint/api/StratosApiV41Utils.java | 32 ++-
.../sample-groups/artifacts/application.json | 1 -
.../src/main/resources/AutoscalerService.wsdl | 210 ++++++++++++-------
7 files changed, 190 insertions(+), 84 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/ad9b2c29/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
index 5097b7f..9ef6180 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
@@ -841,7 +841,7 @@ public class DefaultApplicationParser implements ApplicationParser {
ServiceGroup nestedServiceGroup = getNestedServiceGroup(serviceGroupUuid, serviceGroup);
if (nestedServiceGroup == null) {
- handleError("Service Group Definition not found for name " + serviceGroupUuid);
+ handleError("Service Group Definition not found for uuid " + serviceGroupUuid);
}
if (log.isDebugEnabled()) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/ad9b2c29/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index 6c47116..3b42d29 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@ -932,6 +932,25 @@ public class AutoscalerServiceImpl implements AutoscalerService {
}
}
+ public ServiceGroup getOuterServiceGroupByTenant(String name, int tenantId) {
+ ServiceGroup outerGroup = null;
+ if (StringUtils.isEmpty(name)) {
+ return null;
+ }
+ try {
+ ServiceGroup[] serviceGroups = getServiceGroupsByTenant(tenantId);
+ for (ServiceGroup serviceGroup : serviceGroups) {
+ if (serviceGroup.getName().equals(name)) {
+ outerGroup = serviceGroup;
+ break;
+ }
+ }
+ return outerGroup;
+ } catch (Exception e) {
+ throw new AutoScalerException("Error occurred while retrieving cartridge group", e);
+ }
+ }
+
public DeploymentPolicy getDeploymentPolicyByTenant(String deploymentPolicyId, int tenantId) {
DeploymentPolicy[] deploymentPolicies = getDeploymentPolicies();
for(DeploymentPolicy deploymentPolicy : deploymentPolicies) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/ad9b2c29/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java
index 1c0c6a8..5a3f5cc 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java
@@ -209,6 +209,11 @@ public class AutoscalerServiceClient {
return stub.getServiceGroupByTenant(serviceGroupDefinitionName,tenantId);
}
+ public ServiceGroup getOuterServiceGroupByTenant(String serviceGroupDefinitionName,
+ int tenantId) throws RemoteException {
+ return stub.getOuterServiceGroupByTenant(serviceGroupDefinitionName, tenantId);
+ }
+
public DeploymentPolicy getDeploymentPolicyByTenant(String deploymentPolicyId,int tenantId) throws RemoteException {
return stub.getDeploymentPolicyByTenant(deploymentPolicyId, tenantId);
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/ad9b2c29/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 ec1a17c..4b8fc3f 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
@@ -494,8 +494,9 @@ public class StratosApiV41 extends AbstractApi {
String cartrideGroupUuid= UUID.randomUUID().toString();
int tenantId = carbonContext.getTenantId();
- CartridgeGroupBean groupBean = null;
- groupBean = StratosApiV41Utils.getServiceGroupDefinition(cartridgeGroupBean.getName(), carbonContext.getTenantId());
+ CartridgeGroupBean groupBean;
+ groupBean = StratosApiV41Utils.getOuterServiceGroupDefinition(cartridgeGroupBean.getName(),
+ carbonContext.getTenantId());
if (groupBean != null) {
String msg = String.format("Cartridge group already exists: [cartridge-group-name] %s",
http://git-wip-us.apache.org/repos/asf/stratos/blob/ad9b2c29/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 5c9f3f0..80fdde5 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
@@ -1046,7 +1046,7 @@ public class StratosApiV41Utils {
}
ServiceGroup serviceGroup = ObjectConverter.convertServiceGroupDefinitionToASStubServiceGroup
- (serviceGroupDefinition,UUID.randomUUID().toString(), tenantId);
+ (serviceGroupDefinition, cartridgeGroupUuid, tenantId);
try {
findCartridgesInGroupBean(serviceGroup, cartridgeTypes);
} catch (RemoteException e) {
@@ -1281,6 +1281,36 @@ public class StratosApiV41Utils {
}
/**
+ * Get a Service Group Definition by Name
+ *
+ * @param groupName Group Name
+ * @param tenantId tenant Id
+ * @return GroupBean
+ * @throws RestAPIException
+ */
+ public static CartridgeGroupBean getOuterServiceGroupDefinition(String groupName,
+ int tenantId) throws RestAPIException {
+ if (log.isDebugEnabled()) {
+ log.debug("Reading cartridge group: [cartridge-group-name] " + groupName);
+ }
+
+ try {
+ AutoscalerServiceClient asServiceClient = AutoscalerServiceClient.getInstance();
+ ServiceGroup serviceGroup = asServiceClient.getOuterServiceGroupByTenant(groupName, tenantId);
+ if (serviceGroup == null) {
+ return null;
+ }
+ return ObjectConverter.convertStubServiceGroupToServiceGroupDefinition(serviceGroup);
+
+ } catch (Exception e) {
+ String message = "Could not get cartridge group: [cartridge-group-name] " + groupName;
+ log.error(message, e);
+ throw new RestAPIException(message, e);
+ }
+ }
+
+
+ /**
* Get a list of GroupBeans
*
* @return array of Group Beans
http://git-wip-us.apache.org/repos/asf/stratos/blob/ad9b2c29/samples/applications/scaling/dependent-scaling/sample-groups/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/scaling/dependent-scaling/sample-groups/artifacts/application.json b/samples/applications/scaling/dependent-scaling/sample-groups/artifacts/application.json
index 21e5991..d32932c 100644
--- a/samples/applications/scaling/dependent-scaling/sample-groups/artifacts/application.json
+++ b/samples/applications/scaling/dependent-scaling/sample-groups/artifacts/application.json
@@ -8,7 +8,6 @@
"alias": "my-esb-php-group",
"groupMinInstances": 1,
"groupMaxInstances": 2,
- "deploymentPolicy": "deployment-policy-1",
"cartridges": [
{
"type": "esb",
http://git-wip-us.apache.org/repos/asf/stratos/blob/ad9b2c29/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 224ca3c..3daffb3 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:ax29="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax27="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ns="http://impl.services.autoscaler.stratos.apache.org" xmlns:ax23="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax24="http://common.stratos.apache.org/xsd" xmlns:ax21="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax216="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax227="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax220="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax212="http://partition.common.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax223="http://rmi.java/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xml
ns:ax211="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax224="http://io.java/xsd" 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://impl.services.autoscaler.stratos.apache.org">
+<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax29="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ns="http://impl.services.autoscaler.stratos.apache.org" xmlns:ax27="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax25="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax21="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax216="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax22="http://common.stratos.apache.org/xsd" xmlns:ax227="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax214="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax220="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax210="http://partition.common.stratos.apache.org/xsd" xmlns:ax22
3="http://rmi.java/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax224="http://io.java/xsd" 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://impl.services.autoscaler.stratos.apache.org">
<wsdl:types>
<xs:schema xmlns:ax225="http://io.java/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://rmi.java/xsd">
<xs:import namespace="http://io.java/xsd"/>
@@ -34,18 +34,18 @@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax25="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd">
+ <xs:schema xmlns:ax23="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd">
<xs:import namespace="http://common.stratos.apache.org/xsd"/>
<xs:complexType name="ApplicationContext">
<xs:sequence>
<xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="applicationUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="components" nillable="true" type="ax23:ComponentContext"/>
+ <xs:element minOccurs="0" name="components" nillable="true" type="ax21:ComponentContext"/>
<xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="multiTenant" type="xs:boolean"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
<xs:element minOccurs="0" name="status" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tenantAdminUsername" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tenantDomain" nillable="true" type="xs:string"/>
@@ -54,10 +54,10 @@
</xs:complexType>
<xs:complexType name="ComponentContext">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="applicationClusterContexts" nillable="true" type="ax23:ApplicationClusterContext"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeContexts" nillable="true" type="ax23:CartridgeContext"/>
- <xs:element minOccurs="0" name="dependencyContext" nillable="true" type="ax23:DependencyContext"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax23:GroupContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="applicationClusterContexts" nillable="true" type="ax21:ApplicationClusterContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeContexts" nillable="true" type="ax21:CartridgeContext"/>
+ <xs:element minOccurs="0" name="dependencyContext" nillable="true" type="ax21:DependencyContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax21:GroupContext"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ApplicationClusterContext">
@@ -69,8 +69,8 @@
<xs:element maxOccurs="unbounded" minOccurs="0" name="dependencyClusterIds" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="deploymentPolicyName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax23:PersistenceContext"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
+ <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax21:PersistenceContext"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
<xs:element minOccurs="0" name="tenantRange" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="textPayload" nillable="true" type="xs:string"/>
</xs:sequence>
@@ -78,7 +78,7 @@
<xs:complexType name="PersistenceContext">
<xs:sequence>
<xs:element minOccurs="0" name="persistenceRequired" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax23:VolumeContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax21:VolumeContext"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="VolumeContext">
@@ -97,7 +97,7 @@
<xs:sequence>
<xs:element minOccurs="0" name="cartridgeMax" type="xs:int"/>
<xs:element minOccurs="0" name="cartridgeMin" type="xs:int"/>
- <xs:element minOccurs="0" name="subscribableInfoContext" nillable="true" type="ax23:SubscribableInfoContext"/>
+ <xs:element minOccurs="0" name="subscribableInfoContext" nillable="true" type="ax21:SubscribableInfoContext"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="type" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
@@ -106,7 +106,7 @@
<xs:complexType name="SubscribableInfoContext">
<xs:sequence>
<xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="artifactRepositoryContext" nillable="true" type="ax23:ArtifactRepositoryContext"/>
+ <xs:element minOccurs="0" name="artifactRepositoryContext" nillable="true" type="ax21:ArtifactRepositoryContext"/>
<xs:element minOccurs="0" name="autoscalingPolicy" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="autoscalingPolicyUuid" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="dependencyAliases" nillable="true" type="xs:string"/>
@@ -114,8 +114,8 @@
<xs:element minOccurs="0" name="deploymentPolicyUuid" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="maxMembers" type="xs:int"/>
<xs:element minOccurs="0" name="minMembers" type="xs:int"/>
- <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax23:PersistenceContext"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
+ <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax21:PersistenceContext"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ArtifactRepositoryContext">
@@ -137,10 +137,10 @@
<xs:complexType name="GroupContext">
<xs:sequence>
<xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeContexts" nillable="true" type="ax23:CartridgeContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeContexts" nillable="true" type="ax21:CartridgeContext"/>
<xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="deploymentPolicyUuid" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax23:GroupContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax21:GroupContext"/>
<xs:element minOccurs="0" name="groupMaxInstances" type="xs:int"/>
<xs:element minOccurs="0" name="groupMinInstances" type="xs:int"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
@@ -153,8 +153,8 @@
<xs:complexType name="ServiceGroup">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="cartridges" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="dependencies" nillable="true" type="ax21:Dependencies"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="groups" nillable="true" type="ax21:ServiceGroup"/>
+ <xs:element minOccurs="0" name="dependencies" nillable="true" type="ax214:Dependencies"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="groups" nillable="true" type="ax214:ServiceGroup"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
@@ -168,31 +168,17 @@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax28="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax217="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax22="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax218="http://common.stratos.apache.org/xsd" xmlns:ax221="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax226="http://rmi.java/xsd" xmlns:ax228="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax215="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax210="http://exception.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.autoscaler.stratos.apache.org">
- <xs:import namespace="http://pojo.autoscaler.stratos.apache.org/xsd"/>
+ <xs:schema xmlns:ax28="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax24="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax217="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax218="http://common.stratos.apache.org/xsd" xmlns:ax221="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax226="http://rmi.java/xsd" xmlns:ax228="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax215="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax213="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.autoscaler.stratos.apache.org">
<xs:import namespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://application.exception.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://pojo.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://common.stratos.apache.org/xsd"/>
<xs:import namespace="http://policy.exception.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://rmi.java/xsd"/>
<xs:import namespace="http://partition.exception.autoscaler.stratos.apache.org/xsd"/>
- <xs:element name="getServiceGroup">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getServiceGroupResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax21:ServiceGroup"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
<xs:element name="getApplications">
<xs:complexType>
<xs:sequence/>
@@ -201,35 +187,35 @@
<xs:element name="getApplicationsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:ApplicationContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AutoscalerServiceApplicationDefinitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="ApplicationDefinitionException" nillable="true" type="ax27:ApplicationDefinitionException"/>
+ <xs:element minOccurs="0" name="ApplicationDefinitionException" nillable="true" type="ax25:ApplicationDefinitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AutoscalerServiceCartridgeGroupNotFoundException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeGroupNotFoundException" nillable="true" type="ax29:CartridgeGroupNotFoundException"/>
+ <xs:element minOccurs="0" name="CartridgeGroupNotFoundException" nillable="true" type="ax27:CartridgeGroupNotFoundException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AutoscalerServiceCartridgeNotFoundException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax29:CartridgeNotFoundException"/>
+ <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax27:CartridgeNotFoundException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addApplication">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax26:ApplicationContext"/>
+ <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax24:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -250,7 +236,7 @@
<xs:element name="getDeploymentPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -264,7 +250,21 @@
<xs:element name="getApplicationResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ApplicationContext"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getServiceGroup">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getServiceGroupResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -285,7 +285,7 @@
<xs:element name="AutoscalerServiceInvalidArgumentException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidArgumentException" nillable="true" type="ax29:InvalidArgumentException"/>
+ <xs:element minOccurs="0" name="InvalidArgumentException" nillable="true" type="ax27:InvalidArgumentException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -293,7 +293,7 @@
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -314,7 +314,7 @@
<xs:element name="getApplicationPolicyByUuidResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax215:ApplicationPolicy"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -347,7 +347,7 @@
<xs:element name="AutoscalerServiceAutoScalingPolicyAlreadyExistException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="AutoScalingPolicyAlreadyExistException" nillable="true" type="ax29:AutoScalingPolicyAlreadyExistException"/>
+ <xs:element minOccurs="0" name="AutoScalingPolicyAlreadyExistException" nillable="true" type="ax27:AutoScalingPolicyAlreadyExistException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -432,7 +432,7 @@
<xs:element name="updateApplication">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax26:ApplicationContext"/>
+ <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax24:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -454,7 +454,7 @@
<xs:element name="getApplicationByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ApplicationContext"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -483,7 +483,7 @@
<xs:element name="getApplicationsByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:ApplicationContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -534,14 +534,14 @@
<xs:element name="AutoscalerServiceInvalidServiceGroupException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax27:InvalidServiceGroupException"/>
+ <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax25:InvalidServiceGroupException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax21:ServiceGroup"/>
+ <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax214:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -555,7 +555,7 @@
<xs:element name="updateServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeGroup" nillable="true" type="ax21:ServiceGroup"/>
+ <xs:element minOccurs="0" name="cartridgeGroup" nillable="true" type="ax214:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -591,7 +591,22 @@
<xs:element name="getServiceGroupByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax21:ServiceGroup"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getOuterServiceGroupByTenant">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getOuterServiceGroupByTenantResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -606,7 +621,7 @@
<xs:element name="getDeploymentPolicyByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -628,7 +643,7 @@
<xs:element name="AutoscalerServiceAutoScalerException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="AutoScalerException" nillable="true" type="ax29:AutoScalerException"/>
+ <xs:element minOccurs="0" name="AutoScalerException" nillable="true" type="ax27:AutoScalerException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -640,7 +655,7 @@
<xs:element name="getServiceGroupsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax21:ServiceGroup"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -654,7 +669,7 @@
<xs:element name="getServiceGroupsByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax21:ServiceGroup"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -710,7 +725,7 @@
<xs:element name="AutoscalerServiceInvalidApplicationPolicyException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidApplicationPolicyException" nillable="true" type="ax27:InvalidApplicationPolicyException"/>
+ <xs:element minOccurs="0" name="InvalidApplicationPolicyException" nillable="true" type="ax25:InvalidApplicationPolicyException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -724,7 +739,7 @@
<xs:element name="addApplicationPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationPolicy" nillable="true" type="ax215:ApplicationPolicy"/>
+ <xs:element minOccurs="0" name="applicationPolicy" nillable="true" type="ax29:ApplicationPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -746,7 +761,7 @@
<xs:element name="getApplicationPolicyByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax215:ApplicationPolicy"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -774,7 +789,7 @@
<xs:element name="updateApplicationPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationPolicy" nillable="true" type="ax215:ApplicationPolicy"/>
+ <xs:element minOccurs="0" name="applicationPolicy" nillable="true" type="ax29:ApplicationPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -793,7 +808,7 @@
<xs:element name="getApplicationPoliciesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:ApplicationPolicy"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -807,7 +822,7 @@
<xs:element name="getApplicationPoliciesByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:ApplicationPolicy"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -850,7 +865,7 @@
<xs:element name="addDeployementPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax215:DeploymentPolicy"/>
+ <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax29:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -871,14 +886,14 @@
<xs:element name="AutoscalerServiceCloudControllerConnectionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CloudControllerConnectionException" nillable="true" type="ax29:CloudControllerConnectionException"/>
+ <xs:element minOccurs="0" name="CloudControllerConnectionException" nillable="true" type="ax27:CloudControllerConnectionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="updateDeploymentPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax215:DeploymentPolicy"/>
+ <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax29:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -914,7 +929,7 @@
<xs:element name="getDeploymentPolicyForTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -926,7 +941,7 @@
<xs:element name="getDeploymentPoliciesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -940,7 +955,7 @@
<xs:element name="getDeploymentPoliciesByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -955,18 +970,18 @@
<xs:element name="getApplicationPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax215:ApplicationPolicy"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
- <xs:schema xmlns:ax219="http://common.stratos.apache.org/xsd" xmlns:ax214="http://partition.common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd">
+ <xs:schema xmlns:ax219="http://common.stratos.apache.org/xsd" xmlns:ax212="http://partition.common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd">
<xs:import namespace="http://partition.common.stratos.apache.org/xsd"/>
<xs:import namespace="http://common.stratos.apache.org/xsd"/>
<xs:complexType name="DeploymentPolicy">
<xs:sequence>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionRefs" nillable="true" type="ax214:NetworkPartitionRef"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionRefs" nillable="true" type="ax212:NetworkPartitionRef"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
@@ -978,19 +993,19 @@
<xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionGroups" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitions" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionsUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax213="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.common.stratos.apache.org/xsd">
+ <xs:schema xmlns:ax211="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.common.stratos.apache.org/xsd">
<xs:import namespace="http://common.stratos.apache.org/xsd"/>
<xs:complexType name="NetworkPartitionRef">
<xs:sequence>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="partitionAlgo" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="partitionRefs" nillable="true" type="ax212:PartitionRef"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="partitionRefs" nillable="true" type="ax210:PartitionRef"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
@@ -1000,7 +1015,7 @@
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="partitionMax" type="xs:int"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
@@ -1026,7 +1041,7 @@
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.stratos.apache.org/xsd">
<xs:complexType name="Properties">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax24:Property"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax22:Property"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Property">
@@ -1052,14 +1067,14 @@
</xs:complexType>
<xs:complexType name="UnremovablePolicyException">
<xs:complexContent>
- <xs:extension base="ax29:AutoScalerException">
+ <xs:extension base="ax27:AutoScalerException">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="PolicyDoesNotExistException">
<xs:complexContent>
- <xs:extension base="ax29:AutoScalerException">
+ <xs:extension base="ax27:AutoScalerException">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
@@ -1312,6 +1327,12 @@
<wsdl:message name="undeployServiceGroupResponse">
<wsdl:part name="parameters" element="ns:undeployServiceGroupResponse"/>
</wsdl:message>
+ <wsdl:message name="getOuterServiceGroupByTenantRequest">
+ <wsdl:part name="parameters" element="ns:getOuterServiceGroupByTenant"/>
+ </wsdl:message>
+ <wsdl:message name="getOuterServiceGroupByTenantResponse">
+ <wsdl:part name="parameters" element="ns:getOuterServiceGroupByTenantResponse"/>
+ </wsdl:message>
<wsdl:message name="getApplicationPolicyByTenantRequest">
<wsdl:part name="parameters" element="ns:getApplicationPolicyByTenant"/>
</wsdl:message>
@@ -1576,6 +1597,10 @@
<wsdl:output message="ns:undeployServiceGroupResponse" wsaw:Action="urn:undeployServiceGroupResponse"/>
<wsdl:fault message="ns:AutoscalerServiceAutoScalerException" name="AutoscalerServiceAutoScalerException" wsaw:Action="urn:undeployServiceGroupAutoscalerServiceAutoScalerException"/>
</wsdl:operation>
+ <wsdl:operation name="getOuterServiceGroupByTenant">
+ <wsdl:input message="ns:getOuterServiceGroupByTenantRequest" wsaw:Action="urn:getOuterServiceGroupByTenant"/>
+ <wsdl:output message="ns:getOuterServiceGroupByTenantResponse" wsaw:Action="urn:getOuterServiceGroupByTenantResponse"/>
+ </wsdl:operation>
<wsdl:operation name="getApplicationPolicyByTenant">
<wsdl:input message="ns:getApplicationPolicyByTenantRequest" wsaw:Action="urn:getApplicationPolicyByTenant"/>
<wsdl:output message="ns:getApplicationPolicyByTenantResponse" wsaw:Action="urn:getApplicationPolicyByTenantResponse"/>
@@ -1966,6 +1991,15 @@
<soap:fault use="literal" name="AutoscalerServiceAutoScalerException"/>
</wsdl:fault>
</wsdl:operation>
+ <wsdl:operation name="getOuterServiceGroupByTenant">
+ <soap:operation soapAction="urn:getOuterServiceGroupByTenant" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="getApplicationPolicyByTenant">
<soap:operation soapAction="urn:getApplicationPolicyByTenant" style="document"/>
<wsdl:input>
@@ -2494,6 +2528,15 @@
<soap12:fault use="literal" name="AutoscalerServiceAutoScalerException"/>
</wsdl:fault>
</wsdl:operation>
+ <wsdl:operation name="getOuterServiceGroupByTenant">
+ <soap12:operation soapAction="urn:getOuterServiceGroupByTenant" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="getApplicationPolicyByTenant">
<soap12:operation soapAction="urn:getApplicationPolicyByTenant" style="document"/>
<wsdl:input>
@@ -2968,6 +3011,15 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="getOuterServiceGroupByTenant">
+ <http:operation location="getOuterServiceGroupByTenant"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="getApplicationPolicyByTenant">
<http:operation location="getApplicationPolicyByTenant"/>
<wsdl:input>
[04/50] [abbrv] stratos git commit: Updating logs to display uuid and
tenantId
Posted by ga...@apache.org.
Updating logs to display uuid and tenantId
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/eb0d28f4
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/eb0d28f4
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/eb0d28f4
Branch: refs/heads/master
Commit: eb0d28f4e2bc6d86b4ce54124e9c40ac6a046722
Parents: b228f11
Author: Dinithi <di...@wso2.com>
Authored: Fri Aug 21 10:21:39 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Fri Aug 21 10:21:39 2015 +0530
----------------------------------------------------------------------
.../autoscaler/pojo/policy/PolicyManager.java | 105 +-
.../services/impl/AutoscalerServiceImpl.java | 102 +-
.../impl/CloudControllerServiceImpl.java | 219 ++--
.../rest/endpoint/api/StratosApiV41.java | 7 +-
.../rest/endpoint/api/StratosApiV41Utils.java | 8 +-
.../src/main/resources/AutoscalerService.wsdl | 396 +++----
.../main/resources/CloudControllerService.wsdl | 1044 +++++++++---------
7 files changed, 956 insertions(+), 925 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/eb0d28f4/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
index 1d15c1b..957386b 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
@@ -83,8 +83,9 @@ public class PolicyManager {
// Add the policy to information model and persist.
public boolean addAutoscalePolicy(AutoscalePolicy policy) throws AutoScalingPolicyAlreadyExistException {
if (log.isInfoEnabled()) {
- log.info(String.format("Adding autoscaling policy: [autoscaling policy-uuid] %s [autoscaling policy-id] " +
- "%s", policy.getUuid(), policy.getId()));
+ log.info(String.format("Adding autoscaling policy: [tenant-id] %d [autoscaling policy-uuid] %s " +
+ "[autoscaling policy-id] " +
+ "%s", policy.getTenantId(), policy.getUuid(), policy.getId()));
}
if (StringUtils.isEmpty(policy.getUuid())) {
throw new AutoScalerException("Autoscaling policy id cannot be empty");
@@ -92,9 +93,9 @@ public class PolicyManager {
this.addASPolicyToInformationModel(policy);
RegistryManager.getInstance().persistAutoscalerPolicy(policy);
if (log.isInfoEnabled()) {
- log.info(String.format("Autoscaling policy: [autoscaling-policy-uuid] %s [autoscaling-policy-id] %s added" +
- " successfully",
- policy.getUuid(), policy.getId()));
+ log.info(String.format("Autoscaling policy: [tenant-id] %d [autoscaling-policy-uuid] %s " +
+ "[autoscaling-policy-id] %s added successfully", policy.getTenantId(), policy.getUuid(),
+ policy.getId()));
}
return true;
}
@@ -106,8 +107,8 @@ public class PolicyManager {
this.updateASPolicyInInformationModel(policy);
RegistryManager.getInstance().persistAutoscalerPolicy(policy);
if (log.isInfoEnabled()) {
- log.info(String.format("Autoscaling policy updated successfully: [autoscaling policy-uuid] %s " +
- "[autoscaling policy-id] %s", policy.getUuid(), policy.getId()));
+ log.info(String.format("Autoscaling policy updated successfully: [tenant-id] %d [autoscaling policy-uuid]" +
+ " %s [autoscaling policy-id] %s", policy.getTenantId(), policy.getUuid(), policy.getId()));
}
return true;
}
@@ -136,8 +137,8 @@ public class PolicyManager {
RegistryManager.getInstance().persistDeploymentPolicy(policy);
if (log.isInfoEnabled()) {
- log.info(String.format("Deployment policy is added successfully: [deployment-policy-id] %s",
- policy.getUuid()));
+ log.info(String.format("Deployment policy added successfully: [tenant-id] %d [deployment-policy-uuid] %s " +
+ "[deployment-policy-id] %s", policy.getTenantId(), policy.getUuid(), policy.getId()));
}
}
@@ -151,12 +152,15 @@ public class PolicyManager {
throws InvalidDeploymentPolicyException {
if (!deploymentPolicyListMap.containsKey(deploymentPolicy.getUuid())) {
if (log.isDebugEnabled()) {
- log.debug("Adding deployment policy: " + deploymentPolicy.getUuid());
+ log.debug(String.format("Adding deployment policy [tenant-id] %d [deployment-policy-uuid] %s " +
+ "deployment-policy-id] %s: ", deploymentPolicy.getTenantId(),
+ deploymentPolicy.getUuid(), deploymentPolicy.getId()));
}
deploymentPolicyListMap.put(deploymentPolicy.getUuid(), deploymentPolicy);
} else {
- String errMsg = "Specified deployment policy [" +
- deploymentPolicy.getUuid() + "] already exists";
+ String errMsg = String.format("Deployment policy already exists: [tenant-id] %d [deployment-policy-uuid] " +
+ "%s [deployment-policy-id] %s", deploymentPolicy.getTenantId(),
+ deploymentPolicy.getUuid(), deploymentPolicy.getId());
log.error(errMsg);
throw new InvalidDeploymentPolicyException(errMsg);
}
@@ -169,7 +173,9 @@ public class PolicyManager {
this.updateDeploymentPolicyInInformationModel(policy);
RegistryManager.getInstance().persistDeploymentPolicy(policy);
if (log.isInfoEnabled()) {
- log.info(String.format("Deployment policy is updated successfully: [id] %s", policy.getUuid()));
+ log.info(String.format("Deployment policy updated successfully: [tenant-id] %d [deployment-policy-uuid] " +
+ "%s [deployment-policy-id] %s", policy.getTenantId(),
+ policy.getUuid(), policy.getId()));
}
return true;
}
@@ -185,7 +191,7 @@ public class PolicyManager {
RegistryManager.getInstance().removeDeploymentPolicy(deploymentPolicyId);
if (log.isInfoEnabled()) {
- log.info(String.format("Deployment policy is removed successfully: [deployment-policy-id] %s",
+ log.info(String.format("Deployment policy removed successfully: [deployment-policy-id] %s",
deploymentPolicyId));
}
}
@@ -193,11 +199,15 @@ public class PolicyManager {
public void addASPolicyToInformationModel(AutoscalePolicy asPolicy) throws AutoScalingPolicyAlreadyExistException {
if (!autoscalePolicyListMap.containsKey(asPolicy.getUuid())) {
if (log.isDebugEnabled()) {
- log.debug("Adding autoscaling policy: " + asPolicy.getUuid());
+ log.debug(String.format("Adding autoscaling policy: [tenant-id] %d [autoscaling-policy-uuid] " +
+ "%s " +
+ "[autoscaling-policy-id] %s", asPolicy.getTenantId(), asPolicy.getUuid(), asPolicy.getId()));
}
autoscalePolicyListMap.put(asPolicy.getUuid(), asPolicy);
} else {
- String errMsg = "Specified autoscaling policy [" + asPolicy.getUuid() + "] already exists";
+ String errMsg = String.format("Specified autoscaling policy already exists: [tenant-id] %d " +
+ "[autoscaling-policy-uuid] %s [autoscaling-policy-id] %s", asPolicy.getTenantId(),
+ asPolicy.getUuid(), asPolicy.getId());
log.error(errMsg);
throw new AutoScalingPolicyAlreadyExistException(errMsg);
}
@@ -206,7 +216,9 @@ public class PolicyManager {
public void updateASPolicyInInformationModel(AutoscalePolicy asPolicy) throws InvalidPolicyException {
if (autoscalePolicyListMap.containsKey(asPolicy.getUuid())) {
if (log.isDebugEnabled()) {
- log.debug("Updating autoscaling policy: " + asPolicy.getUuid());
+ log.debug(String.format("Updating autoscaling policy: [tenant-id] %d [autoscaling-policy-uuid] %s " +
+ "[autoscaling-policy-id] %s", asPolicy.getTenantId(), asPolicy.getUuid(),
+ asPolicy.getId()));
}
autoscalePolicyListMap.put(asPolicy.getUuid(), asPolicy);
}
@@ -215,20 +227,22 @@ public class PolicyManager {
public void updateDeploymentPolicyInInformationModel(DeploymentPolicy deploymentPolicy) throws InvalidPolicyException {
if (deploymentPolicyListMap.containsKey(deploymentPolicy.getUuid())) {
if (log.isDebugEnabled()) {
- log.debug("Updating deployment policy: " + deploymentPolicy.getUuid());
+ log.debug(String.format("Updating deployment policy: [tenant-id] %d [deployment-policy-uuid] " +
+ "%s [deployment-policy-id] %s", deploymentPolicy.getTenantId(),
+ deploymentPolicy.getUuid(), deploymentPolicy.getId()));
}
deploymentPolicyListMap.put(deploymentPolicy.getUuid(), deploymentPolicy);
}
}
- public void removeASPolicyInInformationModel(String policyID) throws PolicyDoesNotExistException {
- if (autoscalePolicyListMap.containsKey(policyID)) {
+ public void removeASPolicyInInformationModel(String policyId) throws PolicyDoesNotExistException {
+ if (autoscalePolicyListMap.containsKey(policyId)) {
if (log.isDebugEnabled()) {
- log.debug("Updating autoscaling policy: " + policyID);
+ log.debug("Removing autoscaling policy: [autoscaling-policy-id] " + policyId);
}
- autoscalePolicyListMap.remove(policyID);
+ autoscalePolicyListMap.remove(policyId);
} else {
- throw new PolicyDoesNotExistException("No such policy ID [" + policyID + "] exists");
+ throw new PolicyDoesNotExistException("No such policy exists: [autoscaling-policy-id] " + policyId);
}
}
@@ -239,7 +253,8 @@ public class PolicyManager {
}
applicationPolicyListMap.remove(applicationPolicyId);
} else {
- throw new InvalidPolicyException(String.format("Application policy not found: [application-policy-id] %s", applicationPolicyId));
+ throw new InvalidPolicyException(String.format("Application policy not found: [application-policy-id] " +
+ "%s", applicationPolicyId));
}
}
@@ -303,11 +318,13 @@ public class PolicyManager {
}
if (!deploymentPolicyListMap.containsKey(policy.getUuid())) {
if (log.isDebugEnabled()) {
- log.debug("Adding deployment policy: [deployment-policy-id] " + policy.getUuid());
+ log.debug(String.format("Adding deployment policy: [tenant-id] %d [deployment-policy-uuid] %s " +
+ "[deployment-policy-id] %s ", policy.getTenantId(), policy.getUuid(), policy.getId()));
}
deploymentPolicyListMap.put(policy.getUuid(), policy);
} else {
- String errMsg = "Deployment policy already exists: [deployment-policy-id] " + policy.getUuid();
+ String errMsg = String.format("Deployment policy already exists: [tenant-id] %d [deployment-policy-uuid] " +
+ "%s [deployment-policy-id] %s ", policy.getTenantId(), policy.getUuid(), policy.getId());
log.error(errMsg);
}
}
@@ -383,20 +400,21 @@ public class PolicyManager {
return deploymentPolicy;
}
-
public void addApplicationPolicy(ApplicationPolicy applicationPolicy) throws InvalidApplicationPolicyException {
- String applicationPolicyId = applicationPolicy.getUuid();
+ String applicationPolicyUuid = applicationPolicy.getUuid();
if (log.isInfoEnabled()) {
- log.info(String.format("Adding application policy : [application-policy-id] %s", applicationPolicyId));
+ log.info(String.format("Adding application policy : [tenant-id] %d [application-policy-uuid] %s " +
+ "[application-policy-id] %s", applicationPolicy.getTenantId(), applicationPolicyUuid,
+ applicationPolicy.getId()));
}
this.addApplicationPolicyToInformationModel(applicationPolicy);
RegistryManager.getInstance().persistApplicationPolicy(applicationPolicy);
if (log.isInfoEnabled()) {
- log.info(String.format("Application policy is added successfully: [application-policy-id] %s",
- applicationPolicyId));
+ log.info(String.format("Application policy added successfully: [tenant-id] %d [application-policy-uuid] %s " +
+ "[application-policy-id] %s", applicationPolicy.getTenantId(), applicationPolicyUuid,
+ applicationPolicy.getId()));
}
-
}
public boolean removeApplicationPolicy(String applicationPolicyId) throws InvalidPolicyException {
@@ -406,21 +424,26 @@ public class PolicyManager {
this.removeApplicationPolicyInInformationModel(applicationPolicyId);
RegistryManager.getInstance().removeApplicationPolicy(applicationPolicyId);
if (log.isInfoEnabled()) {
- log.info(String.format("Application policy is removed successfully: [id] %s", applicationPolicyId));
+ log.info(String.format("Application policy removed successfully: [application-policy-id] %s",
+ applicationPolicyId));
}
return true;
}
public void addApplicationPolicyToInformationModel(ApplicationPolicy applicationPolicy)
throws InvalidApplicationPolicyException {
- String applicationPolicyId = applicationPolicy.getUuid();
- if (!applicationPolicyListMap.containsKey(applicationPolicyId)) {
+ String applicationPolicyUuid = applicationPolicy.getUuid();
+ if (!applicationPolicyListMap.containsKey(applicationPolicyUuid)) {
if (log.isDebugEnabled()) {
- log.debug("Adding application policy : " + applicationPolicyId);
+ log.debug(String.format("Adding application policy: [tenant-id] %d [application-policy-uuid] %s " +
+ "[application-policy-id] %s", applicationPolicy.getTenantId(), applicationPolicyUuid,
+ applicationPolicy.getId()));
}
- applicationPolicyListMap.put(applicationPolicyId, applicationPolicy);
+ applicationPolicyListMap.put(applicationPolicyUuid, applicationPolicy);
} else {
- String errMsg = "Application policy already exists : " + applicationPolicyId;
+ String errMsg = String.format("Application policy already exists : [tenant-id] %d " +
+ "[application-policy-uuid] %s [application-policy-id] %s",
+ applicationPolicy.getTenantId(), applicationPolicyUuid, applicationPolicy.getId());
log.error(errMsg);
throw new InvalidApplicationPolicyException(errMsg);
}
@@ -456,7 +479,9 @@ public class PolicyManager {
public void updateApplicationPolicyInInformationModel(ApplicationPolicy applicationPolicy) {
if (applicationPolicyListMap.containsKey(applicationPolicy.getUuid())) {
if (log.isDebugEnabled()) {
- log.debug("Updating application policy: " + applicationPolicy.getUuid());
+ log.debug(String.format("Updating application policy: [tenant-id] %d [application-policy-uuid] %s " +
+ "[application-policy-id] %s", applicationPolicy.getTenantId(), applicationPolicy.getUuid(),
+ applicationPolicy.getId()));
}
applicationPolicyListMap.put(applicationPolicy.getUuid(), applicationPolicy);
}
@@ -469,7 +494,7 @@ public class PolicyManager {
this.updateApplicationPolicyInInformationModel(applicationPolicy);
RegistryManager.getInstance().persistApplicationPolicy(applicationPolicy);
if (log.isInfoEnabled()) {
- log.info(String.format("Application policy is updated successfully: [id] %s", applicationPolicy.getUuid()));
+ log.info(String.format("Application policyupdated successfully: [id] %s", applicationPolicy.getUuid()));
}
return true;
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/eb0d28f4/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index db9a305..e5fd50d 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@ -109,12 +109,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
String autoscalePolicyId = autoscalePolicy.getId();
if (PolicyManager.getInstance().getAutoscalePolicyById(autoscalePolicyId) != null && PolicyManager
.getInstance().getAutoscalePolicyById(autoscalePolicyId).getTenantId() == autoscalePolicy.getTenantId()) {
- String logMessage = String.format("Autoscaling policy already exists: [tenant-id] %d " +
+ String message = String.format("Autoscaling policy already exists: [tenant-id] %d " +
"[autoscaling-policy-uuid] %s [autoscaling-policy-id] %s", autoscalePolicy.getTenantId(),
autoscalePolicy.getUuid(), autoscalePolicyId);
- String message = String.format("Autoscaling policy already exists: [autoscaling-policy-id] %s",
- autoscalePolicyId);
- log.error(logMessage);
+ log.error(message);
throw new AutoScalingPolicyAlreadyExistException(message);
}
return PolicyManager.getInstance().addAutoscalePolicy(autoscalePolicy);
@@ -405,9 +403,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
applicationContext.setStatus(ApplicationContext.STATUS_CREATED);
AutoscalerContext.getInstance().updateApplicationContext(applicationContext);
}
- String logMessage = String.format("Application deployment failed: [application-uuid] %s ", applicationUuid);
- String message = String.format("Application deployment failed: [application-id] %s", applicationUuid);
- log.error(logMessage, e);
+ String message = String.format("Application deployment failed: [application-uuid] %s ", applicationUuid);
+ log.error(message, e);
throw new RuntimeException(message, e);
}
}
@@ -650,11 +647,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
}
if (!applicationContext.getStatus().equals(ApplicationContext.STATUS_DEPLOYED)) {
- String logMessage = String.format("Application is not deployed: [tenant-id] %d " +
+ String message = String.format("Application is not deployed: [tenant-id] %d " +
"[application-uuid] %s [application-id] %s", applicationContext.getTenantId(),
applicationContext.getApplicationUuid(), applicationId);
- String message = String.format("Application is not deployed: [application-id] %s", applicationId);
- log.error(logMessage);
+ log.error(message);
throw new RuntimeException(message);
}
applicationContext.setStatus(ApplicationContext.STATUS_UNDEPLOYING);
@@ -697,12 +693,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
}
if (application.getInstanceContextCount() > 0) {
- String logMessage = String.format("Application cannot be deleted, undeployment process is still in " +
+ String message = String.format("Application cannot be deleted, undeployment process is still in " +
"progress: [tenant-id] %d [application-uuid] %s [application-id] %s",
applicationContext.getTenantId(), applicationContext.getApplicationUuid(), applicationId);
- String message = String.format("Application cannot be deleted, undeployment process is still in " +
- "progress: [application-id] %s", applicationId);
- log.error(logMessage);
+ log.error(message);
throw new RuntimeException(message);
}
@@ -1026,11 +1020,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
boolean isExist = PolicyManager.getInstance().checkApplicationPolicyInTenant
(applicationPolicy.getId(), applicationPolicy.getTenantId());
if (isExist) {
- String message = "Application policy already exists: [application-policy-id] " + applicationPolicyId;
- String logMessage = String.format("Application policy already exists: [tenant-id] %d " +
+ String message = String.format("Application policy already exists: [tenant-id] %d " +
"[application-policy-uuid] %s [application-policy-id] %s", applicationPolicy.getTenantId(),
applicationPolicy.getUuid(), applicationPolicy.getId());
- log.error(logMessage);
+ log.error(message);
throw new ApplicationPolicyAlreadyExistsException(message);
}
@@ -1038,11 +1031,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
if (PolicyManager.getInstance().getApplicationPolicyByUuid(applicationPolicyUuid) != null && PolicyManager
.getInstance().getApplicationPolicyByUuid(applicationPolicyUuid).getTenantId() == applicationPolicy
.getTenantId()) {
- String message = "Application policy already exists: [application-policy-id] " + applicationPolicyId;
- String logMessage = String.format("Application policy already exists: [tenant-id] %d " +
+ String message = String.format("Application policy already exists: [tenant-id] %d " +
"[application-policy-uuid] %s [application-policy-id] %s", applicationPolicy.getTenantId(),
applicationPolicy.getUuid(), applicationPolicy.getId());
- log.error(logMessage);
+ log.error(message);
throw new ApplicationPolicyAlreadyExistsException(message);
}
@@ -1163,15 +1155,12 @@ public class AutoscalerServiceImpl implements AutoscalerService {
if (networkPartitions != null) {
for (int i = 0; i < networkPartitions.length; i++) {
if (networkPartitions[i].equals(networkPartitionId)) {
- String logMessage = String.format("Cannot remove the network partition since it is used" +
+ String message = String.format("Cannot remove the network partition since it is used" +
" in application: [tenant-id] %d [network-partition-id] %s " +
"[application-uuid] %s [application-id] %s", tenantId,
networkPartitionId, applicationContext.getApplicationUuid(),
applicationContext.getApplicationId());
- String message = String.format("Cannot remove the network partition since it is " +
- "used in application: [network-partition-id] %s [application-id] %s",
- networkPartitionId, applicationContext.getApplicationId());
- log.error(logMessage);
+ log.error(message);
throw new PartitionValidationException(message);
}
}
@@ -1272,24 +1261,20 @@ public class AutoscalerServiceImpl implements AutoscalerService {
String deploymentPolicyUuid = deploymentPolicy.getUuid();
if (PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyUuid) != null) {
- String logMessage = String.format("Deployment policy already exists: [tenant-id] %d [deployment-policy-uuid]" +
+ String message = String.format("Deployment policy already exists: [tenant-id] %d [deployment-policy-uuid]" +
" %s [deployment-policy-id] %s ",deploymentPolicy.getTenantId(), deploymentPolicy.getUuid(),
deploymentPolicy.getId());
- String message = String.format("Deployment policy already exists: [deployment-policy-id] %s ",
- deploymentPolicy.getId());
- log.error(logMessage);
+ log.error(message);
throw new DeploymentPolicyAlreadyExistsException(message);
}
String deploymentPolicyId = deploymentPolicy.getId();
if (PolicyManager.getInstance().getDeploymentPolicyById(deploymentPolicyId) != null && PolicyManager
.getInstance().getDeploymentPolicyById(deploymentPolicyId).getTenantId() == deploymentPolicy.getTenantId()) {
- String logMessage = String.format("Deployment policy already exists: [tenant-id] %d [deployment-policy-uuid]" +
+ String message = String.format("Deployment policy already exists: [tenant-id] %d [deployment-policy-uuid]" +
" %s [deployment-policy-id] %s ",deploymentPolicy.getTenantId(), deploymentPolicy.getUuid(),
deploymentPolicy.getId());
- String message = String.format("Deployment policy already exists: [deployment-policy-id] %s ",
- deploymentPolicy.getId());
- log.error(logMessage);
+ log.error(message);
throw new DeploymentPolicyAlreadyExistsException(message);
}
@@ -1329,12 +1314,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
// deployment policy should contain at least one network partition reference
if (null == deploymentPolicy.getNetworkPartitionRefs() || deploymentPolicy.getNetworkPartitionRefs().length == 0) {
- String logMessage = String.format("Deployment policy does not have any network partition references: " +
+ String message = String.format("Deployment policy does not have any network partition references: " +
"[tenant-id] %d [deployment-policy-uuid] %s [deployment-policy-id] %s",
deploymentPolicy.getTenantId(), deploymentPolicyUuid, deploymentPolicyId);
- String message = String.format("Deployment policy does not have any network partition references: " +
- "[deployment-policy-id] %s", deploymentPolicyId);
- log.error(logMessage);
+ log.error(message);
throw new InvalidDeploymentPolicyException(message);
}
@@ -1344,12 +1327,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
//String networkPartitionUuid = networkPartitionRef.getUuid();
String networkPartitionId = networkPartitionRef.getId();
if (StringUtils.isBlank(networkPartitionId)) {
- String message = String.format("Network partition id is blank: [deployment-policy-id] %s",
- deploymentPolicyId);
- String logMessage = String.format("Network partition id is blank: [tenant-id] " +
+ String message = String.format("Network partition id is blank: [tenant-id] " +
"%d [deployment-policy-uuid] %s [deployment-policy-id] %s", deploymentPolicy.getTenantId(),
deploymentPolicyUuid, deploymentPolicyId);
- log.error(logMessage);
+ log.error(message);
throw new InvalidDeploymentPolicyException(message);
}
@@ -1365,12 +1346,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
}
}
if (networkPartitionForTenant == null) {
- String logMessage = String.format("Network partition not found: [tenant-id] %d " +
+ String message = String.format("Network partition not found: [tenant-id] %d " +
"[deployment-policy-uuid] %s [deployment-policy-id] %s [network-partition-id] %s",
deploymentPolicy.getTenantId(), deploymentPolicyUuid, deploymentPolicyId, networkPartitionId);
- String message = String.format("Network partition not found: [deployment-policy-id] %s " +
- "[network-partition-id] %s", deploymentPolicyId, networkPartitionId);
- log.error(logMessage);
+ log.error(message);
throw new InvalidDeploymentPolicyException(message);
}
@@ -1385,15 +1364,12 @@ public class AutoscalerServiceImpl implements AutoscalerService {
}
}
if (!isPartitionFound) {
- String logMessage = String.format("Partition not found: [tenant-id] " +
+ String message = String.format("Partition not found: [tenant-id] " +
"%d [deployment-policy-uuid] %s [deployment-policy-id] %s [network-partition-id] " +
"%s [network=partition-uuid] %s [partition-id] %s ",
deploymentPolicy.getTenantId(), deploymentPolicy.getUuid(), deploymentPolicyId,
networkPartitionRef.getUuid(), networkPartitionId, partitionRef.getId());
- String message = String.format("Partition not found: [deployment-policy-id] %s " +
- "[network-partition-id] %s [partition-id] %s ", deploymentPolicyId,
- networkPartitionId, partitionRef.getId());
- log.error(logMessage);
+ log.error(message);
throw new InvalidDeploymentPolicyException(message);
}
}
@@ -1401,44 +1377,35 @@ public class AutoscalerServiceImpl implements AutoscalerService {
// partition algorithm can't be null or empty
String partitionAlgorithm = networkPartitionRef.getPartitionAlgo();
if (StringUtils.isBlank(partitionAlgorithm)) {
- String logMessage = String.format("Partition algorithm is blank: [tenant-id] %d " +
+ String message = String.format("Partition algorithm is blank: [tenant-id] %d " +
"[deployment-policy-uuid] %s [deployment-policy-id] %s [network-partition-uuid] %s " +
"[network-partition-id] %s [partition-algorithm] %s",
deploymentPolicy.getTenantId(), deploymentPolicyUuid, deploymentPolicyId,
networkPartitionRef.getUuid(), networkPartitionId, partitionAlgorithm);
- String message = String.format("Partition algorithm is blank: [deployment-policy-id] %s " +
- "[network-partition-id] %s [partition-algorithm] %s",
- deploymentPolicyId, networkPartitionId, partitionAlgorithm);
- log.error(logMessage);
+ log.error(message);
throw new InvalidDeploymentPolicyException(message);
}
// partition algorithm should be either one-after-another or round-robin
if ((!StratosConstants.PARTITION_ROUND_ROBIN_ALGORITHM_ID.equals(partitionAlgorithm))
&& (!StratosConstants.PARTITION_ONE_AFTER_ANOTHER_ALGORITHM_ID.equals(partitionAlgorithm))) {
- String logMessage = String.format("Partition algorithm is not valid: [tenant-id] %d " +
+ String message = String.format("Partition algorithm is not valid: [tenant-id] %d " +
"[deployment-policy-uuid] %s [deployment-policy-id] %s [network-partition-uuid] %s " +
"[network-partition-id] %s [partition-algorithm] %s", deploymentPolicy.getTenantId(),
deploymentPolicyUuid, deploymentPolicyId, networkPartitionRef.getUuid(), networkPartitionId,
partitionAlgorithm);
- String message = String.format("Partition algorithm is not valid: [deployment-policy-id] %s " +
- "[network-partition-id] %s [partition-algorithm] %s",
- deploymentPolicyId, networkPartitionId, partitionAlgorithm);
- log.error(logMessage);
+ log.error(message);
throw new InvalidDeploymentPolicyException(message);
}
// a network partition reference should contain at least one partition reference
PartitionRef[] partitions = networkPartitionRef.getPartitionRefs();
if (null == partitions || partitions.length == 0) {
- String logMessage = String.format("Network partition does not have any partition references: " +
+ String message = String.format("Network partition does not have any partition references: " +
"[tenant-id] %d [deployment-policy-uuid] %s [deployment-policy-id] %s " +
"[network-partition-uuid] %s [network-partition-id] %s ", deploymentPolicy.getTenantId(),
deploymentPolicyUuid, deploymentPolicyId, networkPartitionRef.getUuid(), networkPartitionId);
- String message = String.format("Network partition does not have any partition references: " +
- "[deployment-policy-id] %s [network-partition-id] %s", deploymentPolicyId,
- networkPartitionId);
- log.error(logMessage);
+ log.error(message);
throw new InvalidDeploymentPolicyException(message);
}
}
@@ -1461,11 +1428,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
String deploymentPolicyUuid = deploymentPolicy.getUuid();
if (PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyUuid) == null) {
- String logMessage = String.format("Deployment policy not exists: [tenant-id] %d [deployment-policy-uuid] " +
+ String message = String.format("Deployment policy not exists: [tenant-id] %d [deployment-policy-uuid] " +
"%s [deployment-policy-id] %s", deploymentPolicy.getTenantId(), deploymentPolicyUuid,
deploymentPolicy.getId());
- String message = "Deployment policy not exists: [deployment-policy-id] " + deploymentPolicy.getId();
- log.error(logMessage);
+ log.error(message);
throw new DeploymentPolicyNotExistsException(message);
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/eb0d28f4/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
index 96bb38c..4c12f60 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
@@ -38,7 +38,6 @@ import org.apache.stratos.common.Property;
import org.apache.stratos.common.domain.LoadBalancingIPType;
import org.apache.stratos.common.threading.StratosThreadPool;
import org.apache.stratos.messaging.domain.topology.*;
-import org.wso2.carbon.context.PrivilegedCarbonContext;
import java.net.MalformedURLException;
import java.net.URL;
@@ -63,7 +62,6 @@ public class CloudControllerServiceImpl implements CloudControllerService {
private CloudControllerContext cloudControllerContext = CloudControllerContext.getInstance();
private ExecutorService executorService;
- private int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
public CloudControllerServiceImpl() {
executorService = StratosThreadPool.getExecutorService("cloud.controller.instance.manager.thread.pool", 50);
@@ -77,9 +75,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
handleNullObject(cartridgeConfig.getUuid(), "Cartridge definition UUID is null");
if (log.isInfoEnabled()) {
- log.info(String.format("Adding cartridge: [cartridge-uuid] %s [cartridge-type] %s [tenant id] %d ",
- cartridgeConfig.getUuid(), cartridgeConfig.getType(),
- cartridgeConfig.getTenantId()));
+ log.info(String.format("Adding cartridge: [tenant id] %d [cartridge-uuid] %s [cartridge-type] %s ",
+ cartridgeConfig.getTenantId(), cartridgeConfig.getUuid(), cartridgeConfig.getType()));
}
if (log.isDebugEnabled()) {
log.debug("Cartridge definition: " + cartridgeConfig.toString());
@@ -88,9 +85,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
try {
CloudControllerUtil.extractIaaSProvidersFromCartridge(cartridgeConfig);
} catch (Exception e) {
- String message = String.format("Invalid cartridge definition: [cartridge-uuid] %s [cartridge-type] %s",
- " [tenant-id] ", cartridgeConfig.getUuid(), cartridgeConfig.getType(),
- cartridgeConfig.getTenantId());
+ String message = String.format("Invalid cartridge definition: " +
+ "[cartridge-type] %s", cartridgeConfig.getType());
log.error(message, e);
throw new InvalidCartridgeDefinitionException(message, e);
}
@@ -98,9 +94,9 @@ public class CloudControllerServiceImpl implements CloudControllerService {
String cartridgeUuid = cartridgeConfig.getUuid();
Cartridge existingCartridge = cloudControllerContext.getCartridge(cartridgeUuid);
if (existingCartridge != null) {
- String message = String.format(
- "Cartridge already exists: [cartridge-uuid] %s [cartridge-type] %s [tenant id] %d ", cartridgeUuid,
- existingCartridge.getType(), existingCartridge.getTenantId());
+ String message = String.format("Cartridge already exists: [tenant id] %d [cartridge-uuid] %s " +
+ "[cartridge-type] %s ", existingCartridge.getTenantId(), cartridgeUuid,
+ existingCartridge.getType());
log.error(message);
throw new CartridgeAlreadyExistsException(message);
}
@@ -115,8 +111,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
TopologyBuilder.handleServiceCreated(cartridgeList);
if (log.isInfoEnabled()) {
- log.info(String.format("Successfully added cartridge: [cartridge-uuid] %s [cartridge-type] %s [tenant-id] %d ",
- cartridgeUuid, cartridgeConfig.getType(), cartridgeConfig.getTenantId()));
+ log.info(String.format("Successfully added cartridge: [tenant-id] %d [cartridge-uuid] %s [cartridge-type]" +
+ " %s", cartridgeConfig.getTenantId(), cartridgeUuid, cartridgeConfig.getType()));
}
return true;
}
@@ -129,7 +125,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
handleNullObject(cartridge, "Cartridge definition is null");
if (log.isInfoEnabled()) {
- log.info("Updating cartridge: [cartridge-type] " + cartridge.getType());
+ log.info(String.format("Updating cartridge: [tenant-id] %d [cartridge-uuid] %s [cartridge-type]" +
+ " %s", cartridge.getTenantId(), cartridge.getUuid(), cartridge.getType()));
}
if (log.isDebugEnabled()) {
log.debug("Cartridge definition: " + cartridge.toString());
@@ -152,7 +149,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
}
copyIaasProviders(cartridge, cartridgeToBeRemoved);
} else {
- throw new CartridgeDefinitionNotExistsException("This cartridge definition not exists");
+ throw new CartridgeDefinitionNotExistsException("Cartridge definition not exists: [cartridge-type] " +
+ cartridge.getType());
}
// Add cartridge to the cloud controller context and persist
@@ -161,7 +159,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
// transaction ends
if (log.isInfoEnabled()) {
- log.info("Successfully updated cartridge: [cartridge-type] " + cartridgeUuid);
+ log.info(String.format("Successfully updated cartridge: tenant-id] %d [cartridge-uuid] %s " +
+ "[cartridge-type] %s", cartridge.getTenantId(), cartridge.getUuid(), cartridge.getType()));
}
return true;
}
@@ -200,8 +199,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
removeCartridgeFromTopology(cartridge);
if (log.isInfoEnabled()) {
- log.info(String.format("Successfully removed cartridge: [cartridge-uuid] %s [cartridge-type] %s " +
- "[tenant-id] %d", cartridge.getUuid(), cartridge.getType(), cartridge.getTenantId()));
+ log.info(String.format("Successfully removed cartridge: [tenant-id] %d [cartridge-uuid] %s " +
+ "[cartridge-type] %s", cartridge.getTenantId(), cartridge.getUuid(), cartridge.getType()));
}
return true;
}
@@ -220,13 +219,13 @@ public class CloudControllerServiceImpl implements CloudControllerService {
CloudControllerContext.getInstance().persist();
if (log.isInfoEnabled()) {
- log.info(String.format("Successfully removed cartridge: [cartridge-uuid] %s [cartridge-type] %s " +
- "[tenant-id] %d", cartridge.getUuid(), cartridge.getType(), cartridge.getTenantId()));
+ log.info(String.format("Successfully removed cartridge: [tenant-id] %d [cartridge-uuid] %s " +
+ "[cartridge-type] %s", cartridge.getTenantId(), cartridge.getUuid(), cartridge.getType()));
}
return cartridge;
}
}
- String msg = "Cartridge not found: [cartridge-type] " + cartridgeUuid;
+ String msg = "Cartridge not found: [cartridge-uuid] " + cartridgeUuid;
log.error(msg);
throw new InvalidCartridgeTypeException(msg);
}
@@ -253,7 +252,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
public boolean removeServiceGroup(String name) throws InvalidServiceGroupException {
if (log.isDebugEnabled()) {
- log.debug("CloudControllerServiceImpl:removeServiceGroup: " + name);
+ log.debug("Removing service group: [service-group-name] " + name);
}
ServiceGroup serviceGroup = null;
@@ -264,7 +263,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
if (CloudControllerContext.getInstance().getServiceGroups().remove(serviceGroup)) {
CloudControllerContext.getInstance().persist();
if (log.isInfoEnabled()) {
- log.info("Successfully removed the cartridge group: [group-name] " + serviceGroup);
+ log.info(String.format("Successfully removed the cartridge group: [service-group-name] %s", name));
}
return true;
}
@@ -299,7 +298,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
public String[] getServiceGroupSubGroups(String name) throws InvalidServiceGroupException {
ServiceGroup serviceGroup = this.getServiceGroup(name);
if (serviceGroup == null) {
- throw new InvalidServiceGroupException("Invalid cartridge group: [group-name] " + serviceGroup);
+ throw new InvalidServiceGroupException("Invalid cartridge group: [group-name] " + name);
}
return serviceGroup.getSubGroups();
@@ -311,7 +310,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
public String[] getServiceGroupCartridges(String name) throws InvalidServiceGroupException {
ServiceGroup serviceGroup = this.getServiceGroup(name);
if (serviceGroup == null) {
- throw new InvalidServiceGroupException("Invalid cartridge group: [group-name] " + serviceGroup);
+ throw new InvalidServiceGroupException("Invalid cartridge group: [group-name] " + name);
}
String[] cs = serviceGroup.getCartridges();
return cs;
@@ -321,7 +320,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
public Dependencies getServiceGroupDependencies(String name) throws InvalidServiceGroupException {
ServiceGroup serviceGroup = this.getServiceGroup(name);
if (serviceGroup == null) {
- throw new InvalidServiceGroupException("Invalid cartridge group: [group-name] " + serviceGroup);
+ throw new InvalidServiceGroupException("Invalid cartridge group: [group-name] " + name);
}
return serviceGroup.getDependencies();
}
@@ -489,6 +488,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
MemberContext memberContext = new MemberContext(
applicationId, cartridgeType, instanceContext.getClusterId(), memberId);
+
memberContext.setClusterInstanceId(instanceContext.getClusterInstanceId());
memberContext.setNetworkPartitionId(instanceContext.getNetworkPartitionId());
memberContext.setPartition(cloudControllerContext.getNetworkPartition(instanceContext.getNetworkPartitionId()).
@@ -896,7 +896,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
CloudControllerUtil.sleep(1000);
}
- log.info(String.format("Unregistration of service cluster: [cluster-id] %s [application-id]",
+ log.info(String.format("Unregistration of service cluster: [cluster-id] %s [application-id] %s",
clusterId_, ctxt.getApplicationUuid()));
deleteVolumes(ctxt);
onClusterRemoval(clusterId_);
@@ -929,8 +929,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
} catch (Exception ignore) {
if (log.isErrorEnabled()) {
log.error((String.format("Error while deleting volume [id] %s " +
- "[application-id]", volume.getId(), ctxt.getApplicationUuid())),
- ignore);
+ "[application-id] %s", volume.getId(),
+ ctxt.getApplicationUuid())), ignore);
}
}
}
@@ -980,7 +980,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
Cartridge cartridge = CloudControllerContext.getInstance().getCartridge(cartridgeUuid);
if (cartridge == null) {
- String msg = "Cartridge not found: " + cartridgeUuid;
+ String msg = "Cartridge not found: [cartridge-uuid] " + cartridgeUuid;
log.error(msg);
throw new InvalidCartridgeTypeException(msg);
}
@@ -1020,8 +1020,9 @@ public class CloudControllerServiceImpl implements CloudControllerService {
CloudControllerContext.getInstance().addToCartridgeTypeToPartitionIdMap(cartridgeUuid, partitionId);
if (log.isDebugEnabled()) {
- log.debug("Partition " + partitionId + " added to the cache against cartridge: " +
- "[cartridge-uuid] " + cartridgeUuid);
+ log.debug(String.format("Partition %s added to the cache against " +
+ "cartridge: [tenant-id] %d [cartridge-uuid] %s [cartridge-type] %s", partitionId,
+ cartridge.getTenantId(), cartridgeUuid, cartridge.getType()));
}
} catch (Exception e) {
String message = "Could not cache partitions against the cartridge: [cartridge-uuid] " + cartridgeUuid;
@@ -1037,8 +1038,10 @@ public class CloudControllerServiceImpl implements CloudControllerService {
// persist data
CloudControllerContext.getInstance().persist();
- log.info("All partitions [" + CloudControllerUtil.getPartitionIds(networkPartition.getPartitions()) + "]" +
- " were validated successfully, against the cartridge: " + cartridgeUuid);
+ log.info(String.format("All partitions [%s] were validated successfully, " +
+ "against the cartridge: [tenant-id] %d [cartridge-uuid] %s [cartridge-type] %s",
+ CloudControllerUtil.getPartitionIds(networkPartition.getPartitions()), cartridge.getTenantId(),
+ cartridgeUuid, cartridge.getType()));
return true;
} finally {
@@ -1061,9 +1064,10 @@ public class CloudControllerServiceImpl implements CloudControllerService {
handleNullObject(partition, "Partition validation failed. Partition is null.");
String provider = partition.getProvider();
- String partitionId = partition.getUuid();
+ String partitionUuid = partition.getUuid();
- handleNullObject(provider, "Partition [" + partitionId + "] validation failed. Partition provider is null.");
+ handleNullObject(provider, String.format("Partition validation failed. Partition provider is null. " +
+ "[partition-uuid] %s [partition-id] %s ", partitionUuid, partition.getId()));
IaasProvider iaasProvider = CloudControllerConfig.getInstance().getIaasProvider(provider);
return CloudControllerServiceUtil.validatePartition(partition, iaasProvider);
@@ -1245,7 +1249,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
try {
if (CloudControllerContext.getInstance().getKubernetesCluster(kubernetesCluster.getClusterUuid()) != null) {
- throw new KubernetesClusterAlreadyExistsException("Kubernetes cluster already exists");
+ throw new KubernetesClusterAlreadyExistsException("Kubernetes cluster already exists: " +
+ "[kubernetes-cluster] " + kubernetesCluster.getClusterId());
}
} catch (NonExistingKubernetesClusterException ignore) {
}
@@ -1254,8 +1259,9 @@ public class CloudControllerServiceImpl implements CloudControllerService {
lock = CloudControllerContext.getInstance().acquireKubernetesClusterWriteLock();
if (log.isInfoEnabled()) {
- log.info(String.format("Adding kubernetes cluster: [kubernetes-cluster-id] %s",
- kubernetesCluster.getClusterUuid()));
+ log.info(String.format("Adding kubernetes cluster: [tenant-id] %d [kubernetes-cluster-uuid] %s " +
+ "[kubernetes-cluster-id] %s", kubernetesCluster.getTenantId(),
+ kubernetesCluster.getClusterUuid(), kubernetesCluster.getClusterId()));
}
CloudControllerUtil.validateKubernetesCluster(kubernetesCluster);
@@ -1264,8 +1270,10 @@ public class CloudControllerServiceImpl implements CloudControllerService {
CloudControllerContext.getInstance().persist();
if (log.isInfoEnabled()) {
- log.info(String.format("Kubernetes cluster added successfully: [kubernetes-cluster-id] %s",
- kubernetesCluster.getClusterUuid()));
+ log.info(String.format("Kubernetes cluster added successfully: [tenant-id] %d " +
+ "[kubernetes-cluster-uuid] %s [kubernetes-cluster-id] %s",
+ kubernetesCluster.getTenantId(), kubernetesCluster.getClusterUuid(),
+ kubernetesCluster.getClusterId()));
}
return true;
} catch (Exception e) {
@@ -1287,8 +1295,9 @@ public class CloudControllerServiceImpl implements CloudControllerService {
lock = CloudControllerContext.getInstance().acquireKubernetesClusterWriteLock();
if (log.isInfoEnabled()) {
- log.info(String.format("Updating kubernetes cluster: [kubernetes-cluster-id] %s",
- kubernetesCluster.getClusterUuid()));
+ log.info(String.format("Updating kubernetes cluster: [tenant-id] %d [kubernetes-cluster-uuid] %s " +
+ "[kubernetes-cluster-id] %s", kubernetesCluster.getTenantId(),
+ kubernetesCluster.getClusterUuid(), kubernetesCluster.getClusterId()));
}
CloudControllerUtil.validateKubernetesCluster(kubernetesCluster);
@@ -1297,8 +1306,10 @@ public class CloudControllerServiceImpl implements CloudControllerService {
CloudControllerContext.getInstance().persist();
if (log.isInfoEnabled()) {
- log.info(String.format("Kubernetes cluster updated successfully: [kubernetes-cluster-id] %s",
- kubernetesCluster.getClusterUuid()));
+ log.info(String.format("Kubernetes cluster updated successfully: [tenant-id] %d " +
+ "[kubernetes-cluster-uuid] %s [kubernetes-cluster-id] %s",
+ kubernetesCluster.getTenantId(), kubernetesCluster.getClusterUuid(),
+ kubernetesCluster.getClusterId()));
}
return true;
} catch (Exception e) {
@@ -1337,7 +1348,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
kubernetesHostArrayList = new ArrayList<KubernetesHost>();
} else {
if (CloudControllerContext.getInstance().kubernetesHostExists(kubernetesHost.getHostId())) {
- throw new InvalidKubernetesHostException("Kubernetes host already exists: [hostname] " +
+ throw new InvalidKubernetesHostException("Kubernetes host already exists: [kubernetes-host-id] " +
kubernetesHost.getHostId());
}
kubernetesHostArrayList = new
@@ -1351,7 +1362,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
CloudControllerContext.getInstance().persist();
if (log.isInfoEnabled()) {
- log.info(String.format("Kubernetes host added successfully: [id] %s", kubernetesCluster.getClusterUuid()));
+ log.info(String.format("Kubernetes host added successfully: [kubernetes-cluster-id] %s " +
+ "[kubernetes-host-id] %s", kubernetesCluster.getClusterUuid(), kubernetesHost.getHostId()));
}
return true;
@@ -1381,7 +1393,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
CloudControllerContext.getInstance().removeKubernetesCluster(groupUuid);
if (log.isInfoEnabled()) {
- log.info(String.format("Kubernetes cluster removed successfully: [id] %s", groupUuid));
+ log.info(String.format("Kubernetes cluster removed successfully: [kubernetes-cluster-uuid] %s",
+ groupUuid));
}
CloudControllerContext.getInstance().persist();
@@ -1412,7 +1425,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
// Kubernetes master cannot be removed
if (kubernetesClusterStored.getKubernetesMaster().getHostId().equals(kubernetesHostId)) {
- throw new NonExistingKubernetesHostException("Kubernetes master is not allowed to be removed [id] " + kubernetesHostId);
+ throw new NonExistingKubernetesHostException("Kubernetes master is not allowed to be removed " +
+ "[kubernetes-host-id] " + kubernetesHostId);
}
List<KubernetesHost> kubernetesHostList = new ArrayList<KubernetesHost>();
@@ -1423,7 +1437,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
}
// member count will be equal only when host object was not found
if (kubernetesHostList.size() == kubernetesClusterStored.getKubernetesHosts().length) {
- throw new NonExistingKubernetesHostException("Kubernetes host not found for [id] " + kubernetesHostId);
+ throw new NonExistingKubernetesHostException("Kubernetes host not found for [kubernetes-host-id] " +
+ "" + kubernetesHostId);
}
KubernetesHost[] kubernetesHostsArray = new KubernetesHost[kubernetesHostList.size()];
kubernetesHostList.toArray(kubernetesHostsArray);
@@ -1432,7 +1447,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
kubernetesClusterStored.setKubernetesHosts(kubernetesHostsArray);
if (log.isInfoEnabled()) {
- log.info(String.format("Kubernetes host removed successfully: [id] %s", kubernetesHostId));
+ log.info(String.format("Kubernetes host removed successfully: [kubernetes-host-id] %s", kubernetesHostId));
}
CloudControllerContext.getInstance().persist();
@@ -1490,7 +1505,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
lock = CloudControllerContext.getInstance().acquireKubernetesClusterWriteLock();
CloudControllerUtil.validateKubernetesHost(kubernetesHost);
if (log.isInfoEnabled()) {
- log.info("Updating Kubernetes Host: " + kubernetesHost);
+ log.info("Updating Kubernetes Host: [kubernetes-host-id] " + kubernetesHost);
}
try {
@@ -1502,7 +1517,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
kubernetesHosts[i] = kubernetesHost;
if (log.isInfoEnabled()) {
- log.info(String.format("Kubernetes host updated successfully: [id] %s", kubernetesHost.getHostId()));
+ log.info(String.format("Kubernetes host updated successfully: [kubernetes-host-id] %s", kubernetesHost.getHostId()));
}
CloudControllerContext.getInstance().updateKubernetesCluster(kubernetesClusterStored);
@@ -1518,7 +1533,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
CloudControllerContext.getInstance().releaseWriteLock(lock);
}
}
- throw new NonExistingKubernetesHostException("Kubernetes host not found [id] " + kubernetesHost.getHostId());
+ throw new NonExistingKubernetesHostException("Kubernetes host not found [kubernetes-host-id] " + kubernetesHost.getHostId());
}
@Override
@@ -1530,15 +1545,21 @@ public class CloudControllerServiceImpl implements CloudControllerService {
handleNullObject(networkPartition.getUuid(), "Network Partition Id is null");
if (log.isInfoEnabled()) {
- log.info(String.format("Adding network partition: [network-partition-uuid] %s",
- networkPartition.getUuid()));
+ log.info(String.format("Adding network partition: [tenant-id] %d [network-partition-uuid] %s " +
+ "[network-partition-id] %s", networkPartition.getTenantId(), networkPartition.getUuid(),
+ networkPartition.getId()));
}
String networkPartitionUuid = networkPartition.getUuid();
if (cloudControllerContext.getNetworkPartition(networkPartitionUuid) != null) {
- String message = "Network partition already exists: [network-partition-uuid] " + networkPartitionUuid +
- "[network-partition-id] " + networkPartition.getId();
- log.error(message);
+ String logMessage = String.format("Network partition already exists: [tenant-id] %d " +
+ "[network-partition-uuid]" +
+ " %s [network-partition-id] %s", networkPartition.getTenantId(), networkPartition.getUuid(),
+ networkPartition.getId());
+ String message = String.format("Network partition already exists: [network-partition-id] %s",
+ networkPartition.getId());
+
+ log.error(logMessage);
throw new NetworkPartitionAlreadyExistsException(message);
}
@@ -1546,8 +1567,13 @@ public class CloudControllerServiceImpl implements CloudControllerService {
if (cloudControllerContext.getNetworkPartitionForTenant(networkPartitionId,
networkPartition.getTenantId()) != null) {
- String message = "Network partition already exists: [network-partition-id] " + networkPartitionId;
- log.error(message);
+ String logMessage = String.format("Network partition already exists: [tenant-id] %d " +
+ "[network-partition-uuid]" +
+ " %s [network-partition-id] %s", networkPartition.getTenantId(), networkPartition.getUuid(),
+ networkPartition.getId());
+ String message = String.format("Network partition already exists: [network-partition-id] %s",
+ networkPartition.getId());
+ log.error(logMessage);
throw new NetworkPartitionAlreadyExistsException(message);
}
@@ -1555,9 +1581,10 @@ public class CloudControllerServiceImpl implements CloudControllerService {
for (Partition partition : networkPartition.getPartitions()) {
if (partition != null) {
if (log.isInfoEnabled()) {
- log.info(String.format("Validating partition: [network-partition-uuid] %s " +
- "[network-partition-id] %s [partition-id] %s", networkPartitionUuid,
- networkPartition.getId(), partition.getUuid()));
+ log.info(String.format("Validating partition: [tenant-id] %d[network-partition-uuid] %s " +
+ "[network-partition-id] %s [partition-id] %s",
+ networkPartition.getTenantId(), networkPartitionUuid, networkPartition.getId(),
+ partition.getUuid()));
}
// Overwrites partition provider with network partition provider
partition.setProvider(networkPartition.getProvider());
@@ -1566,22 +1593,24 @@ public class CloudControllerServiceImpl implements CloudControllerService {
} catch (InvalidPartitionException e) {
//Following message is shown to the end user in all the the API clients(GUI/CLI/Rest API)
throw new InvalidNetworkPartitionException(String.format("Network partition " +
- "[network-partition-uuid] %s [network-partition-id] %s , " +
+ "[tenant-id] %d [network-partition-uuid] %s [network-partition-id] %s , " +
"is invalid since the partition %s is invalid",
- networkPartition.getUuid(), networkPartition.getId(), partition.getUuid()), e);
+ networkPartition.getTenantId(), networkPartition.getUuid(), networkPartition.getId(),
+ partition.getUuid()), e);
}
if (log.isInfoEnabled()) {
- log.info(String.format("Partition validated successfully: [network-partition-uuid] %s " +
- "[network-partition-id] %s [partition-id] %s", networkPartition.getUuid(),
- networkPartition.getId(), partition.getUuid()));
+ log.info(String.format("Partition validated successfully: [tenant-id] %d " +
+ "[network-partition-uuid] %s [network-partition-id] %s [partition-id] %s",
+ networkPartition.getTenantId(), networkPartition.getUuid(), networkPartition.getId(),
+ partition.getUuid()));
}
}
}
} else {
//Following message is shown to the end user in all the the API clients(GUI/CLI/Rest API)
- throw new InvalidNetworkPartitionException(String.format("Network partition [network-partition-uuid] %s " +
- "[network-partition-id] %s, doesn't not have any partitions ", networkPartition.getUuid(),
- networkPartition.getId()));
+ throw new InvalidNetworkPartitionException(String.format("Network partition [tenant-id] %d " +
+ "[network-partition-uuid] %s [network-partition-id] %s, doesn't not have any partitions ",
+ networkPartition.getTenantId(), networkPartition.getUuid(), networkPartition.getId()));
}
// adding network partition to CC-Context
@@ -1589,8 +1618,9 @@ public class CloudControllerServiceImpl implements CloudControllerService {
// persisting CC-Context
CloudControllerContext.getInstance().persist();
if (log.isInfoEnabled()) {
- log.info(String.format("Network partition added successfully: [network-partition-uuid] %s " +
- "[network-partition-id] %s", networkPartition.getUuid(),networkPartition.getId()));
+ log.info(String.format("Network partition added successfully: [tenant-id] %d [network-partition-uuid] %s " +
+ "[network-partition-id] %s", networkPartition.getTenantId(), networkPartition.getUuid(),
+ networkPartition.getId()));
}
return true;
}
@@ -1607,13 +1637,15 @@ public class CloudControllerServiceImpl implements CloudControllerService {
String networkPartitionUuid = networkPartition.getUuid();
if (log.isInfoEnabled()) {
- log.info(String.format("Removing network partition: [network-partition-uuid] %s " +
- "[network-partition-id] %s", networkPartitionUuid, networkPartitionId));
+ log.info(String.format("Removing network partition: [tenant-id] %d [network-partition-uuid] %s " +
+ "[network-partition-id] %s", networkPartition.getTenantId(), networkPartitionUuid,
+ networkPartitionId));
}
handleNullObject(networkPartitionId, "Network Partition Id is null");
if (networkPartitionUuid == null) {
- String message = String.format("Network partition not found:[network-partition-id] %s", networkPartitionId);
+ String message = String.format("Network partition not found: [network-partition-id] %s",
+ networkPartitionId);
log.error(message);
throw new NetworkPartitionNotExistsException(message);
}
@@ -1622,8 +1654,9 @@ public class CloudControllerServiceImpl implements CloudControllerService {
// persisting CC-Context
CloudControllerContext.getInstance().persist();
if (log.isInfoEnabled()) {
- log.info(String.format("Network partition removed successfully: [network-partition-uuid] %s " +
- "[network-partition-id] %s", networkPartitionUuid, networkPartitionId));
+ log.info(String.format("Network partition removed successfully: [tenant-id] %d " +
+ "[network-partition-uuid] %s [network-partition-id] %s", networkPartition.getTenantId(),
+ networkPartitionUuid, networkPartitionId));
}
} else {
String message = String.format("Network partition not found: [network-partition-id] %s",
@@ -1650,14 +1683,17 @@ public class CloudControllerServiceImpl implements CloudControllerService {
handleNullObject(networkPartition.getUuid(), "Network Partition Id is null");
if (log.isInfoEnabled()) {
- log.info(String.format("Updating network partition: [network-partition-id] %s", networkPartition.getUuid()));
+ log.info(String.format("Updating network partition: [tenant-id] %d [network-partition-uuid] %s " +
+ "[network-partition-id] %s", networkPartition.getTenantId(),
+ networkPartition.getUuid(), networkPartition.getId()));
}
String networkPartitionId = networkPartition.getId();
String networkPartitionUuid = networkPartition.getUuid();
if (cloudControllerContext.getNetworkPartition(networkPartitionUuid) == null) {
- String message = String.format("Network partition not found: [network-partition-uuid] %s " +
- "[network-partition-id] %s", networkPartitionUuid, networkPartitionId);
+ String message = String.format("Network partition not found: [tenant-id] %d [network-partition-uuid] %s " +
+ "[network-partition-id] %s", networkPartition.getTenantId(),
+ networkPartition.getUuid(), networkPartition.getId());
log.error(message);
throw new NetworkPartitionNotExistsException(message);
}
@@ -1666,17 +1702,19 @@ public class CloudControllerServiceImpl implements CloudControllerService {
for (Partition partition : networkPartition.getPartitions()) {
if (partition != null) {
if (log.isInfoEnabled()) {
- log.info(String.format("Validating partition: [network-partition-uuid] %s " +
- "[network-partition-id] %s [partition-id] %s", networkPartitionUuid,
- networkPartitionId, partition.getUuid()));
+ log.info(String.format("Validating partition: [tenant-id] %d [network-partition-uuid] %s" +
+ "[network-partition-id] %s [partition-uuid] %s [partition-id] %s ",
+ networkPartition.getTenantId(), networkPartitionUuid, networkPartitionId,
+ partition.getUuid(), partition.getId()));
}
// Overwrites partition provider with network partition provider
partition.setProvider(networkPartition.getProvider());
validatePartition(partition);
if (log.isInfoEnabled()) {
- log.info(String.format("Partition validated successfully: [network-partition-uuid] %s " +
- "[network-partition-uuid] %s [partition-id] %s", networkPartitionUuid,
- networkPartitionId, partition.getUuid()));
+ log.info(String.format("Partition validated successfully: [tenant-id] %d " +
+ "[network-partition-uuid] %s [network-partition-id] %s [partition-uuid] " +
+ "%s [partition-id] %s ", networkPartition.getTenantId(),
+ networkPartitionUuid, networkPartitionId, partition.getUuid(), partition.getId()));
}
}
}
@@ -1687,8 +1725,9 @@ public class CloudControllerServiceImpl implements CloudControllerService {
// persisting CC-Context
CloudControllerContext.getInstance().persist();
if (log.isInfoEnabled()) {
- log.info(String.format("Network partition updated successfully: [network-partition-uuid] %s " +
- "[network-partition-id] %s", networkPartitionUuid, networkPartitionId));
+ log.info(String.format("Network partition updated successfully: [tenant-id] %d [network-partition-uuid] %s " +
+ "[network-partition-id] %s", networkPartition.getTenantId(),
+ networkPartition.getUuid(), networkPartition.getId()));
}
return true;
} catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/eb0d28f4/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 32be807..ec1a17c 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
@@ -303,8 +303,7 @@ public class StratosApiV41 extends AbstractApi {
//Ignore this since this is valid(cartridge is does not exist) when adding the cartridge for first time
}
if (cartridgeBean != null) {
- String msg = String.format("Cartridge already exists: [tenant-id] %d [cartridge-uuid] %s [cartridge-type] %s ",
- tenantId, cartridgeUuid, cartridgeType);
+ String msg = String.format("Cartridge already exists: [cartridge-type] %s ", cartridgeType);
log.warn(msg);
return Response.status(Response.Status.CONFLICT)
.entity(new ResponseMessageBean(ResponseMessageBean.ERROR, msg)).build();
@@ -499,8 +498,8 @@ public class StratosApiV41 extends AbstractApi {
groupBean = StratosApiV41Utils.getServiceGroupDefinition(cartridgeGroupBean.getName(), carbonContext.getTenantId());
if (groupBean != null) {
- String msg = String.format("Cartridge already exists: [tenant-id] %d [cartridge-uuid] %s [cartridge-type]" +
- "%s", tenantId, cartrideGroupUuid, cartridgeGroupBean.getName());
+ String msg = String.format("Cartridge group already exists: [cartridge-group-name] %s",
+ cartridgeGroupBean.getName());
log.warn(msg);
return Response.status(Response.Status.CONFLICT)
.entity(new ResponseMessageBean(ResponseMessageBean.ERROR, msg)).build();
http://git-wip-us.apache.org/repos/asf/stratos/blob/eb0d28f4/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 ddb4f88..5c9f3f0 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
@@ -284,17 +284,19 @@ public class StratosApiV41Utils {
// Validate whether cartridge can be removed
if (!smServiceClient.canCartridgeBeRemoved(cartridge.getUuid())) {
- String message = String.format("Cannot remove cartridge : [tenant-id] %d [cartridge-uuid] %s " +
+ String logMessage = String.format("Cannot remove cartridge : [tenant-id] %d [cartridge-uuid] %s " +
"[cartridge-type] %s since it is used in another cartridge group or an application",
tenantId, cartridge.getUuid(), cartridgeType);
- log.error(message);
+ String message = String.format("Cannot remove cartridge :n[cartridge-type] %s since it is used in another" +
+ " cartridge group or an application", cartridgeType);
+ log.error(logMessage);
throw new RestAPIException(message);
}
cloudControllerServiceClient.removeCartridge(cartridge.getUuid());
if (log.isInfoEnabled()) {
log.info(String.format("Successfully removed cartridge: [tenant-id] %d [cartridge-uuid] %s " +
- "[cartridge-type] %s from tenant: ", tenantId, cartridge.getUuid(), cartridgeType));
+ "[cartridge-type] %s", tenantId, cartridge.getUuid(), cartridgeType));
}
}
[41/50] [abbrv] stratos git commit: Merge with tenant-isolation branch
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
index ecd2728,142b16f..0e5c4a5
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
@@@ -31,7 -31,7 +31,6 @@@ import org.apache.stratos.cloud.control
import org.apache.stratos.cloud.controller.statistics.publisher.BAMUsageDataPublisher;
import org.apache.stratos.cloud.controller.util.CloudControllerUtil;
import org.apache.stratos.common.Property;
- import org.apache.stratos.kubernetes.client.KubernetesConstants;
-import org.apache.stratos.common.constants.StratosConstants;
import org.apache.stratos.messaging.domain.application.ClusterDataHolder;
import org.apache.stratos.messaging.domain.instance.ClusterInstance;
import org.apache.stratos.messaging.domain.topology.*;
@@@ -148,9 -148,40 +147,9 @@@ public class TopologyBuilder
}
}
- public static void handleClusterCreated(ClusterStatusClusterCreatedEvent event) {
- TopologyManager.acquireWriteLock();
- Cluster cluster;
- try {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(event.getServiceName());
- if (service == null) {
- log.error("Service " + event.getServiceName() +
- " not found in Topology, unable to update the cluster status to Created");
- return;
- }
-
- if (service.clusterExists(event.getClusterId())) {
- log.warn("Cluster " + event.getClusterId() + " is already in the Topology ");
- return;
- } else {
- cluster = new Cluster(event.getServiceName(),
- event.getClusterId(), event.getDeploymentPolicyName(),
- event.getAutosScalePolicyName(), event.getAppId());
- //cluster.setStatus(Status.Created);
- cluster.setHostNames(event.getHostNames());
- cluster.setTenantRange(event.getTenantRange());
- service.addCluster(cluster);
- TopologyManager.updateTopology(topology);
- }
- } finally {
- TopologyManager.releaseWriteLock();
- }
-
- TopologyEventPublisher.sendClusterCreatedEvent(cluster);
- }
- public static void handleApplicationClustersCreated(String appId, List<Cluster> appClusters) {
+ public static void handleApplicationClustersCreated(String appUuid, List<Cluster> appClusters) {
TopologyManager.acquireWriteLock();
@@@ -180,331 -211,262 +179,248 @@@
}
for (PortMapping portMapping : cartridge.getPortMappings()) {
- ClusterPortMapping clusterPortMapping = new ClusterPortMapping(appId,
+ ClusterPortMapping clusterPortMapping = new ClusterPortMapping(appUuid,
cluster.getClusterId(), portMapping.getName(), portMapping.getProtocol(), portMapping.getPort(),
- portMapping.getProxyPort());
- CloudControllerContext.getInstance().addClusterPortMapping(clusterPortMapping);
- log.debug("Cluster port mapping created: " + clusterPortMapping.toString());
- }
+ portMapping.getProxyPort());
+ if (portMapping.getKubernetesPortType() != null) {
+ clusterPortMapping.setKubernetesServiceType(portMapping.getKubernetesPortType());
}
+ CloudControllerContext.getInstance().addClusterPortMapping(clusterPortMapping);
+ log.debug("Cluster port mapping created: " + clusterPortMapping.toString());
+ }
+ }
- // Persist cluster port mappings
- CloudControllerContext.getInstance().persist();
+ // Persist cluster port mappings
+ CloudControllerContext.getInstance().persist();
- // Send application clusters created event
- TopologyEventPublisher.sendApplicationClustersCreated(appId, appClusters);
- }
+ // Send application clusters created event
+ TopologyEventPublisher.sendApplicationClustersCreated(appUuid, appClusters);
+ }
- public static void handleApplicationClustersRemoved(String appId,
- Set<ClusterDataHolder> clusterData) {
- TopologyManager.acquireWriteLock();
+ public static void handleApplicationClustersRemoved (String appId,
+ Set < ClusterDataHolder > clusterData){
+ TopologyManager.acquireWriteLock();
- List<Cluster> removedClusters = new ArrayList<Cluster>();
- CloudControllerContext context = CloudControllerContext.getInstance();
- try {
- Topology topology = TopologyManager.getTopology();
+ List<Cluster> removedClusters = new ArrayList<Cluster>();
+ CloudControllerContext context = CloudControllerContext.getInstance();
+ try {
+ Topology topology = TopologyManager.getTopology();
+
+ if (clusterData != null) {
+ // remove clusters from CC topology model and remove runtime information
+ for (ClusterDataHolder aClusterData : clusterData) {
+ Service aService = topology.getService(aClusterData.getServiceUuid());
+ if (aService != null) {
+ removedClusters.add(aService.removeCluster(aClusterData.getClusterId()));
+ } else {
+ log.warn("Service " + aClusterData.getServiceType() + " not found, " +
+ "unable to remove Cluster " + aClusterData.getClusterId());
+ }
+ // remove runtime data
+ context.removeClusterContext(aClusterData.getClusterId());
- if (clusterData != null) {
- // remove clusters from CC topology model and remove runtime information
- for (ClusterDataHolder aClusterData : clusterData) {
- Service aService = topology.getService(aClusterData.getServiceType());
- if (aService != null) {
- removedClusters.add(aService.removeCluster(aClusterData.getClusterId()));
- } else {
- log.warn("Service " + aClusterData.getServiceType() + " not found, " +
- "unable to remove Cluster " + aClusterData.getClusterId());
+ log.info("Removed application [ " + appId + " ]'s Cluster " +
+ "[ " + aClusterData.getClusterId() + " ] from the topology");
}
- // remove runtime data
- context.removeClusterContext(aClusterData.getClusterId());
-
- log.info("Removed application [ " + appId + " ]'s Cluster " +
- "[ " + aClusterData.getClusterId() + " ] from the topology");
+ // persist runtime data changes
+ CloudControllerContext.getInstance().persist();
+ } else {
+ log.info("No cluster data found for application " + appId + " to remove");
}
- // persist runtime data changes
- CloudControllerContext.getInstance().persist();
- } else {
- log.info("No cluster data found for application " + appId + " to remove");
- }
-
- TopologyManager.updateTopology(topology);
- } finally {
- TopologyManager.releaseWriteLock();
- }
-
- // Remove cluster port mappings of application
- CloudControllerContext.getInstance().removeClusterPortMappings(appId);
- CloudControllerContext.getInstance().persist();
-
- TopologyEventPublisher.sendApplicationClustersRemoved(appId, clusterData);
-
- }
-
- public static void handleClusterReset(ClusterStatusClusterResetEvent event) {
- TopologyManager.acquireWriteLock();
+ TopologyManager.updateTopology(topology);
- try {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(event.getServiceName());
- if (service == null) {
- log.error("Service " + event.getServiceName() +
- " not found in Topology, unable to update the cluster status to Created");
- return;
+ } finally {
+ TopologyManager.releaseWriteLock();
}
- Cluster cluster = service.getCluster(event.getClusterId());
- if (cluster == null) {
- log.error("Cluster " + event.getClusterId() + " not found in Topology, unable to update " +
- "status to Created");
- return;
- }
+ // Remove cluster port mappings of application
+ CloudControllerContext.getInstance().removeClusterPortMappings(appId);
+ CloudControllerContext.getInstance().persist();
- ClusterInstance context = cluster.getInstanceContexts(event.getInstanceId());
- if (context == null) {
- log.warn("Cluster Instance Context is not found for [cluster] " +
- event.getClusterId() + " [instance-id] " +
- event.getInstanceId());
- return;
- }
- ClusterStatus status = ClusterStatus.Created;
- if (context.isStateTransitionValid(status)) {
- context.setStatus(status);
- log.info("Cluster Created adding status started for" + cluster.getClusterId());
- TopologyManager.updateTopology(topology);
- //publishing data
- TopologyEventPublisher.sendClusterResetEvent(event.getAppId(), event.getServiceName(),
- event.getClusterId(), event.getInstanceId());
- } else {
- log.warn(String.format("Cluster state transition is not valid: [cluster-id] %s " +
- " [instance-id] %s [current-status] %s [status-requested] %s",
- event.getClusterId(), event.getInstanceId(),
- context.getStatus(), status));
- }
+ TopologyEventPublisher.sendApplicationClustersRemoved(appId, clusterData);
- } finally {
- TopologyManager.releaseWriteLock();
}
+ public static void handleClusterReset (ClusterStatusClusterResetEvent event){
+ TopologyManager.acquireWriteLock();
- }
-
- public static void handleClusterInstanceCreated(String serviceType, String clusterId,
- String alias, String instanceId, String partitionId,
- String networkPartitionId) {
-
- TopologyManager.acquireWriteLock();
+ try {
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(event.getServiceName());
+ if (service == null) {
+ log.error("Service " + event.getServiceName() +
+ " not found in Topology, unable to update the cluster status to Created");
+ return;
+ }
- try {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(serviceType);
- if (service == null) {
- log.error("Service " + serviceType +
- " not found in Topology, unable to update the cluster status to Created");
- return;
- }
+ Cluster cluster = service.getCluster(event.getClusterId());
+ if (cluster == null) {
+ log.error("Cluster " + event.getClusterId() + " not found in Topology, unable to update " +
+ "status to Created");
+ return;
+ }
- Cluster cluster = service.getCluster(clusterId);
- if (cluster == null) {
- log.error("Cluster " + clusterId + " not found in Topology, unable to update " +
- "status to Created");
- return;
- }
+ ClusterInstance context = cluster.getInstanceContexts(event.getInstanceId());
+ if (context == null) {
+ log.warn("Cluster Instance Context is not found for [cluster] " +
+ event.getClusterId() + " [instance-id] " +
+ event.getInstanceId());
+ return;
+ }
+ ClusterStatus status = ClusterStatus.Created;
+ if (context.isStateTransitionValid(status)) {
+ context.setStatus(status);
+ log.info("Cluster Created adding status started for" + cluster.getClusterId());
+ TopologyManager.updateTopology(topology);
+ //publishing data
+ TopologyEventPublisher.sendClusterResetEvent(event.getAppId(), event.getServiceName(),
+ event.getClusterId(), event.getInstanceId());
+ } else {
+ log.warn(String.format("Cluster state transition is not valid: [cluster-id] %s " +
+ " [instance-id] %s [current-status] %s [status-requested] %s",
+ event.getClusterId(), event.getInstanceId(),
+ context.getStatus(), status));
+ }
- if (cluster.getInstanceContexts(instanceId) != null) {
- log.warn("The Instance context for the cluster already exists for [cluster] " +
- clusterId + " [instance-id] " + instanceId);
- return;
+ } finally {
+ TopologyManager.releaseWriteLock();
}
- ClusterInstance clusterInstance = new ClusterInstance(alias, clusterId, instanceId);
- clusterInstance.setNetworkPartitionId(networkPartitionId);
- clusterInstance.setPartitionId(partitionId);
- cluster.addInstanceContext(instanceId, clusterInstance);
- TopologyManager.updateTopology(topology);
-
- ClusterInstanceCreatedEvent clusterInstanceCreatedEvent =
- new ClusterInstanceCreatedEvent(serviceType, clusterId,
- clusterInstance);
- clusterInstanceCreatedEvent.setPartitionId(partitionId);
- TopologyEventPublisher.sendClusterInstanceCreatedEvent(clusterInstanceCreatedEvent);
- } finally {
- TopologyManager.releaseWriteLock();
}
- }
+ public static void handleClusterInstanceCreated (String serviceUuid, String clusterId,
+ String alias, String instanceId, String partitionId,
+ String networkPartitionUuid){
- public static void handleClusterRemoved(ClusterContext ctxt) {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(ctxt.getCartridgeType());
- String deploymentPolicy;
- if (service == null) {
- log.warn(String.format("Service %s does not exist",
- ctxt.getCartridgeType()));
- return;
- }
-
- if (!service.clusterExists(ctxt.getClusterId())) {
- log.warn(String.format("Cluster %s does not exist for service %s",
- ctxt.getClusterId(),
- ctxt.getCartridgeType()));
- return;
- }
-
- try {
TopologyManager.acquireWriteLock();
- Cluster cluster = service.removeCluster(ctxt.getClusterId());
- deploymentPolicy = cluster.getDeploymentPolicyName();
- TopologyManager.updateTopology(topology);
- } finally {
- TopologyManager.releaseWriteLock();
- }
- TopologyEventPublisher.sendClusterRemovedEvent(ctxt, deploymentPolicy);
- }
- /**
- * Add member object to the topology and publish member created event
- *
- * @param memberContext
- */
- public static void handleMemberCreatedEvent(MemberContext memberContext) {
- Topology topology = TopologyManager.getTopology();
+ try {
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(serviceUuid);
+ if (service == null) {
+ log.error("Service " + serviceUuid +
+ " not found in Topology, unable to update the cluster status to Created");
+ return;
+ }
- Service service = topology.getService(memberContext.getCartridgeType());
- String clusterId = memberContext.getClusterId();
- Cluster cluster = service.getCluster(clusterId);
- String memberId = memberContext.getMemberId();
- String clusterInstanceId = memberContext.getClusterInstanceId();
- String networkPartitionId = memberContext.getNetworkPartitionId();
- String partitionId = memberContext.getPartition().getId();
- String lbClusterId = memberContext.getLbClusterId();
- long initTime = memberContext.getInitTime();
-
- if (cluster.memberExists(memberId)) {
- log.warn(String.format("Member %s already exists", memberId));
- return;
- }
+ Cluster cluster = service.getCluster(clusterId);
+ if (cluster == null) {
+ log.error("Cluster " + clusterId + " not found in Topology, unable to update " +
+ "status to Created");
+ return;
+ }
- try {
- TopologyManager.acquireWriteLock();
- Member member = new Member(service.getServiceName(), clusterId, memberId, clusterInstanceId,
- networkPartitionId, partitionId, memberContext.getLoadBalancingIPType(), initTime);
- member.setStatus(MemberStatus.Created);
- member.setLbClusterId(lbClusterId);
- member.setProperties(CloudControllerUtil.toJavaUtilProperties(memberContext.getProperties()));
- cluster.addMember(member);
- TopologyManager.updateTopology(topology);
- } finally {
- TopologyManager.releaseWriteLock();
- }
+ if (cluster.getInstanceContexts(instanceId) != null) {
+ log.warn("The Instance context for the cluster already exists for [cluster] " +
+ clusterId + " [instance-id] " + instanceId);
+ return;
+ }
- TopologyEventPublisher.sendMemberCreatedEvent(memberContext);
- }
+ ClusterInstance clusterInstance = new ClusterInstance(alias, clusterId, instanceId);
+ clusterInstance.setNetworkPartitionUuid(networkPartitionUuid);
+ clusterInstance.setPartitionId(partitionId);
+ cluster.addInstanceContext(instanceId, clusterInstance);
+ TopologyManager.updateTopology(topology);
- /**
- * Update member status to initialized and publish member initialized event
- *
- * @param memberContext
- */
- public static void handleMemberInitializedEvent(MemberContext memberContext) {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(memberContext.getCartridgeType());
- if (service == null) {
- log.warn(String.format("Service %s does not exist",
- memberContext.getCartridgeType()));
- return;
- }
- if (!service.clusterExists(memberContext.getClusterId())) {
- log.warn(String.format("Cluster %s does not exist in service %s",
- memberContext.getClusterId(),
- memberContext.getCartridgeType()));
- return;
- }
+ ClusterInstanceCreatedEvent clusterInstanceCreatedEvent =
+ new ClusterInstanceCreatedEvent(serviceUuid, clusterId,
+ clusterInstance);
+ clusterInstanceCreatedEvent.setPartitionId(partitionId);
+ TopologyEventPublisher.sendClusterInstanceCreatedEvent(clusterInstanceCreatedEvent);
- Member member = service.getCluster(memberContext.getClusterId()).
- getMember(memberContext.getMemberId());
- if (member == null) {
- log.warn(String.format("Member %s does not exist",
- memberContext.getMemberId()));
- return;
+ } finally {
+ TopologyManager.releaseWriteLock();
+ }
}
- try {
- TopologyManager.acquireWriteLock();
- // Set ip addresses
- member.setDefaultPrivateIP(memberContext.getDefaultPrivateIP());
- if (memberContext.getPrivateIPs() != null) {
- member.setMemberPrivateIPs(Arrays.asList(memberContext.getPrivateIPs()));
- }
- member.setDefaultPublicIP(memberContext.getDefaultPublicIP());
- if (memberContext.getPublicIPs() != null) {
- member.setMemberPublicIPs(Arrays.asList(memberContext.getPublicIPs()));
+ public static void handleClusterRemoved (ClusterContext ctxt){
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(ctxt.getCartridgeUuid());
+ String deploymentPolicy;
+ if (service == null) {
+ log.warn(String.format("Service %s does not exist",
+ ctxt.getCartridgeUuid()));
+ return;
}
- // try update lifecycle state
- if (!member.isStateTransitionValid(MemberStatus.Initialized)) {
- log.error("Invalid state transition from " + member.getStatus() + " to " +
- MemberStatus.Initialized);
+ if (!service.clusterExists(ctxt.getClusterId())) {
+ log.warn(String.format("Cluster %s does not exist for service %s",
+ ctxt.getClusterId(),
+ ctxt.getCartridgeUuid()));
return;
- } else {
+ }
- Cluster cluster = service.getCluster(memberContext.getClusterId());
- String clusterId = cluster.getClusterId();
- ClusterContext clusterContext = CloudControllerContext.getInstance().getClusterContext(clusterId);
- List<KubernetesService> kubernetesServices = clusterContext.getKubernetesServices();
+ try {
+ TopologyManager.acquireWriteLock();
+ Cluster cluster = service.removeCluster(ctxt.getClusterId());
+ deploymentPolicy = cluster.getDeploymentPolicyName();
+ TopologyManager.updateTopology(topology);
+ } finally {
+ TopologyManager.releaseWriteLock();
+ }
+ TopologyEventPublisher.sendClusterRemovedEvent(ctxt, deploymentPolicy);
+ }
- if (kubernetesServices != null) {
- cluster.setKubernetesServices(kubernetesServices);
- }
+ /**
+ * Add member object to the topology and publish member created event
+ *
+ * @param memberContext
+ */
+ public static void handleMemberCreatedEvent (MemberContext memberContext){
+ Topology topology = TopologyManager.getTopology();
- member.setStatus(MemberStatus.Initialized);
- log.info("Member status updated to initialized");
+ Service service = topology.getService(memberContext.getCartridgeType());
+ String clusterId = memberContext.getClusterId();
+ Cluster cluster = service.getCluster(clusterId);
+ String memberId = memberContext.getMemberId();
+ String clusterInstanceId = memberContext.getClusterInstanceId();
+ String networkPartitionId = memberContext.getNetworkPartitionId();
+ String partitionId = memberContext.getPartition().getUuid();
+ String lbClusterId = memberContext.getLbClusterId();
+ long initTime = memberContext.getInitTime();
- String autoscalingReason = memberContext.getProperties().getProperty(
- StratosConstants.SCALING_REASON).getValue();
- long scalingTime = Long.parseLong(memberContext.getProperties().getProperty(
- StratosConstants.SCALING_TIME).getValue());
- TopologyManager.updateTopology(topology);
- TopologyEventPublisher.sendMemberInitializedEvent(memberContext);
- //publishing data
- BAMUsageDataPublisher.publish(memberContext.getMemberId(),
- memberContext.getPartition().getId(),
- memberContext.getNetworkPartitionId(),
- memberContext.getClusterId(),
- memberContext.getCartridgeType(),
- MemberStatus.Initialized.toString(),
- null);
+ if (cluster.memberExists(memberId)) {
+ log.warn(String.format("Member %s already exists", memberId));
+ return;
}
+
+ try {
+ TopologyManager.acquireWriteLock();
+ Member member = new Member(service.getServiceName(), clusterId, memberId, clusterInstanceId,
+ networkPartitionId, partitionId, memberContext.getLoadBalancingIPType(), initTime);
+ member.setStatus(MemberStatus.Created);
+ member.setLbClusterId(lbClusterId);
+ member.setProperties(CloudControllerUtil.toJavaUtilProperties(memberContext.getProperties()));
+ cluster.addMember(member);
+ TopologyManager.updateTopology(topology);
- //member created time
- Long timeStamp = System.currentTimeMillis();
- //publishing to BAM
- BAMUsageDataPublisher
- .publish(memberContext.getMemberId(),
- memberContext.getPartition().getId(),
- memberContext.getNetworkPartitionId(),
- memberContext.getClusterId(),
- memberContext.getClusterInstanceId(),
- memberContext.getCartridgeType(),
- MemberStatus.Created.toString(),
- timeStamp, autoscalingReason,
- scalingTime, null);
- } finally {
- TopologyManager.releaseWriteLock();
- }
-
- TopologyEventPublisher.sendMemberCreatedEvent(memberContext);
+ } finally {
+ TopologyManager.releaseWriteLock();
}
- }
- private static int findKubernetesServicePort(String clusterId, List<KubernetesService> kubernetesServices,
- PortMapping portMapping) {
- for (KubernetesService kubernetesService : kubernetesServices) {
- if (kubernetesService.getProtocol().equals(portMapping.getProtocol())) {
- return kubernetesService.getPort();
- }
- }
- throw new RuntimeException("Kubernetes service port not found: [cluster-id] " + clusterId + " [port] "
- + portMapping.getPort());
++ TopologyEventPublisher.sendMemberCreatedEvent(memberContext);
+ }
+
- public static void handleMemberStarted(InstanceStartedEvent instanceStartedEvent) {
- try {
+ /**
+ * Update member status to initialized and publish member initialized event
+ *
+ * @param memberContext
+ */
+ public static void handleMemberInitializedEvent (MemberContext memberContext){
Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(instanceStartedEvent.getServiceName());
+ Service service = topology.getService(memberContext.getCartridgeType());
if (service == null) {
log.warn(String.format("Service %s does not exist",
- instanceStartedEvent.getServiceName()));
+ memberContext.getCartridgeType()));
return;
}
- if (!service.clusterExists(instanceStartedEvent.getClusterId())) {
+ if (!service.clusterExists(memberContext.getClusterId())) {
log.warn(String.format("Cluster %s does not exist in service %s",
- instanceStartedEvent.getClusterId(),
- instanceStartedEvent.getServiceName()));
+ memberContext.getClusterId(),
+ memberContext.getCartridgeType()));
return;
}
@@@ -542,448 -517,427 +471,426 @@@
} finally {
TopologyManager.releaseWriteLock();
}
- } catch (Exception e) {
- String message = String.format("Could not handle member started event: [application-id] %s " +
- "[service-name] %s [member-id] %s", instanceStartedEvent.getApplicationId(),
- instanceStartedEvent.getServiceName(), instanceStartedEvent.getMemberId());
- log.warn(message, e);
}
- }
- public static void handleMemberActivated(InstanceActivatedEvent instanceActivatedEvent) {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(instanceActivatedEvent.getServiceName());
- if (service == null) {
- log.warn(String.format("Service %s does not exist",
- instanceActivatedEvent.getServiceName()));
- return;
- }
-
- Cluster cluster = service.getCluster(instanceActivatedEvent.getClusterId());
- if (cluster == null) {
- log.warn(String.format("Cluster %s does not exist",
- instanceActivatedEvent.getClusterId()));
- return;
+ private static int findKubernetesServicePort (String clusterId, List < KubernetesService > kubernetesServices,
+ PortMapping portMapping){
+ for (KubernetesService kubernetesService : kubernetesServices) {
+ if (kubernetesService.getProtocol().equals(portMapping.getProtocol())) {
+ return kubernetesService.getPort();
+ }
+ }
+ throw new RuntimeException("Kubernetes service port not found: [cluster-id] " + clusterId + " [port] "
+ + portMapping.getPort());
}
- Member member = cluster.getMember(instanceActivatedEvent.getMemberId());
- if (member == null) {
- log.warn(String.format("Member %s does not exist",
- instanceActivatedEvent.getMemberId()));
- return;
- }
+ public static void handleMemberStarted (InstanceStartedEvent instanceStartedEvent){
+ try {
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(instanceStartedEvent.getServiceName());
+ if (service == null) {
+ log.warn(String.format("Service %s does not exist",
+ instanceStartedEvent.getServiceName()));
+ return;
+ }
+ if (!service.clusterExists(instanceStartedEvent.getClusterId())) {
+ log.warn(String.format("Cluster %s does not exist in service %s",
+ instanceStartedEvent.getClusterId(),
+ instanceStartedEvent.getServiceName()));
+ return;
+ }
- MemberActivatedEvent memberActivatedEvent = new MemberActivatedEvent(
- instanceActivatedEvent.getServiceName(),
- instanceActivatedEvent.getClusterId(),
- instanceActivatedEvent.getClusterInstanceId(),
- instanceActivatedEvent.getMemberId(),
- instanceActivatedEvent.getNetworkPartitionId(),
- instanceActivatedEvent.getPartitionId());
-
- // grouping - set grouid
- //TODO
- memberActivatedEvent.setApplicationId(null);
- try {
- TopologyManager.acquireWriteLock();
- // try update lifecycle state
- if (!member.isStateTransitionValid(MemberStatus.Active)) {
- log.error("Invalid state transition from [" + member.getStatus() + "] to [" + MemberStatus.Active + "]");
- return;
- } else {
- member.setStatus(MemberStatus.Active);
+ Cluster cluster = service.getCluster(instanceStartedEvent.getClusterId());
+ Member member = cluster.getMember(instanceStartedEvent.getMemberId());
+ if (member == null) {
+ log.warn(String.format("Member %s does not exist",
+ instanceStartedEvent.getMemberId()));
+ return;
+ }
- // Set member ports
try {
- Cartridge cartridge = CloudControllerContext.getInstance().getCartridge(service.getServiceName());
- if (cartridge == null) {
- throw new RuntimeException(String.format("Cartridge not found: [cartridge-type] %s",
- service.getServiceName()));
- }
-
- Port port;
- int portValue;
- List<PortMapping> portMappings = Arrays.asList(cartridge.getPortMappings());
- String clusterId = cluster.getClusterId();
- ClusterContext clusterContext = CloudControllerContext.getInstance().getClusterContext(clusterId);
- List<KubernetesService> kubernetesServices = clusterContext.getKubernetesServices();
+ TopologyManager.acquireWriteLock();
+ // try update lifecycle state
+ if (!member.isStateTransitionValid(MemberStatus.Starting)) {
+ log.error("Invalid State Transition from " + member.getStatus() + " to " +
+ MemberStatus.Starting);
+ return;
+ } else {
+ member.setStatus(MemberStatus.Starting);
+ log.info("member started event adding status started");
- for (PortMapping portMapping : portMappings) {
- if (kubernetesServices != null) {
- portValue = findKubernetesServicePort(clusterId, kubernetesServices, portMapping);
- } else {
- portValue = portMapping.getPort();
- }
- port = new Port(portMapping.getProtocol(), portValue, portMapping.getProxyPort());
- member.addPort(port);
- memberActivatedEvent.addPort(port);
+ TopologyManager.updateTopology(topology);
+ //member started time
+ Long timeStamp = System.currentTimeMillis();
+ //memberStartedEvent.
+ TopologyEventPublisher.sendMemberStartedEvent(instanceStartedEvent);
+ //publishing data
+ BAMUsageDataPublisher.publish(instanceStartedEvent.getMemberId(),
+ instanceStartedEvent.getPartitionId(),
+ instanceStartedEvent.getNetworkPartitionId(),
+ instanceStartedEvent.getClusterInstanceId(),
+ instanceStartedEvent.getClusterId(),
+ instanceStartedEvent.getServiceName(),
+ MemberStatus.Starting.toString(),
+ timeStamp, null, null, null);
}
- } catch (Exception e) {
- String message = String.format("Could not add member ports: [service-name] %s [member-id] %s",
- memberActivatedEvent.getServiceName(), memberActivatedEvent.getMemberId());
- log.error(message, e);
+ } finally {
+ TopologyManager.releaseWriteLock();
}
-
- // Set member ip addresses
- memberActivatedEvent.setDefaultPrivateIP(member.getDefaultPrivateIP());
- memberActivatedEvent.setMemberPrivateIPs(member.getMemberPrivateIPs());
- memberActivatedEvent.setDefaultPublicIP(member.getDefaultPublicIP());
- memberActivatedEvent.setMemberPublicIPs(member.getMemberPublicIPs());
- TopologyManager.updateTopology(topology);
-
- // Publish member activated event
- TopologyEventPublisher.sendMemberActivatedEvent(memberActivatedEvent);
-
- // Publish statistics data
- BAMUsageDataPublisher.publish(memberActivatedEvent.getMemberId(),
- memberActivatedEvent.getPartitionId(),
- memberActivatedEvent.getNetworkPartitionId(),
- memberActivatedEvent.getClusterId(),
- memberActivatedEvent.getServiceName(),
- MemberStatus.Active.toString(),
- null);
+ } catch (Exception e) {
+ String message = String.format("Could not handle member started event: [application-id] %s " +
+ "[service-name] %s [member-id] %s", instanceStartedEvent.getApplicationId(),
+ instanceStartedEvent.getServiceName(), instanceStartedEvent.getMemberId());
+ log.warn(message, e);
}
- } finally {
- TopologyManager.releaseWriteLock();
- }
- }
-
- public static void handleMemberReadyToShutdown(InstanceReadyToShutdownEvent instanceReadyToShutdownEvent)
- throws InvalidMemberException, InvalidCartridgeTypeException {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(instanceReadyToShutdownEvent.getServiceName());
- //update the status of the member
- if (service == null) {
- log.warn(String.format("Service %s does not exist",
- instanceReadyToShutdownEvent.getServiceName()));
- return;
- }
-
- Cluster cluster = service.getCluster(instanceReadyToShutdownEvent.getClusterId());
- if (cluster == null) {
- log.warn(String.format("Cluster %s does not exist",
- instanceReadyToShutdownEvent.getClusterId()));
- return;
}
+ public static void handleMemberActivated (InstanceActivatedEvent instanceActivatedEvent){
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(instanceActivatedEvent.getServiceName());
+ if (service == null) {
+ log.warn(String.format("Service %s does not exist",
+ instanceActivatedEvent.getServiceName()));
+ return;
+ }
- Member member = cluster.getMember(instanceReadyToShutdownEvent.getMemberId());
- if (member == null) {
- log.warn(String.format("Member %s does not exist",
- instanceReadyToShutdownEvent.getMemberId()));
- return;
- }
- MemberReadyToShutdownEvent memberReadyToShutdownEvent = new MemberReadyToShutdownEvent(
- instanceReadyToShutdownEvent.getServiceName(),
- instanceReadyToShutdownEvent.getClusterId(),
- instanceReadyToShutdownEvent.getClusterInstanceId(),
- instanceReadyToShutdownEvent.getMemberId(),
- instanceReadyToShutdownEvent.getNetworkPartitionId(),
- instanceReadyToShutdownEvent.getPartitionId());
- try {
- TopologyManager.acquireWriteLock();
+ Cluster cluster = service.getCluster(instanceActivatedEvent.getClusterId());
+ if (cluster == null) {
+ log.warn(String.format("Cluster %s does not exist",
+ instanceActivatedEvent.getClusterId()));
+ return;
+ }
- if (!member.isStateTransitionValid(MemberStatus.ReadyToShutDown)) {
- log.error("Invalid State Transition from " + member.getStatus() + " to " +
- MemberStatus.ReadyToShutDown);
+ Member member = cluster.getMember(instanceActivatedEvent.getMemberId());
+ if (member == null) {
+ log.warn(String.format("Member %s does not exist",
+ instanceActivatedEvent.getMemberId()));
return;
}
- member.setStatus(MemberStatus.ReadyToShutDown);
- log.info("Member Ready to shut down event adding status started");
- TopologyManager.updateTopology(topology);
- } finally {
- TopologyManager.releaseWriteLock();
- }
- TopologyEventPublisher.sendMemberReadyToShutdownEvent(memberReadyToShutdownEvent);
- //publishing data
- BAMUsageDataPublisher.publish(instanceReadyToShutdownEvent.getMemberId(),
- instanceReadyToShutdownEvent.getPartitionId(),
- instanceReadyToShutdownEvent.getNetworkPartitionId(),
- instanceReadyToShutdownEvent.getClusterId(),
- instanceReadyToShutdownEvent.getServiceName(),
- MemberStatus.ReadyToShutDown.toString(),
- null);
- //termination of particular instance will be handled by autoscaler
- }
+ MemberActivatedEvent memberActivatedEvent = new MemberActivatedEvent(
+ instanceActivatedEvent.getServiceName(),
+ instanceActivatedEvent.getClusterId(),
+ instanceActivatedEvent.getClusterInstanceId(),
+ instanceActivatedEvent.getMemberId(),
+ instanceActivatedEvent.getNetworkPartitionId(),
+ instanceActivatedEvent.getPartitionId());
+
+ // grouping - set grouid
+ //TODO
+ memberActivatedEvent.setApplicationId(null);
+ try {
+ TopologyManager.acquireWriteLock();
+ // try update lifecycle state
+ if (!member.isStateTransitionValid(MemberStatus.Active)) {
+ log.error("Invalid state transition from [" + member.getStatus() + "] to [" +
+ MemberStatus.Active + "]");
+ return;
+ } else {
+ member.setStatus(MemberStatus.Active);
- public static void handleMemberMaintenance(InstanceMaintenanceModeEvent instanceMaintenanceModeEvent)
- throws InvalidMemberException, InvalidCartridgeTypeException {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(instanceMaintenanceModeEvent.getServiceName());
- //update the status of the member
- if (service == null) {
- log.warn(String.format("Service %s does not exist",
- instanceMaintenanceModeEvent.getServiceName()));
- return;
- }
+ // Set member ports
+ try {
+ Cartridge cartridge = CloudControllerContext.getInstance().getCartridge(service.getServiceUuid());
+ if (cartridge == null) {
+ throw new RuntimeException(String.format("Cartridge not found: [cartridge-type] %s",
+ service.getServiceName()));
+ }
- Cluster cluster = service.getCluster(instanceMaintenanceModeEvent.getClusterId());
- if (cluster == null) {
- log.warn(String.format("Cluster %s does not exist",
- instanceMaintenanceModeEvent.getClusterId()));
- return;
- }
+ Port port;
+ int portValue;
+ List<PortMapping> portMappings = Arrays.asList(cartridge.getPortMappings());
+ String clusterId = cluster.getClusterId();
+ ClusterContext clusterContext = CloudControllerContext.getInstance().getClusterContext(clusterId);
+ List<KubernetesService> kubernetesServices = clusterContext.getKubernetesServices();
- Member member = cluster.getMember(instanceMaintenanceModeEvent.getMemberId());
- if (member == null) {
- log.warn(String.format("Member %s does not exist",
- instanceMaintenanceModeEvent.getMemberId()));
- return;
+ for (PortMapping portMapping : portMappings) {
+ if (kubernetesServices != null) {
+ portValue = findKubernetesServicePort(clusterId, kubernetesServices, portMapping);
+ } else {
+ portValue = portMapping.getPort();
+ }
+ port = new Port(portMapping.getProtocol(), portValue, portMapping.getProxyPort());
+ member.addPort(port);
+ memberActivatedEvent.addPort(port);
+ }
+ } catch (Exception e) {
+ String message = String.format("Could not add member ports: [service-name] %s [member-id] %s",
+ memberActivatedEvent.getServiceName(), memberActivatedEvent.getMemberId());
+ log.error(message, e);
+ }
+
+ // Set member ip addresses
+ memberActivatedEvent.setDefaultPrivateIP(member.getDefaultPrivateIP());
+ memberActivatedEvent.setMemberPrivateIPs(member.getMemberPrivateIPs());
+ memberActivatedEvent.setDefaultPublicIP(member.getDefaultPublicIP());
+ memberActivatedEvent.setMemberPublicIPs(member.getMemberPublicIPs());
+ TopologyManager.updateTopology(topology);
+ //member activated time
+ Long timeStamp = System.currentTimeMillis();
+ // Publish member activated event
+ TopologyEventPublisher.sendMemberActivatedEvent(memberActivatedEvent);
+
+ // Publish statistics data
+ BAMUsageDataPublisher.publish(memberActivatedEvent.getMemberId(),
+ memberActivatedEvent.getPartitionId(),
+ memberActivatedEvent.getNetworkPartitionId(),
+ memberActivatedEvent.getClusterInstanceId(),
+ memberActivatedEvent.getClusterId(),
+ memberActivatedEvent.getServiceName(),
+ MemberStatus.Active.toString(),
+ timeStamp, null, null, null);
+ }
+ } finally {
+ TopologyManager.releaseWriteLock();
+ }
}
+ public static void handleMemberReadyToShutdown (InstanceReadyToShutdownEvent instanceReadyToShutdownEvent)
+ throws InvalidMemberException, InvalidCartridgeTypeException {
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(instanceReadyToShutdownEvent.getServiceName());
+ //update the status of the member
+ if (service == null) {
+ log.warn(String.format("Service %s does not exist",
+ instanceReadyToShutdownEvent.getServiceName()));
+ return;
+ }
- MemberMaintenanceModeEvent memberMaintenanceModeEvent = new MemberMaintenanceModeEvent(
- instanceMaintenanceModeEvent.getServiceName(),
- instanceMaintenanceModeEvent.getClusterId(),
- instanceMaintenanceModeEvent.getClusterInstanceId(),
- instanceMaintenanceModeEvent.getMemberId(),
- instanceMaintenanceModeEvent.getNetworkPartitionId(),
- instanceMaintenanceModeEvent.getPartitionId());
- try {
- TopologyManager.acquireWriteLock();
- // try update lifecycle state
- if (!member.isStateTransitionValid(MemberStatus.In_Maintenance)) {
- log.error("Invalid State Transition from " + member.getStatus() + " to "
- + MemberStatus.In_Maintenance);
+ Cluster cluster = service.getCluster(instanceReadyToShutdownEvent.getClusterId());
+ if (cluster == null) {
+ log.warn(String.format("Cluster %s does not exist",
+ instanceReadyToShutdownEvent.getClusterId()));
return;
}
- member.setStatus(MemberStatus.In_Maintenance);
- log.info("member maintenance mode event adding status started");
- TopologyManager.updateTopology(topology);
- } finally {
- TopologyManager.releaseWriteLock();
- }
- //publishing data
- TopologyEventPublisher.sendMemberMaintenanceModeEvent(memberMaintenanceModeEvent);
- }
+ Member member = cluster.getMember(instanceReadyToShutdownEvent.getMemberId());
+ if (member == null) {
+ log.warn(String.format("Member %s does not exist",
+ instanceReadyToShutdownEvent.getMemberId()));
+ return;
+ }
+ MemberReadyToShutdownEvent memberReadyToShutdownEvent = new MemberReadyToShutdownEvent(
+ instanceReadyToShutdownEvent.getServiceName(),
+ instanceReadyToShutdownEvent.getClusterId(),
+ instanceReadyToShutdownEvent.getClusterInstanceId(),
+ instanceReadyToShutdownEvent.getMemberId(),
+ instanceReadyToShutdownEvent.getNetworkPartitionId(),
+ instanceReadyToShutdownEvent.getPartitionId());
+ //member ReadyToShutDown state change time
+ Long timeStamp = null;
+ try {
+ TopologyManager.acquireWriteLock();
- /**
- * Remove member from topology and send member terminated event.
- *
- * @param serviceName
- * @param clusterId
- * @param networkPartitionId
- * @param partitionId
- * @param memberId
- */
- public static void handleMemberTerminated(String serviceName, String clusterId,
- String networkPartitionId, String partitionId,
- String memberId) {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(serviceName);
- Properties properties;
- if (service == null) {
- log.warn(String.format("Service %s does not exist",
- serviceName));
- return;
- }
- Cluster cluster = service.getCluster(clusterId);
- if (cluster == null) {
- log.warn(String.format("Cluster %s does not exist",
- clusterId));
- return;
- }
+ if (!member.isStateTransitionValid(MemberStatus.ReadyToShutDown)) {
+ log.error("Invalid State Transition from " + member.getStatus() + " to " +
+ MemberStatus.ReadyToShutDown);
+ return;
+ }
+ member.setStatus(MemberStatus.ReadyToShutDown);
+ log.info("Member Ready to shut down event adding status started");
- Member member = cluster.getMember(memberId);
- if (member == null) {
- log.warn(String.format("Member %s does not exist",
- memberId));
- return;
+ TopologyManager.updateTopology(topology);
+ timeStamp = System.currentTimeMillis();
+ } finally {
+ TopologyManager.releaseWriteLock();
+ }
+ TopologyEventPublisher.sendMemberReadyToShutdownEvent(memberReadyToShutdownEvent);
+ //publishing data
+ BAMUsageDataPublisher.publish(instanceReadyToShutdownEvent.getMemberId(),
+ instanceReadyToShutdownEvent.getPartitionId(),
+ instanceReadyToShutdownEvent.getNetworkPartitionId(),
+ instanceReadyToShutdownEvent.getClusterInstanceId(),
+ instanceReadyToShutdownEvent.getClusterId(),
+ instanceReadyToShutdownEvent.getServiceName(),
+ MemberStatus.ReadyToShutDown.toString(),
+ timeStamp, null, null, null);
+ //termination of particular instance will be handled by autoscaler
}
- String clusterInstanceId = member.getClusterInstanceId();
+ public static void handleMemberMaintenance (InstanceMaintenanceModeEvent instanceMaintenanceModeEvent)
+ throws InvalidMemberException, InvalidCartridgeTypeException {
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(instanceMaintenanceModeEvent.getServiceName());
+ //update the status of the member
+ if (service == null) {
+ log.warn(String.format("Service %s does not exist",
+ instanceMaintenanceModeEvent.getServiceName()));
+ return;
+ }
- try {
- TopologyManager.acquireWriteLock();
- properties = member.getProperties();
- cluster.removeMember(member);
- TopologyManager.updateTopology(topology);
- } finally {
- TopologyManager.releaseWriteLock();
- }
- /* @TODO leftover from grouping_poc*/
- String groupAlias = null;
- TopologyEventPublisher.sendMemberTerminatedEvent(serviceName, clusterId, memberId,
- clusterInstanceId, networkPartitionId,
- partitionId, properties, groupAlias);
- }
+ Cluster cluster = service.getCluster(instanceMaintenanceModeEvent.getClusterId());
+ if (cluster == null) {
+ log.warn(String.format("Cluster %s does not exist",
+ instanceMaintenanceModeEvent.getClusterId()));
+ return;
+ }
- public static void handleMemberSuspended() {
- //TODO
- try {
- TopologyManager.acquireWriteLock();
- } finally {
- TopologyManager.releaseWriteLock();
- }
- }
+ Member member = cluster.getMember(instanceMaintenanceModeEvent.getMemberId());
+ if (member == null) {
+ log.warn(String.format("Member %s does not exist",
+ instanceMaintenanceModeEvent.getMemberId()));
+ return;
+ }
- public static void handleClusterActivatedEvent(ClusterStatusClusterActivatedEvent clusterStatusClusterActivatedEvent) {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(clusterStatusClusterActivatedEvent.getServiceName());
- //update the status of the cluster
- if (service == null) {
- log.warn(String.format("Service %s does not exist",
- clusterStatusClusterActivatedEvent.getServiceName()));
- return;
- }
+ MemberMaintenanceModeEvent memberMaintenanceModeEvent = new MemberMaintenanceModeEvent(
+ instanceMaintenanceModeEvent.getServiceName(),
+ instanceMaintenanceModeEvent.getClusterId(),
+ instanceMaintenanceModeEvent.getClusterInstanceId(),
+ instanceMaintenanceModeEvent.getMemberId(),
+ instanceMaintenanceModeEvent.getNetworkPartitionId(),
+ instanceMaintenanceModeEvent.getPartitionId());
+ try {
+ TopologyManager.acquireWriteLock();
+ // try update lifecycle state
+ if (!member.isStateTransitionValid(MemberStatus.In_Maintenance)) {
+ log.error("Invalid State Transition from " + member.getStatus() + " to "
+ + MemberStatus.In_Maintenance);
+ return;
+ }
+ member.setStatus(MemberStatus.In_Maintenance);
+ log.info("member maintenance mode event adding status started");
- Cluster cluster = service.getCluster(clusterStatusClusterActivatedEvent.getClusterId());
- if (cluster == null) {
- log.warn(String.format("Cluster %s does not exist",
- clusterStatusClusterActivatedEvent.getClusterId()));
- return;
- }
+ TopologyManager.updateTopology(topology);
+ } finally {
+ TopologyManager.releaseWriteLock();
+ }
+ //publishing data
+ TopologyEventPublisher.sendMemberMaintenanceModeEvent(memberMaintenanceModeEvent);
- String clusterId = cluster.getClusterId();
- ClusterContext clusterContext = CloudControllerContext.getInstance().getClusterContext(clusterId);
- if (clusterContext == null) {
- log.warn("Cluster context not found: [cluster-id] " + clusterId);
- return;
}
- ClusterInstanceActivatedEvent clusterInstanceActivatedEvent =
- new ClusterInstanceActivatedEvent(
- clusterStatusClusterActivatedEvent.getAppId(),
- clusterStatusClusterActivatedEvent.getServiceName(),
- clusterStatusClusterActivatedEvent.getClusterId(),
- clusterStatusClusterActivatedEvent.getInstanceId());
- try {
- TopologyManager.acquireWriteLock();
- List<KubernetesService> kubernetesServices = clusterContext.getKubernetesServices();
-
- if (kubernetesServices != null) {
-
- try {
- // Generate access URLs for kubernetes services
- for (KubernetesService kubernetesService : kubernetesServices) {
-
- if (kubernetesService.getServiceType().equals(KubernetesConstants.NODE_PORT)) {
- // Public IP = Kubernetes minion public IP
- String[] publicIPs = kubernetesService.getPublicIPs();
- if ((publicIPs != null) && (publicIPs.length > 0)) {
- for (String publicIP : publicIPs) {
- // There can be a String array with null values
- if (publicIP != null) {
- // Using type URI since only http, https, ftp, file, jar protocols are supported in URL
- URI accessURL = new URI(kubernetesService.getProtocol(), null, publicIP,
- kubernetesService.getPort(), null, null, null);
- cluster.addAccessUrl(accessURL.toString());
- clusterInstanceActivatedEvent.addAccessUrl(accessURL.toString());
- } else {
- log.error(String.format("Could not create access URL for [Kubernetes-service] %s , " +
- "since Public IP is not available", kubernetesService.getId()));
- }
- }
- }
- }
- }
- } catch (URISyntaxException e) {
- log.error("Could not create access URLs for Kubernetes services", e);
- }
+ /**
+ * Remove member from topology and send member terminated event.
+ *
+ * @param serviceName
+ * @param clusterId
+ * @param networkPartitionId
+ * @param partitionId
+ * @param memberId
+ */
+ public static void handleMemberTerminated (String serviceName, String clusterId,
+ String networkPartitionId, String partitionId,
+ String memberId){
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(serviceName);
+ Properties properties;
+ if (service == null) {
+ log.warn(String.format("Service %s does not exist",
+ serviceName));
+ return;
}
-
- ClusterInstance context = cluster.getInstanceContexts(clusterStatusClusterActivatedEvent.getInstanceId());
-
- if (context == null) {
- log.warn("Cluster instance context is not found for [cluster] " +
- clusterStatusClusterActivatedEvent.getClusterId() + " [instance-id] " +
- clusterStatusClusterActivatedEvent.getInstanceId());
+ Cluster cluster = service.getCluster(clusterId);
+ if (cluster == null) {
+ log.warn(String.format("Cluster %s does not exist",
+ clusterId));
return;
}
- ClusterStatus status = ClusterStatus.Active;
- if (context.isStateTransitionValid(status)) {
- context.setStatus(status);
- log.info("Cluster activated adding status started for " + cluster.getClusterId());
- TopologyManager.updateTopology(topology);
- // publish event
- TopologyEventPublisher.sendClusterActivatedEvent(clusterInstanceActivatedEvent);
- } else {
- log.error(String.format("Cluster state transition is not valid: [cluster-id] %s " +
- " [instance-id] %s [current-status] %s [status-requested] %s",
- clusterStatusClusterActivatedEvent.getClusterId(), clusterStatusClusterActivatedEvent.getInstanceId(),
- context.getStatus(), status));
+
+ Member member = cluster.getMember(memberId);
+ if (member == null) {
+ log.warn(String.format("Member %s does not exist",
+ memberId));
return;
}
- } finally {
- TopologyManager.releaseWriteLock();
- }
- }
+ String clusterInstanceId = member.getClusterInstanceId();
- public static void handleClusterInactivateEvent(
- ClusterStatusClusterInactivateEvent clusterInactivateEvent) {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(clusterInactivateEvent.getServiceName());
- //update the status of the cluster
- if (service == null) {
- log.warn(String.format("Service %s does not exist",
- clusterInactivateEvent.getServiceName()));
- return;
+ try {
+ TopologyManager.acquireWriteLock();
+ properties = member.getProperties();
+ cluster.removeMember(member);
+ TopologyManager.updateTopology(topology);
+ } finally {
+ TopologyManager.releaseWriteLock();
+ }
+ /* @TODO leftover from grouping_poc*/
+ String groupAlias = null;
+ TopologyEventPublisher.sendMemberTerminatedEvent(serviceName, clusterId, memberId,
+ clusterInstanceId, networkPartitionId,
+ partitionId, properties, groupAlias);
}
- Cluster cluster = service.getCluster(clusterInactivateEvent.getClusterId());
- if (cluster == null) {
- log.warn(String.format("Cluster %s does not exist",
- clusterInactivateEvent.getClusterId()));
- return;
+ public static void handleMemberSuspended () {
+ //TODO
+ try {
+ TopologyManager.acquireWriteLock();
+ } finally {
+ TopologyManager.releaseWriteLock();
+ }
}
- ClusterInstanceInactivateEvent clusterInactivatedEvent1 =
- new ClusterInstanceInactivateEvent(
- clusterInactivateEvent.getAppId(),
- clusterInactivateEvent.getServiceName(),
- clusterInactivateEvent.getClusterId(),
- clusterInactivateEvent.getInstanceId());
- try {
- TopologyManager.acquireWriteLock();
- ClusterInstance context = cluster.getInstanceContexts(clusterInactivateEvent.getInstanceId());
- if (context == null) {
- log.warn("Cluster Instance Context is not found for [cluster] " +
- clusterInactivateEvent.getClusterId() + " [instance-id] " +
- clusterInactivateEvent.getInstanceId());
+ public static void handleClusterActivatedEvent (ClusterStatusClusterActivatedEvent
+ clusterStatusClusterActivatedEvent){
+
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(clusterStatusClusterActivatedEvent.getServiceName());
+ //update the status of the cluster
+ if (service == null) {
+ log.warn(String.format("Service %s does not exist",
+ clusterStatusClusterActivatedEvent.getServiceName()));
return;
}
- ClusterStatus status = ClusterStatus.Inactive;
- if (context.isStateTransitionValid(status)) {
- context.setStatus(status);
- log.info("Cluster Inactive adding status started for" + cluster.getClusterId());
- TopologyManager.updateTopology(topology);
- //publishing data
- TopologyEventPublisher.sendClusterInactivateEvent(clusterInactivatedEvent1);
- } else {
- log.error(String.format("Cluster state transition is not valid: [cluster-id] %s " +
- " [instance-id] %s [current-status] %s [status-requested] %s",
- clusterInactivateEvent.getClusterId(), clusterInactivateEvent.getInstanceId(),
- context.getStatus(), status));
+
+ Cluster cluster = service.getCluster(clusterStatusClusterActivatedEvent.getClusterId());
+ if (cluster == null) {
+ log.warn(String.format("Cluster %s does not exist",
+ clusterStatusClusterActivatedEvent.getClusterId()));
return;
}
- } finally {
- TopologyManager.releaseWriteLock();
- }
- }
+ String clusterId = cluster.getClusterId();
+ ClusterContext clusterContext = CloudControllerContext.getInstance().getClusterContext(clusterId);
+ if (clusterContext == null) {
+ log.warn("Cluster context not found: [cluster-id] " + clusterId);
+ return;
+ }
- private static void deleteAppResourcesFromMetadataService(ApplicationInstanceTerminatedEvent event) {
- try {
- MetaDataServiceClient metadataClient = new DefaultMetaDataServiceClient();
- metadataClient.deleteApplicationProperties(event.getAppId());
- } catch (Exception e) {
- log.error("Error occurred while deleting the application resources frm metadata service ", e);
- }
- }
+ ClusterInstanceActivatedEvent clusterInstanceActivatedEvent =
+ new ClusterInstanceActivatedEvent(
+ clusterStatusClusterActivatedEvent.getAppId(),
+ clusterStatusClusterActivatedEvent.getServiceName(),
+ clusterStatusClusterActivatedEvent.getClusterId(),
+ clusterStatusClusterActivatedEvent.getInstanceId());
+ try {
+ TopologyManager.acquireWriteLock();
+ List<KubernetesService> kubernetesServices = clusterContext.getKubernetesServices();
+ cluster.setKubernetesServices(kubernetesServices);
- clusterInstanceActivatedEvent.setKubernetesServices(kubernetesServices);
+
- public static void handleClusterTerminatedEvent(ClusterStatusClusterTerminatedEvent event) {
- TopologyManager.acquireWriteLock();
+ ClusterInstance context = cluster.getInstanceContexts(clusterStatusClusterActivatedEvent.getInstanceId());
+ if (context == null) {
+ log.warn("Cluster instance context is not found for [cluster] " +
+ clusterStatusClusterActivatedEvent.getClusterId() + " [instance-id] " +
+ clusterStatusClusterActivatedEvent.getInstanceId());
+ return;
+ }
+ ClusterStatus status = ClusterStatus.Active;
+ if (context.isStateTransitionValid(status)) {
+ context.setStatus(status);
+ log.info("Cluster activated adding status started for " + cluster.getClusterId());
+ TopologyManager.updateTopology(topology);
+ // publish event
+ TopologyEventPublisher.sendClusterActivatedEvent(clusterInstanceActivatedEvent);
+ } else {
+ log.error(String.format("Cluster state transition is not valid: [cluster-id] %s " +
+ " [instance-id] %s [current-status] %s [status-requested] %s",
- clusterStatusClusterActivatedEvent.getClusterId(),
- clusterStatusClusterActivatedEvent.getInstanceId(),
++ clusterStatusClusterActivatedEvent.getClusterId(), clusterStatusClusterActivatedEvent.getInstanceId(),
+ context.getStatus(), status));
+ return;
+ }
+ } finally {
+ TopologyManager.releaseWriteLock();
+ }
- try {
- Topology topology = TopologyManager.getTopology();
- Service service = topology.getService(event.getServiceName());
+ }
+ public static void handleClusterInactivateEvent (
+ ClusterStatusClusterInactivateEvent clusterInactivateEvent){
+ Topology topology = TopologyManager.getTopology();
+ Service service = topology.getService(clusterInactivateEvent.getServiceName());
//update the status of the cluster
if (service == null) {
log.warn(String.format("Service %s does not exist",
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/application/ApplicationBean.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/application/ApplicationBean.java
index 1c7295d,f6e6745..ae1e6bb
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/application/ApplicationBean.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/application/ApplicationBean.java
@@@ -104,11 -95,11 +104,8 @@@ public class ApplicationBean implement
this.property = property;
}
- public String getApplicationId() {
- return applicationId;
- }
+ public boolean isSignUpsExist() {
+ return signUpsExist;
+ }
- public void setSignUpsExist(boolean signUpsExist) {
- this.signUpsExist = signUpsExist;
- }
- public void setApplicationId(String applicationId) {
- this.applicationId = applicationId;
- }
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/StratosManagerServiceClient.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java
index ee0477c,55e97d9..a1f2fa9
--- 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
@@@ -164,12 -167,11 +167,13 @@@ public class StratosConstants
// member expiry timeout constants
public static final String PENDING_MEMBER_EXPIRY_TIMEOUT = "autoscaler.member.pendingMemberExpiryTimeout";
+ public static final String SPIN_TERMINATE_PARALLEL = "autoscaler.member.spinAfterTerminate";
public static final String OBSOLETED_MEMBER_EXPIRY_TIMEOUT = "autoscaler.member.obsoletedMemberExpiryTimeout";
- public static final String PENDING_TERMINATION_MEMBER_EXPIRY_TIMEOUT = "autoscaler.member.pendingTerminationMemberExpiryTimeout";
+ public static final String PENDING_TERMINATION_MEMBER_EXPIRY_TIMEOUT =
+ "autoscaler.member.pendingTerminationMemberExpiryTimeout";
public static final String FILTER_VALUE_SEPARATOR = ",";
+ public static final String TOPOLOGY_APPLICATION_FILTER = "stratos.topology.application.filter";
public static final String TOPOLOGY_SERVICE_FILTER = "stratos.topology.service.filter";
public static final String TOPOLOGY_CLUSTER_FILTER = "stratos.topology.cluster.filter";
public static final String TOPOLOGY_MEMBER_FILTER = "stratos.topology.member.filter";
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java
index ceeca1c,6741d6b..78504e9
--- a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java
@@@ -76,10 -76,9 +76,11 @@@ public interface KubernetesAPIClientInt
*
* @param serviceId
* @param serviceLabel
- * @param nodePort
+ * @param servicePort
+ * @param serviceType
* @param containerPortName
* @param containerPort
++ * @param publicIPs
* @param sessionAffinity
* @throws KubernetesClientException
*/
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.manager/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/context/StratosManagerContext.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/context/StratosManagerContext.java
index e4fa435,5443cbd..5788e8e
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/context/StratosManagerContext.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/context/StratosManagerContext.java
@@@ -48,18 -49,21 +48,18 @@@ public class StratosManagerContext impl
private static final String SM_CARTRIDGES_APPLICATIONS_WRITE_LOCK = "SM_CARTRIDGES_APPLICATIONS_WRITE_LOCK";
private static final String SM_CARTRIDGEGROUPS_CARTRIDGESUBGROUPS_WRITE_LOCK = "SM_CARTRIDGEGROUPS_CARTRIDGESUBGROUPS_WRITE_LOCK";
private static final String SM_CARTRIDGEGROUPS_APPLICATIONS_WRITE_LOCK = "SM_CARTRIDGEGROUPS_APPLICATIONS_WRITE_LOCK";
-
- public static final String DATA_RESOURCE = "/stratos.manager/data";
-
- private final transient DistributedObjectProvider distributedObjectProvider;
private static final Log log = LogFactory.getLog(StratosManagerContext.class);
-
+ private static volatile StratosManagerContext instance;
+ private final transient DistributedObjectProvider distributedObjectProvider;
/**
- * Key - cartridge type
- * Value - list of cartridgeGroupNames
+ * Key - cartridge type uuid
+ * Value - list of cartridgeGroupNames uuid
*/
- private Map<String, Set<String>> cartridgeTypeToCartridgeGroupsMap;
+ private Map<String,Set<String>> cartridgeTypeToCartridgeGroupsMap;
/**
- * Key - cartridge type
- * Value - list of ApplicationNames
+ * Key - cartridge type uuid
+ * Value - list of ApplicationNames uuid
*/
private Map<String, Set<String>> cartridgeTypeToApplicationsMap;
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java
index 4c4237a,9be1a92..9327b3e
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java
@@@ -137,10 -119,10 +137,10 @@@ public interface StratosManagerService
/**
* Removes the used cartridges in cartridge groups from cache structure.
*
- * @param cartridgeGroupName the cartridge group name
- * @param cartridgeNames the cartridge names
+ * @param cartridgeGroupUuid the cartridge group UUID
- * @param cartridgeNames the cartridge names
++ * @param cartridgeNamesUuid the cartridge names
*/
- public void removeUsedCartridgesInCartridgeGroups(String cartridgeGroupName, String[] cartridgeNames);
- public void removeUsedCartridgesInCartridgeGroups(String cartridgeGroupUuid, String[] cartridgeNames);
++ public void removeUsedCartridgesInCartridgeGroups(String cartridgeGroupUuid, String[] cartridgeNamesUuid);
/**
* Adds the used cartridges in applications to cache structure.
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/application/Applications.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/application/Applications.java
index 4d366f1,809fccb..442c56b
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/application/Applications.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/application/Applications.java
@@@ -46,11 -43,23 +46,23 @@@ public class Applications implements Se
this.applicationMap.put(application.getUniqueIdentifier(), application);
}
- public synchronized Application getApplication(String appId) {
- return this.getApplications().get(appId);
- public Application getApplication(String applicationUuid) {
++ public synchronized Application getApplication(String applicationUuid) {
+ return this.getApplications().get(applicationUuid);
}
- public synchronized boolean isInitialized() {
- public Application getApplicationByTenant(String applicationId, int tenantId) {
++ public synchronized Application getApplicationByTenant(String applicationId, int tenantId) {
+ if(getApplications() != null) {
+ for (Application application : this.getApplications().values()) {
+ if (application.getId().equals(applicationId) && application.getTenantId() == tenantId) {
+ return application;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public boolean isInitialized() {
return initialized;
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Topology.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Topology.java
index 9f641ec,e79f446..c8e903f
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Topology.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Topology.java
@@@ -50,25 -50,31 +50,25 @@@ public class Topology implements Serial
}
public void addService(Service service) {
- this.serviceMap.put(service.getServiceName(), service);
+ this.serviceMap.put(service.getServiceUuid(), service);
}
- public synchronized void addServices(Collection<Service> services) {
- for (Service service : services) {
- addService(service);
- }
- }
-
public void removeService(Service service) {
- this.serviceMap.remove(service.getServiceName());
- TopologyLockHierarchy.getInstance().removeTopologyLockForService(service.getServiceName());
+ this.serviceMap.remove(service.getServiceUuid());
+ TopologyLockHierarchy.getInstance().removeTopologyLockForService(service.getServiceUuid());
}
- public void removeService(String serviceName) {
- this.serviceMap.remove(serviceName);
- TopologyLockHierarchy.getInstance().removeTopologyLockForService(serviceName);
+ public void removeService(String serviceUuid) {
+ this.serviceMap.remove(serviceUuid);
+ TopologyLockHierarchy.getInstance().removeTopologyLockForService(serviceUuid);
}
- public Service getService(String serviceName) {
- return this.serviceMap.get(serviceName);
+ public Service getService(String serviceUuid) {
+ return this.serviceMap.get(serviceUuid);
}
- public boolean serviceExists(String serviceName) {
- return this.serviceMap.containsKey(serviceName);
+ public boolean serviceExists(String serviceUuid) {
+ return this.serviceMap.containsKey(serviceUuid);
}
public void addToCluterMap(Cluster cluster) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterInstanceCreatedMessageProcessor.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterInstanceCreatedMessageProcessor.java
index 8fb28cb,08ceb19..0f558b2
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterInstanceCreatedMessageProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterInstanceCreatedMessageProcessor.java
@@@ -98,17 -97,11 +98,17 @@@ public class ClusterInstanceCreatedMess
}
return false;
}
+
Cluster cluster = service.getCluster(event.getClusterId());
+ // Apply application filter
+ if(TopologyApplicationFilter.apply(cluster.getAppId())) {
+ return false;
+ }
+
if (cluster == null) {
if (log.isDebugEnabled()) {
- log.debug(String.format("Cluster not exists in service: [service] %s [cluster] %s", event.getServiceName(),
+ log.debug(String.format("Cluster not exists in service: [service] %s [cluster] %s", event.getServiceUuid(),
event.getClusterId()));
}
return false;
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
----------------------------------------------------------------------
[03/50] [abbrv] stratos git commit: Updating logs to display uuid and
tenantId
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/eb0d28f4/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 1be6af2..224ca3c 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:ax29="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ns="http://impl.services.autoscaler.stratos.apache.org" xmlns:ax27="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax25="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax21="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax216="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax22="http://common.stratos.apache.org/xsd" xmlns:ax227="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax220="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax212="http://partition.common.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax223="http://rmi.java/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xml
ns:ax211="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax224="http://io.java/xsd" 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://impl.services.autoscaler.stratos.apache.org">
+<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax29="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax27="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ns="http://impl.services.autoscaler.stratos.apache.org" xmlns:ax23="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax24="http://common.stratos.apache.org/xsd" xmlns:ax21="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax216="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax227="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax220="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax212="http://partition.common.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax223="http://rmi.java/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xml
ns:ax211="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax224="http://io.java/xsd" 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://impl.services.autoscaler.stratos.apache.org">
<wsdl:types>
<xs:schema xmlns:ax225="http://io.java/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://rmi.java/xsd">
<xs:import namespace="http://io.java/xsd"/>
@@ -34,18 +34,18 @@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax23="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd">
+ <xs:schema xmlns:ax25="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd">
<xs:import namespace="http://common.stratos.apache.org/xsd"/>
<xs:complexType name="ApplicationContext">
<xs:sequence>
<xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="applicationUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="components" nillable="true" type="ax21:ComponentContext"/>
+ <xs:element minOccurs="0" name="components" nillable="true" type="ax23:ComponentContext"/>
<xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="multiTenant" type="xs:boolean"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
<xs:element minOccurs="0" name="status" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tenantAdminUsername" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tenantDomain" nillable="true" type="xs:string"/>
@@ -54,10 +54,10 @@
</xs:complexType>
<xs:complexType name="ComponentContext">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="applicationClusterContexts" nillable="true" type="ax21:ApplicationClusterContext"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeContexts" nillable="true" type="ax21:CartridgeContext"/>
- <xs:element minOccurs="0" name="dependencyContext" nillable="true" type="ax21:DependencyContext"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax21:GroupContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="applicationClusterContexts" nillable="true" type="ax23:ApplicationClusterContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeContexts" nillable="true" type="ax23:CartridgeContext"/>
+ <xs:element minOccurs="0" name="dependencyContext" nillable="true" type="ax23:DependencyContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax23:GroupContext"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ApplicationClusterContext">
@@ -69,8 +69,8 @@
<xs:element maxOccurs="unbounded" minOccurs="0" name="dependencyClusterIds" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="deploymentPolicyName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax21:PersistenceContext"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
+ <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax23:PersistenceContext"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
<xs:element minOccurs="0" name="tenantRange" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="textPayload" nillable="true" type="xs:string"/>
</xs:sequence>
@@ -78,7 +78,7 @@
<xs:complexType name="PersistenceContext">
<xs:sequence>
<xs:element minOccurs="0" name="persistenceRequired" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax21:VolumeContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax23:VolumeContext"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="VolumeContext">
@@ -97,7 +97,7 @@
<xs:sequence>
<xs:element minOccurs="0" name="cartridgeMax" type="xs:int"/>
<xs:element minOccurs="0" name="cartridgeMin" type="xs:int"/>
- <xs:element minOccurs="0" name="subscribableInfoContext" nillable="true" type="ax21:SubscribableInfoContext"/>
+ <xs:element minOccurs="0" name="subscribableInfoContext" nillable="true" type="ax23:SubscribableInfoContext"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="type" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
@@ -106,7 +106,7 @@
<xs:complexType name="SubscribableInfoContext">
<xs:sequence>
<xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="artifactRepositoryContext" nillable="true" type="ax21:ArtifactRepositoryContext"/>
+ <xs:element minOccurs="0" name="artifactRepositoryContext" nillable="true" type="ax23:ArtifactRepositoryContext"/>
<xs:element minOccurs="0" name="autoscalingPolicy" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="autoscalingPolicyUuid" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="dependencyAliases" nillable="true" type="xs:string"/>
@@ -114,8 +114,8 @@
<xs:element minOccurs="0" name="deploymentPolicyUuid" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="maxMembers" type="xs:int"/>
<xs:element minOccurs="0" name="minMembers" type="xs:int"/>
- <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax21:PersistenceContext"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
+ <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax23:PersistenceContext"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ArtifactRepositoryContext">
@@ -137,10 +137,10 @@
<xs:complexType name="GroupContext">
<xs:sequence>
<xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeContexts" nillable="true" type="ax21:CartridgeContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeContexts" nillable="true" type="ax23:CartridgeContext"/>
<xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="deploymentPolicyUuid" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax21:GroupContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax23:GroupContext"/>
<xs:element minOccurs="0" name="groupMaxInstances" type="xs:int"/>
<xs:element minOccurs="0" name="groupMinInstances" type="xs:int"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
@@ -153,8 +153,8 @@
<xs:complexType name="ServiceGroup">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="cartridges" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="dependencies" nillable="true" type="ax29:Dependencies"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="groups" nillable="true" type="ax29:ServiceGroup"/>
+ <xs:element minOccurs="0" name="dependencies" nillable="true" type="ax21:Dependencies"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="groups" nillable="true" type="ax21:ServiceGroup"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
@@ -168,17 +168,31 @@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax28="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax24="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax217="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax218="http://common.stratos.apache.org/xsd" xmlns:ax221="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax226="http://rmi.java/xsd" xmlns:ax228="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax215="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax210="http://pojo.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.autoscaler.stratos.apache.org">
+ <xs:schema xmlns:ax28="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax217="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax22="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax218="http://common.stratos.apache.org/xsd" xmlns:ax221="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax226="http://rmi.java/xsd" xmlns:ax228="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax215="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax210="http://exception.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.autoscaler.stratos.apache.org">
+ <xs:import namespace="http://pojo.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://application.exception.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
- <xs:import namespace="http://pojo.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://common.stratos.apache.org/xsd"/>
<xs:import namespace="http://policy.exception.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://rmi.java/xsd"/>
<xs:import namespace="http://partition.exception.autoscaler.stratos.apache.org/xsd"/>
+ <xs:element name="getServiceGroup">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getServiceGroupResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax21:ServiceGroup"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
<xs:element name="getApplications">
<xs:complexType>
<xs:sequence/>
@@ -187,35 +201,35 @@
<xs:element name="getApplicationsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AutoscalerServiceApplicationDefinitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="ApplicationDefinitionException" nillable="true" type="ax25:ApplicationDefinitionException"/>
+ <xs:element minOccurs="0" name="ApplicationDefinitionException" nillable="true" type="ax27:ApplicationDefinitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AutoscalerServiceCartridgeGroupNotFoundException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeGroupNotFoundException" nillable="true" type="ax27:CartridgeGroupNotFoundException"/>
+ <xs:element minOccurs="0" name="CartridgeGroupNotFoundException" nillable="true" type="ax29:CartridgeGroupNotFoundException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AutoscalerServiceCartridgeNotFoundException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax27:CartridgeNotFoundException"/>
+ <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax29:CartridgeNotFoundException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addApplication">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax24:ApplicationContext"/>
+ <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax26:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -226,17 +240,17 @@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroup">
+ <xs:element name="getDeploymentPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupResponse">
+ <xs:element name="getDeploymentPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ServiceGroup"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -250,21 +264,7 @@
<xs:element name="getApplicationResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getDeploymentPolicy">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getDeploymentPolicyResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -285,7 +285,7 @@
<xs:element name="AutoscalerServiceInvalidArgumentException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidArgumentException" nillable="true" type="ax27:InvalidArgumentException"/>
+ <xs:element minOccurs="0" name="InvalidArgumentException" nillable="true" type="ax29:InvalidArgumentException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -293,7 +293,7 @@
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -318,75 +318,6 @@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="AutoscalerServiceDeploymentPolicyNotExistsException">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="DeploymentPolicyNotExistsException" nillable="true" type="ax220:DeploymentPolicyNotExistsException"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="AutoscalerServiceUnremovablePolicyException">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="UnremovablePolicyException" nillable="true" type="ax220:UnremovablePolicyException"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="removeDeployementPolicy">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="deploymentPolicyID" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="removeDeployementPolicyResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getDeploymentPolicyForTenant">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="deploymentPolicyID" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getDeploymentPolicyForTenantResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getDeploymentPolicies">
- <xs:complexType>
- <xs:sequence/>
- </xs:complexType>
- </xs:element>
- <xs:element name="getDeploymentPoliciesResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getDeploymentPoliciesByTenant">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getDeploymentPoliciesByTenantResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
<xs:element name="getAutoScalingPolicies">
<xs:complexType>
<xs:sequence/>
@@ -416,7 +347,7 @@
<xs:element name="AutoscalerServiceAutoScalingPolicyAlreadyExistException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="AutoScalingPolicyAlreadyExistException" nillable="true" type="ax27:AutoScalingPolicyAlreadyExistException"/>
+ <xs:element minOccurs="0" name="AutoScalingPolicyAlreadyExistException" nillable="true" type="ax29:AutoScalingPolicyAlreadyExistException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -455,6 +386,13 @@
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element name="AutoscalerServiceUnremovablePolicyException">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="UnremovablePolicyException" nillable="true" type="ax220:UnremovablePolicyException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
<xs:element name="AutoscalerServicePolicyDoesNotExistException">
<xs:complexType>
<xs:sequence>
@@ -494,7 +432,7 @@
<xs:element name="updateApplication">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax24:ApplicationContext"/>
+ <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax26:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -516,7 +454,7 @@
<xs:element name="getApplicationByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -545,7 +483,7 @@
<xs:element name="getApplicationsByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -596,14 +534,14 @@
<xs:element name="AutoscalerServiceInvalidServiceGroupException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax25:InvalidServiceGroupException"/>
+ <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax27:InvalidServiceGroupException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax29:ServiceGroup"/>
+ <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax21:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -617,7 +555,7 @@
<xs:element name="updateServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeGroup" nillable="true" type="ax29:ServiceGroup"/>
+ <xs:element minOccurs="0" name="cartridgeGroup" nillable="true" type="ax21:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -653,7 +591,7 @@
<xs:element name="getServiceGroupByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ServiceGroup"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax21:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -690,7 +628,7 @@
<xs:element name="AutoscalerServiceAutoScalerException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="AutoScalerException" nillable="true" type="ax27:AutoScalerException"/>
+ <xs:element minOccurs="0" name="AutoScalerException" nillable="true" type="ax29:AutoScalerException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -702,7 +640,7 @@
<xs:element name="getServiceGroupsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:ServiceGroup"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax21:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -716,7 +654,7 @@
<xs:element name="getServiceGroupsByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:ServiceGroup"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax21:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -772,7 +710,7 @@
<xs:element name="AutoscalerServiceInvalidApplicationPolicyException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidApplicationPolicyException" nillable="true" type="ax25:InvalidApplicationPolicyException"/>
+ <xs:element minOccurs="0" name="InvalidApplicationPolicyException" nillable="true" type="ax27:InvalidApplicationPolicyException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -923,10 +861,17 @@
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element name="AutoscalerServiceDeploymentPolicyNotExistsException">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="DeploymentPolicyNotExistsException" nillable="true" type="ax220:DeploymentPolicyNotExistsException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
<xs:element name="AutoscalerServiceCloudControllerConnectionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CloudControllerConnectionException" nillable="true" type="ax27:CloudControllerConnectionException"/>
+ <xs:element minOccurs="0" name="CloudControllerConnectionException" nillable="true" type="ax29:CloudControllerConnectionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -944,6 +889,61 @@
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element name="removeDeployementPolicy">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeDeployementPolicyResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPolicyForTenant">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="deploymentPolicyID" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPolicyForTenantResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPolicies">
+ <xs:complexType>
+ <xs:sequence/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPoliciesResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPoliciesByTenant">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPoliciesByTenantResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
<xs:element name="getApplicationPolicy">
<xs:complexType>
<xs:sequence>
@@ -978,7 +978,7 @@
<xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionGroups" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitions" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionsUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
@@ -1000,7 +1000,7 @@
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="partitionMax" type="xs:int"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
<xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
@@ -1026,7 +1026,7 @@
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.stratos.apache.org/xsd">
<xs:complexType name="Properties">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax22:Property"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax24:Property"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Property">
@@ -1045,24 +1045,21 @@
</xs:schema>
<xs:schema xmlns:ax222="http://exception.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://policy.exception.autoscaler.stratos.apache.org/xsd">
<xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
- <xs:complexType name="DeploymentPolicyNotExistsException">
- <xs:sequence/>
+ <xs:complexType name="InvalidPolicyException">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+ </xs:sequence>
</xs:complexType>
<xs:complexType name="UnremovablePolicyException">
<xs:complexContent>
- <xs:extension base="ax27:AutoScalerException">
+ <xs:extension base="ax29:AutoScalerException">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
- <xs:complexType name="InvalidPolicyException">
- <xs:sequence>
- <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
<xs:complexType name="PolicyDoesNotExistException">
<xs:complexContent>
- <xs:extension base="ax27:AutoScalerException">
+ <xs:extension base="ax29:AutoScalerException">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
@@ -1083,6 +1080,9 @@
<xs:complexType name="DeploymentPolicyAlreadyExistsException">
<xs:sequence/>
</xs:complexType>
+ <xs:complexType name="DeploymentPolicyNotExistsException">
+ <xs:sequence/>
+ </xs:complexType>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://io.java/xsd">
<xs:complexType name="IOException">
@@ -1105,6 +1105,9 @@
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="AutoScalingPolicyAlreadyExistException">
+ <xs:sequence/>
+ </xs:complexType>
<xs:complexType name="AutoScalerException">
<xs:complexContent>
<xs:extension base="xs:RuntimeException">
@@ -1112,9 +1115,6 @@
</xs:extension>
</xs:complexContent>
</xs:complexType>
- <xs:complexType name="AutoScalingPolicyAlreadyExistException">
- <xs:sequence/>
- </xs:complexType>
<xs:complexType name="CloudControllerConnectionException">
<xs:sequence/>
</xs:complexType>
@@ -1132,6 +1132,12 @@
<wsdl:message name="getAutoScalingPoliciesResponse">
<wsdl:part name="parameters" element="ns:getAutoScalingPoliciesResponse"/>
</wsdl:message>
+ <wsdl:message name="getDeploymentPoliciesRequest">
+ <wsdl:part name="parameters" element="ns:getDeploymentPolicies"/>
+ </wsdl:message>
+ <wsdl:message name="getDeploymentPoliciesResponse">
+ <wsdl:part name="parameters" element="ns:getDeploymentPoliciesResponse"/>
+ </wsdl:message>
<wsdl:message name="addApplicationPolicyRequest">
<wsdl:part name="parameters" element="ns:addApplicationPolicy"/>
</wsdl:message>
@@ -1147,12 +1153,6 @@
<wsdl:message name="AutoscalerServiceApplicationPolicyAlreadyExistsException">
<wsdl:part name="parameters" element="ns:AutoscalerServiceApplicationPolicyAlreadyExistsException"/>
</wsdl:message>
- <wsdl:message name="getDeploymentPoliciesRequest">
- <wsdl:part name="parameters" element="ns:getDeploymentPolicies"/>
- </wsdl:message>
- <wsdl:message name="getDeploymentPoliciesResponse">
- <wsdl:part name="parameters" element="ns:getDeploymentPoliciesResponse"/>
- </wsdl:message>
<wsdl:message name="removeAutoScalingPolicyRequest">
<wsdl:part name="parameters" element="ns:removeAutoScalingPolicy"/>
</wsdl:message>
@@ -1318,18 +1318,18 @@
<wsdl:message name="getApplicationPolicyByTenantResponse">
<wsdl:part name="parameters" element="ns:getApplicationPolicyByTenantResponse"/>
</wsdl:message>
- <wsdl:message name="getAutoscalingPolicyForTenantRequest">
- <wsdl:part name="parameters" element="ns:getAutoscalingPolicyForTenant"/>
- </wsdl:message>
- <wsdl:message name="getAutoscalingPolicyForTenantResponse">
- <wsdl:part name="parameters" element="ns:getAutoscalingPolicyForTenantResponse"/>
- </wsdl:message>
<wsdl:message name="getDeploymentPolicyForTenantRequest">
<wsdl:part name="parameters" element="ns:getDeploymentPolicyForTenant"/>
</wsdl:message>
<wsdl:message name="getDeploymentPolicyForTenantResponse">
<wsdl:part name="parameters" element="ns:getDeploymentPolicyForTenantResponse"/>
</wsdl:message>
+ <wsdl:message name="getAutoscalingPolicyForTenantRequest">
+ <wsdl:part name="parameters" element="ns:getAutoscalingPolicyForTenant"/>
+ </wsdl:message>
+ <wsdl:message name="getAutoscalingPolicyForTenantResponse">
+ <wsdl:part name="parameters" element="ns:getAutoscalingPolicyForTenantResponse"/>
+ </wsdl:message>
<wsdl:message name="getDeploymentPolicyByTenantRequest">
<wsdl:part name="parameters" element="ns:getDeploymentPolicyByTenant"/>
</wsdl:message>
@@ -1462,6 +1462,10 @@
<wsdl:input message="ns:getAutoScalingPoliciesRequest" wsaw:Action="urn:getAutoScalingPolicies"/>
<wsdl:output message="ns:getAutoScalingPoliciesResponse" wsaw:Action="urn:getAutoScalingPoliciesResponse"/>
</wsdl:operation>
+ <wsdl:operation name="getDeploymentPolicies">
+ <wsdl:input message="ns:getDeploymentPoliciesRequest" wsaw:Action="urn:getDeploymentPolicies"/>
+ <wsdl:output message="ns:getDeploymentPoliciesResponse" wsaw:Action="urn:getDeploymentPoliciesResponse"/>
+ </wsdl:operation>
<wsdl:operation name="addApplicationPolicy">
<wsdl:input message="ns:addApplicationPolicyRequest" wsaw:Action="urn:addApplicationPolicy"/>
<wsdl:output message="ns:addApplicationPolicyResponse" wsaw:Action="urn:addApplicationPolicyResponse"/>
@@ -1469,10 +1473,6 @@
<wsdl:fault message="ns:AutoscalerServiceInvalidApplicationPolicyException" name="AutoscalerServiceInvalidApplicationPolicyException" wsaw:Action="urn:addApplicationPolicyAutoscalerServiceInvalidApplicationPolicyException"/>
<wsdl:fault message="ns:AutoscalerServiceApplicationPolicyAlreadyExistsException" name="AutoscalerServiceApplicationPolicyAlreadyExistsException" wsaw:Action="urn:addApplicationPolicyAutoscalerServiceApplicationPolicyAlreadyExistsException"/>
</wsdl:operation>
- <wsdl:operation name="getDeploymentPolicies">
- <wsdl:input message="ns:getDeploymentPoliciesRequest" wsaw:Action="urn:getDeploymentPolicies"/>
- <wsdl:output message="ns:getDeploymentPoliciesResponse" wsaw:Action="urn:getDeploymentPoliciesResponse"/>
- </wsdl:operation>
<wsdl:operation name="removeAutoScalingPolicy">
<wsdl:input message="ns:removeAutoScalingPolicyRequest" wsaw:Action="urn:removeAutoScalingPolicy"/>
<wsdl:output message="ns:removeAutoScalingPolicyResponse" wsaw:Action="urn:removeAutoScalingPolicyResponse"/>
@@ -1580,14 +1580,14 @@
<wsdl:input message="ns:getApplicationPolicyByTenantRequest" wsaw:Action="urn:getApplicationPolicyByTenant"/>
<wsdl:output message="ns:getApplicationPolicyByTenantResponse" wsaw:Action="urn:getApplicationPolicyByTenantResponse"/>
</wsdl:operation>
- <wsdl:operation name="getAutoscalingPolicyForTenant">
- <wsdl:input message="ns:getAutoscalingPolicyForTenantRequest" wsaw:Action="urn:getAutoscalingPolicyForTenant"/>
- <wsdl:output message="ns:getAutoscalingPolicyForTenantResponse" wsaw:Action="urn:getAutoscalingPolicyForTenantResponse"/>
- </wsdl:operation>
<wsdl:operation name="getDeploymentPolicyForTenant">
<wsdl:input message="ns:getDeploymentPolicyForTenantRequest" wsaw:Action="urn:getDeploymentPolicyForTenant"/>
<wsdl:output message="ns:getDeploymentPolicyForTenantResponse" wsaw:Action="urn:getDeploymentPolicyForTenantResponse"/>
</wsdl:operation>
+ <wsdl:operation name="getAutoscalingPolicyForTenant">
+ <wsdl:input message="ns:getAutoscalingPolicyForTenantRequest" wsaw:Action="urn:getAutoscalingPolicyForTenant"/>
+ <wsdl:output message="ns:getAutoscalingPolicyForTenantResponse" wsaw:Action="urn:getAutoscalingPolicyForTenantResponse"/>
+ </wsdl:operation>
<wsdl:operation name="getDeploymentPolicyByTenant">
<wsdl:input message="ns:getDeploymentPolicyByTenantRequest" wsaw:Action="urn:getDeploymentPolicyByTenant"/>
<wsdl:output message="ns:getDeploymentPolicyByTenantResponse" wsaw:Action="urn:getDeploymentPolicyByTenantResponse"/>
@@ -1696,15 +1696,6 @@
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getDeploymentPolicies">
- <soap:operation soapAction="urn:getDeploymentPolicies" style="document"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
<wsdl:operation name="addApplicationPolicy">
<soap:operation soapAction="urn:addApplicationPolicy" style="document"/>
<wsdl:input>
@@ -1723,6 +1714,15 @@
<soap:fault use="literal" name="AutoscalerServiceInvalidApplicationPolicyException"/>
</wsdl:fault>
</wsdl:operation>
+ <wsdl:operation name="getDeploymentPolicies">
+ <soap:operation soapAction="urn:getDeploymentPolicies" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="removeAutoScalingPolicy">
<soap:operation soapAction="urn:removeAutoScalingPolicy" style="document"/>
<wsdl:input>
@@ -1975,8 +1975,8 @@
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getDeploymentPolicyForTenant">
- <soap:operation soapAction="urn:getDeploymentPolicyForTenant" style="document"/>
+ <wsdl:operation name="getAutoscalingPolicyForTenant">
+ <soap:operation soapAction="urn:getAutoscalingPolicyForTenant" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
@@ -1984,8 +1984,8 @@
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getAutoscalingPolicyForTenant">
- <soap:operation soapAction="urn:getAutoscalingPolicyForTenant" style="document"/>
+ <wsdl:operation name="getDeploymentPolicyForTenant">
+ <soap:operation soapAction="urn:getDeploymentPolicyForTenant" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
@@ -2224,15 +2224,6 @@
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getDeploymentPolicies">
- <soap12:operation soapAction="urn:getDeploymentPolicies" style="document"/>
- <wsdl:input>
- <soap12:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap12:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
<wsdl:operation name="addApplicationPolicy">
<soap12:operation soapAction="urn:addApplicationPolicy" style="document"/>
<wsdl:input>
@@ -2251,6 +2242,15 @@
<soap12:fault use="literal" name="AutoscalerServiceInvalidApplicationPolicyException"/>
</wsdl:fault>
</wsdl:operation>
+ <wsdl:operation name="getDeploymentPolicies">
+ <soap12:operation soapAction="urn:getDeploymentPolicies" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="removeAutoScalingPolicy">
<soap12:operation soapAction="urn:removeAutoScalingPolicy" style="document"/>
<wsdl:input>
@@ -2503,8 +2503,8 @@
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getDeploymentPolicyForTenant">
- <soap12:operation soapAction="urn:getDeploymentPolicyForTenant" style="document"/>
+ <wsdl:operation name="getAutoscalingPolicyForTenant">
+ <soap12:operation soapAction="urn:getAutoscalingPolicyForTenant" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
@@ -2512,8 +2512,8 @@
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getAutoscalingPolicyForTenant">
- <soap12:operation soapAction="urn:getAutoscalingPolicyForTenant" style="document"/>
+ <wsdl:operation name="getDeploymentPolicyForTenant">
+ <soap12:operation soapAction="urn:getDeploymentPolicyForTenant" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
@@ -2752,8 +2752,8 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getDeploymentPolicies">
- <http:operation location="getDeploymentPolicies"/>
+ <wsdl:operation name="addApplicationPolicy">
+ <http:operation location="addApplicationPolicy"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
@@ -2761,8 +2761,8 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="addApplicationPolicy">
- <http:operation location="addApplicationPolicy"/>
+ <wsdl:operation name="getDeploymentPolicies">
+ <http:operation location="getDeploymentPolicies"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
@@ -2977,8 +2977,8 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getDeploymentPolicyForTenant">
- <http:operation location="getDeploymentPolicyForTenant"/>
+ <wsdl:operation name="getAutoscalingPolicyForTenant">
+ <http:operation location="getAutoscalingPolicyForTenant"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
@@ -2986,8 +2986,8 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getAutoscalingPolicyForTenant">
- <http:operation location="getAutoscalingPolicyForTenant"/>
+ <wsdl:operation name="getDeploymentPolicyForTenant">
+ <http:operation location="getDeploymentPolicyForTenant"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
[38/50] [abbrv] stratos git commit: Merge with tenant-isolation branch
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
----------------------------------------------------------------------
diff --cc service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
index c63166c,c967572..efb9c94
--- 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,35 -1,14 +1,35 @@@
- <?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax29="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" xmlns:ns="http://impl.services.controller.cloud.stratos.apache.org" xmlns:ax27="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:ax23="http://domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax24="http://common.stratos.apache.org/xsd" xmlns:ax21="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax212="http://domain.common.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/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://impl.services.controller.cloud.stratos.apache.org">
-<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax29="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:ns="http://impl.services.controller.cloud.stratos.apache.org" xmlns:ax27="http://domain.common.stratos.apache.org/xsd" xmlns:ax23="http://domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax24="http://common.stratos.apache.org/xsd" xmlns:ax21="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax211="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" 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://impl.services.controller.cloud.stratos.apache.org">
++<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://impl.services.controller.cloud.stratos.apache.org" xmlns:ax27="http://domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax23="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax24="http://common.stratos.apache.org/xsd" xmlns:ax21="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax212="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax210="http://domain.common.stratos.apache.org/xsd" 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://impl.services.controller.cloud.stratos.apache.org">
<wsdl:types>
- <xs:schema xmlns:ax28="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:ax26="http://domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax211="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax22="http://exception.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.controller.cloud.stratos.apache.org">
- <xs:schema xmlns:ax213="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax210="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:ax26="http://domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax22="http://exception.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.controller.cloud.stratos.apache.org">
++ <xs:schema xmlns:ax29="http://domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax213="http://topology.domain.messaging.stratos.apache.org/xsd" xmlns:ax26="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd" xmlns:ax22="http://exception.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.controller.cloud.stratos.apache.org">
<xs:import namespace="http://exception.controller.cloud.stratos.apache.org/xsd"/>
++ <xs:import namespace="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd"/>
<xs:import namespace="http://domain.controller.cloud.stratos.apache.org/xsd"/>
<xs:import namespace="http://topology.domain.messaging.stratos.apache.org/xsd"/>
-- <xs:import namespace="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd"/>
- <xs:element name="CloudControllerServiceInvalidClusterException">
- <xs:element name="CloudControllerServiceInvalidCartridgeDefinitionException">
++ <xs:element name="CloudControllerServiceNonExistingKubernetesClusterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidClusterException" nillable="true" type="ax21:InvalidClusterException"/>
- <xs:element minOccurs="0" name="InvalidCartridgeDefinitionException" nillable="true" type="ax21:InvalidCartridgeDefinitionException"/>
++ <xs:element minOccurs="0" name="NonExistingKubernetesClusterException" nillable="true" type="ax21:NonExistingKubernetesClusterException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="terminateInstances">
++ <xs:element name="getKubernetesCluster">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="kubernetesClusterUuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="terminateInstancesResponse">
++ <xs:element name="getKubernetesClusterResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:KubernetesCluster"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="CloudControllerServiceCartridgeNotFoundException">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax21:CartridgeNotFoundException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -47,31 -19,24 +40,31 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceUnregisteredClusterException">
- <xs:element name="CloudControllerServiceCartridgeDefinitionNotExistsException">
++ <xs:element name="CloudControllerServiceCloudControllerException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="UnregisteredClusterException" nillable="true" type="ax21:UnregisteredClusterException"/>
- <xs:element minOccurs="0" name="CartridgeDefinitionNotExistsException" nillable="true" type="ax21:CartridgeDefinitionNotExistsException"/>
++ <xs:element minOccurs="0" name="CloudControllerException" nillable="true" type="ax21:CloudControllerException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="unregisterService">
- <xs:element name="updateCartridge">
++ <xs:element name="startInstance">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="cartridge" nillable="true" type="ax26:Cartridge"/>
++ <xs:element minOccurs="0" name="instanceContext" nillable="true" type="ax29:InstanceContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="unregisterServiceResponse">
- <xs:element name="updateCartridgeResponse">
++ <xs:element name="startInstanceResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:MemberContext"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="CloudControllerServiceInvalidPartitionException">
++ <xs:element name="CloudControllerServiceInvalidMemberException">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax21:InvalidPartitionException"/>
++ <xs:element minOccurs="0" name="InvalidMemberException" nillable="true" type="ax21:InvalidMemberException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -82,273 -47,207 +75,258 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validateDeploymentPolicyNetworkPartition">
- <xs:element name="removeCartridge">
++ <xs:element name="terminateInstance">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validateDeploymentPolicyNetworkPartitionResponse">
- <xs:element name="removeCartridgeResponse">
++ <xs:element name="terminateInstanceResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validatePartition">
- <xs:element name="CloudControllerServiceInvalidServiceGroupException">
++ <xs:element name="getCartridge">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="partition" nillable="true" type="ax26:Partition"/>
- <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax21:InvalidServiceGroupException"/>
++ <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validatePartitionResponse">
- <xs:element name="addServiceGroup">
++ <xs:element name="getCartridgeResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax26:ServiceGroup"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateClusterStatus">
- <xs:element name="addServiceGroupResponse">
++ <xs:element name="getClusterContext">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="serviceName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="status" nillable="true" type="ax27:ClusterStatus"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateClusterStatusResponse">
- <xs:element name="removeServiceGroup">
++ <xs:element name="getClusterContextResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ClusterContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceApplicationClusterRegistrationException">
- <xs:element name="removeServiceGroupResponse">
++ <xs:element name="getCartridges">
+ <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="ApplicationClusterRegistrationException" nillable="true" type="ax21:ApplicationClusterRegistrationException"/>
- </xs:sequence>
++ <xs:sequence/>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="createApplicationClusters">
++ <xs:element name="getCartridgesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="appId" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="appClustersContexts" nillable="true" type="ax26:ApplicationClusterContext"/>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="createApplicationClustersResponse">
- <xs:element name="getServiceGroup">
++ <xs:element name="getIaasProviders">
+ <xs:complexType>
- <xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- </xs:sequence>
++ <xs:sequence/>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="CloudControllerServiceClusterInstanceCreationException">
++ <xs:element name="getIaasProvidersResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="ClusterInstanceCreationException" nillable="true" type="ax21:ClusterInstanceCreationException"/>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="createClusterInstance">
- <xs:element name="getServiceGroupResponse">
++ <xs:element name="CloudControllerServiceInvalidPartitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="serviceType" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="partitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ServiceGroup"/>
++ <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax21:InvalidPartitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="createClusterInstanceResponse">
- <xs:element name="getServiceGroupSubGroups">
++ <xs:element name="validatePartition">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="partition" nillable="true" type="ax29:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceNonExistingKubernetesClusterException">
- <xs:element name="getServiceGroupSubGroupsResponse">
++ <xs:element name="validatePartitionResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NonExistingKubernetesClusterException" nillable="true" type="ax21:NonExistingKubernetesClusterException"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getMasterForKubernetesCluster">
- <xs:element name="getServiceGroupCartridges">
++ <xs:element name="CloudControllerServiceInvalidCartridgeDefinitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="InvalidCartridgeDefinitionException" nillable="true" type="ax21:InvalidCartridgeDefinitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getMasterForKubernetesClusterResponse">
- <xs:element name="getServiceGroupCartridgesResponse">
++ <xs:element name="CloudControllerServiceCartridgeAlreadyExistsException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax29:KubernetesMaster"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="CartridgeAlreadyExistsException" nillable="true" type="ax21:CartridgeAlreadyExistsException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getHostsForKubernetesCluster">
- <xs:element name="getServiceGroupDependencies">
++ <xs:element name="addCartridge">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="cartridgeConfig" nillable="true" type="ax29:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getHostsForKubernetesClusterResponse">
- <xs:element name="getServiceGroupDependenciesResponse">
++ <xs:element name="addCartridgeResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:KubernetesHost"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:Dependencies"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidKubernetesHostException">
- <xs:element name="CloudControllerServiceInvalidPartitionException">
++ <xs:element name="CloudControllerServiceCartridgeDefinitionNotExistsException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidKubernetesHostException" nillable="true" type="ax21:InvalidKubernetesHostException"/>
- <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax21:InvalidPartitionException"/>
++ <xs:element minOccurs="0" name="CartridgeDefinitionNotExistsException" nillable="true" type="ax21:CartridgeDefinitionNotExistsException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addKubernetesHost">
- <xs:element name="validatePartition">
++ <xs:element name="updateCartridge">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax29:KubernetesHost"/>
- <xs:element minOccurs="0" name="partition" nillable="true" type="ax26:Partition"/>
++ <xs:element minOccurs="0" name="cartridge" nillable="true" type="ax29:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addKubernetesHostResponse">
- <xs:element name="validatePartitionResponse">
++ <xs:element name="updateCartridgeResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidKubernetesMasterException">
- <xs:element name="validateDeploymentPolicyNetworkPartition">
++ <xs:element name="removeCartridge">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidKubernetesMasterException" nillable="true" type="ax21:InvalidKubernetesMasterException"/>
+ <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceNonExistingKubernetesMasterException">
- <xs:element name="validateDeploymentPolicyNetworkPartitionResponse">
++ <xs:element name="removeCartridgeResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NonExistingKubernetesMasterException" nillable="true" type="ax21:NonExistingKubernetesMasterException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesMaster">
- <xs:element name="CloudControllerServiceCartridgeNotFoundException">
++ <xs:element name="CloudControllerServiceInvalidServiceGroupException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax29:KubernetesMaster"/>
- <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax21:CartridgeNotFoundException"/>
++ <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax21:InvalidServiceGroupException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesMasterResponse">
- <xs:element name="registerService">
++ <xs:element name="addServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="registrant" nillable="true" type="ax26:Registrant"/>
++ <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax29:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceNonExistingKubernetesHostException">
- <xs:element name="registerServiceResponse">
++ <xs:element name="addServiceGroupResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NonExistingKubernetesHostException" nillable="true" type="ax21:NonExistingKubernetesHostException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesHost">
- <xs:element name="CloudControllerServiceCloudControllerException">
++ <xs:element name="removeServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax29:KubernetesHost"/>
- <xs:element minOccurs="0" name="CloudControllerException" nillable="true" type="ax21:CloudControllerException"/>
++ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateKubernetesHostResponse">
- <xs:element name="startInstances">
++ <xs:element name="removeServiceGroupResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="instanceContexts" nillable="true" type="ax26:InstanceContext"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceNetworkPartitionNotExistsException">
- <xs:element name="startInstancesResponse">
++ <xs:element name="getServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NetworkPartitionNotExistsException" nillable="true" type="ax21:NetworkPartitionNotExistsException"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:MemberContext"/>
++ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateNetworkPartition">
- <xs:element name="CloudControllerServiceInvalidMemberException">
++ <xs:element name="getServiceGroupResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="networkPartition" nillable="true" type="ax26:NetworkPartition"/>
- <xs:element minOccurs="0" name="InvalidMemberException" nillable="true" type="ax21:InvalidMemberException"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateNetworkPartitionResponse">
- <xs:element name="terminateInstance">
++ <xs:element name="getServiceGroupSubGroups">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getClusterContext">
- <xs:element name="terminateInstanceResponse">
++ <xs:element name="getServiceGroupSubGroupsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="getClusterContextResponse">
++ <xs:element name="getServiceGroupCartridges">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ClusterContext"/>
++ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="removeKubernetesCluster">
++ <xs:element name="getServiceGroupCartridgesResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="removeKubernetesClusterResponse">
++ <xs:element name="getServiceGroupDependencies">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="removeKubernetesHost">
++ <xs:element name="getServiceGroupDependenciesResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="kubernetesHostId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:Dependencies"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="removeKubernetesHostResponse">
++ <xs:element name="startInstances">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="instanceContexts" nillable="true" type="ax29:InstanceContext"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="CloudControllerServiceInvalidKubernetesClusterException">
++ <xs:element name="startInstancesResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="InvalidKubernetesClusterException" nillable="true" type="ax21:InvalidKubernetesClusterException"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:MemberContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -387,90 -286,82 +365,99 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesCluster">
- <xs:element name="updateClusterStatus">
++ <xs:element name="registerService">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="serviceName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="status" nillable="true" type="ax29:ClusterStatus"/>
++ <xs:element minOccurs="0" name="registrant" nillable="true" type="ax29:Registrant"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesClusterResponse">
- <xs:element name="updateClusterStatusResponse">
++ <xs:element name="registerServiceResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax29:KubernetesCluster"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesClusters">
- <xs:element name="CloudControllerServiceUnregisteredClusterException">
++ <xs:element name="getCartridgeByTenant">
<xs:complexType>
- <xs:sequence/>
+ <xs:sequence>
- <xs:element minOccurs="0" name="UnregisteredClusterException" nillable="true" type="ax21:UnregisteredClusterException"/>
++ <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getKubernetesClustersResponse">
- <xs:element name="unregisterService">
++ <xs:element name="getCartridgeByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:KubernetesCluster"/>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidMemberException">
- <xs:element name="unregisterServiceResponse">
++ <xs:element name="getCartridgesByTenant">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidMemberException" nillable="true" type="ax21:InvalidMemberException"/>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceCloudControllerException">
- <xs:element name="getCartridgeByTenant">
++ <xs:element name="getCartridgesByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CloudControllerException" nillable="true" type="ax21:CloudControllerException"/>
- <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:Cartridge"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="terminateInstance">
- <xs:element name="getCartridgeByTenantResponse">
++ <xs:element name="CloudControllerServiceUnregisteredClusterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:Cartridge"/>
++ <xs:element minOccurs="0" name="UnregisteredClusterException" nillable="true" type="ax21:UnregisteredClusterException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="terminateInstanceResponse">
- <xs:element name="getCartridges">
++ <xs:element name="unregisterService">
<xs:complexType>
- <xs:sequence/>
+ <xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ </xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCartridges">
- <xs:element name="getCartridgesResponse">
++ <xs:element name="unregisterServiceResponse">
<xs:complexType>
- <xs:sequence/>
+ <xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCartridgesResponse">
- <xs:element name="getClusterContext">
++ <xs:element name="validateDeploymentPolicyNetworkPartition">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="getCartridge">
++ <xs:element name="validateDeploymentPolicyNetworkPartitionResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="getCartridgeResponse">
++ <xs:element name="updateClusterStatus">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:Cartridge"/>
++ <xs:element minOccurs="0" name="serviceName" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="status" nillable="true" type="ax212:ClusterStatus"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidCartridgeDefinitionException">
- <xs:element name="getClusterContextResponse">
++ <xs:element name="updateClusterStatusResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidCartridgeDefinitionException" nillable="true" type="ax21:InvalidCartridgeDefinitionException"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ClusterContext"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -481,10 -372,11 +468,11 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceCartridgeAlreadyExistsException">
+ <xs:element name="createApplicationClusters">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeAlreadyExistsException" nillable="true" type="ax21:CartridgeAlreadyExistsException"/>
+ <xs:element minOccurs="0" name="appUuid" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="appClustersContexts" nillable="true" type="ax26:ApplicationClusterContext"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="appClustersContexts" nillable="true" type="ax29:ApplicationClusterContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -523,36 -420,60 +516,39 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addNetworkPartitionResponse">
+ <xs:element name="getKubernetesClustersResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax213:KubernetesCluster"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:KubernetesCluster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartition">
- <xs:element name="CloudControllerServiceNonExistingKubernetesClusterException">
++ <xs:element name="getKubernetesClusterByTenant">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="NonExistingKubernetesClusterException" nillable="true" type="ax21:NonExistingKubernetesClusterException"/>
++ <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitionResponse">
- <xs:element name="getKubernetesCluster">
++ <xs:element name="getKubernetesClusterByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
- <xs:element minOccurs="0" name="kubernetesClusterUuid" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:KubernetesCluster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitions">
- <xs:element name="getKubernetesClusterResponse">
++ <xs:element name="getMasterForKubernetesCluster">
<xs:complexType>
- <xs:sequence/>
+ <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax213:KubernetesCluster"/>
++ <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
+ </xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getNetworkPartitionsResponse">
- <xs:element name="getKubernetesClusterByTenant">
++ <xs:element name="getMasterForKubernetesClusterResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getKubernetesClusterByTenantResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax213:KubernetesCluster"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getMasterForKubernetesCluster">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getMasterForKubernetesClusterResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax213:KubernetesMaster"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:KubernetesMaster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -563,10 -484,10 +559,10 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeNetworkPartitionResponse">
+ <xs:element name="getHostsForKubernetesClusterResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax213:KubernetesHost"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:KubernetesHost"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -584,10 -505,10 +580,10 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceCartridgeDefinitionNotExistsException">
+ <xs:element name="addKubernetesCluster">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeDefinitionNotExistsException" nillable="true" type="ax21:CartridgeDefinitionNotExistsException"/>
- <xs:element minOccurs="0" name="kubernetesCluster" nillable="true" type="ax213:KubernetesCluster"/>
++ <xs:element minOccurs="0" name="kubernetesCluster" nillable="true" type="ax26:KubernetesCluster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -598,10 -519,10 +594,10 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateCartridgeResponse">
+ <xs:element name="updateKubernetesCluster">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="kubernetesCluster" nillable="true" type="ax213:KubernetesCluster"/>
++ <xs:element minOccurs="0" name="kubernetesCluster" nillable="true" type="ax26:KubernetesCluster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -619,10 -540,11 +615,11 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupResponse">
+ <xs:element name="addKubernetesHost">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:ServiceGroup"/>
+ <xs:element minOccurs="0" name="groupUuid" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax213:KubernetesHost"/>
++ <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax26:KubernetesHost"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -633,24 -555,38 +630,24 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addServiceGroupResponse">
- <xs:element name="CloudControllerServiceNonExistingKubernetesHostException">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="NonExistingKubernetesHostException" nillable="true" type="ax21:NonExistingKubernetesHostException"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="updateKubernetesHost">
++ <xs:element name="removeKubernetesCluster">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax213:KubernetesHost"/>
++ <xs:element minOccurs="0" name="groupUuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeServiceGroup">
- <xs:element name="updateKubernetesHostResponse">
++ <xs:element name="removeKubernetesClusterResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeServiceGroupResponse">
- <xs:element name="removeKubernetesCluster">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="groupUuid" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="removeKubernetesClusterResponse">
++ <xs:element name="CloudControllerServiceNonExistingKubernetesHostException">
<xs:complexType>
<xs:sequence>
- <xs:element name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="NonExistingKubernetesHostException" nillable="true" type="ax21:NonExistingKubernetesHostException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -682,10 -618,10 +679,10 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupCartridges">
+ <xs:element name="updateKubernetesMaster">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax213:KubernetesMaster"/>
++ <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax26:KubernetesMaster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -696,24 -632,10 +693,24 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupDependencies">
++ <xs:element name="updateKubernetesHost">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax26:KubernetesHost"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="getServiceGroupDependenciesResponse">
++ <xs:element name="updateKubernetesHostResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:Dependencies"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="startInstances">
+ <xs:element name="CloudControllerServiceNetworkPartitionAlreadyExistsException">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="instanceContexts" nillable="true" type="ax26:InstanceContext"/>
+ <xs:element minOccurs="0" name="NetworkPartitionAlreadyExistsException" nillable="true" type="ax21:NetworkPartitionAlreadyExistsException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -724,15 -646,65 +721,65 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getIaasProviders">
+ <xs:element name="addNetworkPartition">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="networkPartition" nillable="true" type="ax26:NetworkPartition"/>
++ <xs:element minOccurs="0" name="networkPartition" nillable="true" type="ax29:NetworkPartition"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="addNetworkPartitionResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="CloudControllerServiceNetworkPartitionNotExistsException">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="NetworkPartitionNotExistsException" nillable="true" type="ax21:NetworkPartitionNotExistsException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeNetworkPartition">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeNetworkPartitionResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateNetworkPartition">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="networkPartition" nillable="true" type="ax26:NetworkPartition"/>
++ <xs:element minOccurs="0" name="networkPartition" nillable="true" type="ax29:NetworkPartition"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateNetworkPartitionResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getNetworkPartitions">
<xs:complexType>
<xs:sequence/>
</xs:complexType>
</xs:element>
- <xs:element name="getIaasProvidersResponse">
+ <xs:element name="getNetworkPartitionsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:NetworkPartition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -743,10 -715,144 +790,69 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="startInstanceResponse">
+ <xs:element name="getNetworkPartitionsByTenantResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getNetworkPartition">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getNetworkPartitionResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getCartridgesByTenant">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getCartridgesByTenantResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:Cartridge"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:NetworkPartition"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getNetworkPartitionByTenant">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:MemberContext"/>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getNetworkPartitionByTenantResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:NetworkPartition"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:NetworkPartition"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="startInstance">
++ <xs:element name="getNetworkPartition">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="instanceContext" nillable="true" type="ax26:InstanceContext"/>
++ <xs:element minOccurs="0" name="networkPartitionUuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="startInstanceResponse">
++ <xs:element name="getNetworkPartitionResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:MemberContext"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:NetworkPartition"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getNetworkPartitionUuid">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getNetworkPartitionUuidResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getPartitionsByNetworkPartition">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getPartitionsByNetworkPartitionResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:Partition"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getIaasProviders">
- <xs:complexType>
- <xs:sequence/>
- </xs:complexType>
- </xs:element>
- <xs:element name="getIaasProvidersResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="CloudControllerServiceCartridgeAlreadyExistsException">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="CartridgeAlreadyExistsException" nillable="true" type="ax21:CartridgeAlreadyExistsException"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="addCartridge">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="cartridgeConfig" nillable="true" type="ax26:Cartridge"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="addCartridgeResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getCartridge">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="cartridgeUuid" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getCartridgeResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax26:Cartridge"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -776,7 -882,7 +882,7 @@@
</xs:complexType>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://exception.controller.cloud.stratos.apache.org/xsd">
- <xs:complexType name="InvalidClusterException">
- <xs:complexType name="InvalidCartridgeDefinitionException">
++ <xs:complexType name="NonExistingKubernetesClusterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
@@@ -786,12 -892,12 +892,19 @@@
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="UnregisteredClusterException">
- <xs:complexType name="CartridgeDefinitionNotExistsException">
++ <xs:complexType name="InvalidIaasProviderException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidPartitionException">
- <xs:complexType name="InvalidCartridgeTypeException">
++ <xs:complexType name="CloudControllerException">
++ <xs:complexContent>
++ <xs:extension base="xs:RuntimeException">
++ <xs:sequence/>
++ </xs:extension>
++ </xs:complexContent>
++ </xs:complexType>
++ <xs:complexType name="InvalidMemberException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
@@@ -806,40 -912,44 +919,40 @@@
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="ClusterInstanceCreationException">
- <xs:complexType name="CartridgeNotFoundException">
++ <xs:complexType name="InvalidCartridgeDefinitionException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="NonExistingKubernetesClusterException">
- <xs:complexType name="CloudControllerException">
- <xs:complexContent>
- <xs:extension base="xs:RuntimeException">
- <xs:sequence/>
- </xs:extension>
- </xs:complexContent>
++ <xs:complexType name="CartridgeAlreadyExistsException">
++ <xs:sequence/>
+ </xs:complexType>
- <xs:complexType name="InvalidMemberException">
++ <xs:complexType name="CartridgeDefinitionNotExistsException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidKubernetesHostException">
- <xs:complexType name="InvalidClusterException">
++ <xs:complexType name="InvalidServiceGroupException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidKubernetesMasterException">
- <xs:complexType name="UnregisteredClusterException">
++ <xs:complexType name="InvalidClusterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="NonExistingKubernetesMasterException">
- <xs:complexType name="ApplicationClusterRegistrationException">
++ <xs:complexType name="UnregisteredClusterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="NonExistingKubernetesHostException">
- <xs:complexType name="ClusterInstanceCreationException">
++ <xs:complexType name="ApplicationClusterRegistrationException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="NetworkPartitionNotExistsException">
- <xs:sequence/>
- </xs:complexType>
- <xs:complexType name="InvalidKubernetesClusterException">
- <xs:complexType name="NonExistingKubernetesClusterException">
++ <xs:complexType name="ClusterInstanceCreationException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
@@@ -894,36 -994,39 +997,51 @@@
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="NetworkPartitionNotExistsException">
+ <xs:sequence/>
+ </xs:complexType>
- <xs:complexType name="CartridgeAlreadyExistsException">
- <xs:sequence/>
+ </xs:schema>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.common.stratos.apache.org/xsd">
+ <xs:complexType name="NameValuePair">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="value" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="LoadBalancingIPType">
+ <xs:complexContent>
+ <xs:extension base="xs:Enum">
+ <xs:sequence/>
+ </xs:extension>
+ </xs:complexContent>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax210="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd">
- <xs:schema xmlns:ax212="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd">
++ <xs:schema xmlns:ax25="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://kubernetes.domain.controller.cloud.stratos.apache.org/xsd">
<xs:import namespace="http://common.stratos.apache.org/xsd"/>
+ <xs:complexType name="KubernetesCluster">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="clusterUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="kubernetesHosts" nillable="true" type="ax211:KubernetesHost"/>
- <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax211:KubernetesMaster"/>
- <xs:element minOccurs="0" name="portRange" nillable="true" type="ax211:PortRange"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax212:Properties"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="kubernetesHosts" nillable="true" type="ax23:KubernetesHost"/>
++ <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax23:KubernetesMaster"/>
++ <xs:element minOccurs="0" name="portRange" nillable="true" type="ax23:PortRange"/>
++ <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
<xs:complexType name="KubernetesHost">
<xs:sequence>
<xs:element minOccurs="0" name="hostId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="hostname" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="privateIPAddress" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax210:Properties"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax212:Properties"/>
++ <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
<xs:element minOccurs="0" name="publicIPAddress" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="KubernetesMaster">
<xs:complexContent>
- <xs:extension base="ax29:KubernetesHost">
- <xs:extension base="ax211:KubernetesHost">
++ <xs:extension base="ax23:KubernetesHost">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
@@@ -945,96 -1038,27 +1053,92 @@@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax213="http://domain.common.stratos.apache.org/xsd" xmlns:ax25="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.controller.cloud.stratos.apache.org/xsd">
- <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.common.stratos.apache.org/xsd">
- <xs:complexType name="NameValuePair">
++ <xs:schema xmlns:ax28="http://common.stratos.apache.org/xsd" xmlns:ax211="http://domain.common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.controller.cloud.stratos.apache.org/xsd">
+ <xs:import namespace="http://common.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://domain.common.stratos.apache.org/xsd"/>
- <xs:complexType name="Registrant">
++ <xs:complexType name="InstanceContext">
<xs:sequence>
- <xs:element minOccurs="0" name="autoScalerPolicyName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="value" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="deploymentPolicyName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="payload" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="persistence" nillable="true" type="ax23:Persistence"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
- <xs:element minOccurs="0" name="tenantRange" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="Persistence">
- <xs:sequence>
- <xs:element minOccurs="0" name="persistenceRequired" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax23:Volume"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="Volume">
- <xs:sequence>
- <xs:element minOccurs="0" name="device" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="iaasType" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="mappingPath" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="removeOntermination" type="xs:boolean"/>
- <xs:element minOccurs="0" name="size" type="xs:int"/>
- <xs:element minOccurs="0" name="snapshotId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="volumeId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="clusterInstanceId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="initTime" type="xs:long"/>
++ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="obsoleteExpiryTime" type="xs:long"/>
++ <xs:element minOccurs="0" name="partition" nillable="true" type="ax27:Partition"/>
++ <xs:element minOccurs="0" name="properties" nillable="true" type="ax28:Properties"/>
++ <xs:element minOccurs="0" name="volumeRequired" type="xs:boolean"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax27:Volume"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="LoadBalancingIPType">
- <xs:complexContent>
- <xs:extension base="xs:Enum">
- <xs:sequence/>
- </xs:extension>
- </xs:complexContent>
+ <xs:complexType name="Partition">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="isPublic" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="partitionMax" type="xs:int"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
++ <xs:element minOccurs="0" name="properties" nillable="true" type="ax28:Properties"/>
+ <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
++ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
- <xs:complexType name="ApplicationClusterContext">
- <xs:sequence>
- <xs:element minOccurs="0" name="autoscalePolicyName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="dependencyClusterIds" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="deploymentPolicyName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="lbCluster" type="xs:boolean"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
- <xs:element minOccurs="0" name="tenantRange" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="textPayload" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="volumeRequired" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax23:Volume"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="NetworkPartition">
++ <xs:complexType name="Volume">
+ <xs:sequence>
- <xs:element minOccurs="0" name="activeByDefault" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="device" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="iaasType" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="partitionAlgo" nillable="true" type
<TRUNCATED>
[10/50] [abbrv] stratos git commit: adding missing changes for
monitoring service
Posted by ga...@apache.org.
adding missing changes for monitoring service
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/c2abc57a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/c2abc57a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/c2abc57a
Branch: refs/heads/master
Commit: c2abc57af45b67acb5581d6e69653e04a04318e3
Parents: 02eafdf
Author: Thanuja <th...@wso2.com>
Authored: Fri Aug 21 16:07:19 2015 +0530
Committer: Thanuja <th...@wso2.com>
Committed: Fri Aug 21 16:07:19 2015 +0530
----------------------------------------------------------------------
.../publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java | 2 +-
.../publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java | 2 +-
.../outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/c2abc57a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
index 33cf0b5..9d095ba 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
@@ -54,7 +54,7 @@ public class WSO2CEPHealthStatisticsPublisher extends ThriftStatisticsPublisher
// Set payload definition
List<Attribute> payloadData = new ArrayList<Attribute>();
- payloadData.add(new Attribute("time_stamp", AttributeType.LONG));
+ payloadData.add(new Attribute("timestamp", AttributeType.LONG));
payloadData.add(new Attribute("cluster_id", AttributeType.STRING));
payloadData.add(new Attribute("cluster_instance_id", AttributeType.STRING));
payloadData.add(new Attribute("network_partition_id", AttributeType.STRING));
http://git-wip-us.apache.org/repos/asf/stratos/blob/c2abc57a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
index f853f23..bfd645c 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
@@ -56,7 +56,7 @@ public class WSO2CEPInFlightRequestPublisher extends ThriftStatisticsPublisher i
List<Attribute> payloadData = new ArrayList<Attribute>();
// Set payload definition
- payloadData.add(new Attribute("time_stamp", AttributeType.LONG));
+ payloadData.add(new Attribute("timestamp", AttributeType.LONG));
payloadData.add(new Attribute("cluster_id", AttributeType.STRING));
payloadData.add(new Attribute("cluster_instance_id", AttributeType.STRING));
payloadData.add(new Attribute("network_partition_id", AttributeType.STRING));
http://git-wip-us.apache.org/repos/asf/stratos/blob/c2abc57a/extensions/cep/artifacts/outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml b/extensions/cep/artifacts/outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml
index 5cec300..6dad7a0 100755
--- a/extensions/cep/artifacts/outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml
+++ b/extensions/cep/artifacts/outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml
@@ -23,7 +23,7 @@
statistics="disable" trace="disable" type="wso2event"
xmlns="http://wso2.org/carbon/eventadaptormanager">
<property name="username">admin</property>
- <property name="receiverURL">tcp://localhost:7612</property>
+ <property name="receiverURL">tcp://localhost:7611</property>
<property name="password">admin</property>
- <property name="authenticatorURL">ssl://localhost:7712</property>
+ <property name="authenticatorURL">ssl://localhost:7711</property>
</outputEventAdaptor>
[06/50] [abbrv] stratos git commit: Merge branch
'tenant-isolation-v1' of https://github.com/dinithis/stratos into
tenant-isolation
Posted by ga...@apache.org.
Merge branch 'tenant-isolation-v1' of https://github.com/dinithis/stratos into tenant-isolation
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/a776ca19
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/a776ca19
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/a776ca19
Branch: refs/heads/master
Commit: a776ca196482f6d5042bb820dedc97f795e769e4
Parents: 2f2debf eb0d28f
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 21 10:28:35 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 21 10:28:35 2015 +0530
----------------------------------------------------------------------
.../autoscaler/pojo/policy/PolicyManager.java | 105 +-
.../services/impl/AutoscalerServiceImpl.java | 269 +++--
.../impl/CloudControllerServiceImpl.java | 219 ++--
.../rest/endpoint/api/StratosApiV41.java | 18 +-
.../rest/endpoint/api/StratosApiV41Utils.java | 10 +-
.../src/main/resources/AutoscalerService.wsdl | 396 +++----
.../main/resources/CloudControllerService.wsdl | 1044 +++++++++---------
7 files changed, 1084 insertions(+), 977 deletions(-)
----------------------------------------------------------------------
[18/50] [abbrv] stratos git commit: Adding statsPublisherEnabled
element to thrift-client-config.xml
Posted by ga...@apache.org.
Adding statsPublisherEnabled element to thrift-client-config.xml
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/65b1b2ac
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/65b1b2ac
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/65b1b2ac
Branch: refs/heads/master
Commit: 65b1b2ac2089cdaa806a393fd057c73e30ca83be
Parents: 0770ff1
Author: Thanuja <th...@wso2.com>
Authored: Thu Aug 20 13:49:02 2015 +0530
Committer: Thanuja <th...@wso2.com>
Committed: Fri Aug 21 18:45:13 2015 +0530
----------------------------------------------------------------------
.../statistics/publisher/ThriftClientConfigParser.java | 9 +++++++--
.../common/statistics/publisher/ThriftClientInfo.java | 8 ++++++++
.../statistics/publisher/ThriftStatisticsPublisher.java | 6 ++----
.../wso2/cep/WSO2CEPHealthStatisticsPublisher.java | 3 +--
.../publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java | 3 +--
.../stratos/common/test/ThriftClientConfigParserTest.java | 2 ++
.../src/test/resources/thrift-client-config.xml | 2 ++
products/stratos/conf/thrift-client-config.xml | 2 ++
8 files changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/65b1b2ac/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java
index e2684ac..361b56a 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientConfigParser.java
@@ -40,6 +40,7 @@ public class ThriftClientConfigParser {
* Fields to be read from the thrift-client-config.xml file
*/
private static final String NAME_ELEMENT = "name";
+ private static final String STATS_PUBLISHER_ENABLED = "statsPublisherEnabled";
private static final String USERNAME_ELEMENT = "username";
private static final String PASSWORD_ELEMENT = "password";
private static final String IP_ELEMENT = "ip";
@@ -79,6 +80,7 @@ public class ThriftClientConfigParser {
SecretResolver secretResolver = SecretResolverFactory.create(document, false);
String nameValuesStr = null;
+ boolean statsPublisherEnabled;
String userNameValuesStr = null;
String passwordValueStr = null;
String ipValuesStr = null;
@@ -93,11 +95,9 @@ public class ThriftClientConfigParser {
OMElement thriftClientConfig = (OMElement) thriftClientIterator.next();
Iterator thriftClientConfigIterator = thriftClientConfig.getChildElements();
ThriftClientInfo thriftClientInfo = new ThriftClientInfo();
- log.info("Client Config: " + thriftClientConfigIterator.toString());
while (thriftClientConfigIterator.hasNext()) {
OMElement thriftClientConfigElement = (OMElement) thriftClientConfigIterator.next();
- log.info("Client Config Element: " + thriftClientConfigElement);
if (NAME_ELEMENT.equals(thriftClientConfigElement.getQName().getLocalPart())) {
nameValuesStr = thriftClientConfigElement.getText();
@@ -108,6 +108,11 @@ public class ThriftClientConfigParser {
}
}
+ if (STATS_PUBLISHER_ENABLED.equals(thriftClientConfigElement.getQName().getLocalPart())) {
+ statsPublisherEnabled = Boolean.parseBoolean(thriftClientConfigElement.getText());
+ thriftClientInfo.setStatsPublisherEnabled(statsPublisherEnabled);
+ }
+
if (USERNAME_ELEMENT.equals(thriftClientConfigElement.getQName().getLocalPart())) {
userNameValuesStr = thriftClientConfigElement.getText();
thriftClientInfo.setUsername(userNameValuesStr);
http://git-wip-us.apache.org/repos/asf/stratos/blob/65b1b2ac/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientInfo.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientInfo.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientInfo.java
index 514d907..162c04f 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientInfo.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftClientInfo.java
@@ -23,11 +23,19 @@ package org.apache.stratos.common.statistics.publisher;
* Thrift Client Info
*/
public class ThriftClientInfo {
+ private boolean statsPublisherEnabled;
private String username;
private String password;
private String ip;
private String port;
+ public boolean isStatsPublisherEnabled() {
+ return statsPublisherEnabled;
+ }
+
+ public void setStatsPublisherEnabled(boolean statsPublisherEnabled) {
+ this.statsPublisherEnabled = statsPublisherEnabled;
+ }
public String getUsername() {
return username;
http://git-wip-us.apache.org/repos/asf/stratos/blob/65b1b2ac/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
index 9242e41..151137e 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java
@@ -50,21 +50,19 @@ public class ThriftStatisticsPublisher implements StatisticsPublisher {
* is parsed and assigned into ip,port,username and password fields
*
* @param streamDefinition Thrift Event Stream Definition
- * @param statsPublisherEnabled Whether thrift statistics publisher is enabled
* @param thriftClientName Thrift Client Name
*/
- public ThriftStatisticsPublisher(StreamDefinition streamDefinition, String statsPublisherEnabled,
- String thriftClientName) {
+ public ThriftStatisticsPublisher(StreamDefinition streamDefinition, String thriftClientName) {
ThriftClientConfig thriftClientConfig = ThriftClientConfig.getInstance();
ThriftClientInfo thriftClientInfo = thriftClientConfig.getThriftClientInfo(thriftClientName);
this.streamDefinition = streamDefinition;
+ this.enabled = thriftClientInfo.isStatsPublisherEnabled();
this.ip = thriftClientInfo.getIp();
this.port = thriftClientInfo.getPort();
this.username = thriftClientInfo.getUsername();
this.password = thriftClientInfo.getPassword();
- enabled = Boolean.getBoolean(statsPublisherEnabled);
if (enabled) {
init();
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/65b1b2ac/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
index f98e46c..fbc4030 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
@@ -37,13 +37,12 @@ public class WSO2CEPHealthStatisticsPublisher extends ThriftStatisticsPublisher
private static final Log log = LogFactory.getLog(WSO2CEPHealthStatisticsPublisher.class);
- private static final String STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
private static final String DATA_STREAM_NAME = "cartridge_agent_health_stats";
private static final String VERSION = "1.0.0";
private static final String CEP_THRIFT_CLIENT_NAME = "cep";
public WSO2CEPHealthStatisticsPublisher() {
- super(createStreamDefinition(), STATS_PUBLISHER_ENABLED, CEP_THRIFT_CLIENT_NAME);
+ super(createStreamDefinition(), CEP_THRIFT_CLIENT_NAME);
}
private static StreamDefinition createStreamDefinition() {
http://git-wip-us.apache.org/repos/asf/stratos/blob/65b1b2ac/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
index 4780a3d..9114074 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
@@ -39,13 +39,12 @@ import java.util.List;
public class WSO2CEPInFlightRequestPublisher extends ThriftStatisticsPublisher implements InFlightRequestPublisher {
private static final Log log = LogFactory.getLog(WSO2CEPInFlightRequestPublisher.class);
- private static final String STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
private static final String DATA_STREAM_NAME = "in_flight_requests";
private static final String VERSION = "1.0.0";
private static final String CEP_THRIFT_CLIENT_NAME = "cep";
public WSO2CEPInFlightRequestPublisher() {
- super(createStreamDefinition(), STATS_PUBLISHER_ENABLED, CEP_THRIFT_CLIENT_NAME);
+ super(createStreamDefinition(), CEP_THRIFT_CLIENT_NAME);
}
private static StreamDefinition createStreamDefinition() {
http://git-wip-us.apache.org/repos/asf/stratos/blob/65b1b2ac/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java b/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java
index c51fa7e..1627c40 100644
--- a/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java
+++ b/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftClientConfigParserTest.java
@@ -47,11 +47,13 @@ public class ThriftClientConfigParserTest extends TestCase {
ThriftClientInfo dasThriftClientInfo = thriftClientConfig.getThriftClientInfo(
ThriftClientConfig.DAS_THRIFT_CLIENT_NAME);
+ assertEquals("CEP Stats Publisher not enabled",true,cepThriftClientInfo.isStatsPublisherEnabled());
assertEquals("Incorrect Username", "admin", cepThriftClientInfo.getUsername());
assertEquals("Incorrect Password", "1234", cepThriftClientInfo.getPassword());
assertEquals("Incorrect IP", "192.168.10.10", cepThriftClientInfo.getIp());
assertEquals("Incorrect Port", "9300", cepThriftClientInfo.getPort());
+ assertEquals("DAS Stats Publisher not enabled",true,dasThriftClientInfo.isStatsPublisherEnabled());
assertEquals("Incorrect Username", "admin1", dasThriftClientInfo.getUsername());
assertEquals("Incorrect Password", "12345", dasThriftClientInfo.getPassword());
assertEquals("Incorrect IP", "192.168.10.11", dasThriftClientInfo.getIp());
http://git-wip-us.apache.org/repos/asf/stratos/blob/65b1b2ac/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml b/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml
index 80d5796..8b10756 100644
--- a/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml
+++ b/components/org.apache.stratos.common/src/test/resources/thrift-client-config.xml
@@ -22,6 +22,7 @@
<thriftClientConfiguration>
<config>
<name>cep</name>
+ <statsPublisherEnabled>true</statsPublisherEnabled>
<username>admin</username>
<password>1234</password>
<ip>192.168.10.10</ip>
@@ -29,6 +30,7 @@
</config>
<config>
<name>das</name>
+ <statsPublisherEnabled>true</statsPublisherEnabled>
<username>admin1</username>
<password>12345</password>
<ip>192.168.10.11</ip>
http://git-wip-us.apache.org/repos/asf/stratos/blob/65b1b2ac/products/stratos/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/products/stratos/conf/thrift-client-config.xml b/products/stratos/conf/thrift-client-config.xml
index 4b3b5b9..e5ea9c8 100644
--- a/products/stratos/conf/thrift-client-config.xml
+++ b/products/stratos/conf/thrift-client-config.xml
@@ -22,6 +22,7 @@
<thriftClientConfiguration>
<config>
<name>cep</name>
+ <statsPublisherEnabled>true</statsPublisherEnabled>
<username>admin</username>
<password>admin</password>
<ip>localhost</ip>
@@ -29,6 +30,7 @@
</config>
<config>
<name>das</name>
+ <statsPublisherEnabled>true</statsPublisherEnabled>
<username>admin</username>
<password>admin</password>
<ip>localhost</ip>
[39/50] [abbrv] stratos git commit: Merge with tenant-isolation branch
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoscalerService.wsdl
----------------------------------------------------------------------
diff --cc service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoscalerService.wsdl
index f1d8525,3daffb3..f46f4c2
--- 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,6 -1,6 +1,6 @@@
- <?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax29="http://rmi.java/xsd" xmlns:ns="http://impl.services.autoscaler.stratos.apache.org" xmlns:ax27="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax25="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax23="http://common.stratos.apache.org/xsd" xmlns:ax21="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax219="http://partition.common.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax215="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax213="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax222="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax210="http://io.java/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax224="http://pojo.applications.a
utoscaler.stratos.apache.org/xsd" 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://impl.services.autoscaler.stratos.apache.org">
-<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax29="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ns="http://impl.services.autoscaler.stratos.apache.org" xmlns:ax27="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax25="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax21="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax216="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax22="http://common.stratos.apache.org/xsd" xmlns:ax227="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax214="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax220="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax210="http://partition.common.stratos.apache.org/xsd" xmlns:ax2
23="http://rmi.java/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax224="http://io.java/xsd" 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://impl.services.autoscaler.stratos.apache.org">
++<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://impl.services.autoscaler.stratos.apache.org" xmlns:ax25="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://partition.common.stratos.apache.org/xsd" xmlns:ax21="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax22="http://common.stratos.apache.org/xsd" xmlns:ax218="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax227="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax215="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax221="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax213="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax223="http://rmi.java/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:ax211="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax224="http://io.java/xsd" 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://impl.services.autoscaler.stratos.apache.org">
<wsdl:types>
- <xs:schema xmlns:ax211="http://io.java/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://rmi.java/xsd">
+ <xs:schema xmlns:ax225="http://io.java/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://rmi.java/xsd">
<xs:import namespace="http://io.java/xsd"/>
<xs:complexType name="RemoteException">
<xs:complexContent>
@@@ -21,8 -21,9 +21,9 @@@
<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="ax222:LoadThresholds"/>
- <xs:element minOccurs="0" name="loadThresholds" nillable="true" type="ax216:LoadThresholds"/>
++ <xs:element minOccurs="0" name="loadThresholds" nillable="true" type="ax211:LoadThresholds"/>
<xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LoadThresholds">
@@@ -101,14 -106,15 +106,16 @@@
<xs:complexType name="SubscribableInfoContext">
<xs:sequence>
<xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="artifactRepositoryContext" nillable="true" type="ax224:ArtifactRepositoryContext"/>
+ <xs:element minOccurs="0" name="artifactRepositoryContext" nillable="true" type="ax21:ArtifactRepositoryContext"/>
<xs:element minOccurs="0" name="autoscalingPolicy" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="autoscalingPolicyUuid" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="dependencyAliases" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="deploymentPolicyUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="lvsVirtualIP" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="maxMembers" type="xs:int"/>
<xs:element minOccurs="0" name="minMembers" type="xs:int"/>
- <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax224:PersistenceContext"/>
+ <xs:element minOccurs="0" name="persistenceContext" nillable="true" type="ax21:PersistenceContext"/>
<xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
</xs:sequence>
</xs:complexType>
@@@ -144,9 -153,11 +154,11 @@@
<xs:complexType name="ServiceGroup">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="cartridges" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="dependencies" nillable="true" type="ax27:Dependencies"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="groups" nillable="true" type="ax27:ServiceGroup"/>
- <xs:element minOccurs="0" name="dependencies" nillable="true" type="ax214:Dependencies"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="groups" nillable="true" type="ax214:ServiceGroup"/>
++ <xs:element minOccurs="0" name="dependencies" nillable="true" type="ax221:Dependencies"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="groups" nillable="true" type="ax221:ServiceGroup"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Dependencies">
@@@ -157,61 -168,61 +169,40 @@@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax216="http://common.stratos.apache.org/xsd" xmlns:ax221="http://partition.common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd">
- <xs:import namespace="http://common.stratos.apache.org/xsd"/>
- <xs:import namespace="http://partition.common.stratos.apache.org/xsd"/>
- <xs:complexType name="ApplicationPolicy">
- <xs:sequence>
- <xs:element minOccurs="0" name="algorithm" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionGroups" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitions" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="DeploymentPolicy">
- <xs:sequence>
- <xs:element minOccurs="0" name="deploymentPolicyID" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionRefs" nillable="true" type="ax219:NetworkPartitionRef"/>
- </xs:sequence>
- </xs:complexType>
- </xs:schema>
- <xs:schema xmlns:ax28="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax24="http://common.stratos.apache.org/xsd" xmlns:ax217="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax22="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax214="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax212="http://rmi.java/xsd" xmlns:ax223="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax226="http://pojo.applications.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.autoscaler.stratos.apache.org">
- <xs:schema xmlns:ax28="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax24="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax217="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax218="http://common.stratos.apache.org/xsd" xmlns:ax221="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax226="http://rmi.java/xsd" xmlns:ax228="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax215="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax213="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.autoscaler.stratos.apache.org">
++ <xs:schema xmlns:ax29="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax24="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax216="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax219="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax220="http://common.stratos.apache.org/xsd" xmlns:ax222="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax226="http://rmi.java/xsd" xmlns:ax228="http://partition.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax214="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax212="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.autoscaler.stratos.apache.org">
+ <xs:import namespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd"/>
- <xs:import namespace="http://application.exception.autoscaler.stratos.apache.org/xsd"/>
- <xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
- <xs:import namespace="http://pojo.autoscaler.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
- <xs:import namespace="http://common.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
- <xs:import namespace="http://common.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://policy.exception.autoscaler.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://application.exception.autoscaler.stratos.apache.org/xsd"/>
++ <xs:import namespace="http://common.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://pojo.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://rmi.java/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://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
- <xs:import namespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd"/>
- <xs:element name="undeployApplication">
+ <xs:import namespace="http://partition.exception.autoscaler.stratos.apache.org/xsd"/>
+ <xs:element name="getApplications">
<xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="force" type="xs:boolean"/>
- </xs:sequence>
+ <xs:sequence/>
</xs:complexType>
</xs:element>
- <xs:element name="undeployApplicationResponse">
+ <xs:element name="getApplicationsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="deleteApplication">
- <xs:element name="AutoscalerServiceApplicationDefinitionException">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="ApplicationDefinitionException" nillable="true" type="ax25:ApplicationDefinitionException"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="AutoscalerServiceCartridgeGroupNotFoundException">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="CartridgeGroupNotFoundException" nillable="true" type="ax27:CartridgeGroupNotFoundException"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="AutoscalerServiceCartridgeNotFoundException">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax27:CartridgeNotFoundException"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="addApplication">
++ <xs:element name="getApplication">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax24:ApplicationContext"/>
+ <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="deleteApplicationResponse">
- <xs:element name="addApplicationResponse">
++ <xs:element name="getApplicationResponse">
<xs:complexType>
<xs:sequence>
-- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -230,177 -240,192 +220,178 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateClusterMonitorResponse">
- <xs:element name="getApplication">
++ <xs:element name="getApplicationPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="applicationPolicyId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="AutoscalerServiceInvalidServiceGroupException">
- <xs:element name="getApplicationResponse">
++ <xs:element name="getApplicationPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax25:InvalidServiceGroupException"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:ApplicationContext"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addServiceGroup">
- <xs:element name="getServiceGroup">
++ <xs:element name="getAutoScalingPoliciesByTenant">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax27:ServiceGroup"/>
- <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addServiceGroupResponse">
- <xs:element name="getServiceGroupResponse">
++ <xs:element name="getAutoScalingPoliciesByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax212:AutoscalePolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateServiceGroup">
- <xs:element name="getAutoscalingPolicy">
++ <xs:element name="getAutoScalingPolicies">
<xs:complexType>
-- <xs:sequence>
- <xs:element minOccurs="0" name="cartridgeGroup" nillable="true" type="ax27:ServiceGroup"/>
- <xs:element minOccurs="0" name="autoscalingPolicyId" nillable="true" type="xs:string"/>
-- </xs:sequence>
++ <xs:sequence/>
</xs:complexType>
</xs:element>
- <xs:element name="updateServiceGroupResponse">
- <xs:element name="getAutoscalingPolicyResponse">
++ <xs:element name="getAutoScalingPoliciesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax217:AutoscalePolicy"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax212:AutoscalePolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="AutoscalerServiceCartridgeGroupNotFoundException">
- <xs:element name="AutoscalerServiceInvalidArgumentException">
++ <xs:element name="AutoscalerServiceAutoScalingPolicyAlreadyExistException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeGroupNotFoundException" nillable="true" type="ax21:CartridgeGroupNotFoundException"/>
- <xs:element minOccurs="0" name="InvalidArgumentException" nillable="true" type="ax27:InvalidArgumentException"/>
++ <xs:element minOccurs="0" name="AutoScalingPolicyAlreadyExistException" nillable="true" type="ax214:AutoScalingPolicyAlreadyExistException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeServiceGroup">
- <xs:element name="updateClusterMonitor">
++ <xs:element name="addAutoScalingPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="groupName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
++ <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax212:AutoscalePolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeServiceGroupResponse">
- <xs:element name="updateClusterMonitorResponse">
++ <xs:element name="addAutoScalingPolicyResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroup">
- <xs:element name="getApplicationPolicyByUuid">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="applicationPolicyUuid" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getApplicationPolicyByUuidResponse">
++ <xs:element name="AutoscalerServiceInvalidPolicyException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
++ <xs:element minOccurs="0" name="InvalidPolicyException" nillable="true" type="ax216:InvalidPolicyException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupResponse">
- <xs:element name="getAutoScalingPolicies">
- <xs:complexType>
- <xs:sequence/>
- </xs:complexType>
- </xs:element>
- <xs:element name="getAutoScalingPoliciesResponse">
++ <xs:element name="updateAutoScalingPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax27:ServiceGroup"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax217:AutoscalePolicy"/>
++ <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax212:AutoscalePolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="findClusterId">
- <xs:element name="getAutoScalingPoliciesByTenant">
++ <xs:element name="updateAutoScalingPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="findClusterIdResponse">
- <xs:element name="getAutoScalingPoliciesByTenantResponse">
++ <xs:element name="AutoscalerServiceUnremovablePolicyException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax217:AutoscalePolicy"/>
++ <xs:element minOccurs="0" name="UnremovablePolicyException" nillable="true" type="ax216:UnremovablePolicyException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="AutoscalerServiceAutoScalerException">
- <xs:element name="AutoscalerServiceAutoScalingPolicyAlreadyExistException">
++ <xs:element name="AutoscalerServicePolicyDoesNotExistException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="AutoScalerException" nillable="true" type="ax21:AutoScalerException"/>
- <xs:element minOccurs="0" name="AutoScalingPolicyAlreadyExistException" nillable="true" type="ax27:AutoScalingPolicyAlreadyExistException"/>
++ <xs:element minOccurs="0" name="PolicyDoesNotExistException" nillable="true" type="ax216:PolicyDoesNotExistException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroups">
- <xs:element name="addAutoScalingPolicy">
++ <xs:element name="removeAutoScalingPolicy">
<xs:complexType>
- <xs:sequence/>
+ <xs:sequence>
- <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax217:AutoscalePolicy"/>
++ <xs:element minOccurs="0" name="autoscalePolicyId" nillable="true" type="xs:string"/>
+ </xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getServiceGroupsResponse">
- <xs:element name="addAutoScalingPolicyResponse">
++ <xs:element name="removeAutoScalingPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax27:ServiceGroup"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="serviceGroupExist">
- <xs:element name="AutoscalerServiceInvalidPolicyException">
++ <xs:element name="getAutoscalingPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="serviceName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="InvalidPolicyException" nillable="true" type="ax220:InvalidPolicyException"/>
++ <xs:element minOccurs="0" name="autoscalingPolicyId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="serviceGroupExistResponse">
- <xs:element name="updateAutoScalingPolicy">
++ <xs:element name="getAutoscalingPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax217:AutoscalePolicy"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax212:AutoscalePolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="undeployServiceGroup">
- <xs:element name="updateAutoScalingPolicyResponse">
++ <xs:element name="getAutoscalingPolicyForTenant">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="autoscalingPolicyId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="undeployServiceGroupResponse">
- <xs:element name="AutoscalerServiceUnremovablePolicyException">
++ <xs:element name="getAutoscalingPolicyForTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="UnremovablePolicyException" nillable="true" type="ax220:UnremovablePolicyException"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax212:AutoscalePolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="AutoscalerServiceRemoteException">
- <xs:element name="AutoscalerServicePolicyDoesNotExistException">
++ <xs:element name="AutoscalerServiceApplicationDefinitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="RemoteException" nillable="true" type="ax29:RemoteException"/>
- <xs:element minOccurs="0" name="PolicyDoesNotExistException" nillable="true" type="ax220:PolicyDoesNotExistException"/>
++ <xs:element minOccurs="0" name="ApplicationDefinitionException" nillable="true" type="ax219:ApplicationDefinitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="AutoscalerServiceInvalidApplicationPolicyException">
- <xs:element name="removeAutoScalingPolicy">
++ <xs:element name="AutoscalerServiceCartridgeGroupNotFoundException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidApplicationPolicyException" nillable="true" type="ax25:InvalidApplicationPolicyException"/>
- <xs:element minOccurs="0" name="autoscalePolicyId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="CartridgeGroupNotFoundException" nillable="true" type="ax214:CartridgeGroupNotFoundException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="AutoscalerServiceApplicationPolicyAlreadyExistsException">
- <xs:element name="removeAutoScalingPolicyResponse">
++ <xs:element name="AutoscalerServiceCartridgeNotFoundException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="ApplicationPolicyAlreadyExistsException" nillable="true" type="ax214:ApplicationPolicyAlreadyExistsException"/>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax214:CartridgeNotFoundException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addApplicationPolicy">
- <xs:element name="getAutoscalingPolicyForTenant">
++ <xs:element name="addApplication">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationPolicy" nillable="true" type="ax217:ApplicationPolicy"/>
- <xs:element minOccurs="0" name="autoscalingPolicyId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
++ <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax24:ApplicationContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addApplicationPolicyResponse">
- <xs:element name="getAutoscalingPolicyForTenantResponse">
++ <xs:element name="addApplicationResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax217:AutoscalePolicy"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -500,50 -531,31 +497,53 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="AutoscalerServiceCloudControllerConnectionException">
++ <xs:element name="AutoscalerServiceInvalidArgumentException">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="CloudControllerConnectionException" nillable="true" type="ax21:CloudControllerConnectionException"/>
++ <xs:element minOccurs="0" name="InvalidArgumentException" nillable="true" type="ax214:InvalidArgumentException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="updateDeploymentPolicy">
++ <xs:element name="updateClusterMonitor">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax217:DeploymentPolicy"/>
++ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="updateDeploymentPolicyResponse">
++ <xs:element name="updateClusterMonitorResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="removeDeployementPolicy">
+ <xs:element name="AutoscalerServiceInvalidServiceGroupException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="deploymentPolicyID" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax25:InvalidServiceGroupException"/>
++ <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax219:InvalidServiceGroupException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeDeployementPolicyResponse">
+ <xs:element name="addServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax214:ServiceGroup"/>
++ <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax221:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getDeploymentPolicies">
+ <xs:element name="addServiceGroupResponse">
<xs:complexType>
- <xs:sequence/>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getDeploymentPoliciesResponse">
+ <xs:element name="updateServiceGroup">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax217:DeploymentPolicy"/>
- <xs:element minOccurs="0" name="cartridgeGroup" nillable="true" type="ax214:ServiceGroup"/>
++ <xs:element minOccurs="0" name="cartridgeGroup" nillable="true" type="ax221:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -566,31 -580,18 +568,32 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addAutoScalingPolicy">
++ <xs:element name="getServiceGroup">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax222:AutoscalePolicy"/>
++ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="addAutoScalingPolicyResponse">
++ <xs:element name="getServiceGroupResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax221:ServiceGroup"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="updateAutoScalingPolicy">
+ <xs:element name="getServiceGroupByTenant">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax222:AutoscalePolicy"/>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateAutoScalingPolicyResponse">
+ <xs:element name="getServiceGroupByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax221:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -601,10 -603,10 +605,10 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="removeAutoScalingPolicy">
+ <xs:element name="getOuterServiceGroupByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="autoscalePolicyId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax221:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -636,24 -640,22 +642,22 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="AutoscalerServiceCartridgeNotFoundException">
+ <xs:element name="AutoscalerServiceAutoScalerException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="CartridgeNotFoundException" nillable="true" type="ax21:CartridgeNotFoundException"/>
- <xs:element minOccurs="0" name="AutoScalerException" nillable="true" type="ax27:AutoScalerException"/>
++ <xs:element minOccurs="0" name="AutoScalerException" nillable="true" type="ax214:AutoScalerException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="addApplication">
+ <xs:element name="getServiceGroups">
<xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax224:ApplicationContext"/>
- </xs:sequence>
+ <xs:sequence/>
</xs:complexType>
</xs:element>
- <xs:element name="addApplicationResponse">
+ <xs:element name="getServiceGroupsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax221:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -664,10 -666,10 +668,10 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="updateApplicationResponse">
+ <xs:element name="getServiceGroupsByTenantResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax214:ServiceGroup"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax221:ServiceGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -721,17 -722,17 +724,17 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getDeploymentPolicyResponse">
+ <xs:element name="AutoscalerServiceInvalidApplicationPolicyException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax217:DeploymentPolicy"/>
- <xs:element minOccurs="0" name="InvalidApplicationPolicyException" nillable="true" type="ax25:InvalidApplicationPolicyException"/>
++ <xs:element minOccurs="0" name="InvalidApplicationPolicyException" nillable="true" type="ax219:InvalidApplicationPolicyException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getApplicationPolicy">
+ <xs:element name="AutoscalerServiceApplicationPolicyAlreadyExistsException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="applicationPolicyId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="ApplicationPolicyAlreadyExistsException" nillable="true" type="ax220:ApplicationPolicyAlreadyExistsException"/>
++ <xs:element minOccurs="0" name="ApplicationPolicyAlreadyExistsException" nillable="true" type="ax216:ApplicationPolicyAlreadyExistsException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -742,7 -743,64 +745,78 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getApplications">
+ <xs:element name="addApplicationPolicyResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
++ <xs:element name="getApplicationPolicyByUuid">
++ <xs:complexType>
++ <xs:sequence>
++ <xs:element minOccurs="0" name="applicationPolicyUuid" nillable="true" type="xs:string"/>
++ </xs:sequence>
++ </xs:complexType>
++ </xs:element>
++ <xs:element name="getApplicationPolicyByUuidResponse">
++ <xs:complexType>
++ <xs:sequence>
++ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
++ </xs:sequence>
++ </xs:complexType>
++ </xs:element>
+ <xs:element name="getApplicationPolicyByTenant">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="applicationPolicyId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getApplicationPolicyByTenantResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeApplicationPolicy">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="applicationPolicyId" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeApplicationPolicyResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="AutoscalerServiceApplicatioinPolicyNotExistsException">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="ApplicatioinPolicyNotExistsException" nillable="true" type="ax220:ApplicatioinPolicyNotExistsException"/>
++ <xs:element minOccurs="0" name="ApplicatioinPolicyNotExistsException" nillable="true" type="ax216:ApplicatioinPolicyNotExistsException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateApplicationPolicy">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="applicationPolicy" nillable="true" type="ax29:ApplicationPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateApplicationPolicyResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getApplicationPolicies">
<xs:complexType>
<xs:sequence/>
</xs:complexType>
@@@ -768,14 -841,172 +857,157 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element name="validateNetworkPartitionWithApplicationResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="AutoscalerServiceInvalidDeploymentPolicyException">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="InvalidDeploymentPolicyException" nillable="true" type="ax220:InvalidDeploymentPolicyException"/>
++ <xs:element minOccurs="0" name="InvalidDeploymentPolicyException" nillable="true" type="ax216:InvalidDeploymentPolicyException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="AutoscalerServiceDeploymentPolicyAlreadyExistsException">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="DeploymentPolicyAlreadyExistsException" nillable="true" type="ax220:DeploymentPolicyAlreadyExistsException"/>
++ <xs:element minOccurs="0" name="DeploymentPolicyAlreadyExistsException" nillable="true" type="ax216:DeploymentPolicyAlreadyExistsException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="addDeployementPolicy">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax29:DeploymentPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="addDeployementPolicyResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="AutoscalerServiceDeploymentPolicyNotExistsException">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="DeploymentPolicyNotExistsException" nillable="true" type="ax220:DeploymentPolicyNotExistsException"/>
++ <xs:element minOccurs="0" name="DeploymentPolicyNotExistsException" nillable="true" type="ax216:DeploymentPolicyNotExistsException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="AutoscalerServiceCloudControllerConnectionException">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="CloudControllerConnectionException" nillable="true" type="ax27:CloudControllerConnectionException"/>
++ <xs:element minOccurs="0" name="CloudControllerConnectionException" nillable="true" type="ax214:CloudControllerConnectionException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateDeploymentPolicy">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax29:DeploymentPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateDeploymentPolicyResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeDeployementPolicy">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeDeployementPolicyResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPolicyForTenant">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="deploymentPolicyID" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPolicyForTenantResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPolicies">
+ <xs:complexType>
+ <xs:sequence/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPoliciesResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPoliciesByTenant">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getDeploymentPoliciesByTenantResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="getApplicationPolicy">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="applicationPolicyId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getApplicationPolicyResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax29:ApplicationPolicy"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+ </xs:schema>
- <xs:schema xmlns:ax219="http://common.stratos.apache.org/xsd" xmlns:ax212="http://partition.common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd">
++ <xs:schema xmlns:ax28="http://partition.common.stratos.apache.org/xsd" xmlns:ax210="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd">
+ <xs:import namespace="http://partition.common.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://common.stratos.apache.org/xsd"/>
+ <xs:complexType name="DeploymentPolicy">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionRefs" nillable="true" type="ax212:NetworkPartitionRef"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionRefs" nillable="true" type="ax28:NetworkPartitionRef"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ApplicationPolicy">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="algorithm" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionGroups" nillable="true" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitions" nillable="true" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="networkPartitionsUuid" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax220="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.common.stratos.apache.org/xsd">
- <xs:schema xmlns:ax211="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.common.stratos.apache.org/xsd">
++ <xs:schema xmlns:ax27="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.common.stratos.apache.org/xsd">
<xs:import namespace="http://common.stratos.apache.org/xsd"/>
<xs:complexType name="NetworkPartitionRef">
<xs:sequence>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="partitionAlgo" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="partitionRefs" nillable="true" type="ax219:PartitionRef"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="partitionRefs" nillable="true" type="ax210:PartitionRef"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="partitionRefs" nillable="true" type="ax26:PartitionRef"/>
+ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PartitionRef">
@@@ -784,7 -1015,9 +1016,9 @@@
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="kubernetesClusterId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="partitionMax" type="xs:int"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax23:Properties"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax22:Properties"/>
++ <xs:element minOccurs="0" name="properties" nillable="true" type="ax27:Properties"/>
+ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ <xs:element minOccurs="0" name="uuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
@@@ -818,11 -1051,15 +1052,15 @@@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax218="http://exception.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://policy.exception.autoscaler.stratos.apache.org/xsd">
- <xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
- <xs:complexType name="ApplicationPolicyAlreadyExistsException">
- <xs:sequence/>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.exception.autoscaler.stratos.apache.org/xsd">
+ <xs:complexType name="PartitionValidationException">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+ </xs:sequence>
</xs:complexType>
+ </xs:schema>
- <xs:schema xmlns:ax222="http://exception.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://policy.exception.autoscaler.stratos.apache.org/xsd">
++ <xs:schema xmlns:ax217="http://exception.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://policy.exception.autoscaler.stratos.apache.org/xsd">
+ <xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
<xs:complexType name="InvalidPolicyException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
@@@ -830,7 -1067,14 +1068,14 @@@
</xs:complexType>
<xs:complexType name="UnremovablePolicyException">
<xs:complexContent>
- <xs:extension base="ax21:AutoScalerException">
- <xs:extension base="ax27:AutoScalerException">
++ <xs:extension base="ax217:AutoScalerException">
+ <xs:sequence/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="PolicyDoesNotExistException">
+ <xs:complexContent>
- <xs:extension base="ax27:AutoScalerException">
++ <xs:extension base="ax217:AutoScalerException">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
@@@ -865,47 -1105,41 +1106,41 @@@
</xs:complexType>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://exception.autoscaler.stratos.apache.org/xsd">
- <xs:complexType name="InvalidArgumentException">
- <xs:sequence>
- <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="CartridgeGroupNotFoundException">
- <xs:sequence>
- <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
- </xs:sequence>
++ <xs:complexType name="AutoScalingPolicyAlreadyExistException">
++ <xs:sequence/>
+ </xs:complexType>
+ <xs:complexType name="AutoScalerException">
+ <xs:complexContent>
+ <xs:extension base="xs:RuntimeException">
+ <xs:sequence/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
- <xs:complexType name="CloudControllerConnectionException">
- <xs:sequence/>
- </xs:complexType>
- <xs:complexType name="AutoScalingPolicyAlreadyExistException">
- <xs:sequence/>
+ <xs:complexType name="CartridgeGroupNotFoundException">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+ </xs:sequence>
</xs:complexType>
<xs:complexType name="CartridgeNotFoundException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="InvalidArgumentException">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
- <xs:complexType name="AutoScalingPolicyAlreadyExistException">
- <xs:sequence/>
- </xs:complexType>
- <xs:complexType name="AutoScalerException">
- <xs:complexContent>
- <xs:extension base="xs:RuntimeException">
- <xs:sequence/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
+ <xs:complexType name="CloudControllerConnectionException">
+ <xs:sequence/>
+ </xs:complexType>
</xs:schema>
</wsdl:types>
- <wsdl:message name="removeAutoScalingPolicyRequest">
- <wsdl:part name="parameters" element="ns:removeAutoScalingPolicy"/>
+ <wsdl:message name="getServiceGroupByTenantRequest">
+ <wsdl:part name="parameters" element="ns:getServiceGroupByTenant"/>
</wsdl:message>
- <wsdl:message name="removeAutoScalingPolicyResponse">
- <wsdl:part name="parameters" element="ns:removeAutoScalingPolicyResponse"/>
- </wsdl:message>
- <wsdl:message name="AutoscalerServiceUnremovablePolicyException">
- <wsdl:part name="parameters" element="ns:AutoscalerServiceUnremovablePolicyException"/>
- </wsdl:message>
- <wsdl:message name="AutoscalerServicePolicyDoesNotExistException">
- <wsdl:part name="parameters" element="ns:AutoscalerServicePolicyDoesNotExistException"/>
+ <wsdl:message name="getServiceGroupByTenantResponse">
+ <wsdl:part name="parameters" element="ns:getServiceGroupByTenantResponse"/>
</wsdl:message>
<wsdl:message name="getAutoScalingPoliciesRequest">
<wsdl:part name="parameters" element="ns:getAutoScalingPolicies"/>
@@@ -1135,24 -1462,22 +1463,22 @@@
<wsdl:message name="removeServiceGroupResponse">
<wsdl:part name="parameters" element="ns:removeServiceGroupResponse"/>
</wsdl:message>
-- <wsdl:message name="getApplicationPolicyRequest">
-- <wsdl:part name="parameters" element="ns:getApplicationPolicy"/>
-- </wsdl:message>
-- <wsdl:message name="getApplicationPolicyResponse">
-- <wsdl:part name="parameters" element="ns:getApplicationPolicyResponse"/>
-- </wsdl:message>
<wsdl:message name="updateApplicationRequest">
<wsdl:part name="parameters" element="ns:updateApplication"/>
</wsdl:message>
<wsdl:message name="updateApplicationResponse">
<wsdl:part name="parameters" element="ns:updateApplicationResponse"/>
</wsdl:message>
++ <wsdl:message name="getApplicationPolicyRequest">
++ <wsdl:part name="parameters" element="ns:getApplicationPolicy"/>
++ </wsdl:message>
++ <wsdl:message name="getApplicationPolicyResponse">
++ <wsdl:part name="parameters" element="ns:getApplicationPolicyResponse"/>
++ </wsdl:message>
<wsdl:portType name="AutoscalerServicePortType">
- <wsdl:operation name="removeAutoScalingPolicy">
- <wsdl:input message="ns:removeAutoScalingPolicyRequest" wsaw:Action="urn:removeAutoScalingPolicy"/>
- <wsdl:output message="ns:removeAutoScalingPolicyResponse" wsaw:Action="urn:removeAutoScalingPolicyResponse"/>
- <wsdl:fault message="ns:AutoscalerServiceUnremovablePolicyException" name="AutoscalerServiceUnremovablePolicyException" wsaw:Action="urn:removeAutoScalingPolicyAutoscalerServiceUnremovablePolicyException"/>
- <wsdl:fault message="ns:AutoscalerServicePolicyDoesNotExistException" name="AutoscalerServicePolicyDoesNotExistException" wsaw:Action="urn:removeAutoScalingPolicyAutoscalerServicePolicyDoesNotExistException"/>
+ <wsdl:operation name="getServiceGroupByTenant">
+ <wsdl:input message="ns:getServiceGroupByTenantRequest" wsaw:Action="urn:getServiceGroupByTenant"/>
+ <wsdl:output message="ns:getServiceGroupByTenantResponse" wsaw:Action="urn:getServiceGroupByTenantResponse"/>
</wsdl:operation>
<wsdl:operation name="getAutoScalingPolicies">
<wsdl:input message="ns:getAutoScalingPoliciesRequest" wsaw:Action="urn:getAutoScalingPolicies"/>
@@@ -1305,10 -1689,10 +1690,6 @@@
<wsdl:output message="ns:removeServiceGroupResponse" wsaw:Action="urn:removeServiceGroupResponse"/>
<wsdl:fault message="ns:AutoscalerServiceCartridgeGroupNotFoundException" name="AutoscalerServiceCartridgeGroupNotFoundException" wsaw:Action="urn:removeServiceGroupAutoscalerServiceCartridgeGroupNotFoundException"/>
</wsdl:operation>
-- <wsdl:operation name="getApplicationPolicy">
-- <wsdl:input message="ns:getApplicationPolicyRequest" wsaw:Action="urn:getApplicationPolicy"/>
-- <wsdl:output message="ns:getApplicationPolicyResponse" wsaw:Action="urn:getApplicationPolicyResponse"/>
-- </wsdl:operation>
<wsdl:operation name="updateApplication">
<wsdl:input message="ns:updateApplicationRequest" wsaw:Action="urn:updateApplication"/>
<wsdl:output message="ns:updateApplicationResponse" wsaw:Action="urn:updateApplicationResponse"/>
@@@ -1316,6 -1700,6 +1697,10 @@@
<wsdl:fault message="ns:AutoscalerServiceCartridgeGroupNotFoundException" name="AutoscalerServiceCartridgeGroupNotFoundException" wsaw:Action="urn:updateApplicationAutoscalerServiceCartridgeGroupNotFoundException"/>
<wsdl:fault message="ns:AutoscalerServiceCartridgeNotFoundException" name="AutoscalerServiceCartridgeNotFoundException" wsaw:Action="urn:updateApplicationAutoscalerServiceCartridgeNotFoundException"/>
</wsdl:operation>
++ <wsdl:operation name="getApplicationPolicy">
++ <wsdl:input message="ns:getApplicationPolicyRequest" wsaw:Action="urn:getApplicationPolicy"/>
++ <wsdl:output message="ns:getApplicationPolicyResponse" wsaw:Action="urn:getApplicationPolicyResponse"/>
++ </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AutoscalerServiceSoap11Binding" type="ns:AutoscalerServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
@@@ -1697,6 -2210,6 +2211,15 @@@
<soap:fault use="literal" name="AutoscalerServiceCartridgeGroupNotFoundException"/>
</wsdl:fault>
</wsdl:operation>
++ <wsdl:operation name="getApplicationPolicy">
++ <soap:operation soapAction="urn:getApplicationPolicy" style="document"/>
++ <wsdl:input>
++ <soap:body use="literal"/>
++ </wsdl:input>
++ <wsdl:output>
++ <soap:body use="literal"/>
++ </wsdl:output>
++ </wsdl:operation>
<wsdl:operation name="updateApplication">
<soap:operation soapAction="urn:updateApplication" style="document"/>
<wsdl:input>
@@@ -1715,15 -2228,15 +2238,6 @@@
<soap:fault use="literal" name="AutoscalerServiceCartridgeGroupNotFoundException"/>
</wsdl:fault>
</wsdl:operation>
-- <wsdl:operation name="getApplicationPolicy">
-- <soap:operation soapAction="urn:getApplicationPolicy" style="document"/>
-- <wsdl:input>
-- <soap:body use="literal"/>
-- </wsdl:input>
-- <wsdl:output>
-- <soap:body use="literal"/>
-- </wsdl:output>
-- </wsdl:operation>
</wsdl:binding>
<wsdl:binding name="AutoscalerServiceSoap12Binding" type="ns:AutoscalerServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
@@@ -2105,6 -2747,6 +2748,15 @@@
<soap12:fault use="literal" name="AutoscalerServiceCartridgeGroupNotFoundException"/>
</wsdl:fault>
</wsdl:operation>
++ <wsdl:operation name="getApplicationPolicy">
++ <soap12:operation soapAction="urn:getApplicationPolicy" style="document"/>
++ <wsdl:input>
++ <soap12:body use="literal"/>
++ </wsdl:input>
++ <wsdl:output>
++ <soap12:body use="literal"/>
++ </wsdl:output>
++ </wsdl:operation>
<wsdl:operation name="updateApplication">
<soap12:operation soapAction="urn:updateApplication" style="document"/>
<wsdl:input>
@@@ -2123,313 -2765,439 +2775,430 @@@
<soap12:fault use="literal" name="AutoscalerServiceCartridgeGroupNotFoundException"/>
</wsdl:fault>
</wsdl:operation>
-- <wsdl:operation name="getApplicationPolicy">
-- <soap12:operation soapAction="urn:getApplicationPolicy" style="document"/>
- <wsdl:input>
- <soap12:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap12:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="AutoscalerServiceHttpBinding" type="ns:AutoscalerServicePortType">
+ <http:binding verb="POST"/>
+ <wsdl:operation name="getServiceGroupByTenant">
+ <http:operation location="getServiceGroupByTenant"/>
<wsdl:input>
- <soap12:body use="literal"/>
- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
- <soap12:body use="literal"/>
- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="AutoscalerServiceHttpBinding" type="ns:AutoscalerServicePortType">
- <http:binding verb="POST"/>
<wsdl:operation name="getAutoScalingPolicies">
<http:operation location="getAutoScalingPolicies"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="removeAutoScalingPolicy">
- <http:operation location="removeAutoScalingPolicy"/>
+ <wsdl:operation name="addApplicationPolicy">
+ <http:operation location="addApplicationPolicy"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="addApplicationPolicy">
- <http:operation location="addApplicationPolicy"/>
+ <wsdl:operation name="getDeploymentPolicies">
+ <http:operation location="getDeploymentPolicies"/>
+ <wsdl:input>
- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="removeAutoScalingPolicy">
+ <http:operation location="removeAutoScalingPolicy"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getApplicationPolicies">
<http:operation location="getApplicationPolicies"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getDeploymentPolicies">
- <http:operation location="getDeploymentPolicies"/>
+ <wsdl:operation name="getApplicationByTenant">
+ <http:operation location="getApplicationByTenant"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getServiceGroups">
<http:operation location="getServiceGroups"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getAutoScalingPoliciesByTenant">
+ <http:operation location="getAutoScalingPoliciesByTenant"/>
+ <wsdl:input>
- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getApplication">
<http:operation location="getApplication"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="updateServiceGroup">
<http:operation location="updateServiceGroup"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="deployApplication">
<http:operation location="deployApplication"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getApplicationsByTenant">
+ <http:operation location="getApplicationsByTenant"/>
+ <wsdl:input>
- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="updateApplicationPolicy">
<http:operation location="updateApplicationPolicy"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getApplicationNetworkPartitions">
<http:operation location="getApplicationNetworkPartitions"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="serviceGroupExist">
<http:operation location="serviceGroupExist"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDeploymentPolicy">
<http:operation location="getDeploymentPolicy"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="addAutoScalingPolicy">
- <http:operation location="addAutoScalingPolicy"/>
+ <wsdl:operation name="getApplicationPolicyByUuid">
+ <http:operation location="getApplicationPolicyByUuid"/>
<wsdl:input>
-- <mime:content type="text/xml" part="parameters"/>
++ <mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
-- <mime:content type="text/xml" part="p
<TRUNCATED>
[24/50] [abbrv] stratos git commit: Upgrading fabric8 kubernetes api
version to 2.2.16 and removing forked code
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.html
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.html b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.html
deleted file mode 100644
index d7b2668..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.html
+++ /dev/null
@@ -1,1636 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head><title>Kubernetes API documentation</title>
- <meta http-equiv=X-UA-Compatible content="IE=edge">
- <meta http-equiv=Content-Type content="text/html; charset=utf-8">
- <meta name=generator content="https://github.com/kevinrenskers/raml2html 0.30.0">
- <link rel=stylesheet href=http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css>
- <link rel=stylesheet href=http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/default.min.css>
- <script type=text/javascript src=http://code.jquery.com/jquery-1.11.0.min.js></script>
- <script type=text/javascript src=http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js></script>
- <script type=text/javascript src=http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/highlight.min.js></script>
- <script type=text/javascript>
- $(document).ready(function () {
- $('.page-header pre code, .top-resource-description pre code').each(function (i, block) {
- hljs.highlightBlock(block);
- });
-
- $('[data-toggle]').click(function () {
- var selector = $(this).data('target') + ' pre code';
- $(selector).each(function (i, block) {
- hljs.highlightBlock(block);
- });
- });
- });
- </script>
- <style>
- .hljs {
- background: transparent;
- }
-
- .parent {
- color: #999;
- }
-
- .list-group-item > .badge {
- float: none;
- margin-right: 6px;
- }
-
- .panel-title > .methods {
- float: right;
- }
-
- .badge {
- border-radius: 0;
- text-transform: uppercase;
- width: 70px;
- font-weight: normal;
- color: #f3f3f6;
- line-height: normal;
- }
-
- .badge_get {
- background-color: #63a8e2;
- }
-
- .badge_post {
- background-color: #6cbd7d;
- }
-
- .badge_put {
- background-color: #22bac4;
- }
-
- .badge_delete {
- background-color: #d26460;
- }
-
- .list-group, .panel-group {
- margin-bottom: 0;
- }
-
- .panel-group .panel + .panel-white {
- margin-top: 0;
- }
-
- .panel-group .panel-white {
- border-bottom: 1px solid #F5F5F5;
- border-radius: 0;
- }
-
- .panel-white:last-child {
- border-bottom-color: white;
- -webkit-box-shadow: none;
- box-shadow: none;
- }
-
- .panel-white .panel-heading {
- background: white;
- }
-
- .tab-pane ul {
- padding-left: 2em;
- }
-
- .tab-pane h2 {
- font-size: 1.2em;
- padding-bottom: 4px;
- border-bottom: 1px solid #ddd;
- }
-
- .tab-pane h3 {
- font-size: 1.1em;
- }
-
- .tab-content {
- border-left: 1px solid #ddd;
- border-right: 1px solid #ddd;
- border-bottom: 1px solid #ddd;
- padding: 10px;
- }
-
- #sidebar {
- margin-top: 30px;
- }
-
- .top-resource-description {
- border-bottom: 1px solid #ddd;
- background: #fcfcfc;
- padding: 15px 15px 0 15px;
- margin: -15px -15px 10px -15px;
- }
-
- .resource-description {
- border-bottom: 1px solid #fcfcfc;
- background: #fcfcfc;
- padding: 15px 15px 0 15px;
- margin: -15px -15px 10px -15px;
- }
-
- .panel > .panel-body > .panel-group > .panel:first-child .resource-description {
- display: none;
- }
-
- .list-group .badge {
- float: left;
- }
-
- .method_description {
- margin-left: 85px;
- }
-
- .method_description p:last-child {
- margin: 0;
- }
- </style>
-</head>
-<body data-spy=scroll data-target=#sidebar>
-<div class=container>
- <div class=row>
- <div class=col-md-9 role=main>
- <div class=page-header>
- <h1>Kubernetes API documentation
- <small>version v1beta1</small>
- </h1>
- <p>http://server/api/v1beta1</p>
-
- <h3 id=Overview><a href=#Overview>Overview</a></h3>
-
- <p>The Kubernetes API currently manages 3 main resources: <code>pods</code>, <code>replicationControllers</code>,
- and <code>services</code>. Pods correspond to colocated groups of <a href=http://docker.io>Docker
- containers</a> with shared volumes, as supported by <a
- href=https://developers.google.com/compute/docs/containers>Google Cloud Platform's container-vm
- images</a>. Singleton pods can be created directly via the <code>/pods</code> endpoint. Sets of pods may
- created, maintained, and scaled using replicationControllers. Services create load-balanced targets for sets
- of pods.</p>
-
- <h3 id=Resource-identifiers><a href=#Resource-identifiers>Resource identifiers</a></h3>
-
- <p>Each resource has a string <code>id</code> and list of key-value <code>labels</code>. The <code>id</code> is
- generated by the system and is guaranteed to be unique in space and time across all resources.
- <code>labels</code> is a map of string (key) to string (value). Each resource may have at most one label with
- a particular key. Individual labels are used to specify identifying metadata that can be used to define sets
- of resources by specifying required labels. Examples of typical pod label keys include <code>stage</code>,
- <code>service</code>, <code>name</code>, <code>tier</code>, <code>partition</code>, and <code>track</code>,
- but you are free to develop your own conventions.</p>
-
- <h3 id=Creation-semantics><a href=#Creation-semantics>Creation semantics</a></h3>
-
- <p>Creation is currently not idempotent. We plan to add a modification token to each resource. A unique value
- for the token should be provided by the user during creation. If the user specifies a duplicate token at
- creation time, the system should return an error with a pointer to the existing resource with that token. In
- this way a user can deterministically recover from a dropped connection during a resource creation
- request.</p>
-
- <h3 id=Update-semantics><a href=#Update-semantics>Update semantics</a></h3>
-
- <p>Custom verbs are minimized and are used only for 'edge triggered' actions such as a reboot. Resource
- descriptions are generally set up with <code>desiredState</code> for the user provided parameters and <code>currentState</code>
- for the actual system state. While consistent terminology is used across these two stanzas they do not match
- member for member.</p>
-
- <p>When a new version of a resource is PUT the <code>desiredState</code> is updated and available immediately.
- Over time the system will work to bring the <code>currentState</code> into line with the
- <code>desiredState</code>. The system will drive toward the most recent <code>desiredState</code> regardless
- of previous versions of that stanza. In other words, if a value is changed from 2 to 5 in one PUT and then
- back down to 3 in another PUT the system isn't required to 'touch base' at 5 before making 3 the
- <code>currentState</code>.</p>
-
- <p>When doing an update, we assume that the entire <code>desiredState</code> stanza is specified. If a field is
- omitted it is assumed that the user is looking to delete that field. It is viable for a user to GET the
- resource, modify what they like in the <code>desiredState</code> or labels stanzas and then PUT it back. If
- the <code>currentState</code> is included in the PUT it will be silently ignored.</p>
-
- <p>While currently unspecified, it is intended that concurrent modification should be accomplished with
- optimistic locking of resources. We plan to add a modification token to each resource. If this is included
- with the PUT operation the system will verify that there haven't been other successful mutations to the
- resource during a read/modify/write cycle. The correct client action at this point is to GET the resource
- again, apply the changes afresh and try submitting again.</p>
-
- <p>Note that updates currently only work for replicationControllers and services, but not for pods. Label
- updates have not yet been implemented, either.</p></div>
- <div class="panel panel-default">
- <div class=panel-heading><h3 id=_pods class=panel-title>/pods</h3></div>
- <div class=panel-body>
- <div class=panel-group>
- <div class="panel panel-white">
- <div class=panel-heading><h4 class=panel-title><a class=collapsed data-toggle=collapse
- href=#panel__pods><span class=parent></span>/pods</a>
- <span class=methods><a href=# data-toggle=modal data-target=#_pods_get><span
- class="badge badge_get">get</span></a> <a href=# data-toggle=modal data-target=#_pods_post><span
- class="badge badge_post">post</span></a></span></h4></div>
- <div id=panel__pods class="panel-collapse collapse">
- <div class=panel-body>
- <div class=list-group><a href=# data-toggle=modal data-target=#_pods_get class=list-group-item><span
- class="badge badge_get">get</span>
-
- <div class=method_description><p>List all pods on this cluster</p></div>
- <div class=clearfix></div>
- </a> <a href=# data-toggle=modal data-target=#_pods_post class=list-group-item><span
- class="badge badge_post">post</span>
-
- <div class=method_description><p>Create a new pod. currentState is ignored if present.</p></div>
- <div class=clearfix></div>
- </a></div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_pods_get>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_get">get</span> <span
- class=parent></span>/pods</h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>List all pods on this cluster</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_pods_get_request data-toggle=tab>Request</a></li>
- <li><a href=#_pods_get_response data-toggle=tab>Response</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_pods_get_request></div>
- <div class=tab-pane id=_pods_get_response><h2>HTTP status code <a href=http://httpstatus.es/200
- target=_blank>200</a></h2>
-
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "kind": "PodList",
- "apiVersion": "v1beta1",
- "items": [
- {
- "id": "my-pod-1",
- "labels": {
- "name": "testRun",
- "replicationController": "testRun"
- },
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "id": "my-pod-1",
- "containers": [{
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [{
- "hostPort": 8080,
- "containerPort": 80
- }]
- }]
- }
- },
- "currentState": {
- "host": "host-1"
- }
- },
- {
- "id": "my-pod-2",
- "labels": {
- "name": "testRun",
- "replicationController": "testRun"
- },
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "id": "my-pod-2",
- "containers": [{
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [{
- "hostPort": 8080,
- "containerPort": 80
- }]
- }]
- }
- },
- "currentState": {
- "host": "host-2"
- }
- }
- ]
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_pods_post>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_post">post</span> <span
- class=parent></span>/pods</h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Create a new pod. currentState is ignored if present.</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_pods_post_request data-toggle=tab>Request</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_pods_post_request><h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Schema</strong>:<pre><code>{
- "$schema": "http://json-schema.org/draft-03/schema",
- "type": "object",
- "required": false,
- "description": "Pod resource. A pod corresponds to a co-located group of [Docker
- containers](http://docker.io).",
- "properties": {
- "kind": {
- "type": "string",
- "required": false
- },
- "id": {
- "type": "string",
- "required": false
- },
- "creationTimestamp": {
- "type": "string",
- "required": false
- },
- "selfLink": {
- "type": "string",
- "required": false
- },
- "desiredState": {
- "type": "object",
- "required": false,
- "description": "The desired configuration of the pod",
- "properties": {
- "manifest": {
- "type": "object",
- "required": false,
- "description": "Manifest describing group of [Docker containers](http://docker.io);
- compatible with format used by [Google Cloud Platform's container-vm
- images](https://developers.google.com/compute/docs/containers)"
- },
- "status": {
- "type": "string",
- "required": false,
- "description": ""
- },
- "host": {
- "type": "string",
- "required": false,
- "description": ""
- },
- "hostIP": {
- "type": "string",
- "required": false,
- "description": ""
- },
- "info": {
- "type": "object",
- "required": false,
- "description": ""
- }
- }
- },
- "currentState": {
- "type": "object",
- "required": false,
- "description": "The current configuration and status of the pod. Fields in common with
- desiredState have the same meaning.",
- "properties": {
- "manifest": {
- "type": "object",
- "required": false
- },
- "status": {
- "type": "string",
- "required": false
- },
- "host": {
- "type": "string",
- "required": false
- },
- "hostIP": {
- "type": "string",
- "required": false
- },
- "info": {
- "type": "object",
- "required": false
- }
- }
- },
- "labels": {
- "type": "object",
- "required": false
- }
- }
- }
- </code></pre>
- </small>
- </p>
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "kind": "Pod",
- "apiVersion": "v1beta1",
- "id": "php",
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "id": "php",
- "containers": [{
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [{
- "containerPort": 80,
- "hostPort": 8080
- }],
- "livenessProbe": {
- "enabled": true,
- "type": "http",
- "initialDelaySeconds": 30,
- "httpGet": {
- "path": "/index.html",
- "port": "8080"
- }
- }
- }]
- }
- },
- "labels": {
- "name": "foo"
- }
- }
-
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="panel panel-white">
- <div class=panel-heading><h4 class=panel-title><a class=collapsed data-toggle=collapse
- href=#panel__pods__podId_><span
- class=parent>/pods</span>/{podId}</a> <span class=methods><a href=# data-toggle=modal
- data-target=#_pods__podId__get><span
- class="badge badge_get">get</span></a> <a href=# data-toggle=modal data-target=#_pods__podId__put><span
- class="badge badge_put">put</span></a> <a href=# data-toggle=modal
- data-target=#_pods__podId__delete><span
- class="badge badge_delete">delete</span></a></span></h4></div>
- <div id=panel__pods__podId_ class="panel-collapse collapse">
- <div class=panel-body>
- <div class=list-group><a href=# data-toggle=modal data-target=#_pods__podId__get
- class=list-group-item><span class="badge badge_get">get</span>
-
- <div class=method_description><p>Get a specific pod</p></div>
- <div class=clearfix></div>
- </a> <a href=# data-toggle=modal data-target=#_pods__podId__put class=list-group-item><span
- class="badge badge_put">put</span>
-
- <div class=method_description><p>Update a pod</p></div>
- <div class=clearfix></div>
- </a> <a href=# data-toggle=modal data-target=#_pods__podId__delete class=list-group-item><span
- class="badge badge_delete">delete</span>
-
- <div class=method_description><p>Delete a specific pod</p></div>
- <div class=clearfix></div>
- </a></div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_pods__podId__get>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_get">get</span> <span class=parent>/pods</span>/{podId}
- </h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Get a specific pod</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_pods__podId__get_request data-toggle=tab>Request</a></li>
- <li><a href=#_pods__podId__get_response data-toggle=tab>Response</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_pods__podId__get_request><h3>URI Parameters</h3>
- <ul>
- <li><strong>podId</strong>: <em>required (string)</em></li>
- </ul>
- </div>
- <div class=tab-pane id=_pods__podId__get_response><h2>HTTP status code <a
- href=http://httpstatus.es/200 target=_blank>200</a></h2>
-
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "kind": "Pod",
- "apiVersion": "v1beta1",
- "id": "php",
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "id": "php",
- "containers": [{
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [{
- "containerPort": 80,
- "hostPort": 8080
- }],
- "livenessProbe": {
- "enabled": true,
- "type": "http",
- "initialDelaySeconds": 30,
- "httpGet": {
- "path": "/index.html",
- "port": "8080"
- }
- }
- }]
- }
- },
- "labels": {
- "name": "foo"
- }
- }
-
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_pods__podId__put>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_put">put</span> <span class=parent>/pods</span>/{podId}
- </h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Update a pod</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_pods__podId__put_request data-toggle=tab>Request</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_pods__podId__put_request><h3>URI Parameters</h3>
- <ul>
- <li><strong>podId</strong>: <em>required (string)</em></li>
- </ul>
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Schema</strong>:<pre><code>{
- "$schema": "http://json-schema.org/draft-03/schema",
- "type": "object",
- "required": false,
- "description": "Pod resource. A pod corresponds to a co-located group of [Docker
- containers](http://docker.io).",
- "properties": {
- "kind": {
- "type": "string",
- "required": false
- },
- "id": {
- "type": "string",
- "required": false
- },
- "creationTimestamp": {
- "type": "string",
- "required": false
- },
- "selfLink": {
- "type": "string",
- "required": false
- },
- "desiredState": {
- "type": "object",
- "required": false,
- "description": "The desired configuration of the pod",
- "properties": {
- "manifest": {
- "type": "object",
- "required": false,
- "description": "Manifest describing group of [Docker containers](http://docker.io);
- compatible with format used by [Google Cloud Platform's container-vm
- images](https://developers.google.com/compute/docs/containers)"
- },
- "status": {
- "type": "string",
- "required": false,
- "description": ""
- },
- "host": {
- "type": "string",
- "required": false,
- "description": ""
- },
- "hostIP": {
- "type": "string",
- "required": false,
- "description": ""
- },
- "info": {
- "type": "object",
- "required": false,
- "description": ""
- }
- }
- },
- "currentState": {
- "type": "object",
- "required": false,
- "description": "The current configuration and status of the pod. Fields in common with
- desiredState have the same meaning.",
- "properties": {
- "manifest": {
- "type": "object",
- "required": false
- },
- "status": {
- "type": "string",
- "required": false
- },
- "host": {
- "type": "string",
- "required": false
- },
- "hostIP": {
- "type": "string",
- "required": false
- },
- "info": {
- "type": "object",
- "required": false
- }
- }
- },
- "labels": {
- "type": "object",
- "required": false
- }
- }
- }
- </code></pre>
- </small>
- </p>
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "kind": "Pod",
- "apiVersion": "v1beta1",
- "id": "php",
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "id": "php",
- "containers": [{
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [{
- "containerPort": 80,
- "hostPort": 8080
- }],
- "livenessProbe": {
- "enabled": true,
- "type": "http",
- "initialDelaySeconds": 30,
- "httpGet": {
- "path": "/index.html",
- "port": "8080"
- }
- }
- }]
- }
- },
- "labels": {
- "name": "foo"
- }
- }
-
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_pods__podId__delete>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_delete">delete</span> <span
- class=parent>/pods</span>/{podId}</h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Delete a specific pod</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_pods__podId__delete_request data-toggle=tab>Request</a></li>
- <li><a href=#_pods__podId__delete_response data-toggle=tab>Response</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_pods__podId__delete_request><h3>URI Parameters</h3>
- <ul>
- <li><strong>podId</strong>: <em>required (string)</em></li>
- </ul>
- </div>
- <div class=tab-pane id=_pods__podId__delete_response><h2>HTTP status code <a
- href=http://httpstatus.es/200 target=_blank>200</a></h2>
-
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "success": true
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="panel panel-default">
- <div class=panel-heading><h3 id=_replicationControllers class=panel-title>/replicationControllers</h3></div>
- <div class=panel-body>
- <div class=panel-group>
- <div class="panel panel-white">
- <div class=panel-heading><h4 class=panel-title><a class=collapsed data-toggle=collapse
- href=#panel__replicationControllers><span
- class=parent></span>/replicationControllers</a> <span class=methods><a href=# data-toggle=modal
- data-target=#_replicationControllers_get><span
- class="badge badge_get">get</span></a> <a href=# data-toggle=modal
- data-target=#_replicationControllers_post><span
- class="badge badge_post">post</span></a></span></h4></div>
- <div id=panel__replicationControllers class="panel-collapse collapse">
- <div class=panel-body>
- <div class=list-group><a href=# data-toggle=modal data-target=#_replicationControllers_get
- class=list-group-item><span class="badge badge_get">get</span>
-
- <div class=method_description><p>List all replicationControllers on this cluster</p></div>
- <div class=clearfix></div>
- </a> <a href=# data-toggle=modal data-target=#_replicationControllers_post class=list-group-item><span
- class="badge badge_post">post</span>
-
- <div class=method_description><p>Create a new controller. currentState is ignored if present.</p>
- </div>
- <div class=clearfix></div>
- </a></div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_replicationControllers_get>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_get">get</span> <span
- class=parent></span>/replicationControllers</h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>List all replicationControllers on this cluster</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_replicationControllers_get_request data-toggle=tab>Request</a></li>
- <li><a href=#_replicationControllers_get_response data-toggle=tab>Response</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_replicationControllers_get_request></div>
- <div class=tab-pane id=_replicationControllers_get_response><h2>HTTP status code <a
- href=http://httpstatus.es/200 target=_blank>200</a></h2>
-
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "kind": "ReplicationControllerList",
- "apiVersion": "v1beta1",
- "items": [
- {
- "id": "testRun",
- "desiredState": {
- "replicas": 2,
- "replicaSelector": {
- "name": "testRun"
- },
- "podTemplate": {
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "image": "dockerfile/nginx",
- "networkPorts": [
- {
- "hostPort": 8080,
- "containerPort": 80
- }
- ]
- }
- },
- "labels": {
- "name": "testRun"
- }
- }
- },
- "labels": {
- "name": "testRun"
- }
- }
- ]
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_replicationControllers_post>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_post">post</span> <span
- class=parent></span>/replicationControllers</h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Create a new controller. currentState is ignored if present.</p>
- </div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_replicationControllers_post_request data-toggle=tab>Request</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_replicationControllers_post_request><h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Schema</strong>:<pre><code>{
- "$schema": "http://json-schema.org/draft-03/schema",
- "type": "object",
- "required": false,
- "description": "A replicationController resource. A replicationController helps to create
- and manage a set of pods. It acts as a factory to create new pods based on a template. It
- ensures that there are a specific number of pods running. If fewer pods are running than
- `replicas` then the needed pods are generated using `podTemplate`. If
- more pods are running than `replicas`, then excess pods are deleted.",
- "properties": {
- "kind": {
- "type": "string",
- "required": false
- },
- "id": {
- "type": "string",
- "required": false
- },
- "creationTimestamp": {
- "type": "string",
- "required": false
- },
- "selfLink": {
- "type": "string",
- "required": false
- },
- "desiredState": {
- "type": "object",
- "required": false,
- "description": "The desired configuration of the replicationController",
- "properties": {
- "replicas": {
- "type": "number",
- "required": false,
- "description": "Number of pods desired in the set"
- },
- "replicaSelector": {
- "type": "object",
- "required": false,
- "description": "Required labels used to identify pods in the set"
- },
- "podTemplate": {
- "type": "object",
- "required": false,
- "description": "Template from which to create new pods, as necessary. Identical to pod
- schema."
- }
- }
- },
- "labels": {
- "type": "object",
- "required": false
- }
- }
- }
- </code></pre>
- </small>
- </p>
- <p>
- <small><strong>Example</strong>:<pre><code> {
- "id": "nginxController",
- "apiVersion": "v1beta1",
- "kind": "ReplicationController",
- "desiredState": {
- "replicas": 2,
- "replicaSelector": {"name": "nginx"},
- "podTemplate": {
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "id": "nginxController",
- "containers": [{
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [{"containerPort": 80, "hostPort": 8080}]
- }]
- }
- },
- "labels": {"name": "nginx"}
- }},
- "labels": {"name": "nginx"}
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="panel panel-white">
- <div class=panel-heading><h4 class=panel-title><a class=collapsed data-toggle=collapse
- href=#panel__replicationControllers__controllerId_><span
- class=parent>/replicationControllers</span>/{controllerId}</a> <span class=methods><a href=#
- data-toggle=modal
- data-target=#_replicationControllers__controllerId__get><span
- class="badge badge_get">get</span></a> <a href=# data-toggle=modal
- data-target=#_replicationControllers__controllerId__put><span
- class="badge badge_put">put</span></a> <a href=# data-toggle=modal
- data-target=#_replicationControllers__controllerId__delete><span
- class="badge badge_delete">delete</span></a></span></h4></div>
- <div id=panel__replicationControllers__controllerId_ class="panel-collapse collapse">
- <div class=panel-body>
- <div class=list-group><a href=# data-toggle=modal
- data-target=#_replicationControllers__controllerId__get
- class=list-group-item><span class="badge badge_get">get</span>
-
- <div class=method_description><p>Get a specific controller</p></div>
- <div class=clearfix></div>
- </a> <a href=# data-toggle=modal data-target=#_replicationControllers__controllerId__put
- class=list-group-item><span class="badge badge_put">put</span>
-
- <div class=method_description><p>Update a controller</p></div>
- <div class=clearfix></div>
- </a> <a href=# data-toggle=modal data-target=#_replicationControllers__controllerId__delete
- class=list-group-item><span class="badge badge_delete">delete</span>
-
- <div class=method_description><p>Delete a specific controller</p></div>
- <div class=clearfix></div>
- </a></div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_replicationControllers__controllerId__get>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_get">get</span> <span class=parent>/replicationControllers</span>/{controllerId}
- </h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Get a specific controller</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_replicationControllers__controllerId__get_request data-toggle=tab>Request</a>
- </li>
- <li><a href=#_replicationControllers__controllerId__get_response data-toggle=tab>Response</a>
- </li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_replicationControllers__controllerId__get_request><h3>URI
- Parameters</h3>
- <ul>
- <li><strong>controllerId</strong>: <em>required (string)</em></li>
- </ul>
- </div>
- <div class=tab-pane id=_replicationControllers__controllerId__get_response><h2>HTTP status code
- <a href=http://httpstatus.es/200 target=_blank>200</a></h2>
-
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Example</strong>:<pre><code> {
- "id": "nginxController",
- "apiVersion": "v1beta1",
- "kind": "ReplicationController",
- "desiredState": {
- "replicas": 2,
- "replicaSelector": {"name": "nginx"},
- "podTemplate": {
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "id": "nginxController",
- "containers": [{
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [{"containerPort": 80, "hostPort": 8080}]
- }]
- }
- },
- "labels": {"name": "nginx"}
- }},
- "labels": {"name": "nginx"}
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_replicationControllers__controllerId__put>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_put">put</span> <span class=parent>/replicationControllers</span>/{controllerId}
- </h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Update a controller</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_replicationControllers__controllerId__put_request data-toggle=tab>Request</a>
- </li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_replicationControllers__controllerId__put_request><h3>URI
- Parameters</h3>
- <ul>
- <li><strong>controllerId</strong>: <em>required (string)</em></li>
- </ul>
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Schema</strong>:<pre><code>{
- "$schema": "http://json-schema.org/draft-03/schema",
- "type": "object",
- "required": false,
- "description": "A replicationController resource. A replicationController helps to create
- and manage a set of pods. It acts as a factory to create new pods based on a template. It
- ensures that there are a specific number of pods running. If fewer pods are running than
- `replicas` then the needed pods are generated using `podTemplate`. If
- more pods are running than `replicas`, then excess pods are deleted.",
- "properties": {
- "kind": {
- "type": "string",
- "required": false
- },
- "id": {
- "type": "string",
- "required": false
- },
- "creationTimestamp": {
- "type": "string",
- "required": false
- },
- "selfLink": {
- "type": "string",
- "required": false
- },
- "desiredState": {
- "type": "object",
- "required": false,
- "description": "The desired configuration of the replicationController",
- "properties": {
- "replicas": {
- "type": "number",
- "required": false,
- "description": "Number of pods desired in the set"
- },
- "replicaSelector": {
- "type": "object",
- "required": false,
- "description": "Required labels used to identify pods in the set"
- },
- "podTemplate": {
- "type": "object",
- "required": false,
- "description": "Template from which to create new pods, as necessary. Identical to pod
- schema."
- }
- }
- },
- "labels": {
- "type": "object",
- "required": false
- }
- }
- }
- </code></pre>
- </small>
- </p>
- <p>
- <small><strong>Example</strong>:<pre><code> {
- "id": "nginxController",
- "apiVersion": "v1beta1",
- "kind": "ReplicationController",
- "desiredState": {
- "replicas": 2,
- "replicaSelector": {"name": "nginx"},
- "podTemplate": {
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "id": "nginxController",
- "containers": [{
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [{"containerPort": 80, "hostPort": 8080}]
- }]
- }
- },
- "labels": {"name": "nginx"}
- }},
- "labels": {"name": "nginx"}
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_replicationControllers__controllerId__delete>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_delete">delete</span> <span
- class=parent>/replicationControllers</span>/{controllerId}</h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Delete a specific controller</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_replicationControllers__controllerId__delete_request data-toggle=tab>Request</a>
- </li>
- <li><a href=#_replicationControllers__controllerId__delete_response data-toggle=tab>Response</a>
- </li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_replicationControllers__controllerId__delete_request><h3>URI
- Parameters</h3>
- <ul>
- <li><strong>controllerId</strong>: <em>required (string)</em></li>
- </ul>
- </div>
- <div class=tab-pane id=_replicationControllers__controllerId__delete_response><h2>HTTP status
- code <a href=http://httpstatus.es/200 target=_blank>200</a></h2>
-
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "success": true
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="panel panel-default">
- <div class=panel-heading><h3 id=_services class=panel-title>/services</h3></div>
- <div class=panel-body>
- <div class=panel-group>
- <div class="panel panel-white">
- <div class=panel-heading><h4 class=panel-title><a class=collapsed data-toggle=collapse
- href=#panel__services><span class=parent></span>/services</a>
- <span class=methods><a href=# data-toggle=modal data-target=#_services_get><span
- class="badge badge_get">get</span></a> <a href=# data-toggle=modal
- data-target=#_services_post><span
- class="badge badge_post">post</span></a></span></h4></div>
- <div id=panel__services class="panel-collapse collapse">
- <div class=panel-body>
- <div class=list-group><a href=# data-toggle=modal data-target=#_services_get
- class=list-group-item><span class="badge badge_get">get</span>
-
- <div class=method_description><p>List all services on this cluster</p></div>
- <div class=clearfix></div>
- </a> <a href=# data-toggle=modal data-target=#_services_post class=list-group-item><span
- class="badge badge_post">post</span>
-
- <div class=method_description><p>Create a new service</p></div>
- <div class=clearfix></div>
- </a></div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_services_get>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_get">get</span> <span
- class=parent></span>/services</h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>List all services on this cluster</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_services_get_request data-toggle=tab>Request</a></li>
- <li><a href=#_services_get_response data-toggle=tab>Response</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_services_get_request></div>
- <div class=tab-pane id=_services_get_response><h2>HTTP status code <a
- href=http://httpstatus.es/200 target=_blank>200</a></h2>
-
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "kind": "ServiceList",
- "apiVersion": "v1beta1",
- "items": [
- {
- "id": "example1",
- "port": 8000,
- "labels": {
- "name": "nginx"
- },
- "selector": {
- "name": "nginx"
- }
- },
- {
- "id": "example2",
- "port": 8080,
- "labels": {
- "env": "prod",
- "name": "jetty"
- },
- "selector": {
- "env": "prod",
- "name": "jetty"
- }
- }
- ]
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_services_post>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_post">post</span> <span
- class=parent></span>/services</h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Create a new service</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_services_post_request data-toggle=tab>Request</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_services_post_request><h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Schema</strong>:<pre><code>{
- "$schema": "http://json-schema.org/draft-03/schema",
- "type": "object",
- "required": false,
- "description": "A service resource.",
- "properties": {
- "kind": {
- "type": "string",
- "required": false
- },
- "id": {
- "type": "string",
- "required": false
- },
- "creationTimestamp": {
- "type": "string",
- "required": false
- },
- "selfLink": {
- "type": "string",
- "required": false
- },
- "name": {
- "type": "string",
- "required": false
- },
- "port": {
- "type": "number",
- "required": false
- },
- "containerPort": {
- "type": "string",
- "required": false
- },
- "labels": {
- "type": "object",
- "required": false
- },
- "selector": {
- "type": "object",
- "required": false
- }
- }
- }
- </code></pre>
- </small>
- </p>
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "kind": "Service",
- "apiVersion": "v1beta1",
- "id": "example",
- "port": 8000,
- "labels": {
- "name": "nginx"
- },
- "selector": {
- "name": "nginx"
- }
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="panel panel-white">
- <div class=panel-heading><h4 class=panel-title><a class=collapsed data-toggle=collapse
- href=#panel__services__serviceId_><span class=parent>/services</span>/{serviceId}</a>
- <span class=methods><a href=# data-toggle=modal data-target=#_services__serviceId__get><span
- class="badge badge_get">get</span></a> <a href=# data-toggle=modal
- data-target=#_services__serviceId__put><span
- class="badge badge_put">put</span></a> <a href=# data-toggle=modal
- data-target=#_services__serviceId__delete><span
- class="badge badge_delete">delete</span></a></span></h4></div>
- <div id=panel__services__serviceId_ class="panel-collapse collapse">
- <div class=panel-body>
- <div class=list-group><a href=# data-toggle=modal data-target=#_services__serviceId__get
- class=list-group-item><span class="badge badge_get">get</span>
-
- <div class=method_description><p>Get a specific service</p></div>
- <div class=clearfix></div>
- </a> <a href=# data-toggle=modal data-target=#_services__serviceId__put class=list-group-item><span
- class="badge badge_put">put</span>
-
- <div class=method_description><p>Update a service</p></div>
- <div class=clearfix></div>
- </a> <a href=# data-toggle=modal data-target=#_services__serviceId__delete class=list-group-item><span
- class="badge badge_delete">delete</span>
-
- <div class=method_description><p>Delete a specific service</p></div>
- <div class=clearfix></div>
- </a></div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_services__serviceId__get>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_get">get</span> <span class=parent>/services</span>/{serviceId}
- </h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Get a specific service</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_services__serviceId__get_request data-toggle=tab>Request</a></li>
- <li><a href=#_services__serviceId__get_response data-toggle=tab>Response</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_services__serviceId__get_request><h3>URI Parameters</h3>
- <ul>
- <li><strong>serviceId</strong>: <em>required (string)</em></li>
- </ul>
- </div>
- <div class=tab-pane id=_services__serviceId__get_response><h2>HTTP status code <a
- href=http://httpstatus.es/200 target=_blank>200</a></h2>
-
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "kind": "Service",
- "apiVersion": "v1beta1",
- "id": "example",
- "port": 8000,
- "labels": {
- "name": "nginx"
- },
- "selector": {
- "name": "nginx"
- }
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_services__serviceId__put>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_put">put</span> <span class=parent>/services</span>/{serviceId}
- </h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Update a service</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_services__serviceId__put_request data-toggle=tab>Request</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_services__serviceId__put_request><h3>URI Parameters</h3>
- <ul>
- <li><strong>serviceId</strong>: <em>required (string)</em></li>
- </ul>
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Schema</strong>:<pre><code>{
- "$schema": "http://json-schema.org/draft-03/schema",
- "type": "object",
- "required": false,
- "description": "A service resource.",
- "properties": {
- "kind": {
- "type": "string",
- "required": false
- },
- "id": {
- "type": "string",
- "required": false
- },
- "creationTimestamp": {
- "type": "string",
- "required": false
- },
- "selfLink": {
- "type": "string",
- "required": false
- },
- "name": {
- "type": "string",
- "required": false
- },
- "port": {
- "type": "number",
- "required": false
- },
- "containerPort": {
- "type": "string",
- "required": false
- },
- "labels": {
- "type": "object",
- "required": false
- },
- "selector": {
- "type": "object",
- "required": false
- }
- }
- }
- </code></pre>
- </small>
- </p>
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "kind": "Service",
- "apiVersion": "v1beta1",
- "id": "example",
- "port": 8000,
- "labels": {
- "name": "nginx"
- },
- "selector": {
- "name": "nginx"
- }
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" tabindex=0 id=_services__serviceId__delete>
- <div class=modal-dialog>
- <div class=modal-content>
- <div class=modal-header>
- <button type=button class=close data-dismiss=modal aria-hidden=true>×</button>
- <h4 class=modal-title id=myModalLabel><span class="badge badge_delete">delete</span> <span
- class=parent>/services</span>/{serviceId}</h4></div>
- <div class=modal-body>
- <div class="alert alert-info"><p>Delete a specific service</p></div>
- <ul class="nav nav-tabs">
- <li class=active><a href=#_services__serviceId__delete_request data-toggle=tab>Request</a></li>
- <li><a href=#_services__serviceId__delete_response data-toggle=tab>Response</a></li>
- </ul>
- <div class=tab-content>
- <div class="tab-pane active" id=_services__serviceId__delete_request><h3>URI Parameters</h3>
- <ul>
- <li><strong>serviceId</strong>: <em>required (string)</em></li>
- </ul>
- </div>
- <div class=tab-pane id=_services__serviceId__delete_response><h2>HTTP status code <a
- href=http://httpstatus.es/200 target=_blank>200</a></h2>
-
- <h3>Body</h3>
-
- <p><strong>Type: application/json</strong></p>
-
- <p>
- <small><strong>Example</strong>:<pre><code>{
- "success": true
- }
- </code></pre>
- </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class=col-md-3>
- <div id=sidebar class="hidden-print affix" role=complementary>
- <ul class="nav nav-pills nav-stacked">
- <li><a href=#_pods>/pods</a></li>
- <li><a href=#_replicationControllers>/replicationControllers</a></li>
- <li><a href=#_services>/services</a></li>
- </ul>
- </div>
- </div>
- </div>
-</div>
-</body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.raml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.raml b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.raml
deleted file mode 100644
index 6cf25c4..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/kubernetes.raml
+++ /dev/null
@@ -1,185 +0,0 @@
-#%RAML 0.8
-baseUri: http://server/api/{version}
-title: Kubernetes
-version: v1beta1
-mediaType: application/json
-documentation:
- - title: Overview
- content: |
- The Kubernetes API currently manages 3 main resources: `pods`,
- `replicationControllers`, and `services`. Pods correspond to
- colocated groups of [Docker containers](http://docker.io) with
- shared volumes, as supported by [Google Cloud Platform's
- container-vm
- images](https://developers.google.com/compute/docs/containers).
- Singleton pods can be created directly via the `/pods`
- endpoint. Sets of pods may created, maintained, and scaled using
- replicationControllers. Services create load-balanced targets
- for sets of pods.
-
- - title: Resource identifiers
- content: |
- Each resource has a string `id` and list of key-value
- `labels`. The `id` is generated by the system and is guaranteed
- to be unique in space and time across all resources. `labels`
- is a map of string (key) to string (value). Each resource may
- have at most one label with a particular key. Individual labels
- are used to specify identifying metadata that can be used to
- define sets of resources by specifying required labels. Examples
- of typical pod label keys include `stage`, `service`, `name`,
- `tier`, `partition`, and `track`, but you are free to develop
- your own conventions.
-
- - title: Creation semantics
- content: |
- Creation is currently not idempotent. We plan to add a
- modification token to each resource. A unique value for the token
- should be provided by the user during creation. If the user
- specifies a duplicate token at creation time, the system should
- return an error with a pointer to the existing resource with that
- token. In this way a user can deterministically recover from a
- dropped connection during a resource creation request.
-
- - title: Update semantics
- content: |
- Custom verbs are minimized and are used only for 'edge triggered'
- actions such as a reboot. Resource descriptions are generally set
- up with `desiredState` for the user provided parameters and
- `currentState` for the actual system state. While consistent
- terminology is used across these two stanzas they do not match
- member for member.
-
- When a new version of a resource is PUT the `desiredState` is
- updated and available immediately. Over time the system will work
- to bring the `currentState` into line with the `desiredState`. The
- system will drive toward the most recent `desiredState` regardless
- of previous versions of that stanza. In other words, if a value
- is changed from 2 to 5 in one PUT and then back down to 3 in
- another PUT the system isn't required to 'touch base' at 5 before
- making 3 the `currentState`.
-
- When doing an update, we assume that the entire `desiredState`
- stanza is specified. If a field is omitted it is assumed that the
- user is looking to delete that field. It is viable for a user to
- GET the resource, modify what they like in the `desiredState` or
- labels stanzas and then PUT it back. If the `currentState` is
- included in the PUT it will be silently ignored.
-
- While currently unspecified, it is intended that concurrent
- modification should be accomplished with optimistic locking of
- resources. We plan to add a modification token to each resource. If
- this is included with the PUT operation the system will verify
- that there haven't been other successful mutations to the
- resource during a read/modify/write cycle. The correct client
- action at this point is to GET the resource again, apply the
- changes afresh and try submitting again.
-
- Note that updates currently only work for replicationControllers
- and services, but not for pods. Label updates have not yet been
- implemented, either.
-
-/pods:
- get:
- description: List all pods on this cluster
- responses:
- 200:
- body:
- example: !include examples/pod-list.json
- post:
- description: Create a new pod. currentState is ignored if present.
- body:
- schema: !include doc/pod-schema.json
- example: !include examples/pod.json
-
- /{podId}:
- get:
- description: Get a specific pod
- responses:
- 200:
- body:
- example: !include examples/pod.json
- put:
- description: Update a pod
- body:
- schema: !include doc/pod-schema.json
- example: !include examples/pod.json
- delete:
- description: Delete a specific pod
- responses:
- 200:
- body:
- example: |
- {
- "success": true
- }
-
-/replicationControllers:
- get:
- description: List all replicationControllers on this cluster
- responses:
- 200:
- body:
- example: !include examples/controller-list.json
- post:
- description: Create a new controller. currentState is ignored if present.
- body:
- schema: !include doc/controller-schema.json
- example: !include examples/controller.json
-
- /{controllerId}:
- get:
- description: Get a specific controller
- responses:
- 200:
- body:
- example: !include examples/controller.json
- put:
- description: Update a controller
- body:
- schema: !include doc/controller-schema.json
- example: !include examples/controller.json
- delete:
- description: Delete a specific controller
- responses:
- 200:
- body:
- example: |
- {
- "success": true
- }
-
-/services:
- get:
- description: List all services on this cluster
- responses:
- 200:
- body:
- example: !include examples/service-list.json
- post:
- description: Create a new service
- body:
- schema: !include doc/service-schema.json
- example: !include examples/service.json
-
- /{serviceId}:
- get:
- description: Get a specific service
- responses:
- 200:
- body:
- example: !include examples/service.json
- put:
- description: Update a service
- body:
- schema: !include doc/service-schema.json
- example: !include examples/service.json
- delete:
- description: Delete a specific service
- responses:
- 200:
- body:
- example: |
- {
- "success": true
- }
-
[27/50] [abbrv] stratos git commit: Upgrading fabric8 kubernetes api
version to 2.2.16 and removing forked code
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesClient.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesClient.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesClient.java
deleted file mode 100644
index 78faa40..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesClient.java
+++ /dev/null
@@ -1,1618 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.builds.Builds;
-import io.fabric8.kubernetes.api.extensions.Configs;
-import io.fabric8.kubernetes.api.model.*;
-import io.fabric8.kubernetes.api.model.config.Config;
-import io.fabric8.kubernetes.api.model.config.Context;
-import io.fabric8.openshift.api.model.*;
-import io.fabric8.openshift.api.model.template.Template;
-import io.fabric8.utils.*;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
-import org.eclipse.jetty.websocket.client.WebSocketClient;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.net.URL;
-import java.util.*;
-import java.util.Objects;
-import java.util.concurrent.Callable;
-
-import static io.fabric8.kubernetes.api.KubernetesHelper.*;
-
-/**
- * A simple client interface abstracting away the details of working with
- * the {@link io.fabric8.kubernetes.api.KubernetesFactory} and the differences between
- * the core {@link io.fabric8.kubernetes.api.Kubernetes} API and the {@link io.fabric8.kubernetes.api.KubernetesExtensions}
- */
-public class KubernetesClient implements Kubernetes, KubernetesExtensions, KubernetesGlobalExtensions {
- private static final transient Logger LOG = LoggerFactory.getLogger(KubernetesClient.class);
- private static final long DEFAULT_TRIGGER_TIMEOUT = 60 * 1000;
-
- private KubernetesFactory factory;
- private Kubernetes kubernetes;
- private KubernetesExtensions kubernetesExtensions;
- private KubernetesGlobalExtensions kubernetesGlobalExtensions;
- private String namespace = defaultNamespace();
-
- public static String defaultNamespace() {
- String namespace = System.getenv("KUBERNETES_NAMESPACE");
- if (Strings.isNullOrBlank(namespace)) {
- namespace = findDefaultOpenShiftNamespace();
- }
- if (Strings.isNotBlank(namespace)) {
- return namespace;
- }
- return "default";
- }
-
- public static String findDefaultOpenShiftNamespace() {
- Config config = Configs.parseConfigs();
- if (config != null) {
- Context context = Configs.getCurrentContext(config);
- if (context != null) {
- return context.getNamespace();
- }
- }
- return null;
- }
-
- public KubernetesClient() {
- this(new KubernetesFactory());
- }
-
- public KubernetesClient(String url) {
- this(new KubernetesFactory(url));
- }
-
- public KubernetesClient(KubernetesFactory factory) {
- this.factory = factory;
- }
-
- // Properties
- //-------------------------------------------------------------------------
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- public Kubernetes getKubernetes() {
- if (kubernetes == null) {
- kubernetes = getFactory().createKubernetes();
- }
- return kubernetes;
- }
-
- public KubernetesExtensions getKubernetesExtensions() {
- if (kubernetesExtensions == null) {
- kubernetesExtensions = getFactory().createKubernetesExtensions();
- }
- return kubernetesExtensions;
- }
-
- public KubernetesGlobalExtensions getKubernetesGlobalExtensions() {
- if (kubernetesGlobalExtensions == null) {
- kubernetesGlobalExtensions = getFactory().createKubernetesGlobalExtensions();
- }
- return kubernetesGlobalExtensions;
- }
-
- public KubernetesFactory getFactory() {
- if (factory == null) {
- factory = new KubernetesFactory();
- }
- return factory;
- }
-
- public void setFactory(KubernetesFactory factory) {
- this.factory = factory;
- }
-
- public String getAddress() {
- return getFactory().getAddress();
- }
-
- public String getWriteableAddress() {
- return getFactory().getAddress();
- }
-
-
- // Delegated Kubernetes API
- //-------------------------------------------------------------------------
-
- @Override
- @GET
- @Path("namespaces")
- public NamespaceList getNamespaces() {
- return getKubernetes().getNamespaces();
- }
-
- @Override
- public String createNamespace(Namespace entity) throws Exception {
- return getKubernetes().createNamespace(entity);
- }
-
- @Override
- @GET
- @Path("namespaces/{name}")
- public Namespace getNamespace(final @NotNull String name) {
- return handle404ByReturningNull(new Callable<Namespace>() {
- @Override
- public Namespace call() throws Exception {
- return getKubernetes().getNamespace(name);
- }
- });
- }
-
- @Override
- @PUT
- @Path("namespaces/{name}")
- @Consumes("application/json")
- public String updateNamespace(@NotNull String namespaceId, Namespace entity) throws Exception {
- return getKubernetes().updateNamespace(namespaceId, entity);
- }
-
- @Override
- @DELETE
- @Path("namespaces/{name}")
- @Consumes("text/plain")
- public String deleteNamespace(@NotNull String name) throws Exception {
- return getKubernetes().deleteNamespace(name);
- }
-
- @GET
- @Path("pods")
- public PodList getPods() {
- return getPods(getNamespace());
- }
-
- @Override
- public PodList getPods(@QueryParam("namespace") String namespace) {
- validateNamespace(namespace, null);
- return getKubernetes().getPods(namespace);
- }
-
- @DELETE
- @Path("pods/{podId}")
- public String deletePod(@NotNull String podId) throws Exception {
- validateNamespace(namespace, podId);
- return getKubernetes().deletePod(podId, getNamespace());
- }
-
- @Override
- @DELETE
- @Path("pods/{podId}")
- @Consumes("text/plain")
- public String deletePod(@NotNull String podId, String namespace) throws Exception {
- validateNamespace(namespace, podId);
- return getKubernetes().deletePod(podId, namespace);
- }
-
- @GET
- @Path("replicationControllers/{controllerId}")
- @Produces("application/json")
- public ReplicationController getReplicationController(@NotNull String controllerId) {
- validateNamespace(namespace, controllerId);
- return getReplicationController(controllerId, getNamespace());
- }
-
- @Override
- public ReplicationController getReplicationController(final @PathParam("controllerId") @NotNull String controllerId, final @QueryParam("namespace") String namespace) {
- validateNamespace(namespace, controllerId);
- return handle404ByReturningNull(new Callable<ReplicationController>() {
- @Override
- public ReplicationController call() throws Exception {
- return getKubernetes().getReplicationController(controllerId, namespace);
- }
- });
- }
-
- @DELETE
- @Path("replicationControllers/{controllerId}")
- @Produces("application/json")
- public String deleteReplicationController(@NotNull String controllerId) throws Exception {
- validateNamespace(namespace, controllerId);
- return getKubernetes().deleteReplicationController(controllerId, getNamespace());
- }
-
- @Override
- @DELETE
- @Path("replicationControllers/{controllerId}")
- @Produces("application/json")
- @Consumes("text/plain")
- public String deleteReplicationController(@NotNull String controllerId, String namespace) throws Exception {
- validateNamespace(namespace, controllerId);
- return getKubernetes().deleteReplicationController(controllerId, namespace);
- }
-
- @Override
- @DELETE
- @Path("services/{serviceId}")
- @Produces("application/json")
- @Consumes("text/plain")
- public String deleteService(@NotNull String serviceId, String namespace) throws Exception {
- validateNamespace(namespace, serviceId);
- return getKubernetes().deleteService(serviceId, namespace);
- }
-
- @Path("replicationControllers")
- @GET
- @Produces("application/json")
- public ReplicationControllerList getReplicationControllers() {
- return getReplicationControllers(getNamespace());
- }
-
- @Override
- public ReplicationControllerList getReplicationControllers(@QueryParam("namespace") String namespace) {
- validateNamespace(namespace, null);
- return getKubernetes().getReplicationControllers(namespace);
- }
-
- @PUT
- @Path("replicationControllers/{controllerId}")
- @Consumes("application/json")
- public String updateReplicationController(@NotNull String controllerId, ReplicationController entity) throws Exception {
- validateNamespace(namespace, entity);
- return updateReplicationController(controllerId, entity, getNamespace());
- }
-
- @PUT
- @Path("replicationControllers/{controllerId}")
- @Consumes("application/json")
- public String updateReplicationController(@NotNull String controllerId, ReplicationController entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- if (!KubernetesHelper.hasResourceVersion(entity)) {
- // lets load it from the oldEntity
- ReplicationController oldEntity = getReplicationController(controllerId, namespace);
- if (oldEntity == null) {
- // no entity exists so lets create a new one
- return createReplicationController(entity, namespace);
- }
- String resourceVersion = KubernetesHelper.getResourceVersion(oldEntity);
- KubernetesHelper.getOrCreateMetadata(entity).setResourceVersion(resourceVersion);
- }
- return getKubernetes().updateReplicationController(controllerId, entity, namespace);
- }
-
- @PUT
- @Path("services/{serviceId}")
- @Consumes("application/json")
- public String updateService(@NotNull String serviceId, Service entity) throws Exception {
- validateNamespace(namespace, entity);
- return updateService(serviceId, entity, getNamespace());
- }
-
- @Override
- public String updateService(@PathParam("serviceId") @NotNull String serviceId, Service entity, @QueryParam("namespace") String namespace) throws Exception {
- validateNamespace(namespace, entity);
- if (!KubernetesHelper.hasResourceVersion(entity)) {
- // lets load it from the old service
- Service service = getService(serviceId, namespace);
- if (service == null) {
- // no service so lets create the service
- return createService(entity, namespace);
- }
- String resourceVersion = KubernetesHelper.getResourceVersion(service);
- KubernetesHelper.getOrCreateMetadata(entity).setResourceVersion(resourceVersion);
-
- // lets copy over some fields set on the spec by kubernetes
- ServiceSpec oldSpec = service.getSpec();
- ServiceSpec newSpec = entity.getSpec();
- if (oldSpec != null && newSpec != null) {
- if (Strings.isNullOrBlank(newSpec.getPortalIP())) {
- newSpec.setPortalIP(oldSpec.getPortalIP());
- }
- }
-
- }
- return getKubernetes().updateService(serviceId, entity, namespace);
- }
-
- @GET
- @Path("services/{serviceId}")
- @Produces("application/json")
- public Service getService(@NotNull String serviceId) {
- return getService(serviceId, getNamespace());
- }
-
- @Override
- public Service getService(final @PathParam("serviceId") @NotNull String serviceId, final @QueryParam("namespace") String namespace) {
- validateNamespace(namespace, serviceId);
- return handle404ByReturningNull(new Callable<Service>() {
- @Override
- public Service call() throws Exception {
- return getKubernetes().getService(serviceId, namespace);
- }
- });
- }
-
- @DELETE
- @Path("services/{serviceId}")
- @Produces("application/json")
- public String deleteService(@NotNull String serviceId) throws Exception {
- validateNamespace(namespace, serviceId);
- return deleteService(serviceId, getNamespace());
- }
-
- @GET
- @Path("pods/{podId}")
- public Pod getPod(@NotNull String podId) {
- return getPod(podId, getNamespace());
- }
-
- @Override
- public Pod getPod(final @PathParam("podId") @NotNull String podId, final @QueryParam("namespace") String namespace) {
- validateNamespace(namespace, podId);
- return handle404ByReturningNull(new Callable<Pod>() {
- @Override
- public Pod call() throws Exception {
- return getKubernetes().getPod(podId, namespace);
- }
- });
- }
-
- @PUT
- @Path("pods/{podId}")
- @Consumes("application/json")
- public String updatePod(@NotNull String podId, Pod entity) throws Exception {
- return updatePod(podId, entity, getNamespace());
- }
-
- @Override
- public String updatePod(@PathParam("podId") @NotNull String podId, Pod entity, @QueryParam("namespace") String namespace) throws Exception {
- validateNamespace(namespace, podId);
- return getKubernetes().updatePod(podId, entity, namespace);
- }
-
- @Path("services")
- @GET
- @Produces("application/json")
- public ServiceList getServices() {
- validateNamespace(namespace, null);
- return getServices(getNamespace());
- }
-
- @Override
- public ServiceList getServices(@QueryParam("namespace") String namespace) {
- validateNamespace(namespace, null);
- return getKubernetes().getServices(namespace);
- }
-
- @POST
- @Path("pods")
- @Consumes("application/json")
- public String createPod(Pod entity) throws Exception {
- validateNamespace(namespace, entity);
- return createPod(entity, getNamespace());
- }
-
- @Override
- @POST
- @Path("pods")
- @Consumes("application/json")
- public String createPod(Pod entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- getOrCreateMetadata(entity).setNamespace(namespace);
- return getKubernetes().createPod(entity, namespace);
- }
-
- @Path("services")
- @POST
- @Consumes("application/json")
- public String createService(Service entity) throws Exception {
- validateNamespace(namespace, entity);
- return createService(entity, getNamespace());
- }
-
- @Override
- @Path("services")
- @POST
- @Consumes("application/json")
- public String createService(Service entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- getOrCreateMetadata(entity).setNamespace(namespace);
- return getKubernetes().createService(entity, namespace);
- }
-
- @Path("replicationControllers")
- @POST
- @Consumes("application/json")
- public String createReplicationController(ReplicationController entity) throws Exception {
- validateNamespace(namespace, entity);
- return createReplicationController(entity, getNamespace());
- }
-
- @Override
- @Path("replicationControllers")
- @POST
- @Consumes("application/json")
- public String createReplicationController(ReplicationController entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- getOrCreateMetadata(entity).setNamespace(namespace);
- return getKubernetes().createReplicationController(entity, namespace);
- }
-
- @GET
- @Path("endpoints")
- public EndpointsList getEndpoints() {
- return getEndpoints(getNamespace());
- }
-
- @Override
- @GET
- @Path("endpoints")
- public EndpointsList getEndpoints(String namespace) {
- validateNamespace(namespace, null);
- return getKubernetes().getEndpoints(namespace);
- }
-
- @Override
- @GET
- @Path("endpoints/{serviceId}")
- public Endpoints endpointsForService(@NotNull String serviceId, String namespace) {
- try {
- validateNamespace(namespace, serviceId);
- return getKubernetes().endpointsForService(serviceId, namespace);
- } catch (WebApplicationException e) {
- if (e.getResponse().getStatus() == 404) {
- // does not exist
- Endpoints answer = new Endpoints();
- answer.setSubsets(new ArrayList<EndpointSubset>());
- return answer;
- } else {
- throw e;
- }
- }
- }
-
- @Override
- @Path("namespaces/{namespace}/secrets")
- @POST
- @Consumes("application/json")
- public String createSecret(Secret entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetes().createSecret(entity, namespace);
- }
-
- @Override
- @DELETE
- @Path("namespaces/{namespace}/secrets/{secretId}")
- @Produces("application/json")
- @Consumes("text/plain")
- public String deleteSecret(@NotNull String secretId, String namespace) throws Exception {
- validateNamespace(namespace, secretId);
- return getKubernetes().deleteSecret(secretId, namespace);
- }
-
- @Override
- @GET
- @Path("namespaces/{namespace}/secrets/{secretId}")
- @Produces("application/json")
- public Secret getSecret(final @NotNull String secretId, final String namespace) {
- validateNamespace(namespace, secretId);
- return handle404ByReturningNull(new Callable<Secret>() {
- @Override
- public Secret call() throws Exception {
- return getKubernetes().getSecret(secretId, namespace);
- }
- });
- }
-
- @Override
- @Path("namespaces/{namespace}/secrets")
- @GET
- @Produces("application/json")
- public SecretList getSecrets(final String namespace) {
- validateNamespace(namespace, null);
- SecretList answer = handle404ByReturningNull(new Callable<SecretList>() {
- @Override
- public SecretList call() throws Exception {
- return getKubernetes().getSecrets(namespace);
- }
- });
- if (answer == null) {
- answer = new SecretList();
- }
- return answer;
- }
-
- @Override
- @PUT
- @Path("namespaces/{namespace}/secrets/{secretId}")
- @Consumes("application/json")
- public String updateSecret(@NotNull String secretId, Secret entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetes().updateSecret(secretId, entity, namespace);
- }
-
- @Override
- @GET
- @Path("nodes")
- public NodeList getNodes() {
- return getKubernetes().getNodes();
- }
-
- @Override
- @GET
- @Path("nodes/{nodeId}")
- public Node node(@NotNull String nodeId) {
- return getKubernetes().node(nodeId);
- }
-
- // Delegated KubernetesExtensions API
- //-------------------------------------------------------------------------
-
-
- @Override
- @POST
- @Path("oauthclients")
- @Consumes("application/json")
- public String createOAuthClient(OAuthClient entity) throws Exception {
- getOrCreateMetadata(entity).setNamespace(namespace);
- String id = getName(entity);
- LOG.info("Creating OAuthClient " + id + " " + summaryText(entity));
- return getKubernetesGlobalExtensions().createOAuthClient(entity);
- }
-
- @Override
- @DELETE
- @Path("oauthclients/{name}")
- public String deleteOAuthClient(@NotNull String name) {
- LOG.info("Deleting OAuthClient " + name);
- return getKubernetesGlobalExtensions().deleteOAuthClient(name);
- }
-
- @Override
- @GET
- @Path("oauthclients/{name}")
- public OAuthClient getOAuthClient(final @NotNull String name) {
- return handle404ByReturningNull(new Callable<OAuthClient>() {
- @Override
- public OAuthClient call() throws Exception {
- return getKubernetesGlobalExtensions().getOAuthClient(name);
- }
- });
- }
-
- @Override
- @PUT
- @Path("oauthclients/{name}")
- @Consumes("application/json")
- public String updateOAuthClient(@NotNull String name, OAuthClient entity) throws Exception {
- LOG.info("Updating OAuthClient " + name + " " + summaryText(entity));
- return getKubernetesGlobalExtensions().updateOAuthClient(name, entity);
- }
-
- @Override
- @POST
- @Path("routes")
- public String createRoute(Route entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetesExtensions().createRoute(entity, namespace);
- }
-
- /**
- * Temporary workaround for 0.4.x of Openshift not having osapi/v1beta3
- * @param entity
- * @param namespace
- */
- public void createRouteOldAPi(Route entity, String namespace) {
- validateNamespace(namespace, entity);
-
- WebClient webClient = getFactory().createWebClient();
- String name = getName(entity);
- RouteSpec spec = entity.getSpec();
- String host = null;
- String serviceName = null;
- if (spec != null) {
- host = spec.getHost();
- ObjectReference to = spec.getTo();
- if (to != null) {
- serviceName = to.getName();
- }
- }
- if (Strings.isNullOrBlank(host)) {
- throw new IllegalArgumentException("No host defined!");
- }
- if (Strings.isNullOrBlank(serviceName)) {
- throw new IllegalArgumentException("No to.name defined!");
- }
- String json = "{ \"kind\": \"Route\", \"apiVersion\": \"v1beta1\", \"metadata\": { \"name\": \"" + name + "\"}, \"host\": \"" + host + "\", \"serviceName\": \"" + serviceName + "\"}";
- System.out.println("Posting JSON: " + json);
- Response response = webClient.path("/osapi/v1beta1/routes").query("namespace", namespace).post(json);
- Object responseEntity = response.getEntity();
- if (responseEntity instanceof InputStream) {
- InputStream inputStream = (InputStream) responseEntity;
- try {
- responseEntity = IOHelpers.readFully(inputStream);
- } catch (IOException e) {
- LOG.error("Failed to parse response: " + e, e);
- }
- }
- System.out.println("Result: " + responseEntity);
- int status = response.getStatus();
- System.out.println("Posted and got result: " + status);
- }
-
- @Override
- @POST
- @Path("deploymentConfigs")
- public String createDeploymentConfig(DeploymentConfig entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- getOrCreateMetadata(entity).setNamespace(namespace);
- return getKubernetesExtensions().createDeploymentConfig(entity, namespace);
- }
-
- @Override
- @POST
- @Path("templates")
- @Consumes("application/json")
- public String processTemplate(Template entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetesExtensions().processTemplate(entity, namespace);
- }
-
- @Override
- @Path("templates")
- @POST
- @Consumes("application/json")
- public String createTemplate(Template entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetesExtensions().createTemplate(entity, namespace);
- }
-
- @Override
- @GET
- @Path("templates/{name}")
- @Produces("application/json")
- public Template getTemplate(final @NotNull String name, final String namespace) {
- return handle404ByReturningNull(new Callable<Template>() {
- @Override
- public Template call() throws Exception {
- return getKubernetesExtensions().getTemplate(name, namespace);
- }
- });
- }
-
- @Override
- @PUT
- @Path("templates/{name}")
- @Consumes("application/json")
- public String updateTemplate(@NotNull String name, Template entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- if (!KubernetesHelper.hasResourceVersion(entity)) {
- // lets load it from the oldEntity
- ReplicationController oldEntity = getReplicationController(name, namespace);
- if (oldEntity == null) {
- // no entity exists so lets create a new one
- return createTemplate(entity, namespace);
- }
- String resourceVersion = KubernetesHelper.getResourceVersion(oldEntity);
- KubernetesHelper.getOrCreateMetadata(entity).setResourceVersion(resourceVersion);
- }
- return getKubernetesExtensions().updateTemplate(name, entity, namespace);
- }
-
- @Override
- @DELETE
- @Path("templates/{name}")
- @Produces("application/json")
- @Consumes("text/plain")
- public String deleteTemplate(@NotNull String name, String namespace) throws Exception {
- return getKubernetesExtensions().deleteTemplate(name, namespace);
- }
-
- @Override
- @DELETE
- @Path("buildConfigs/{name}")
- public String deleteBuildConfig(@NotNull String name, String namespace) {
- validateNamespace(namespace, name);
- return getKubernetesExtensions().deleteBuildConfig(name, namespace);
- }
-
- @Override
- @DELETE
- @Path("deploymentConfigs/{name}")
- public String deleteDeploymentConfig(@NotNull String name, String namespace) {
- validateNamespace(namespace, name);
- return getKubernetesExtensions().deleteDeploymentConfig(name, namespace);
- }
-
- @GET
- @Path("routes")
- @Override
- public RouteList getRoutes(final @QueryParam("namespace") String namespace) {
- validateNamespace(namespace, null);
- RouteList answer = handle404ByReturningNull(new Callable<RouteList>() {
- @Override
- public RouteList call() throws Exception {
- return getKubernetesExtensions().getRoutes(namespace);
- }
- });
- if (answer == null) {
- answer = new RouteList();
- }
- return answer;
- }
-
- @GET
- @Path("routes/{name}")
- @Override
- public Route getRoute(final @PathParam("name") @NotNull String name, final @QueryParam("namespace") String namespace) {
- validateNamespace(namespace, name);
- return handle404ByReturningNull(new Callable<Route>() {
- @Override
- public Route call() throws Exception {
- return getKubernetesExtensions().getRoute(name, namespace);
- }
- });
- }
-
- @Override
- @PUT
- @Path("routes/{name}")
- @Consumes("application/json")
- public String updateRoute(@NotNull String name, Route entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetesExtensions().updateRoute(name, entity, namespace);
- }
-
- @Override
- @DELETE
- @Path("routes/{name}")
- public String deleteRoute(@NotNull String name, String namespace) {
- validateNamespace(namespace, name);
- return getKubernetesExtensions().deleteRoute(name, namespace);
- }
-
- @Override
- @POST
- @Path("builds")
- public String createBuild(Build entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- getOrCreateMetadata(entity).setNamespace(namespace);
- return getKubernetesExtensions().createBuild(entity, namespace);
- }
-
- @Override
- @DELETE
- @Path("builds/{name}")
- public String deleteBuild(@NotNull String name, String namespace) {
- validateNamespace(namespace, name);
- return getKubernetesExtensions().deleteBuild(name, namespace);
- }
-
- @Override
- @GET
- @Path("builds/{name}")
- public Build getBuild(final @NotNull String name, final String namespace) {
- validateNamespace(namespace, name);
- return handle404ByReturningNull(new Callable<Build>() {
- @Override
- public Build call() throws Exception {
- return getKubernetesExtensions().getBuild(name, namespace);
- }
- });
- }
-
- @Override
- @GET
- @Path("builds")
- @Produces("application/json")
- public BuildList getBuilds(final String namespace) {
- validateNamespace(namespace, null);
- BuildList answer = handle404ByReturningNull(new Callable<BuildList>() {
- @Override
- public BuildList call() throws Exception {
- return getKubernetesExtensions().getBuilds(namespace);
- }
- });
- if (answer == null) {
- answer = new BuildList();
- }
- return answer;
- }
-
- @Override
- @PUT
- @Path("builds/{name}")
- @Consumes("application/json")
- public String updateBuild(@NotNull String name, Build entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetesExtensions().updateBuild(name, entity, namespace);
- }
-
- @Override
- @GET
- @Path("buildConfigs/{name}")
- public BuildConfig getBuildConfig(final @NotNull String name, final String namespace) {
- validateNamespace(namespace, name);
- return handle404ByReturningNull(new Callable<BuildConfig>() {
- @Override
- public BuildConfig call() throws Exception {
- return getKubernetesExtensions().getBuildConfig(name, namespace);
- }
- });
- }
-
- @Override
- @GET
- @Path("buildConfigs")
- public BuildConfigList getBuildConfigs(String namespace) {
- validateNamespace(namespace, null);
- return getKubernetesExtensions().getBuildConfigs(namespace);
- }
-
- @Override
- @GET
- @Path("deploymentConfigs/{name}")
- public DeploymentConfig getDeploymentConfig(final @NotNull String name, final String namespace) {
- validateNamespace(namespace, name);
- return handle404ByReturningNull(new Callable<DeploymentConfig>() {
- @Override
- public DeploymentConfig call() throws Exception {
- return getKubernetesExtensions().getDeploymentConfig(name, namespace);
- }
- });
- }
-
- @Override
- @GET
- @Path("deploymentConfigs")
- public DeploymentConfigList getDeploymentConfigs(final String namespace) {
- validateNamespace(namespace, null);
- DeploymentConfigList answer = handle404ByReturningNull(new Callable<DeploymentConfigList>() {
- @Override
- public DeploymentConfigList call() throws Exception {
- return getKubernetesExtensions().getDeploymentConfigs(namespace);
- }
- });
- if (answer == null) {
- answer = new DeploymentConfigList();
- }
- return answer;
- }
-
- @Override
- @PUT
- @Path("buildConfigs/{name}")
- @Consumes("application/json")
- public String updateBuildConfig(@NotNull String name, BuildConfig entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetesExtensions().updateBuildConfig(name, entity, namespace);
- }
-
- @Override
- @PUT
- @Path("deploymentConfigs/{name}")
- @Consumes("application/json")
- public String updateDeploymentConfig(@NotNull String name, DeploymentConfig entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetesExtensions().updateDeploymentConfig(name, entity, namespace);
- }
-
- @Override
- @POST
- @Path("buildConfigs")
- public String createBuildConfig(BuildConfig entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- getOrCreateMetadata(entity).setNamespace(namespace);
- return getKubernetesExtensions().createBuildConfig(entity, namespace);
- }
-
- @Override
- @GET
- @Path("imageStreams/{name}")
- public ImageStream getImageStream(final @NotNull String name, final String namespace) {
- validateNamespace(namespace, name);
- return handle404ByReturningNull(new Callable<ImageStream>() {
- @Override
- public ImageStream call() throws Exception {
- return getKubernetesExtensions().getImageStream(name, namespace);
- }
- });
- }
-
- @Override
- @GET
- @Path("imageStreams")
- public ImageStreamList getImageStreams(final String namespace) {
- validateNamespace(namespace, null);
- ImageStreamList answer = handle404ByReturningNull(new Callable<ImageStreamList>() {
- @Override
- public ImageStreamList call() throws Exception {
- return getKubernetesExtensions().getImageStreams(namespace);
- }
- });
- if (answer == null) {
- answer = new ImageStreamList();
- }
- return answer;
- }
-
- @Override
- @PUT
- @Path("imageStreams/{name}")
- @Consumes("application/json")
- public String updateImageStream(@NotNull String name, ImageStream entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- return getKubernetesExtensions().updateImageStream(name, entity, namespace);
- }
-
- @Override
- @DELETE
- @Path("imageStreams/{name}")
- public String deleteImageStream(@NotNull String name, String namespace) {
- validateNamespace(namespace, name);
- return getKubernetesExtensions().deleteImageStream(name, namespace);
- }
-
- @Override
- @POST
- @Path("imageStreams")
- public String createImageStream(ImageStream entity, String namespace) throws Exception {
- validateNamespace(namespace, entity);
- getOrCreateMetadata(entity).setNamespace(namespace);
- return getKubernetesExtensions().createImageStream(entity, namespace);
- }
-
- @Override
- @POST
- @Path("buildConfigHooks/{name}/{secret}/{type}")
- public String triggerBuild(@NotNull String name, String namespace, @NotNull String secret, @NotNull String type, byte[] body) {
- validateNamespace(namespace, name);
- return getKubernetesExtensions().triggerBuild(name, namespace, secret, type, body);
- }
-
- // Helper methods
- //-------------------------------------------------------------------------
- public void deletePod(Pod entity, String namespace) throws Exception {
- if (Strings.isNotBlank(namespace)) {
- entity.getMetadata().setNamespace(namespace);
- }
- deletePod(entity);
- }
-
- public void deletePod(Pod entity) throws Exception {
- String namespace = KubernetesHelper.getNamespace(entity);
- String id = getName(entity);
- validateNamespace(namespace, entity);
- LOG.info("Deleting Pod: " + id + " namespace: " + namespace);
- if (Strings.isNotBlank(namespace)) {
- deletePod(id, namespace);
- } else {
- deletePod(id);
- }
- }
-
- public void deleteService(Service entity, String namespace) throws Exception {
- if (Strings.isNotBlank(namespace)) {
- entity.getMetadata().setNamespace(namespace);
- }
- deleteService(entity);
- }
-
- public void deleteService(Service entity) throws Exception {
- String namespace = KubernetesHelper.getNamespace(entity);
- String id = getName(entity);
- validateNamespace(namespace, entity);
- LOG.info("Deleting Service: " + id + " namespace: " + namespace);
- if (Strings.isNotBlank(namespace)) {
- deleteService(id, namespace);
- } else {
- deleteService(id);
- }
- }
-
- public void deleteReplicationControllerAndPods(ReplicationController replicationController, String namespace) throws Exception {
- if (Strings.isNotBlank(namespace)) {
- replicationController.getMetadata().setNamespace(namespace);
- }
- deleteReplicationControllerAndPods(replicationController);
- }
-
- public void deleteReplicationControllerAndPods(ReplicationController replicationController) throws Exception {
- String id = getName(replicationController);
- String namespace = KubernetesHelper.getNamespace(replicationController);
- validateNamespace(namespace, replicationController);
- LOG.info("Deleting ReplicationController: " + id + " namespace: " + namespace);
- deleteReplicationController(replicationController);
- List<Pod> podsToDelete = getPodsForReplicationController(replicationController);
- for (Pod pod : podsToDelete) {
- deletePod(pod);
- }
- }
-
- /**
- * Validates a namespace is supplied giving a meaningful error if not
- */
- protected void validateNamespace(String namespace, Object entity) {
- if (Strings.isNullOrBlank(namespace)) {
- String message = "No namespace supported";
- if (entity != null) {
- message += " for " + KubernetesHelper.summaryText(entity);
- }
- throw new IllegalArgumentException(message);
- }
- }
-
- public void deleteReplicationController(ReplicationController replicationController, String namespace) throws Exception {
- if (Strings.isNotBlank(namespace)) {
- replicationController.getMetadata().setNamespace(namespace);
- }
- deleteReplicationController(replicationController);
- }
-
- public void deleteReplicationController(ReplicationController entity) throws Exception {
- String namespace = KubernetesHelper.getNamespace(entity);
- String id = getName(entity);
- if (Strings.isNotBlank(namespace)) {
- deleteReplicationController(id, namespace);
- } else {
- deleteReplicationController(id);
- }
- }
-
- public ReplicationController getReplicationControllerForPod(String podId) {
- Pod pod = getPod(podId);
- return getReplicationControllerForPod(pod);
- }
-
- public ReplicationController getReplicationControllerForPod(Pod pod) {
- if (pod != null) {
- Map<String, String> labels = pod.getMetadata().getLabels();
- if (labels != null && labels.size() > 0) {
- ReplicationControllerList replicationControllers = getReplicationControllers();
- List<ReplicationController> items = replicationControllers.getItems();
- if (items != null) {
- List<ReplicationController> matched = new ArrayList<>();
- for (ReplicationController item : items) {
- if (filterLabels(labels, item.getMetadata().getLabels())) {
- matched.add(item);
- }
- }
- int matchedSize = matched.size();
- if (matchedSize > 1) {
- // lets remove all the RCs with no current replicas and hope there's only 1 left
- List<ReplicationController> nonZeroReplicas = Filters.filter(matched, new Filter<ReplicationController>() {
- @Override
- public boolean matches(ReplicationController replicationController) {
- ReplicationControllerSpec replicationControllerSpec = replicationController.getSpec();
- if (replicationControllerSpec != null) {
- Integer desiredReplicas = replicationControllerSpec.getReplicas();
- if (desiredReplicas != null && desiredReplicas.intValue() > 0) {
- ReplicationControllerStatus currentStatus = replicationController.getStatus();
- if (currentStatus != null) {
- Integer replicas = currentStatus.getReplicas();
- if (replicas != null && replicas.intValue() > 0) {
- return true;
- }
- }
- }
- }
- return false;
- }
- });
- int size = nonZeroReplicas.size();
- if (size > 0) {
- // lets pick the first one for now :)
- return nonZeroReplicas.get(0);
- }
- }
- if (matchedSize >= 1) {
- // otherwise lets pick the first one we found
- return matched.get(0);
- }
- }
- }
- }
- return null;
- }
-
- public List<Pod> getPodsForReplicationController(ReplicationController service) {
- return KubernetesHelper.getPodsForReplicationController(service, getPodList());
- }
-
- public List<Pod> getPodsForReplicationController(String replicationControllerId) {
- ReplicationController replicationController = getReplicationController(replicationControllerId);
- if (replicationController == null) {
- return Collections.EMPTY_LIST;
- } else {
- return getPodsForReplicationController(replicationController);
- }
- }
-
- public List<Pod> getPodsForService(Service service) {
- return KubernetesHelper.getPodsForService(service, getPodList());
- }
-
- public List<Pod> getPodsForService(String serviceId) {
- Service service = getService(serviceId);
- if (service == null) {
- return Collections.EMPTY_LIST;
- } else {
- return getPodsForService(service);
- }
- }
-
- public WebSocketClient watchPods(Watcher<Pod> watcher) throws Exception {
- return watchPods(null, watcher);
- }
-
- public WebSocketClient watchPods(Map<String, String> labels, Watcher<Pod> watcher) throws Exception {
- return watchPods(getNamespace(), labels, watcher);
- }
-
- public WebSocketClient watchPods(String namespace, Map<String, String> labels, Watcher<Pod> watcher) throws Exception {
- PodList currentPodList = getPods(namespace);
- return watchPods(namespace, labels, watcher,
- currentPodList.getMetadata().getResourceVersion());
- }
-
- public WebSocketClient watchPods(String namespace, Map<String, String> labels, Watcher<Pod> watcher, String resourceVersion) throws Exception {
- return watchKubernetesEntities("pods", namespace, labels, watcher, resourceVersion);
- }
-
- public WebSocketClient watchServices(Watcher<Service> watcher) throws Exception {
- return watchServices(null, watcher);
- }
-
- public WebSocketClient watchServices(Map<String, String> labels, Watcher<Service> watcher) throws Exception {
- return watchServices(getNamespace(), labels, watcher);
- }
-
- public WebSocketClient watchServices(String namespace, Map<String, String> labels, Watcher<Service> watcher) throws Exception {
- ServiceList currentServiceList = getServices(namespace);
- return watchServices(namespace, labels, watcher,
- currentServiceList.getMetadata().getResourceVersion());
- }
-
- public WebSocketClient watchServices(String namespace, Map<String, String> labels, Watcher<Service> watcher, String resourceVersion) throws Exception {
- return watchKubernetesEntities("services", namespace, labels, watcher, resourceVersion);
- }
-
- public WebSocketClient watchEndpoints(Watcher<Endpoints> watcher) throws Exception {
- return watchEndpoints(null, watcher);
- }
-
- public WebSocketClient watchEndpoints(Map<String, String> labels, Watcher<Endpoints> watcher) throws Exception {
- return watchEndpoints(getNamespace(), labels, watcher);
- }
-
- public WebSocketClient watchEndpoints(String namespace, Map<String, String> labels, Watcher<Endpoints> watcher) throws Exception {
- EndpointsList currentEndpointList = getEndpoints(namespace);
- return watchEndpoints(namespace, labels, watcher,
- currentEndpointList.getMetadata().getResourceVersion());
- }
-
- public WebSocketClient watchEndpoints(String namespace, Map<String, String> labels, Watcher<Endpoints> watcher, String resourceVersion) throws Exception {
- return watchKubernetesEntities("endpoints", namespace, labels, watcher, resourceVersion);
- }
-
- public WebSocketClient watchReplicationControllers(Watcher<ReplicationController> watcher) throws Exception {
- return watchReplicationControllers(null, watcher);
- }
-
- public WebSocketClient watchReplicationControllers(Map<String, String> labels, Watcher<ReplicationController> watcher) throws Exception {
- return watchReplicationControllers(getNamespace(), labels, watcher);
- }
-
- public WebSocketClient watchReplicationControllers(String namespace, Map<String, String> labels, Watcher<ReplicationController> watcher) throws Exception {
- ReplicationControllerList currentReplicationControllerList = getReplicationControllers(namespace);
- return watchReplicationControllers(namespace, labels, watcher,
- currentReplicationControllerList.getMetadata().getResourceVersion());
- }
-
- public WebSocketClient watchReplicationControllers(String namespace, Map<String, String> labels, Watcher<ReplicationController> watcher, String resourceVersion) throws Exception {
- return watchKubernetesEntities("replicationcontrollers", namespace, labels, watcher, resourceVersion);
- }
-
- public WebSocketClient watchBuilds(Watcher<Build> watcher) throws Exception {
- return watchBuilds(null, watcher);
- }
-
- public WebSocketClient watchBuilds(Map<String, String> labels, Watcher<Build> watcher) throws Exception {
- return watchBuilds(getNamespace(), labels, watcher);
- }
-
- public WebSocketClient watchBuilds(String namespace, Map<String, String> labels, Watcher<Build> watcher) throws Exception {
- BuildList currentList = getBuilds(namespace);
- return watchBuilds(namespace, labels, watcher,
- currentList.getMetadata().getResourceVersion());
- }
-
- public WebSocketClient watchBuilds(String namespace, Map<String, String> labels, Watcher<Build> watcher, String resourceVersion) throws Exception {
- return watchOpenShiftEntities("builds", namespace, labels, watcher, resourceVersion);
- }
-
- public WebSocketClient watchRoutes(Watcher<Route> watcher) throws Exception {
- return watchRoutes(null, watcher);
- }
-
- public WebSocketClient watchRoutes(Map<String, String> labels, Watcher<Route> watcher) throws Exception {
- return watchRoutes(getNamespace(), labels, watcher);
- }
-
- public WebSocketClient watchRoutes(String namespace, Map<String, String> labels, Watcher<Route> watcher) throws Exception {
- RouteList currentList = getRoutes(namespace);
- return watchRoutes(namespace, labels, watcher,
- currentList.getMetadata().getResourceVersion());
- }
-
- public WebSocketClient watchRoutes(String namespace, Map<String, String> labels, Watcher<Route> watcher, String resourceVersion) throws Exception {
- return watchOpenShiftEntities("routes", namespace, labels, watcher, resourceVersion);
- }
-
- public WebSocketClient watchDeploymentConfigs(Watcher<DeploymentConfig> watcher) throws Exception {
- return watchDeploymentConfigs(null, watcher);
- }
-
- public WebSocketClient watchDeploymentConfigs(Map<String, String> labels, Watcher<DeploymentConfig> watcher) throws Exception {
- return watchDeploymentConfigs(getNamespace(), labels, watcher);
- }
-
- public WebSocketClient watchDeploymentConfigs(String namespace, Map<String, String> labels, Watcher<DeploymentConfig> watcher) throws Exception {
- DeploymentConfigList currentList = getDeploymentConfigs(namespace);
- return watchDeploymentConfigs(namespace, labels, watcher,
- currentList.getMetadata().getResourceVersion());
- }
-
- public WebSocketClient watchDeploymentConfigs(String namespace, Map<String, String> labels, Watcher<DeploymentConfig> watcher, String resourceVersion) throws Exception {
- return watchOpenShiftEntities("deploymentconfigs", namespace, labels, watcher, resourceVersion);
- }
-
- private WebSocketClient watchKubernetesEntities(String entityType, String namespace, Map<String, String> labels, Watcher<? extends HasMetadata> watcher, String resourceVersion) throws Exception {
- return watchEntities(Kubernetes.ROOT_API_PATH, entityType, namespace, labels, watcher, resourceVersion);
- }
-
- private WebSocketClient watchOpenShiftEntities(String entityType, String namespace, Map<String, String> labels, Watcher<? extends HasMetadata> watcher, String resourceVersion) throws Exception {
- return watchEntities(KubernetesExtensions.OSAPI_ROOT_PATH, entityType, namespace, labels, watcher, resourceVersion);
- }
-
- private WebSocketClient watchEntities(String apiPath, String entityType, String namespace, Map<String, String> labels, Watcher<? extends HasMetadata> watcher, String resourceVersion) throws Exception {
- String watchUrl = getAddress().replaceFirst("^http", "ws") + "/" + apiPath + "/namespaces/" + namespace + "/" + entityType + "?watch=true&resourceVersion=" + resourceVersion;
- String labelsString = toLabelsString(labels);
- if (Strings.isNotBlank(labelsString)) {
- watchUrl += "&labelSelector=" + labelsString;
- }
- LOG.debug("Connecting to {}", watchUrl);
-
- WebSocketClient client = getFactory().createWebSocketClient();
- try {
- URI watchUri = URI.create(watchUrl);
- ClientUpgradeRequest upgradeRequest = new ClientUpgradeRequest();
- upgradeRequest.setRequestURI(watchUri);
- upgradeRequest.setHeader("Origin", watchUri.getHost() + ":" + watchUri.getPort());
- String token = getFactory().findToken();
- if (token != null) {
- upgradeRequest.setHeader("Authorization", "Bearer " + token);
- }
- client.start();
- client.connect(watcher, watchUri, upgradeRequest);
- return client;
- } catch (Throwable t) {
- LOG.error("Failed to watch pods", t);
- return null;
- }
- }
-
- /**
- * Returns the URL to access the service; using the environment variables, routes
- * or service portalIP address
- *
- * @throws IllegalArgumentException if the URL cannot be found for the serviceName and namespace
- */
- public String getServiceURL(String serviceName, String namespace, String serviceProtocol, boolean serviceExternal) {
- Service srv = null;
- String serviceHost = serviceToHost(serviceName);
- String servicePort = serviceToPort(serviceName);
- String serviceProto = serviceProtocol != null ? serviceProtocol : serviceToProtocol(serviceName, servicePort);
-
- //1. Inside Kubernetes: Services as ENV vars
- if (!serviceExternal && Strings.isNotBlank(serviceHost) && Strings.isNotBlank(servicePort) && Strings.isNotBlank(serviceProtocol)) {
- return serviceProtocol + "://" + serviceHost + ":" + servicePort;
- //2. Anywhere: When namespace is passed System / Env var. Mostly needed for integration tests.
- } else if (Strings.isNotBlank(namespace)) {
- srv = getService(serviceName, namespace);
- } else {
- for (Service s : getServices().getItems()) {
- String sid = getName(s);
- if (serviceName.equals(sid)) {
- srv = s;
- break;
- }
- }
- }
- if (srv == null) {
- throw new IllegalArgumentException("No kubernetes service could be found for name: " + serviceName + " in namespace: " + namespace);
- }
- RouteList routeList = getRoutes(namespace);
- for (Route route : routeList.getItems()) {
- if (route.getSpec().getTo().getName().equals(serviceName)) {
- return (serviceProto + "://" + route.getSpec().getHost()).toLowerCase();
- }
- }
- return (serviceProto + "://" + srv.getSpec().getPortalIP() + ":" + srv.getSpec().getPorts().iterator().next().getPort()).toLowerCase();
- }
-
-
- // Extension helper methods
- //-------------------------------------------------------------------------
-
- /**
- * Returns the route for the given id and namespace or null if it could not be found.
- */
- public Route findRoute(String id, String namespace) {
- Route route = null;
- try {
- route = getRoute(id, namespace);
- } catch (WebApplicationException e) {
- if (e.getResponse().getStatus() == 404) {
- // does not exist
- } else {
- throw e;
- }
- }
- return route;
- }
-
- /**
- * Triggers a build and returns the UID of the newly created build if it can be found within the default time period
- */
- public String triggerBuildAndGetUuid(@NotNull String name, String namespace) {
- return triggerBuildAndGetUuid(name, namespace, DEFAULT_TRIGGER_TIMEOUT);
- }
-
- /**
- * Triggers a build and returns the UID of the newly created build if it can be found within the given time period
- */
- public String triggerBuildAndGetUuid(@NotNull String name, String namespace, long maxTimeoutMs) {
- String answer = triggerBuild(name, namespace);
- if (Strings.isNullOrBlank(answer)) {
- // lets poll the builds to find the latest build for this name
- int sleepMillis = 2000;
- long endTime = System.currentTimeMillis() + maxTimeoutMs;
- while (true) {
- Build build = findLatestBuild(name, namespace);
- // lets assume that the build is created immediately on the webhook
- if (build != null) {
- String uid = Builds.getUid(build);
- answer = uid;
- break;
- }
- if (System.currentTimeMillis() > endTime) {
- break;
- } else {
- try {
- Thread.sleep(sleepMillis);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- }
- return answer;
- }
-
- /**
- * Returns all the builds for the given buildConfigName and namespace
- */
- public List<Build> findBuilds(String buildConfigName, String namespace) {
- List<Build> answer = new ArrayList<>();
- BuildList buildList = getBuilds(namespace);
- if (buildList != null) {
- List<Build> items = buildList.getItems();
- if (items != null) {
- for (Build build : items) {
- String namespace2 = Builds.getNamespace(build);
- String name2 = Builds.getBuildConfigName(build);
- if (Objects.equals(namespace, namespace2) && Objects.equals(buildConfigName, name2)) {
- answer.add(build);
- }
- }
- }
- }
- return answer;
- }
-
- public Build findLatestBuild(String name, String namespace) {
- List<Build> builds = findBuilds(name, namespace);
- int size = builds.size();
- if (size < 1) {
- return null;
- } else if (size == 1) {
- return builds.get(0);
- } else {
- // TODO add each build and sort by date...
- SortedMap<Date, Build> map = new TreeMap<>();
- for (Build build : builds) {
- Date date = Builds.getCreationTimestampDate(build);
- if (date != null) {
- Build otherBuild = map.get(date);
- if (otherBuild != null) {
- LOG.warn("Got 2 builds at the same time: " + build + " and " + otherBuild);
- } else {
- map.put(date, build);
- }
- }
- }
- Date lastKey = map.lastKey();
- Build build = map.get(lastKey);
- if (build == null) {
- LOG.warn("Should have a value for the last key " + lastKey + " for builds " + map);
- }
- return build;
- }
- }
-
- public String triggerBuild(@NotNull String name, String namespace) {
- BuildConfig buildConfig = getBuildConfig(name, namespace);
- if (buildConfig != null) {
- List<BuildTriggerPolicy> triggers = buildConfig.getSpec().getTriggers();
- String type = null;
- String secret = null;
- for (BuildTriggerPolicy trigger : triggers) {
- WebHookTrigger hook = trigger.getGeneric();
- if (hook != null) {
- secret = hook.getSecret();
- String aType = trigger.getType();
- if (Strings.isNotBlank(secret) && Strings.isNotBlank(aType)) {
- type = aType;
- }
- }
- }
- if (Strings.isNullOrBlank(secret) || Strings.isNullOrBlank(type)) {
- for (BuildTriggerPolicy trigger : triggers) {
- WebHookTrigger hook = trigger.getGithub();
- if (hook != null) {
- secret = hook.getSecret();
- String aType = trigger.getType();
- if (Strings.isNotBlank(secret) && Strings.isNotBlank(aType)) {
- type = aType;
- }
- }
- }
- }
- if (Strings.isNullOrBlank(type)) {
- throw new IllegalArgumentException("BuildConfig does not have a generic or github trigger for build: " + name + " namespace: "+ namespace);
- }
- if (Strings.isNullOrBlank(secret)) {
- throw new IllegalArgumentException("BuildConfig does not have secret for build: " + name + " namespace: "+ namespace);
- }
- LOG.info("Triggering build " + name + " namespace: " + namespace + " type: " + type);
- return doTriggerBuild(name, namespace, type, secret);
- } else {
- throw new IllegalArgumentException("No BuildConfig for build: " + name + " namespace: "+ namespace);
- }
- }
-
- protected String doTriggerBuild(String name, String namespace, String type, String secret) {
- String baseUrl;
- String url;
- WebClient webClient;
- boolean useVanillaUrl = true;
- boolean useFabric8Console = true;
- if (useFabric8Console) {
- // lets proxy through the fabric8 console REST API to work around bugs in OpenShift...
- baseUrl = getServiceURL(ServiceNames.FABRIC8_CONSOLE, namespace, "http", false);
- url = URLUtils.pathJoin("/kubernetes/osapi", defaultOsApiVersion, "buildConfigHooks", name, secret, type);
- webClient = new KubernetesFactory(baseUrl, true).createWebClient();
- } else {
- // using the direct REST API...
- KubernetesFactory factory = getFactory();
- baseUrl = factory.getAddress();
- webClient = factory.createWebClient();
- url = URLUtils.pathJoin("/osapi", defaultOsApiVersion, "buildConfigHooks", name, secret, type);
- }
- if (Strings.isNotBlank(namespace)) {
- url += "?namespace=" + namespace;
- }
- if (useVanillaUrl) {
- String triggerBuildUrlText = URLUtils.pathJoin(baseUrl, url);
- LOG.info("Using a URL to trigger: " + triggerBuildUrlText);
- try {
- URL triggerBuildURL = new URL(triggerBuildUrlText);
- HttpURLConnection connection = (HttpURLConnection) triggerBuildURL.openConnection();
- connection.setRequestMethod("POST");
- connection.setRequestProperty("Content-Type", "application/json");
- connection.setRequestProperty("Accept", "application/json");
- connection.setDoOutput(true);
-
- OutputStreamWriter out = new OutputStreamWriter(
- connection.getOutputStream());
- out.close();
-
- int status = connection.getResponseCode();
- String message = connection.getResponseMessage();
- System.out.println("Got response code: " + status + " message: " + message);
- if (status != 200) {
- throw new WebApplicationException(status + ": " + message, status);
- } else {
- return null;
- }
- } catch (IOException e) {
- throw new WebApplicationException(e, 400);
- }
-
- } else {
-
- LOG.info("Triggering build by posting to: " + url);
-
- webClient.getHeaders().remove(HttpHeaders.ACCEPT);
- webClient = webClient.path(url).
- header(HttpHeaders.CONTENT_TYPE, "application/json");
-
- Response response = webClient.
- post(new HashMap());
- int status = response.getStatus();
- if (status != 200) {
- Object entity = response.getEntity();
- if (entity != null) {
- String message = ExceptionResponseMapper.extractErrorMessage(entity);
- throw new WebApplicationException(status + ": " + message, status);
- } else {
- throw new WebApplicationException(status);
- }
- }
- return null;
- }
- //return getKubernetesExtensions().triggerBuild(name, namespace, secret, type, new byte[0]);
- }
-
-
-
- /**
- * A helper method to handle REST APIs which throw a 404 by just returning null
- */
- protected static <T> T handle404ByReturningNull(Callable<T> callable) {
- try {
- return callable.call();
- } catch (WebApplicationException e) {
- if (e.getResponse().getStatus() == 404) {
- return null;
- } else {
- throw e;
- }
- } catch (Exception e) {
- throw new WebApplicationException(e);
- }
- }
-
-
- // implementation methods
- //-------------------------------------------------------------------------
-
- protected Collection<Pod> getPodList() {
- return getPodMap(this, namespace).values();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesExtensions.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesExtensions.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesExtensions.java
deleted file mode 100644
index 342aac6..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesExtensions.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.openshift.api.model.Build;
-import io.fabric8.openshift.api.model.BuildConfig;
-import io.fabric8.openshift.api.model.BuildConfigList;
-import io.fabric8.openshift.api.model.BuildList;
-import io.fabric8.openshift.api.model.DeploymentConfig;
-import io.fabric8.openshift.api.model.DeploymentConfigList;
-import io.fabric8.openshift.api.model.ImageStream;
-import io.fabric8.openshift.api.model.ImageStreamList;
-import io.fabric8.openshift.api.model.Route;
-import io.fabric8.openshift.api.model.RouteList;
-import io.fabric8.openshift.api.model.template.Template;
-
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-
-/**
- * Various Kubernetes extensions defined in the OpenShift project
- */
-@Path(KubernetesExtensions.OSAPI_ROOT_PATH + "/namespaces/{namespace}")
-@Produces("application/json")
-@Consumes("application/json")
-public interface KubernetesExtensions {
-
- String OSAPI_ROOT_PATH = "osapi/v1beta3";
-
- @POST
- @Path("processedtemplates")
- @Consumes("application/json")
- String processTemplate(Template entity, @PathParam("namespace") String namespace) throws Exception;
-
-
-/*
- TODO uncomment when TemplateList is in the schema
-
- @Path("templates")
- @GET
- @Produces("application/json")
- TemplateList getTemplates(@PathParam("namespace") String namespace);
-*/
-
- @Path("templates")
- @POST
- @Consumes("application/json")
- String createTemplate(Template entity, @PathParam("namespace") String namespace) throws Exception;
-
- @GET
- @Path("templates/{name}")
- @Produces("application/json")
- Template getTemplate(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
- @PUT
- @Path("templates/{name}")
- @Consumes("application/json")
- String updateTemplate(@PathParam("name") @NotNull String name, Template entity, @PathParam("namespace") String namespace) throws Exception;
-
- @DELETE
- @Path("templates/{name}")
- @Produces("application/json")
- @Consumes("text/plain")
- String deleteTemplate(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace) throws Exception;
-
-
- // Routes
- //-------------------------------------------------------------------------
-
-
- @GET
- @Path("routes")
- RouteList getRoutes(@PathParam("namespace") String namespace);
-
-
- @POST
- @Path("routes")
- String createRoute(Route entity, @PathParam("namespace") String namespace) throws Exception;
-
- @GET
- @Path("routes/{name}")
- Route getRoute(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
- @PUT
- @Path("routes/{name}")
- @Consumes("application/json")
- String updateRoute(@PathParam("name") @NotNull String name, Route entity, @PathParam("namespace") String namespace) throws Exception;
-
- @DELETE
- @Path("routes/{name}")
- String deleteRoute(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
-
- // Builds
- //-------------------------------------------------------------------------
-
- @GET
- @Path("builds")
- BuildList getBuilds(@PathParam("namespace") String namespace);
-
- @POST
- @Path("builds")
- String createBuild(Build entity, @PathParam("namespace") String namespace) throws Exception;
-
- @GET
- @Path("builds/{name}")
- Build getBuild(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
- @PUT
- @Path("builds/{name}")
- @Consumes("application/json")
- String updateBuild(@PathParam("name") @NotNull String name, Build entity, @PathParam("namespace") String namespace) throws Exception;
-
- @DELETE
- @Path("builds/{name}")
- String deleteBuild(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
-
- // BuildConfigs
- //-------------------------------------------------------------------------
-
- @GET
- @Path("buildconfigs")
- BuildConfigList getBuildConfigs(@PathParam("namespace") String namespace);
-
- @POST
- @Path("buildconfigs")
- String createBuildConfig(BuildConfig entity, @PathParam("namespace") String namespace) throws Exception;
-
- @GET
- @Path("buildconfigs/{name}")
- BuildConfig getBuildConfig(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
- @PUT
- @Path("buildconfigs/{name}")
- @Consumes("application/json")
- String updateBuildConfig(@PathParam("name") @NotNull String name, BuildConfig entity, @PathParam("namespace") String namespace) throws Exception;
-
- @DELETE
- @Path("buildconfigs/{name}")
- String deleteBuildConfig(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
-
- // BuildConfigHooks
- //-------------------------------------------------------------------------
- @POST
- @Path("buildconfigHooks/{name}/{secret}/{type}")
- @Produces("text/plain")
- @Consumes("application/json")
- String triggerBuild(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace,
- @PathParam("secret") @NotNull String secret,
- @PathParam("type") @NotNull String type,
- byte[] body);
-
-
- // ImageRepositorys
- //-------------------------------------------------------------------------
-
- @GET
- @Path("imagestreams")
- ImageStreamList getImageStreams(@PathParam("namespace") String namespace);
-
- @POST
- @Path("imagestreams")
- String createImageStream(ImageStream entity, @PathParam("namespace") String namespace) throws Exception;
-
- @GET
- @Path("imagestreams/{name}")
- ImageStream getImageStream(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
- @PUT
- @Path("imagestreams/{name}")
- @Consumes("application/json")
- String updateImageStream(@PathParam("name") @NotNull String name, ImageStream entity, @PathParam("namespace") String namespace) throws Exception;
-
- @DELETE
- @Path("imagestreams/{name}")
- String deleteImageStream(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
-
- // DeploymentConfigs
- //-------------------------------------------------------------------------
-
- @GET
- @Path("deploymentconfigs")
- DeploymentConfigList getDeploymentConfigs(@PathParam("namespace") String namespace);
-
- @POST
- @Path("deploymentconfigs")
- String createDeploymentConfig(DeploymentConfig entity, @PathParam("namespace") String namespace) throws Exception;
-
- @GET
- @Path("deploymentconfigs/{name}")
- DeploymentConfig getDeploymentConfig(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
- @PUT
- @Path("deploymentconfigs/{name}")
- @Consumes("application/json")
- String updateDeploymentConfig(@PathParam("name") @NotNull String name, DeploymentConfig entity, @PathParam("namespace") String namespace) throws Exception;
-
- @DELETE
- @Path("deploymentconfigs/{name}")
- String deleteDeploymentConfig(@PathParam("name") @NotNull String name, @PathParam("namespace") String namespace);
-
-
-}
[26/50] [abbrv] stratos git commit: Upgrading fabric8 kubernetes api
version to 2.2.16 and removing forked code
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesFactory.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesFactory.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesFactory.java
deleted file mode 100644
index 9877ecb..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesFactory.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.jaxrs.cfg.Annotations;
-import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
-import io.fabric8.kubernetes.api.extensions.Configs;
-import io.fabric8.kubernetes.api.model.config.Config;
-import io.fabric8.kubernetes.api.model.config.Context;
-import io.fabric8.utils.Strings;
-import io.fabric8.utils.Systems;
-import io.fabric8.utils.cxf.AuthorizationHeaderFilter;
-import io.fabric8.utils.cxf.WebClients;
-import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.websocket.client.WebSocketClient;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.MediaType;
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.security.KeyStore;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A simple helper class for creating instances of Kubernetes
- */
-public class KubernetesFactory {
- public static final String KUBERNETES_SCHEMA_JSON = "schema/kube-schema.json";
- private final Logger log = LoggerFactory.getLogger(getClass());
-
- public static final String DEFAULT_KUBERNETES_MASTER = "http://localhost:8080";
-
- public static final String KUBERNETES_TRUST_ALL_CERIFICATES = "KUBERNETES_TRUST_CERT";
-
- public static final String KUBERNETES_SERVICE_HOST_ENV_VAR = "KUBERNETES_SERVICE_HOST";
- public static final String KUBERNETES_SERVICE_PORT_ENV_VAR = "KUBERNETES_SERVICE_PORT";
- public static final String KUBERNETES_MASTER_ENV_VAR = "KUBERNETES_MASTER";
- public static final String KUBERNETES_CA_CERTIFICATE_FILE_ENV_VAR = "KUBERNETES_CA_CERTIFICATE_FILE";
- public static final String KUBERNETES_CLIENT_CERTIFICATE_FILE_ENV_VAR = "KUBERNETES_CLIENT_CERTIFICATE_FILE";
- public static final String KUBERNETES_CLIENT_KEY_FILE_ENV_VAR = "KUBERNETES_CLIENT_KEY_FILE";
- public static final String KUBERNETES_CLIENT_KEY_DATA_ENV_VAR = "KUBERNETES_CLIENT_KEY_DATA";
- public static final String KUBERNETES_CA_CERTIFICATE_DATA_ENV_VAR = "KUBERNETES_CA_CERTIFICATE_DATA";
- public static final String KUBERNETES_CLIENT_CERTIFICATE_DATA_ENV_VAR = "KUBERNETES_CLIENT_CERTIFICATE_DATA";
- public static final String KUBERNETES_CLIENT_KEY_ALGO_ENV_VAR = "KUBERNETES_CLIENT_KEY_ALGO";
- public static final String KUBERNETES_CLIENT_KEY_PASSWORD_ENV_VAR = "KUBERNETES_CLIENT_KEY_PASSWORD";
- public static final String KUBERNETES_MASTER_SYSTEM_PROPERTY = "kubernetes.master";
- public static final String KUBERNETES_VERIFY_SYSTEM_PROPERTY = "kubernetes.verify";
-
- private String address;
- private boolean verifyAddress = true;
- private boolean trustAllCerts = false;
-
- private File caCertFile;
- private File clientCertFile;
- private File clientKeyFile;
- private String caCertData;
- private String clientCertData;
- private String clientKeyData;
- private String clientKeyAlgo = "RSA";
- private char[] clientKeyPassword = new char[]{};
- private String username;
- private String password;
-
- public KubernetesFactory() {
- this(null);
- }
-
- public KubernetesFactory(String address) {
- this(address, Boolean.parseBoolean(System.getProperty(KUBERNETES_VERIFY_SYSTEM_PROPERTY, "true")));
- }
-
- public KubernetesFactory(String address, boolean verifyAddress) {
- this.verifyAddress = verifyAddress;
- init();
- initAddress(address);
- }
-
- protected void initAddress(String address) {
- if (Strings.isNullOrBlank(address)) {
- setAddress(findKubernetesMaster());
- } else {
- setAddress(address);
- }
- }
-
- protected String findKubernetesMaster() {
- return resolveHttpKubernetesMaster();
- }
-
- private void init() {
- if (System.getenv(KUBERNETES_TRUST_ALL_CERIFICATES) != null) {
- this.trustAllCerts = Boolean.valueOf(System.getenv(KUBERNETES_TRUST_ALL_CERIFICATES));
- } else if (System.getenv(KUBERNETES_CA_CERTIFICATE_FILE_ENV_VAR) != null) {
- File candidateCaCertFile = new File(System.getenv(KUBERNETES_CA_CERTIFICATE_FILE_ENV_VAR));
- if (candidateCaCertFile.exists() && candidateCaCertFile.canRead()) {
- this.caCertFile = candidateCaCertFile;
- } else {
- log.error("Specified CA certificate file {} does not exist or is not readable", candidateCaCertFile);
- }
- }
-
- if (System.getenv(KUBERNETES_CA_CERTIFICATE_DATA_ENV_VAR) != null) {
- this.caCertData = System.getenv(KUBERNETES_CA_CERTIFICATE_DATA_ENV_VAR);
- }
-
- if (System.getenv(KUBERNETES_CLIENT_CERTIFICATE_FILE_ENV_VAR) != null) {
- File candidateClientCertFile = new File(System.getenv(KUBERNETES_CLIENT_CERTIFICATE_FILE_ENV_VAR));
- if (candidateClientCertFile.exists() && candidateClientCertFile.canRead()) {
- this.clientCertFile = candidateClientCertFile;
- } else {
- log.error("Specified client certificate file {} does not exist or is not readable", candidateClientCertFile);
- }
- }
-
- if (System.getenv(KUBERNETES_CLIENT_CERTIFICATE_DATA_ENV_VAR) != null) {
- this.clientCertData = System.getenv(KUBERNETES_CLIENT_CERTIFICATE_DATA_ENV_VAR);
- }
-
- if (System.getenv(KUBERNETES_CLIENT_KEY_FILE_ENV_VAR) != null) {
- File candidateClientKeyFile = new File(System.getenv(KUBERNETES_CLIENT_KEY_FILE_ENV_VAR));
- if (candidateClientKeyFile.exists() && candidateClientKeyFile.canRead()) {
- this.clientKeyFile = candidateClientKeyFile;
- } else {
- log.error("Specified client key file {} does not exist or is not readable", candidateClientKeyFile);
- }
- }
-
- if (System.getenv(KUBERNETES_CLIENT_KEY_DATA_ENV_VAR) != null) {
- this.clientKeyData = System.getenv(KUBERNETES_CLIENT_KEY_DATA_ENV_VAR);
- }
-
- if (System.getenv(KUBERNETES_CLIENT_KEY_ALGO_ENV_VAR) != null) {
- this.clientKeyAlgo = System.getenv(KUBERNETES_CLIENT_KEY_ALGO_ENV_VAR);
- }
-
- if (System.getenv(KUBERNETES_CLIENT_KEY_PASSWORD_ENV_VAR) != null) {
- this.clientKeyPassword = System.getenv(KUBERNETES_CLIENT_KEY_PASSWORD_ENV_VAR).toCharArray();
- }
- }
-
- @Override
- public String toString() {
- return "KubernetesFactory{" + address + '}';
- }
-
- public Kubernetes createKubernetes() {
- return createWebClient(Kubernetes.class);
- }
-
- public KubernetesExtensions createKubernetesExtensions() {
- return createWebClient(KubernetesExtensions.class);
- }
-
- public KubernetesGlobalExtensions createKubernetesGlobalExtensions() {
- return createWebClient(KubernetesGlobalExtensions.class);
- }
-
- /**
- * Creates a JAXRS web client for the given JAXRS client
- */
- public <T> T createWebClient(Class<T> clientType) {
- WebClient webClient = createWebClient();
- return JAXRSClientFactory.fromClient(webClient, clientType);
- }
-
- public WebClient createWebClient() {
- return createWebClient(address);
- }
-
- public WebClient createWebClient(String serviceAddress) {
- List<Object> providers = createProviders();
-
- AuthorizationHeaderFilter authorizationHeaderFilter = new AuthorizationHeaderFilter();
- providers.add(authorizationHeaderFilter);
-
- WebClient webClient = WebClient.create(serviceAddress, providers);
- WebClients.configureUserAndPassword(webClient, this.username, this.password);
- boolean registeredCert = false;
- if (trustAllCerts) {
- WebClients.disableSslChecks(webClient);
- } else if (caCertFile != null || caCertData != null) {
- WebClients.configureCaCert(webClient, this.caCertData, this.caCertFile);
- }
- if ((clientCertFile != null || clientCertData != null) && (clientKeyFile != null || clientKeyData != null)) {
- WebClients.configureClientCert(webClient, this.clientCertData, this.clientCertFile, this.clientKeyData, this.clientKeyFile, this.clientKeyAlgo, this.clientKeyPassword);
- registeredCert = true;
- }
- if (!registeredCert) {
- String token = findToken();
- if (Strings.isNotBlank(token)) {
- String authHeader = "Bearer " + token;
- authorizationHeaderFilter.setAuthorizationHeader(authHeader);
- }
- }
- return webClient;
- }
-
- public WebSocketClient createWebSocketClient() throws Exception {
- SslContextFactory sslContextFactory = null;
- if (trustAllCerts) {
- sslContextFactory = new SslContextFactory(trustAllCerts);
- } else if (caCertData != null || caCertFile != null) {
- KeyStore trustStore = WebClients.createTrustStore(caCertData, caCertFile);
- sslContextFactory = new SslContextFactory();
- sslContextFactory.setTrustStore(trustStore);
- }
- if ((clientCertFile != null || clientCertData != null) && (clientKeyFile != null || clientKeyData != null)) {
- if (sslContextFactory == null) {
- sslContextFactory = new SslContextFactory();
- }
- KeyStore keyStore = WebClients.createKeyStore(this.clientCertData, this.clientCertFile, this.clientKeyData, this.clientKeyFile, this.clientKeyAlgo, this.clientKeyPassword);
- sslContextFactory = new SslContextFactory();
- sslContextFactory.setKeyStore(keyStore);
- }
-
- sslContextFactory.setIncludeProtocols("TLSv1", "TLSv1.1", "TLSv1.2");
-
- WebSocketClient client = new WebSocketClient(sslContextFactory);
-
- return client;
- }
-
- public String findToken() {
- String token = getServiceAccountToken();
- if (Strings.isNotBlank(token)) {
- return token;
- }
- return findOpenShiftToken();
- }
-
- public String getServiceAccountToken() {
- try {
- return new String(Files.readAllBytes(Paths.get(Kubernetes.SERVICE_ACCOUNT_TOKEN_FILE)));
- } catch (IOException e) {
- log.debug("Cannot read service account token");
- }
- return null;
- }
-
- public String findOpenShiftToken() {
- Config config = Configs.parseConfigs();
- if (config != null) {
- Context context = Configs.getCurrentContext(config);
- if (context != null) {
- return Configs.getUserToken(config, context);
- }
- }
- return null;
- }
-
- protected List<Object> createProviders() {
- List<Object> providers = new ArrayList<Object>();
- Annotations[] annotationsToUse = JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS;
- ObjectMapper objectMapper = createObjectMapper();
- providers.add(new JacksonJaxbJsonProvider(objectMapper, annotationsToUse));
- providers.add(new PlainTextJacksonProvider(objectMapper, annotationsToUse));
- providers.add(new ExceptionResponseMapper());
- //providers.add(new JacksonIntOrStringConfig(objectMapper));
- return providers;
- }
-
-
- /**
- * Lets accept plain text too as if its JSON to work around some issues with the REST API and remote kube....
- */
- @javax.ws.rs.ext.Provider
- @javax.ws.rs.Consumes({"text/plain"})
- @javax.ws.rs.Produces({"text/plain"})
- public static class PlainTextJacksonProvider extends JacksonJaxbJsonProvider {
- public PlainTextJacksonProvider(ObjectMapper mapper, Annotations[] annotationsToUse) {
- super(mapper, annotationsToUse);
- }
-
- @Override
- protected boolean hasMatchingMediaType(MediaType mediaType) {
- boolean answer = super.hasMatchingMediaType(mediaType);
- String type = mediaType.getType();
- String subtype = mediaType.getSubtype();
- if (!answer && type.equals("text")) {
- answer = super.hasMatchingMediaType(MediaType.APPLICATION_JSON_TYPE);
- }
- return answer;
- }
- }
-
- public String getKubernetesMaster() {
- String answer = address;
- int idx = answer.lastIndexOf(":");
- if (idx > 0) {
- answer = answer.substring(0, idx);
- }
- idx = answer.lastIndexOf(":");
- if (idx > 0) {
- answer = answer.substring(idx + 1);
- }
- idx = answer.lastIndexOf("/");
- if (idx > 0) {
- answer = answer.substring(idx + 1);
- }
- return answer;
- }
-
- public String getAddress() {
- return address;
- }
-
- public void setAddress(String address) {
- this.address = address;
- if (Strings.isNullOrBlank(address)) {
- this.address = findKubernetesMaster();
- }
-
- if (verifyAddress) {
- try {
- URL url = new URL(this.address);
- if (KubernetesHelper.isServiceSsl(url.getHost(), url.getPort(), true)) {
- this.address = "https://" + url.getHost() + ":" + url.getPort();
- } else {
- this.address = "http://" + url.getHost() + ":" + url.getPort();
- }
- } catch (MalformedURLException e) {
- throw new IllegalArgumentException("Invalid kubernetes master address", e);
- }
- }
- }
-
- // Helpers
-
- public static String resolveHttpKubernetesMaster() {
- String kubernetesMaster = resolveKubernetesMaster();
- if (kubernetesMaster.startsWith("tcp:")) {
- return "https:" + kubernetesMaster.substring(4);
- }
- return kubernetesMaster;
- }
-
- public static String resolveKubernetesMaster() {
- String hostEnvVar = KUBERNETES_SERVICE_HOST_ENV_VAR;
- String portEnvVar = KUBERNETES_SERVICE_PORT_ENV_VAR;
- String proto = "https";
-
- // First let's check if it's available as a kubernetes service like it should be...
- String kubernetesMaster = System.getenv(hostEnvVar);
- if (Strings.isNotBlank(kubernetesMaster)) {
- kubernetesMaster = proto + "://" + kubernetesMaster + ":" + System.getenv(portEnvVar);
- } else {
- // If not then fall back to KUBERNETES_MASTER env var
- kubernetesMaster = Systems.getSystemPropertyOrEnvVar(KUBERNETES_MASTER_SYSTEM_PROPERTY, KUBERNETES_MASTER_ENV_VAR, DEFAULT_KUBERNETES_MASTER);
- }
- return kubernetesMaster;
- }
-
- /**
- * Creates a configured Jackson object mapper for parsing JSON
- */
- public static ObjectMapper createObjectMapper() {
- ObjectMapper mapper = new ObjectMapper();
- mapper.enable(SerializationFeature.INDENT_OUTPUT);
- return mapper;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesGlobalExtensions.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesGlobalExtensions.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesGlobalExtensions.java
deleted file mode 100644
index 9ce945f..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesGlobalExtensions.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- * <p/>
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.openshift.api.model.OAuthClient;
-
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-
-/**
- * Various Kubernetes extensions defined in the OpenShift project which are namespace agnostic
- */
-@Path("osapi/v1beta3")
-@Produces("application/json")
-@Consumes("application/json")
-public interface KubernetesGlobalExtensions {
-
- @POST
- @Path("oauthclients")
- @Consumes("application/json")
- String createOAuthClient(OAuthClient entity) throws Exception;
-
- @GET
- @Path("oauthclients/{name}")
- OAuthClient getOAuthClient(@PathParam("name") @NotNull String name);
-
- @PUT
- @Path("oauthclients/{name}")
- @Consumes("application/json")
- String updateOAuthClient(@PathParam("name") @NotNull String name, OAuthClient entity) throws Exception;
-
- @DELETE
- @Path("oauthclients/{name}")
- String deleteOAuthClient(@PathParam("name") @NotNull String name);
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesHelper.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesHelper.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesHelper.java
deleted file mode 100644
index 360c0a5..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesHelper.java
+++ /dev/null
@@ -1,1724 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-import io.fabric8.kubernetes.api.model.KubernetesResource;
-import io.fabric8.kubernetes.api.extensions.Templates;
-import io.fabric8.kubernetes.api.model.Container;
-import io.fabric8.kubernetes.api.model.ContainerPort;
-import io.fabric8.kubernetes.api.model.ContainerState;
-import io.fabric8.kubernetes.api.model.ContainerStateRunning;
-import io.fabric8.kubernetes.api.model.ContainerStateTerminated;
-import io.fabric8.kubernetes.api.model.ContainerStateWaiting;
-import io.fabric8.kubernetes.api.model.ContainerStatus;
-import io.fabric8.kubernetes.api.model.HasMetadata;
-import io.fabric8.kubernetes.api.model.KubernetesList;
-import io.fabric8.kubernetes.api.model.ObjectMeta;
-import io.fabric8.kubernetes.api.model.Pod;
-import io.fabric8.kubernetes.api.model.PodList;
-import io.fabric8.kubernetes.api.model.PodSpec;
-import io.fabric8.kubernetes.api.model.PodStatus;
-import io.fabric8.kubernetes.api.model.PodTemplateSpec;
-import io.fabric8.kubernetes.api.model.ReplicationController;
-import io.fabric8.kubernetes.api.model.ReplicationControllerList;
-import io.fabric8.kubernetes.api.model.ReplicationControllerSpec;
-import io.fabric8.kubernetes.api.model.Secret;
-import io.fabric8.kubernetes.api.model.Service;
-import io.fabric8.kubernetes.api.model.ServiceList;
-import io.fabric8.kubernetes.api.model.ServicePort;
-import io.fabric8.kubernetes.api.model.ServiceSpec;
-import io.fabric8.kubernetes.api.model.util.IntOrString;
-import io.fabric8.openshift.api.model.DeploymentConfig;
-import io.fabric8.openshift.api.model.DeploymentConfigSpec;
-import io.fabric8.openshift.api.model.OAuthClient;
-import io.fabric8.openshift.api.model.Route;
-import io.fabric8.openshift.api.model.RouteSpec;
-import io.fabric8.openshift.api.model.template.Parameter;
-import io.fabric8.openshift.api.model.template.Template;
-import io.fabric8.utils.Files;
-import io.fabric8.utils.Filter;
-import io.fabric8.utils.Filters;
-import io.fabric8.utils.Objects;
-import io.fabric8.utils.Strings;
-import io.fabric8.utils.Systems;
-import io.fabric8.utils.cxf.TrustEverythingSSLTrustManager;
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xbill.DNS.*;
-
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLHandshakeException;
-import javax.net.ssl.SSLKeyException;
-import javax.net.ssl.SSLPeerUnverifiedException;
-import javax.net.ssl.SSLProtocolException;
-import javax.net.ssl.SSLSocketFactory;
-import javax.ws.rs.WebApplicationException;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-import static io.fabric8.utils.Lists.notNullList;
-import static io.fabric8.utils.Strings.isNullOrBlank;
-
-/**
- * Kubernetes utility methods.
- */
-public final class KubernetesHelper {
- public static final int INTORSTRING_KIND_INT = 0;
- public static final int INTORSTRING_KIND_STRING = 1;
- private static final transient Logger LOG = LoggerFactory.getLogger(KubernetesHelper.class);
-
- public static final String DEFAULT_DOCKER_HOST = "tcp://localhost:2375";
- protected static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
- private static ObjectMapper objectMapper = KubernetesFactory.createObjectMapper();
-
- public static final String defaultApiVersion = "v1beta3";
- public static final String defaultOsApiVersion = "v1beta3";
-
- private static final String HOST_SUFFIX = "_SERVICE_HOST";
- private static final String PORT_SUFFIX = "_SERVICE_PORT";
- private static final String PROTO_SUFFIX = "_TCP_PROTO";
- public static final String DEFAULT_PROTO = "tcp";
-
- /**
- * Returns the ID of the given object
- */
- public static String getObjectId(Object object) {
- if (object instanceof HasMetadata) {
- return getName((HasMetadata) object);
- } else {
- return object != null ? object.toString() : null;
- }
- }
-
- public static ObjectMeta getOrCreateMetadata(HasMetadata entity) {
- ObjectMeta metadata = entity.getMetadata();
- if (metadata == null) {
- metadata = new ObjectMeta();
- entity.setMetadata(metadata);
- }
- return metadata;
- }
-
- /**
- * Returns the resource version for the entity or null if it does not have one
- */
- public static String getResourceVersion(HasMetadata entity) {
- if (entity != null) {
- ObjectMeta metadata = entity.getMetadata();
- if (metadata != null) {
- String resourceVersion = metadata.getResourceVersion();
- if (Strings.isNotBlank(resourceVersion)) {
- return resourceVersion;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns true if this entity has a valid non blank resourceVersion in its metadata
- */
- public static boolean hasResourceVersion(HasMetadata entity) {
- return getResourceVersion(entity) != null;
- }
-
- public static String getName(ObjectMeta entity) {
- if (entity != null) {
- return Strings.firstNonBlank(entity.getName(),
- getAdditionalPropertyText(entity.getAdditionalProperties(), "id"),
- entity.getUid());
- } else {
- return null;
- }
- }
-
-
- /**
- * Returns the kind of the entity
- */
- public static String getKind(HasMetadata entity) {
- if (entity != null) {
- // TODO use reflection to find the kind?
- if (entity instanceof KubernetesList) {
- return "List";
- } else {
- return entity.getClass().getSimpleName();
- }
- } else {
- return null;
- }
- }
-
- public static String getName(HasMetadata entity) {
- if (entity != null) {
- return getName(entity.getMetadata());
- } else {
- return null;
- }
- }
-
- public static void setName(HasMetadata entity, String name) {
- getOrCreateMetadata(entity).setName(name);
- }
-
- public static void setName(HasMetadata entity, String namespace, String name) {
- ObjectMeta metadata = getOrCreateMetadata(entity);
- metadata.setNamespace(namespace);
- metadata.setName(name);
- }
-
- public static void setNamespace(HasMetadata entity, String namespace) {
- getOrCreateMetadata(entity).setNamespace(namespace);
- }
-
- public static String getNamespace(ObjectMeta entity) {
- if (entity != null) {
- return entity.getNamespace();
- } else {
- return null;
- }
- }
-
- public static String getNamespace(HasMetadata entity) {
- if (entity != null) {
- return getNamespace(entity.getMetadata());
- } else {
- return null;
- }
- }
-
- public static Map<String, String> getOrCreateAnnotations(HasMetadata entity) {
- ObjectMeta metadata = getOrCreateMetadata(entity);
- Map<String, String> answer = metadata.getAnnotations();
- if (answer == null) {
- // use linked so the annotations can be in the FIFO order
- answer = new LinkedHashMap<>();
- metadata.setAnnotations(answer);
- }
- return answer;
- }
-
- public static Map<String, String> getOrCreateLabels(HasMetadata entity) {
- ObjectMeta metadata = getOrCreateMetadata(entity);
- Map<String, String> answer = metadata.getLabels();
- if (answer == null) {
- // use linked so the annotations can be in the FIFO order
- answer = new LinkedHashMap<>();
- metadata.setLabels(answer);
- }
- return answer;
- }
-
- /**
- * Returns the labels of the given metadata object or an empty map if the metadata or labels are null
- */
- @SuppressWarnings("unchecked")
- public static Map<String, String> getLabels(ObjectMeta metadata) {
- if (metadata != null) {
- Map<String, String> labels = metadata.getLabels();
- if (labels != null) {
- return labels;
- }
- }
- return Collections.EMPTY_MAP;
- }
-
- @SuppressWarnings("unchecked")
- public static Map<String, String> getLabels(HasMetadata entity) {
- if (entity != null) {
- return getLabels(entity.getMetadata());
- }
- return Collections.EMPTY_MAP;
- }
-
- public static ServiceSpec getOrCreateSpec(Service entity) {
- ServiceSpec spec = entity.getSpec();
- if (spec == null) {
- spec = new ServiceSpec();
- entity.setSpec(spec);
- }
- return spec;
- }
-
- public static String getPortalIP(Service entity) {
- String answer = null;
- if (entity != null) {
- ServiceSpec spec = getOrCreateSpec(entity);
- return spec.getPortalIP();
- }
- return answer;
- }
-
- @SuppressWarnings("unchecked")
- public static Map<String, String> getSelector(Service entity) {
- Map<String, String> answer = null;
- if (entity != null) {
- ServiceSpec spec = getOrCreateSpec(entity);
- answer = spec.getSelector();
- }
- return answer != null ? answer : Collections.EMPTY_MAP;
- }
-
- public static void setSelector(Service entity, Map<String, String> labels) {
- ServiceSpec spec = getOrCreateSpec(entity);
- spec.setSelector(labels);
- }
-
- public static Set<Integer> getPorts(Service entity) {
- Set<Integer> answer = new HashSet<>();
- if (entity != null) {
- ServiceSpec spec = getOrCreateSpec(entity);
- for (ServicePort port : spec.getPorts()) {
- answer.add(port.getPort());
- }
- }
- return answer;
- }
-
- protected static String getAdditionalPropertyText(Map<String, Object> additionalProperties, String name) {
- if (additionalProperties != null) {
- Object value = additionalProperties.get(name);
- if (value != null) {
- return value.toString();
- }
- }
- return null;
- }
-
- protected static Map<String, Object> getMetadata(Map<String, Object> additionalProperties, boolean create) {
- Map<String, Object> answer = getAdditionalPropertyMap(additionalProperties, "metadata");
- if (answer == null) {
- answer = new LinkedHashMap<>();
- if (create) {
- additionalProperties.put("metadata", answer);
- }
- }
- return answer;
- }
-
- @SuppressWarnings("unchecked")
- protected static Map<String, Object> getAdditionalPropertyMap(Map<String, Object> additionalProperties, String name) {
- if (additionalProperties != null) {
- Object value = additionalProperties.get(name);
- if (value instanceof Map) {
- return (Map<String, Object>) value;
- }
- }
- return null;
- }
-
- public static String getDockerIp() {
- String url = resolveDockerHost();
- int idx = url.indexOf("://");
- if (idx > 0) {
- url = url.substring(idx + 3);
- }
- idx = url.indexOf(":");
- if (idx > 0) {
- url = url.substring(0, idx);
- }
- return url;
- }
-
- public static String resolveDockerHost() {
- String dockerHost = System.getenv("DOCKER_HOST");
- if (isNullOrBlank(dockerHost)) {
- dockerHost = System.getProperty("docker.host");
- }
- if (isNullOrBlank(dockerHost)) {
- return DEFAULT_DOCKER_HOST;
- } else {
- return dockerHost;
- }
- }
-
- public static String toJson(Object dto) throws JsonProcessingException {
- Class<?> clazz = dto.getClass();
- return objectMapper.writerWithType(clazz).writeValueAsString(dto);
- }
-
- /**
- * Returns the given json data as a DTO such as
- * {@link Pod}, {@link ReplicationController} or
- * {@link io.fabric8.kubernetes.api.model.Service}
- * from the Kubernetes REST API
- */
- public static Object loadJson(File file) throws IOException {
- byte[] data = Files.readBytes(file);
- return loadJson(data);
- }
-
- /**
- * Returns the given json data as a DTO such as
- * {@link Pod}, {@link ReplicationController} or
- * {@link io.fabric8.kubernetes.api.model.Service}
- * from the Kubernetes REST API
- */
- public static Object loadJson(InputStream in) throws IOException {
- byte[] data = Files.readBytes(in);
- return loadJson(data);
- }
-
- public static Object loadJson(String json) throws IOException {
- byte[] data = json.getBytes();
- return loadJson(data);
- }
-
- /**
- * Returns the given json data as a DTO such as
- * {@link Pod}, {@link ReplicationController} or
- * {@link io.fabric8.kubernetes.api.model.Service}
- * from the Kubernetes REST API
- */
- public static Object loadJson(byte[] json) throws IOException {
- if (json != null && json.length > 0) {
- return objectMapper.reader(KubernetesResource.class).readValue(json);
- }
- return null;
- }
-
- /**
- * Loads the YAML file for the given DTO class
- */
- public static <T> T loadYaml(InputStream in, Class<T> clazz) throws IOException {
- byte[] data = Files.readBytes(in);
- return loadYaml(data, clazz);
- }
-
- /**
- * Loads the YAML file for the given DTO class
- */
- public static <T> T loadYaml(File file, Class<T> clazz) throws IOException {
- byte[] data = Files.readBytes(file);
- return loadYaml(data, clazz);
- }
-
- /**
- * Loads the YAML file for the given DTO class
- */
- public static <T> T loadYaml(byte[] data, Class<T> clazz) throws IOException {
- ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
- return mapper.readValue(data, clazz);
- }
-
- /**
- * Loads the Kubernetes JSON and converts it to a list of entities
- */
- @SuppressWarnings("unchecked")
- public static List<HasMetadata> toItemList(Object entity) throws IOException {
- if (entity instanceof List) {
- return (List<HasMetadata>) entity;
- } else if (entity instanceof HasMetadata[]) {
- HasMetadata[] array = (HasMetadata[]) entity;
- return Arrays.asList(array);
- } else if (entity instanceof KubernetesList) {
- KubernetesList config = (KubernetesList) entity;
- return config.getItems();
- } else if (entity instanceof Template) {
- Template objects = (Template) entity;
- return objects.getObjects();
- } else {
- List<HasMetadata> answer = new ArrayList<>();
- if (entity instanceof HasMetadata) {
- answer.add((HasMetadata) entity);
- }
- return answer;
- }
- }
-
- /**
- * Saves the json object to the given file
- */
- public static void saveJson(File json, Object object) throws IOException {
- objectMapper.writer().writeValue(json, object);
- }
-
- /**
- * Returns a map indexed by pod id of the pods
- */
- public static Map<String, Pod> toPodMap(PodList podSchema) {
- return toFilteredPodMap(podSchema, Filters.<Pod>trueFilter());
- }
-
- protected static Map<String, Pod> toFilteredPodMap(PodList podSchema, Filter<Pod> filter) {
- List<Pod> list = podSchema != null ? podSchema.getItems() : null;
- List<Pod> filteredList = Filters.filter(list, filter);
- return toPodMap(filteredList);
- }
-
- /**
- * Returns a map indexed by pod id of the pods
- */
- public static Map<String, Pod> toPodMap(List<Pod> pods) {
- List<Pod> list = notNullList(pods);
- Map<String, Pod> answer = new HashMap<>();
- for (Pod pod : list) {
- String id = getName(pod);
- if (Strings.isNotBlank(id)) {
- answer.put(id, pod);
- }
- }
- return answer;
- }
-
- /**
- * Returns a map indexed by service id of the services
- */
- public static Map<String, Service> toServiceMap(ServiceList serviceSchema) {
- return toServiceMap(serviceSchema != null ? serviceSchema.getItems() : null);
- }
-
- /**
- * Returns a map indexed by service id of the services
- */
- public static Map<String, Service> toServiceMap(List<Service> services) {
- List<Service> list = notNullList(services);
- Map<String, Service> answer = new HashMap<>();
- for (Service service : list) {
- String id = getName(service);
- if (Strings.isNotBlank(id)) {
- answer.put(id, service);
- }
- }
- return answer;
- }
-
- public static Map<String, Service> toFilteredServiceMap(ServiceList serviceList, Filter<Service> filter) {
- List<Service> list = serviceList != null ? serviceList.getItems() : null;
- List<Service> filteredList = Filters.filter(list, filter);
- return toServiceMap(filteredList);
- }
-
- /**
- * Returns a map indexed by replicationController id of the replicationControllers
- */
- public static Map<String, ReplicationController> toReplicationControllerMap(ReplicationControllerList replicationControllerSchema) {
- Filter<ReplicationController> filter = createReplicationControllerFilter((String) null);
- return toFilteredReplicationControllerMap(replicationControllerSchema, filter);
- }
-
- protected static Map<String, ReplicationController> toFilteredReplicationControllerMap(ReplicationControllerList replicationControllerSchema, Filter<ReplicationController> filter) {
- List<ReplicationController> list = replicationControllerSchema != null ? replicationControllerSchema.getItems() : null;
- List<ReplicationController> filteredList = Filters.filter(list, filter);
- return toReplicationControllerMap(filteredList);
- }
-
- /**
- * Returns a map indexed by replicationController id of the replicationControllers
- */
- public static Map<String, ReplicationController> toReplicationControllerMap(List<ReplicationController> replicationControllers) {
- List<ReplicationController> list = notNullList(replicationControllers);
- Map<String, ReplicationController> answer = new HashMap<>();
- for (ReplicationController replicationControllerSchema : list) {
- String id = getName(replicationControllerSchema);
- if (Strings.isNotBlank(id)) {
- answer.put(id, replicationControllerSchema);
- }
- }
- return answer;
- }
-
- public static Map<String, Pod> getPodMap(Kubernetes kubernetes) {
- return getPodMap(kubernetes, Kubernetes.NAMESPACE_ALL);
- }
-
- public static Map<String, Pod> getPodMap(Kubernetes kubernetes, String namespace) {
- PodList pods = null;
- try {
- pods = kubernetes.getPods(namespace);
- } catch (WebApplicationException e) {
- if (e.getResponse().getStatus() == 404) {
- // ignore not found
- } else {
- throw e;
- }
- }
- return toPodMap(pods);
- }
-
- public static Map<String, Pod> getSelectedPodMap(Kubernetes kubernetes, String selector) {
- return getSelectedPodMap(kubernetes, Kubernetes.NAMESPACE_ALL, selector);
- }
-
- public static Map<String, Pod> getSelectedPodMap(Kubernetes kubernetes, String namespace, String selector) {
- Filter<Pod> filter = createPodFilter(selector);
- return getFilteredPodMap(kubernetes, namespace, filter);
- }
-
- public static Map<String, Pod> getFilteredPodMap(Kubernetes kubernetes, Filter<Pod> filter) {
- return getFilteredPodMap(kubernetes, Kubernetes.NAMESPACE_ALL, filter);
- }
-
- public static Map<String, Pod> getFilteredPodMap(Kubernetes kubernetes, String namespace, Filter<Pod> filter) {
- PodList podSchema = kubernetes.getPods(namespace);
- return toFilteredPodMap(podSchema, filter);
- }
-
- public static Map<String, Service> getServiceMap(Kubernetes kubernetes) {
- return getServiceMap(kubernetes, Kubernetes.NAMESPACE_ALL);
- }
-
- public static Map<String, Service> getServiceMap(Kubernetes kubernetes, String namespace) {
- return toServiceMap(kubernetes.getServices(namespace));
- }
-
- public static Map<String, ReplicationController> getReplicationControllerMap(Kubernetes kubernetes) {
- return getReplicationControllerMap(kubernetes, Kubernetes.NAMESPACE_ALL);
- }
-
- public static Map<String, ReplicationController> getReplicationControllerMap(Kubernetes kubernetes, String namespace) {
- return toReplicationControllerMap(kubernetes.getReplicationControllers(namespace));
- }
-
- public static Map<String, ReplicationController> getSelectedReplicationControllerMap(Kubernetes kubernetes, String selector) {
- return getSelectedReplicationControllerMap(kubernetes, Kubernetes.NAMESPACE_ALL, selector);
- }
-
- public static Map<String, ReplicationController> getSelectedReplicationControllerMap(Kubernetes kubernetes, String namespace, String selector) {
- Filter<ReplicationController> filter = createReplicationControllerFilter(selector);
- return toFilteredReplicationControllerMap(kubernetes.getReplicationControllers(namespace), filter);
- }
-
- /**
- * Removes empty pods returned by Kubernetes
- */
- public static void removeEmptyPods(PodList podSchema) {
- List<Pod> list = notNullList(podSchema.getItems());
-
- List<Pod> removeItems = new ArrayList<Pod>();
-
- for (Pod pod : list) {
- if (StringUtils.isEmpty(getName(pod))) {
- removeItems.add(pod);
-
- }
- }
- list.removeAll(removeItems);
- }
-
- /**
- * Returns the pod id for the given container id
- */
- public static String containerNameToPodId(String containerName) {
- // TODO use prefix?
- return containerName;
- }
-
- /**
- * Returns a string for the labels using "," to separate values
- */
- public static String toLabelsString(Map<String, String> labelMap) {
- StringBuilder buffer = new StringBuilder();
- if (labelMap != null) {
- Set<Map.Entry<String, String>> entries = labelMap.entrySet();
- for (Map.Entry<String, String> entry : entries) {
- if (buffer.length() > 0) {
- buffer.append(",");
- }
- buffer.append(entry.getKey());
- buffer.append("=");
- buffer.append(entry.getValue());
- }
- }
- return buffer.toString();
- }
-
- public static Map<String, String> toLabelsMap(String labels) {
- Map<String, String> map = new HashMap<>();
- if (labels != null && !labels.isEmpty()) {
- String[] elements = labels.split(",");
- if (elements.length > 0) {
- for (String str : elements) {
- String[] keyValue = str.split("=");
- if (keyValue.length == 2) {
- String key = keyValue[0];
- String value = keyValue[1];
- if (key != null && value != null) {
- map.put(key.trim(), value.trim());
- }
- }
- }
- }
- }
- return map;
- }
-
- /**
- * Creates a filter on a pod using the given text string
- */
- public static Filter<Pod> createPodFilter(final String textFilter) {
- if (isNullOrBlank(textFilter)) {
- return Filters.<Pod>trueFilter();
- } else {
- return new Filter<Pod>() {
- public String toString() {
- return "PodFilter(" + textFilter + ")";
- }
-
- public boolean matches(Pod entity) {
- return filterMatchesIdOrLabels(textFilter, getName(entity), entity.getMetadata().getLabels());
- }
- };
- }
- }
-
- /**
- * Creates a filter on a pod using the given set of labels
- */
- public static Filter<Pod> createPodFilter(final Map<String, String> labelSelector) {
- if (labelSelector == null || labelSelector.isEmpty()) {
- return Filters.<Pod>trueFilter();
- } else {
- return new Filter<Pod>() {
- public String toString() {
- return "PodFilter(" + labelSelector + ")";
- }
-
- public boolean matches(Pod entity) {
- return filterLabels(labelSelector, entity.getMetadata().getLabels());
- }
- };
- }
- }
-
- /**
- * Creates a filter on a pod annotations using the given set of attribute values
- */
- public static Filter<Pod> createPodAnnotationFilter(final Map<String, String> annotationSelector) {
- if (annotationSelector == null || annotationSelector.isEmpty()) {
- return Filters.<Pod>trueFilter();
- } else {
- return new Filter<Pod>() {
- public String toString() {
- return "PodAnnotationFilter(" + annotationSelector + ")";
- }
-
- public boolean matches(Pod entity) {
- return filterLabels(annotationSelector, entity.getMetadata().getAnnotations());
- }
- };
- }
- }
-
- /**
- * Creates a filter on a service using the given text string
- */
- public static Filter<Service> createServiceFilter(final String textFilter) {
- if (isNullOrBlank(textFilter)) {
- return Filters.<Service>trueFilter();
- } else {
- return new Filter<Service>() {
- public String toString() {
- return "ServiceFilter(" + textFilter + ")";
- }
-
- public boolean matches(Service entity) {
- return filterMatchesIdOrLabels(textFilter, getName(entity), entity.getMetadata().getLabels());
- }
- };
- }
- }
-
- /**
- * Creates a filter on a service if it matches the given namespace
- */
- public static Filter<Service> createNamespaceServiceFilter(final String namespace) {
- if (isNullOrBlank(namespace)) {
- return Filters.<Service>trueFilter();
- } else {
- return new Filter<Service>() {
- public String toString() {
- return "NamespaceServiceFilter(" + namespace + ")";
- }
-
- public boolean matches(Service entity) {
- return Objects.equal(namespace, getNamespace(entity.getMetadata()));
- }
- };
- }
- }
-
- /**
- * Creates a filter on a service using the given text string
- */
- public static Filter<Service> createServiceFilter(final Map<String, String> labelSelector) {
- if (labelSelector == null || labelSelector.isEmpty()) {
- return Filters.<Service>trueFilter();
- } else {
- return new Filter<Service>() {
- public String toString() {
- return "ServiceFilter(" + labelSelector + ")";
- }
-
- public boolean matches(Service entity) {
- return filterLabels(labelSelector, entity.getMetadata().getLabels());
- }
- };
- }
- }
-
- /**
- * Creates a filter on a replicationController using the given text string
- */
- public static Filter<ReplicationController> createReplicationControllerFilter(final String textFilter) {
- if (isNullOrBlank(textFilter)) {
- return Filters.<ReplicationController>trueFilter();
- } else {
- return new Filter<ReplicationController>() {
- public String toString() {
- return "ReplicationControllerFilter(" + textFilter + ")";
- }
-
- public boolean matches(ReplicationController entity) {
- return filterMatchesIdOrLabels(textFilter, getName(entity), entity.getMetadata().getLabels());
- }
- };
- }
- }
-
- /**
- * Creates a filter on a replicationController using the given text string
- */
- public static Filter<ReplicationController> createReplicationControllerFilter(final Map<String, String> labelSelector) {
- if (labelSelector == null || labelSelector.isEmpty()) {
- return Filters.<ReplicationController>trueFilter();
- } else {
- return new Filter<ReplicationController>() {
- public String toString() {
- return "ReplicationControllerFilter(" + labelSelector + ")";
- }
-
- public boolean matches(ReplicationController entity) {
- return filterLabels(labelSelector, entity.getMetadata().getLabels());
- }
- };
- }
- }
-
- /**
- * Returns true if the given textFilter matches either the id or the labels
- */
- public static boolean filterMatchesIdOrLabels(String textFilter, String id, Map<String, String> labels) {
- String text = toLabelsString(labels);
- boolean result = (text != null && text.contains(textFilter)) || (id != null && id.contains(textFilter));
- if (!result) {
- //labels can be in different order to selector
- Map<String, String> selectorMap = toLabelsMap(textFilter);
-
- if (!selectorMap.isEmpty() && labels != null && !labels.isEmpty()) {
- result = true;
- for (Map.Entry<String, String> entry : selectorMap.entrySet()) {
- String value = labels.get(entry.getKey());
- if (value == null || !value.matches(entry.getValue())) {
- result = false;
- break;
- }
- }
- }
- }
- return result;
- }
-
- /**
- * Returns true if the given filterLabels matches the actual labels
- */
- public static boolean filterLabels(Map<String, String> filterLabels, Map<String, String> labels) {
- if (labels == null) {
- return false;
- }
- Set<Map.Entry<String, String>> entries = filterLabels.entrySet();
- for (Map.Entry<String, String> entry : entries) {
- String key = entry.getKey();
- String expectedValue = entry.getValue();
- String actualValue = labels.get(key);
- if (!Objects.equal(expectedValue, actualValue)) {
- return false;
- }
- }
- return true;
- }
-
-
- /**
- * For positive non-zero values return the text of the number or return blank
- */
- public static String toPositiveNonZeroText(Integer port) {
- if (port != null) {
- int value = port;
- if (value > 0) {
- return "" + value;
- }
- }
- return "";
- }
-
- /**
- * Returns all the containers from the given pod
- */
- @SuppressWarnings("unchecked")
- public static List<Container> getContainers(Pod pod) {
- if (pod != null) {
- PodSpec podSpec = pod.getSpec();
- return getContainers(podSpec);
-
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Returns all the containers from the given Replication Controller
- */
- @SuppressWarnings("unchecked")
- public static List<Container> getContainers(ReplicationController replicationController) {
- if (replicationController != null) {
- ReplicationControllerSpec replicationControllerSpec = replicationController.getSpec();
- return getContainers(replicationControllerSpec);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Returns all the containers from the given Replication Controller's replicationControllerSpec
- */
- @SuppressWarnings("unchecked")
- public static List<Container> getContainers(ReplicationControllerSpec replicationControllerSpec) {
- if (replicationControllerSpec != null) {
- PodTemplateSpec podTemplateSpec = replicationControllerSpec.getTemplate();
- return getContainers(podTemplateSpec);
- }
- return Collections.EMPTY_LIST;
- }
-
- @SuppressWarnings("unchecked")
- public static List<Container> getContainers(PodSpec podSpec) {
- if (podSpec != null) {
- return podSpec.getContainers();
- }
- return Collections.EMPTY_LIST;
- }
-
- @SuppressWarnings("unchecked")
- public static List<Container> getContainers(PodTemplateSpec podTemplateSpec) {
- if (podTemplateSpec != null) {
- return getContainers(podTemplateSpec.getSpec());
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Returns all the containers from the given Replication Controller
- */
- @SuppressWarnings("unchecked")
- public static List<Container> getCurrentContainers(ReplicationController replicationController) {
- if (replicationController != null) {
- // TODO
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Returns all the current containers from the given currentState
- */
- @SuppressWarnings("unchecked")
- public static Map<String, ContainerStatus> getCurrentContainers(Pod pod) {
- if (pod != null) {
- PodStatus currentStatus = pod.getStatus();
- return getCurrentContainers(currentStatus);
-
- }
- return Collections.EMPTY_MAP;
- }
-
- /**
- * Returns all the current containers from the given podStatus
- */
- @SuppressWarnings("unchecked")
- public static Map<String, ContainerStatus> getCurrentContainers(PodStatus podStatus) {
- if (podStatus != null) {
- List<ContainerStatus> containerStatuses = podStatus.getContainerStatuses();
- Map<String, ContainerStatus> info = new Hashtable<>(containerStatuses.size());
- for (ContainerStatus status : containerStatuses) {
- info.put(status.getContainerID(), status);
- }
- return info;
- }
- return Collections.EMPTY_MAP;
- }
-
- /**
- * Returns the host of the pod
- */
- public static String getHost(Pod pod) {
- if (pod != null) {
- PodStatus currentState = pod.getStatus();
- if (currentState != null) {
- return currentState.getHostIP();
- }
- }
- return null;
- }
-
- /**
- * Returns the container port number for the given service
- */
- @SuppressWarnings("unchecked")
- public static Set<Integer> getContainerPorts(Service service) {
- Set<Integer> answer = Collections.EMPTY_SET;
- String id = getName(service);
- ServiceSpec spec = service.getSpec();
- if (spec != null) {
- List<ServicePort> servicePorts = spec.getPorts();
- Objects.notNull(servicePorts, "servicePorts for service " + id);
-
- answer = new HashSet<>(servicePorts.size());
- String message = "service " + id;
-
- for (ServicePort port : servicePorts) {
- IntOrString intOrStringValue = port.getTargetPort();
- Integer intValue = intOrStringToInteger(intOrStringValue, message);
- if (intValue != null) {
- answer.add(intValue);
- }
- }
- }
- return answer;
- }
-
- /**
- * Returns the IntOrString converted to an Integer value or throws an exception with the given message
- */
- public static Integer intOrStringToInteger(IntOrString intOrStringValue, String message) {
- Integer intValue = intOrStringValue.getIntVal();
- if (intValue == null) {
- String containerPortText = intOrStringValue.getStrVal();
- if (Strings.isNullOrBlank(containerPortText)) {
- throw new IllegalArgumentException("No port for " +
- message);
- }
- try {
- intValue = Integer.parseInt(containerPortText);
- } catch (NumberFormatException e) {
- throw new IllegalStateException("Invalid servicePorts expression " + containerPortText + " for " +
- message + ". " + e, e);
- }
- }
- return intValue;
- }
-
- /**
- * Returns the container port number for the given service
- */
- @SuppressWarnings("unchecked")
- public static Set<String> getContainerPortsStrings(Service service) {
- Set<String> answer = Collections.EMPTY_SET;
- String id = getName(service);
- ServiceSpec spec = service.getSpec();
- if (spec != null) {
- List<ServicePort> servicePorts = spec.getPorts();
- Objects.notNull(servicePorts, "servicePorts for service " + id);
-
- answer = new HashSet<>(servicePorts.size());
-
- for (ServicePort port : servicePorts) {
- IntOrString intOrStringValue = port.getTargetPort();
- Integer intValue = intOrStringValue.getIntVal();
- if (intValue != null) {
- answer.add(intValue.toString());
- } else {
- String containerPortText = intOrStringValue.getStrVal();
- if (Strings.isNullOrBlank(containerPortText)) {
- throw new IllegalArgumentException("No servicePorts for service " + id);
- }
- answer.add(containerPortText);
- }
- }
- }
- return answer;
- }
-
- /**
- * Combines the JSON objects into a config object
- */
- public static Object combineJson(Object... objects) throws IOException {
- KubernetesList list = findOrCreateList(objects);
- List<HasMetadata> items = list.getItems();
- if (items == null) {
- items = new ArrayList<>();
- list.setItems(items);
- }
- for (Object object : objects) {
- if (object != list) {
- addObjectsToItemArray(items, object);
- }
- }
- moveServicesToFrontOfArray(items);
- removeDuplicates(items);
- Object answer = Templates.combineTemplates(list, items);
- items = toItemList(answer);
- removeDuplicates(items);
- return answer;
- }
-
- /**
- * Lets move all Service resources before any other to avoid ordering issues creating things
- */
- public static void moveServicesToFrontOfArray(List<HasMetadata> list) {
- int size = list.size();
- int lastNonService = -1;
- for (int i = 0; i < size; i++) {
- HasMetadata item = list.get(i);
- if (item instanceof Service) {
- if (lastNonService >= 0) {
- HasMetadata nonService = list.get(lastNonService);
- list.set(i, nonService);
- list.set(lastNonService, item);
- lastNonService++;
- }
- } else if (lastNonService < 0) {
- lastNonService = i;
- }
- }
- }
-
- /**
- * Remove any duplicate resources using the kind and id
- */
- protected static void removeDuplicates(List<HasMetadata> itemArray) {
- int size = itemArray.size();
- int lastNonService = -1;
- Set<String> keys = new HashSet<>();
- for (int i = 0; i < size; i++) {
- HasMetadata item = itemArray.get(i);
- if (item == null) {
- itemArray.remove(i);
- i--;
- size--;
- } else {
- String id = getObjectId(item);
- String kind = item.getClass().getSimpleName();
- if (Strings.isNotBlank(id)) {
- String key = kind + ":" + id;
- if (!keys.add(key)) {
- // lets remove this one
- itemArray.remove(i);
- i--;
- size--;
- }
- }
-
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- protected static void addObjectsToItemArray(List destinationList, Object object) throws IOException {
- if (object instanceof KubernetesList) {
- KubernetesList kubernetesList = (KubernetesList) object;
- List<HasMetadata> items = kubernetesList.getItems();
- if (items != null) {
- destinationList.addAll(items);
- }
- } else if (object instanceof Collection) {
- Collection collection = (Collection) object;
- destinationList.addAll(collection);
- } else {
- destinationList.add(object);
- }
- }
-
- protected static KubernetesList findOrCreateList(Object[] objects) {
- KubernetesList list = null;
- for (Object object : objects) {
- if (object instanceof KubernetesList) {
- list = (KubernetesList) object;
- break;
- }
- }
- if (list == null) {
- list = new KubernetesList();
- }
- return list;
- }
-
- /**
- * Returns the URL to access the service; using the service portalIP and port
- */
- public static String getServiceURL(Service service) {
- if (service != null) {
- ServiceSpec spec = service.getSpec();
- if (spec != null) {
- String portalIP = spec.getPortalIP();
- if (portalIP != null) {
- Integer port = spec.getPorts().iterator().next().getPort();
- if (port != null && port > 0) {
- portalIP += ":" + port;
- }
- String protocol = "http://";
- if (KubernetesHelper.isServiceSsl(spec.getPortalIP(), port, Boolean.valueOf(System.getenv(KubernetesFactory.KUBERNETES_TRUST_ALL_CERIFICATES)))) {
- protocol = "https://";
- }
- return protocol + portalIP;
- }
- }
- }
- return null;
- }
-
- public static String serviceToHost(String id) {
- return Systems.getEnvVarOrSystemProperty(toEnvVariable(id + HOST_SUFFIX), "");
- }
-
- public static String serviceToPort(String id) {
- return Systems.getEnvVarOrSystemProperty(toEnvVariable(id + PORT_SUFFIX), "");
- }
-
- public static String serviceToProtocol(String id, String servicePort) {
- return Systems.getEnvVarOrSystemProperty(toEnvVariable(id + PORT_SUFFIX + "_" + servicePort + PROTO_SUFFIX), DEFAULT_PROTO);
- }
-
- public static String toEnvVariable(String str) {
- return str.toUpperCase().replaceAll("-", "_");
- }
-
- /**
- * Returns the port for the given port number on the pod
- */
- public static ContainerPort findContainerPort(Pod pod, Integer portNumber) {
- List<Container> containers = KubernetesHelper.getContainers(pod);
- for (Container container : containers) {
- List<ContainerPort> ports = container.getPorts();
- for (ContainerPort port : ports) {
- if (Objects.equal(portNumber, port.getContainerPort())) {
- return port;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the port for the given port name
- */
- public static ContainerPort findContainerPortByName(Pod pod, String name) {
- List<Container> containers = KubernetesHelper.getContainers(pod);
- for (Container container : containers) {
- List<ContainerPort> ports = container.getPorts();
- for (ContainerPort port : ports) {
- if (Objects.equal(name, port.getName())) {
- return port;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the port for the given port number or name
- */
- public static ContainerPort findContainerPortByNumberOrName(Pod pod, String numberOrName) {
- Integer portNumber = toOptionalNumber(numberOrName);
- if (portNumber != null) {
- return findContainerPort(pod, portNumber);
- } else {
- return findContainerPortByName(pod, numberOrName);
- }
- }
-
- /**
- * Returns the number if it can be parsed or null
- */
- protected static Integer toOptionalNumber(String text) {
- if (Strings.isNotBlank(text)) {
- try {
- return Integer.parseInt(text);
- } catch (NumberFormatException e) {
- // ignore parse errors
- }
- }
- return null;
- }
-
- public static PodStatusType getPodStatus(Pod pod) {
- String text = getPodStatusText(pod);
- if (Strings.isNotBlank(text)) {
- text = text.toLowerCase();
- if (text.startsWith("run")) {
- return PodStatusType.OK;
- } else if (text.startsWith("wait")) {
- return PodStatusType.WAIT;
- } else {
- return PodStatusType.ERROR;
- }
- }
- return PodStatusType.WAIT;
- }
-
- /**
- * Returns true if the pod is running
- */
- public static boolean isPodRunning(Pod pod) {
- PodStatusType status = getPodStatus(pod);
- return Objects.equal(status, PodStatusType.OK);
- }
-
- public static String getPodStatusText(Pod pod) {
- if (pod != null) {
- PodStatus podStatus = pod.getStatus();
- if (podStatus != null) {
- return podStatus.getPhase();
- }
- }
- return null;
- }
-
- /**
- * Returns the pods for the given replication controller
- */
- @SuppressWarnings("unchecked")
- public static List<Pod> getPodsForReplicationController(ReplicationController replicationController, Iterable<Pod> pods) {
- ReplicationControllerSpec replicationControllerSpec = replicationController.getSpec();
- if (replicationControllerSpec == null) {
- LOG.warn("Cannot instantiate replication controller: " + getName(replicationController) + " due to missing ReplicationController.Spec!");
- } else {
- Map<String, String> replicaSelector = replicationControllerSpec.getSelector();
- Filter<Pod> podFilter = KubernetesHelper.createPodFilter(replicaSelector);
- return Filters.filter(pods, podFilter);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Returns the pods for the given service
- */
- public static List<Pod> getPodsForService(Service service, Iterable<Pod> pods) {
- Map<String, String> selector = getSelector(service);
- Filter<Pod> podFilter = KubernetesHelper.createPodFilter(selector);
- return Filters.filter(pods, podFilter);
- }
-
- /**
- * Looks up the service endpoints in DNS.
- *
- * Endpoints are registered as SRV records in DNS so this method returns
- * endpoints in the format "host:port". This is a list as SRV records are ordered
- * by priority & weight before being returned to the client.
- *
- * See https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/addons/dns/README.md
- */
- public static List<String> lookupServiceEndpointsInDns(String serviceName) throws IllegalArgumentException, UnknownHostException {
- try {
- Lookup l = new Lookup(serviceName, Type.SRV);
- Record[] records = l.run();
- if (l.getResult() == Lookup.SUCCESSFUL) {
-
- SRVRecord[] srvRecords = Arrays.copyOf(records, records.length, SRVRecord[].class);
- Arrays.sort(srvRecords, new Comparator<SRVRecord>() {
- @Override
- public int compare(SRVRecord a, SRVRecord b) {
- int ret = Integer.compare(b.getPriority(), a.getPriority());
- if (ret == 0) {
- ret = Integer.compare(b.getWeight(), a.getWeight());
- }
- return ret;
- }
- });
-
- List<String> endpointAddresses = new ArrayList<>(srvRecords.length);
- for (SRVRecord srvRecord : srvRecords) {
- endpointAddresses.add(srvRecord.getTarget().toString(true).concat(":").concat(String.valueOf(srvRecord.getPort())));
- }
- return endpointAddresses;
- } else {
- LOG.warn("Lookup {} result: {}", serviceName, l.getErrorString());
- }
- } catch (TextParseException e) {
- LOG.error("Unparseable service name: {}", serviceName, e);
- } catch (ClassCastException e) {
- LOG.error("Invalid response from DNS server - should have been A records", e);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Looks up the service in DNS.
- * If this is a headless service, this call returns the endpoint IPs from DNS.
- * If this is a non-headless service, this call returns the service IP only.
- * <p/>
- * See https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md#headless-services
- */
- public static Set<String> lookupServiceInDns(String serviceName) throws IllegalArgumentException, UnknownHostException {
- try {
- Lookup l = new Lookup(serviceName);
- Record[] records = l.run();
- if (l.getResult() == Lookup.SUCCESSFUL) {
- Set<String> endpointAddresses = new HashSet<>(records.length);
- for (int i = 0; i < records.length; i++) {
- ARecord aRecord = (ARecord) records[i];
- endpointAddresses.add(aRecord.getAddress().getHostAddress());
- }
- return endpointAddresses;
- } else {
- LOG.warn("Lookup {} result: {}", serviceName, l.getErrorString());
- }
- } catch (TextParseException e) {
- LOG.error("Unparseable service name: {}", serviceName, e);
- } catch (ClassCastException e) {
- LOG.error("Invalid response from DNS server - should have been A records", e);
- }
- return Collections.EMPTY_SET;
- }
-
- public static boolean isServiceSsl(String host, int port, boolean trustAllCerts) {
- try {
- SSLSocketFactory sslsocketfactory;
- if (trustAllCerts) {
- sslsocketfactory = TrustEverythingSSLTrustManager.getTrustingSSLSocketFactory();
- } else {
- sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
- }
-
- Socket socket = sslsocketfactory.createSocket();
-
- // Connect, with an explicit timeout value
- socket.connect(new InetSocketAddress(host, port), 1 * 1000);
- try {
-
- InputStream in = socket.getInputStream();
- OutputStream out = socket.getOutputStream();
-
- // Write a test byte to get a reaction :)
- out.write(1);
-
- while (in.available() > 0) {
- System.out.print(in.read());
- }
-
- return true;
- } finally {
- socket.close();
- }
- } catch (SSLHandshakeException e) {
- LOG.error("SSL handshake failed - this probably means that you need to trust the kubernetes root SSL certificate or set the environment variable " + KubernetesFactory.KUBERNETES_TRUST_ALL_CERIFICATES, e);
- } catch (SSLProtocolException e) {
- LOG.error("SSL protocol error", e);
- } catch (SSLKeyException e) {
- LOG.error("Bad SSL key", e);
- } catch (SSLPeerUnverifiedException e) {
- LOG.error("Could not verify server", e);
- } catch (SSLException e) {
- LOG.debug("Address does not appear to be SSL-enabled - falling back to http", e);
- } catch (IOException e) {
- LOG.debug("Failed to validate service", e);
- }
- return false;
- }
-
- /**
- * Validates that the given value is valid according to the kubernetes ID parsing rules, throwing an exception if not.
- */
- public static String validateKubernetesId(String currentValue, String description) throws IllegalArgumentException {
- if (isNullOrBlank(currentValue)) {
- throw new IllegalArgumentException("No " + description + " is specified!");
- }
- int size = currentValue.length();
- for (int i = 0; i < size; i++) {
- char ch = currentValue.charAt(i);
- if (Character.isUpperCase(ch)) {
- throw new IllegalArgumentException("Invalid upper case letter '" + ch + "' at index " + i + " for " + description + " value: " + currentValue);
- }
- }
- return currentValue;
- }
-
- public static Date parseDate(String text) {
- try {
- return dateTimeFormat.parse(text);
- } catch (ParseException e) {
- LOG.warn("Failed to parse date: " + text + ". Reason: " + e);
- return null;
- }
- }
-
- /**
- * Returns a short summary text message for the given kubernetes resource
- */
- public static String summaryText(Object object) {
- if (object instanceof Route) {
- return summaryText((Route) object);
- } else if (object instanceof Service) {
- return summaryText((Service) object);
- } else if (object instanceof ReplicationController) {
- return summaryText((ReplicationController) object);
- } else if (object instanceof Pod) {
- return summaryText((Pod) object);
- } else if (object instanceof Template) {
- return summaryText((Template) object);
- } else if (object instanceof DeploymentConfig) {
- return summaryText((DeploymentConfig) object);
- } else if (object instanceof OAuthClient) {
- return summaryText((OAuthClient) object);
- } else if (object instanceof String) {
- return object.toString();
- }
- return "";
- }
-
- /**
- * Returns a short summary text message for the given kubernetes resource
- */
- public static String summaryText(Route entity) {
- RouteSpec spec = entity.getSpec();
- if (spec == null) {
- return "No spec!";
- }
- return "host: " + spec.getHost();
- }
-
- /**
- * Returns a short summary text message for the given kubernetes resource
- */
- public static String summaryText(ContainerState entity) {
- ContainerStateRunning running = entity.getRunning();
- if (running != null) {
- return "Running";
- }
- ContainerStateWaiting waiting = entity.getWaiting();
- if (waiting != null) {
- return "Waiting";
- }
- ContainerStateTerminated termination = entity.getTermination();
- if (termination != null) {
- return "Terminated";
- }
- return "Unknown";
- }
-
- /**
- * Returns a short summary text message for the given kubernetes resource
- */
- public static String summaryText(Template entity) {
- StringBuilder buffer = new StringBuilder();
- List<Parameter> parameters = entity.getParameters();
- if (parameters != null) {
- for (Parameter parameter : parameters) {
- String name = parameter.getName();
- appendText(buffer, name);
- }
- }
- return "parameters: " + buffer;
- }
-
- /**
- * Returns a short summary text message for the given kubernetes resource
- */
- public static String summaryText(OAuthClient entity) {
- return "redirectURIs: " + entity.getRedirectURIs();
- }
-
- /**
- * Returns a short summary text message for the given kubernetes resource
- */
- public static String summaryText(Service entity) {
- StringBuilder portText = new StringBuilder();
- ServiceSpec spec = entity.getSpec();
- if (spec == null) {
- return "No spec";
- } else {
- List<ServicePort> ports = spec.getPorts();
- if (ports != null) {
- for (ServicePort port : ports) {
- Integer number = port.getPort();
- if (number != null) {
- if (portText.length() > 0) {
- portText.append(", ");
- }
- portText.append("").append(number);
- }
- }
-
- }
- return "selector: " + spec.getSelector() + " ports: " + portText;
- }
- }
-
- /**
- * Returns a short summary text message for the given kubernetes resource
- */
- public static String summaryText(ReplicationController entity) {
- StringBuilder buffer = new StringBuilder();
- ReplicationControllerSpec spec = entity.getSpec();
- if (spec != null) {
- buffer.append("replicas: ").append(spec.getReplicas());
- PodTemplateSpec podTemplateSpec = spec.getTemplate();
- if (podTemplateSpec != null) {
- appendSummaryText(buffer, podTemplateSpec);
- }
- }
- return buffer.toString();
- }
-
- /**
- * Returns a short summary text message for the given kubernetes resource
- */
- public static String summaryText(DeploymentConfig entity) {
- StringBuilder buffer = new StringBuilder();
- DeploymentConfigSpec spec = entity.getSpec();
- if (spec != null) {
- buffer.append("replicas: " + spec.getReplicas());
- PodTemplateSpec podTemplateSpec = spec.getTemplate();
- if (podTemplateSpec != null) {
- appendSummaryText(buffer, podTemplateSpec);
- }
- }
- return buffer.toString();
- }
-
- /**
- * Returns a short summary text message for the given kubernetes resource
- */
- public static String summaryText(Pod entity) {
- StringBuilder buffer = new StringBuilder();
- PodSpec podSpec = entity.getSpec();
- appendSummaryText(buffer, podSpec);
- return buffer.toString();
- }
-
- protected static void appendSummaryText(StringBuilder buffer, PodTemplateSpec podTemplateSpec) {
- if (podTemplateSpec != null) {
- appendSummaryText(buffer, podTemplateSpec.getSpec());
- }
- }
-
- protected static void appendSummaryText(StringBuilder buffer, PodSpec podSpec) {
- if (podSpec != null) {
- List<Container> containers = podSpec.getContainers();
- if (containers != null) {
- for (Container container : containers) {
- String image = container.getImage();
- appendText(buffer, "image: " + image);
- }
- }
- }
- }
-
- protected static void appendText(StringBuilder buffer, String text) {
- if (buffer.length() > 0) {
- buffer.append(", ");
- }
- buffer.append(text);
- }
-
- /**
- * Creates an IntOrString from the given string which could be a number or a name
- */
- public static IntOrString createIntOrString(int intVal) {
- IntOrString answer = new IntOrString();
- answer.setIntVal(intVal);
- answer.setKind(INTORSTRING_KIND_INT);
- return answer;
- }
-
- /**
- * Creates an IntOrString from the given string which could be a number or a name
- */
- public static IntOrString createIntOrString(String nameOrNumber) {
- if (isNullOrBlank(nameOrNumber)) {
- return null;
- } else {
- IntOrString answer = new IntOrString();
- Integer intVal = null;
- try {
- intVal = Integer.parseInt(nameOrNumber);
- } catch (Exception e) {
- // ignore invalid number
- }
- if (intVal != null) {
- answer.setIntVal(intVal);
- answer.setKind(INTORSTRING_KIND_INT);
- } else {
- answer.setStrVal(nameOrNumber);
- answer.setKind(INTORSTRING_KIND_STRING);
- }
- return answer;
- }
- }
-
- public static String getStatusText(PodStatus podStatus) {
- String status;
- List<String> statusList = new ArrayList<>();
- List<ContainerStatus> containerStatuses = podStatus.getContainerStatuses();
- for (ContainerStatus containerStatus : containerStatuses) {
- ContainerState state = containerStatus.getState();
- String statusText = summaryText(state);
- if (statusText != null) {
- statusList.add(statusText);
- }
- }
- if (statusList.size() == 1) {
- status = statusList.get(0);
- } else {
- status = statusList.toString();
- }
- return status;
- }
-
- public static Secret validateSecretExists(KubernetesClient kubernetes, String namespace, String secretName) {
- Secret secret = null;
- try {
- secret = kubernetes.getSecret(secretName, namespace);
- } catch (WebApplicationException e) {
- if (e.getResponse().getStatus() == 404) {
- // does not exist
- } else {
- throw e;
- }
- }
- if (secret == null) {
- throw new IllegalArgumentException("No secret named: " + secretName +
- " for namespace " + namespace + " is available on Kubernetes at address " + kubernetes.getAddress() +
- ". For how to create secrets see: http://fabric8.io/guide/fabric8OnOpenShift.html#requirements ");
- } else {
- return secret;
- }
- }
-
- /**
- * Converts the DTO loaded from JSON to a {@link KubernetesList} assuming its not a {@link Template}
- */
- public static KubernetesList asKubernetesList(Object dto) throws IOException {
- if (dto instanceof KubernetesList) {
- return (KubernetesList) dto;
- } else {
- KubernetesList answer = new KubernetesList();
- List<HasMetadata> items = toItemList(dto);
- answer.setItems(items);
- return answer;
- }
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/PodStatusType.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/PodStatusType.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/PodStatusType.java
deleted file mode 100644
index 19a1bd7..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/PodStatusType.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-/**
- * Represents the status of the pod
- */
-public enum PodStatusType {
- WAIT, OK, ERROR
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/ServiceNames.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/ServiceNames.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/ServiceNames.java
deleted file mode 100644
index e453153..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/ServiceNames.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-/**
- * Defines some standard service names for common services in fabric8
- */
-public class ServiceNames {
-
- // Management
- //-------------------------------------------------------------------------
-
- /**
- * The fabric8 console
- */
- public static final String FABRIC8_CONSOLE = "fabric8";
-
- public static final String ELASTICSEARCH = "elasticsearch";
- public static final String KIBANA = "kibana";
- public static final String INFLUXDB = "influxdb";
- public static final String GRAFANA = "grafana";
-
- public static final String KEYCLOAK = "keycloak";
-
- // Continuous Delivery
- //-------------------------------------------------------------------------
- public static final String GOGS = "fabric8";
- public static final String JENKINS = "jenkins";
- public static final String NEXUS = "nexus";
- public static final String GERRIT = "gerrit";
- public static final String SONARQUBE = "sonarqube";
-
- /**
- * used for jBPM workflows with CD
- */
- public static final String CDELIVERY_API = "cdelivery";
-
- // Social
- //-------------------------------------------------------------------------
-
- public static final String HUBOT = "hubot";
- public static final String LETSCHAT = "letschat";
- public static final String TAIGA = "taiga";
-}
[44/50] [abbrv] stratos git commit: Conflict resolved
Posted by ga...@apache.org.
Conflict resolved
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/880f0988
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/880f0988
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/880f0988
Branch: refs/heads/master
Commit: 880f098867fe0efa3d4156195c1b2585ec362740
Parents: 2c34f81
Author: Akila Perera <ra...@gmail.com>
Authored: Thu Aug 27 10:48:59 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Tue Sep 1 16:24:18 2015 +0530
----------------------------------------------------------------------
.../test/PythonCartridgeAgentTest.java | 530 -----------------
.../src/test/resources/agent.conf | 46 --
.../src/test/resources/jndi.properties | 22 -
.../src/test/resources/log4j.properties | 41 --
.../src/test/resources/logging.ini | 52 --
.../src/test/resources/payload/launch-params | 1 -
.../src/test/resources/payload/launch-params2 | 18 -
.../python-cartridge-agent/integration/pom.xml | 161 ++++++
.../python.cartridge.agent/test/ADCTest.java | 21 +
.../test/PythonCartridgeAgentTest.java | 578 +++++++++++++++++++
.../src/test/resources/log4j.properties | 41 ++
.../src/test/resources/pca-testing1.xml | 29 +
.../src/test/resources/pca-testing2.xml | 29 +
.../src/test/resources/suite-1/agent.conf | 46 ++
.../src/test/resources/suite-1/jndi.properties | 22 +
.../src/test/resources/suite-1/logging.ini | 52 ++
.../resources/suite-1/payload/launch-params | 1 +
.../src/test/resources/suite-2/agent.conf | 46 ++
.../src/test/resources/suite-2/jndi.properties | 22 +
.../src/test/resources/suite-2/logging.ini | 52 ++
.../resources/suite-2/payload/launch-params | 18 +
.../test-conf/integration-test.properties | 26 +
products/python-cartridge-agent/pom.xml | 5 +-
23 files changed, 1146 insertions(+), 713 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java b/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
deleted file mode 100644
index f127e67..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.stratos.python.cartridge.agent.test;
-
-import org.apache.activemq.broker.BrokerService;
-import org.apache.commons.exec.*;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.output.ByteArrayOutputStream;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.domain.LoadBalancingIPType;
-import org.apache.stratos.common.threading.StratosThreadPool;
-import org.apache.stratos.messaging.broker.publish.EventPublisher;
-import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
-import org.apache.stratos.messaging.domain.topology.*;
-import org.apache.stratos.messaging.event.Event;
-import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
-import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
-import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
-import org.apache.stratos.messaging.listener.instance.status.InstanceActivatedEventListener;
-import org.apache.stratos.messaging.listener.instance.status.InstanceStartedEventListener;
-import org.apache.stratos.messaging.message.receiver.instance.status.InstanceStatusEventReceiver;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
-import org.apache.stratos.messaging.util.MessagingUtil;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.util.*;
-import java.util.concurrent.ExecutorService;
-
-import static junit.framework.Assert.assertTrue;
-
-@RunWith(Parameterized.class)
-public class PythonCartridgeAgentTest {
-
- private static final Log log = LogFactory.getLog(PythonCartridgeAgentTest.class);
-
- private static final String NEW_LINE = System.getProperty("line.separator");
- // private static final long TIMEOUT = 1440000;
- private static final long TIMEOUT = 120000;
- private static final String CLUSTER_ID = "php.php.domain";
- private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
- private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-1";
- private static final String APP_ID = "application-1";
- private static final String MEMBER_ID = "php.member-1";
- private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
- private static final String NETWORK_PARTITION_ID = "network-partition-1";
- private static final String PARTITION_ID = "partition-1";
- private static final String TENANT_ID = "-1234";
- private static final String SERVICE_NAME = "php";
- public static final String SOURCE_PATH = "/tmp/java.lang.Stringstratos-pca-test-app-path/";
- private static final String CARTRIDGE_UUID ="uuid" ;
-
- private static List<ServerSocket> serverSocketList;
- private static Map<String, Executor> executorList;
- private final ArtifactUpdatedEvent artifactUpdatedEvent;
- private final Boolean expectedResult;
- private boolean instanceStarted;
- private boolean instanceActivated;
- private ByteArrayOutputStreamLocal outputStream;
- private boolean eventReceiverInitiated = false;
- private TopologyEventReceiver topologyEventReceiver;
- private InstanceStatusEventReceiver instanceStatusEventReceiver;
- private int cepPort = 7712;
- private BrokerService broker = new BrokerService();
- private static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "tcp://localhost:61617";
- private static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "mqtt://localhost:1884";
- private static final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
-
- public PythonCartridgeAgentTest(ArtifactUpdatedEvent artifactUpdatedEvent, Boolean expectedResult) {
- this.artifactUpdatedEvent = artifactUpdatedEvent;
- this.expectedResult = expectedResult;
- }
-
- /**
- * Setup method for test class
- */
- @BeforeClass
- public static void oneTimeSetUp() {
- // Set jndi.properties.dir system property for initializing event publishers and receivers
- System.setProperty("jndi.properties.dir", getResourcesFolderPath());
- }
-
- /**
- * Setup method for test method testPythonCartridgeAgent
- */
- @Before
- public void setup() {
- serverSocketList = new ArrayList<ServerSocket>();
- executorList = new HashMap<String, Executor>();
- try {
- broker.addConnector(ACTIVEMQ_AMQP_BIND_ADDRESS);
- broker.addConnector(ACTIVEMQ_MQTT_BIND_ADDRESS);
- broker.setBrokerName("testBroker");
- broker.setDataDirectory(PythonCartridgeAgentTest.class.getResource("/").getPath() +
- File.separator + ".." + File.separator + PYTHON_AGENT_DIR_NAME + File.separator + "activemq-data");
- broker.start();
- log.info("Broker service started!");
- }
- catch (Exception e) {
- log.error("Error while setting up broker service", e);
- }
- if (!this.eventReceiverInitiated) {
- ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 15);
- topologyEventReceiver = new TopologyEventReceiver();
- topologyEventReceiver.setExecutorService(executorService);
- topologyEventReceiver.execute();
-
- instanceStatusEventReceiver = new InstanceStatusEventReceiver();
- instanceStatusEventReceiver.setExecutorService(executorService);
- instanceStatusEventReceiver.execute();
-
- this.instanceStarted = false;
- instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
- @Override
- protected void onEvent(Event event) {
- log.info("Instance started event received");
- instanceStarted = true;
- }
- });
-
- this.instanceActivated = false;
- instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
- @Override
- protected void onEvent(Event event) {
- log.info("Instance activated event received");
- instanceActivated = true;
- }
- });
-
- this.eventReceiverInitiated = true;
- }
- // Simulate CEP server socket
- startServerSocket(cepPort);
- String agentPath = setupPythonAgent();
- log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
- log.info("Starting python cartridge agent...");
- this.outputStream = executeCommand(
- "python " + agentPath + "/agent.py > " + getResourcesFolderPath() + File.separator + ".." +
- File.separator + PYTHON_AGENT_DIR_NAME + File.separator + "cartridge-agent.log");
- }
-
- /**
- * TearDown method for test method testPythonCartridgeAgent
- */
- @After
- public void tearDown() {
- for (Map.Entry<String, Executor> entry : executorList.entrySet()) {
- try {
- String commandText = entry.getKey();
- Executor executor = entry.getValue();
- ExecuteWatchdog watchdog = executor.getWatchdog();
- if (watchdog != null) {
- log.info("Terminating process: " + commandText);
- watchdog.destroyProcess();
- }
- }
- catch (Exception ignore) {
- }
- }
- for (ServerSocket serverSocket : serverSocketList) {
- try {
- log.info("Stopping socket server: " + serverSocket.getLocalSocketAddress());
- serverSocket.close();
- }
- catch (IOException ignore) {
- }
- }
-
- try {
- log.info("Deleting source checkout folder...");
- FileUtils.deleteDirectory(new File(SOURCE_PATH));
- }
- catch (Exception ignore) {
-
- }
-
- this.instanceStatusEventReceiver.terminate();
- this.topologyEventReceiver.terminate();
-
- this.instanceActivated = false;
- this.instanceStarted = false;
- try {
- broker.stop();
- }
- catch (Exception e) {
- log.error("Error while stopping the broker service", e);
- }
- }
-
-
- /**
- * This method returns a collection of {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent}
- * objects as parameters to the test
- *
- * @return
- */
- @Parameterized.Parameters
- public static Collection getArtifactUpdatedEventsAsParams() {
- ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
-
- ArtifactUpdatedEvent privateRepoEvent = createTestArtifactUpdatedEvent();
- privateRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/testrepo.git");
- privateRepoEvent.setRepoUserName("testapache2211");
- privateRepoEvent.setRepoPassword("RExPDGa4GkPJj4kJDzSROQ==");
-
- ArtifactUpdatedEvent privateRepoEvent2 = createTestArtifactUpdatedEvent();
- privateRepoEvent2.setRepoURL("https://testapache2211@bitbucket.org/testapache2211/testrepo.git");
- privateRepoEvent2.setRepoUserName("testapache2211");
- privateRepoEvent2.setRepoPassword("iF7qT+BKKPE3PGV1TeDsJA==");
-
- return Arrays.asList(new Object[][]{
- {publicRepoEvent, true},
- {privateRepoEvent, true},
- {privateRepoEvent2, true}
- });
-
-// return Arrays.asList(new Object[][]{
-// {publicRepoEvent, true}
-// });
-
- }
-
- /**
- * Creates an {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent} object with a public
- * repository URL
- *
- * @return
- */
- private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
- ArtifactUpdatedEvent publicRepoEvent = new ArtifactUpdatedEvent();
- publicRepoEvent.setClusterId(CLUSTER_ID);
- publicRepoEvent.setTenantId(TENANT_ID);
- publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
- return publicRepoEvent;
- }
-
- @Test(timeout = TIMEOUT)
- public void testPythonCartridgeAgent() {
- Thread communicatorThread = new Thread(new Runnable() {
- @Override
- public void run() {
- List<String> outputLines = new ArrayList<String>();
- while (!outputStream.isClosed()) {
- List<String> newLines = getNewLines(outputLines, outputStream.toString());
- if (newLines.size() > 0) {
- for (String line : newLines) {
- if (line.contains("Subscribed to 'topology/#'")) {
- sleep(1000);
- // Send complete topology event
- log.info("Publishing complete topology event...");
- Topology topology = createTestTopology();
- CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
- publishEvent(completeTopologyEvent);
- log.info("Complete topology event published");
-
- sleep(3000);
- // Publish member initialized event
- log.info("Publishing member initialized event...");
- MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
- SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
- PARTITION_ID
- );
- publishEvent(memberInitializedEvent);
- log.info("Member initialized event published");
-
- // Simulate server socket
- startServerSocket(8080);
- }
- if (line.contains("Artifact repository found")) {
- // Send artifact updated event
- publishEvent(artifactUpdatedEvent);
- }
-
- if (line.contains("Exception in thread") || line.contains("ERROR")) {
- //throw new RuntimeException(line);
- }
- log.info(line);
- }
- }
- sleep(100);
- }
- }
- });
-
- communicatorThread.start();
-
- while (!instanceActivated) {
- // wait until the instance activated event is received.
- sleep(2000);
- }
-
- assertTrue("Instance started event was not received", instanceStarted);
- assertTrue("Instance activated event was not received", instanceActivated == this.expectedResult);
- }
-
- /**
- * Publish messaging event
- *
- * @param event
- */
- private void publishEvent(Event event) {
- String topicName = MessagingUtil.getMessageTopicName(event);
- EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
- eventPublisher.publish(event);
- }
-
- /**
- * Start server socket
- *
- * @param port
- */
- private void startServerSocket(final int port) {
- Thread socketThread = new Thread(new Runnable() {
- @Override
- public void run() {
- try {
- ServerSocket serverSocket = new ServerSocket(port);
- serverSocketList.add(serverSocket);
- log.info("Server socket started on port: " + port);
- serverSocket.accept();
- }
- catch (IOException e) {
- String message = "Could not start server socket: [port] " + port;
- log.error(message, e);
- throw new RuntimeException(message, e);
- }
- }
- });
- socketThread.start();
- }
-
- /**
- * Create test topology
- *
- * @return
- */
- private Topology createTestTopology() {
- Topology topology = new Topology();
- Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant,CARTRIDGE_UUID);
- topology.addService(service);
-
- Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
- AUTOSCALING_POLICY_NAME, APP_ID);
- service.addCluster(cluster);
-
- Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
- CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
- System.currentTimeMillis());
-
- member.setDefaultPrivateIP("10.0.0.1");
- member.setDefaultPublicIP("20.0.0.1");
- Properties properties = new Properties();
- properties.setProperty("prop1", "value1");
- member.setProperties(properties);
- member.setStatus(MemberStatus.Created);
- cluster.addMember(member);
-
- return topology;
- }
-
- /**
- * Return new lines found in the output
- *
- * @param currentOutputLines current output lines
- * @param output output
- * @return
- */
- private List<String> getNewLines(List<String> currentOutputLines, String output) {
- List<String> newLines = new ArrayList<String>();
-
- if (StringUtils.isNotBlank(output)) {
- String[] lines = output.split(NEW_LINE);
- if (lines != null) {
- for (String line : lines) {
- if (!currentOutputLines.contains(line)) {
- currentOutputLines.add(line);
- newLines.add(line);
- }
- }
- }
- }
- return newLines;
- }
-
- /**
- * Sleep current thread
- *
- * @param time
- */
- private void sleep(long time) {
- try {
- Thread.sleep(time);
- }
- catch (InterruptedException ignore) {
- }
- }
-
- /**
- * Copy python agent distribution to a new folder, extract it and copy sample configuration files
- *
- * @return
- */
- private String setupPythonAgent() {
- try {
- log.info("Setting up python cartridge agent...");
- String srcAgentPath = getResourcesFolderPath() + "/../../src/main/python/cartridge.agent/cartridge.agent";
- String destAgentPath =
- getResourcesFolderPath() + File.separator + ".." + File.separator + PYTHON_AGENT_DIR_NAME +
- "/cartridge.agent";
- FileUtils.copyDirectory(new File(srcAgentPath), new File(destAgentPath));
-
- String srcAgentConfPath = getResourcesFolderPath() + "/agent.conf";
- String destAgentConfPath = destAgentPath + "/agent.conf";
- FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
-
- String srcLoggingIniPath = getResourcesFolderPath() + "/logging.ini";
- String destLoggingIniPath = destAgentPath + "/logging.ini";
- FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
-
- String srcPayloadPath = getResourcesFolderPath() + "/payload";
- String destPayloadPath = destAgentPath + "/payload";
- FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
-
- log.info("Changing extension scripts permissions");
- File extensionsPath = new File(destAgentPath + "/extensions/bash");
- File[] extensions = extensionsPath.listFiles();
- for (File extension : extensions) {
- extension.setExecutable(true);
- }
-
- log.info("Python cartridge agent setup completed");
-
- return destAgentPath;
- }
- catch (Exception e) {
- String message = "Could not copy cartridge agent distribution";
- log.error(message, e);
- throw new RuntimeException(message, e);
- }
- }
-
- /**
- * Execute shell command
- *
- * @param commandText
- */
- private ByteArrayOutputStreamLocal executeCommand(final String commandText) {
- final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
- try {
- CommandLine commandline = CommandLine.parse(commandText);
- DefaultExecutor exec = new DefaultExecutor();
- PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
- exec.setWorkingDirectory(new File(
- getResourcesFolderPath() + File.separator + ".." + File.separator + PYTHON_AGENT_DIR_NAME));
- exec.setStreamHandler(streamHandler);
- ExecuteWatchdog watchdog = new ExecuteWatchdog(TIMEOUT);
- exec.setWatchdog(watchdog);
- exec.execute(commandline, new ExecuteResultHandler() {
- @Override
- public void onProcessComplete(int i) {
- log.info(commandText + " process completed");
- }
-
- @Override
- public void onProcessFailed(ExecuteException e) {
- log.error(commandText + " process failed", e);
- }
- });
- executorList.put(commandText, exec);
- return outputStream;
- }
- catch (Exception e) {
- log.error(outputStream.toString(), e);
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Get resources folder path
- *
- * @return
- */
- private static String getResourcesFolderPath() {
- String path = PythonCartridgeAgentTest.class.getResource(File.separator).getPath();
- return StringUtils.removeEnd(path, File.separator);
- }
-
- /**
- * Implements ByteArrayOutputStream.isClosed() method
- */
- private class ByteArrayOutputStreamLocal extends ByteArrayOutputStream {
- private boolean closed;
-
- @Override
- public void close() throws IOException {
- super.close();
- closed = true;
- }
-
- public boolean isClosed() {
- return closed;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
deleted file mode 100644
index 04f4a0c..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
+++ /dev/null
@@ -1,46 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-[agent]
-mb.ip =localhost
-mb.port =1884
-listen.address =localhost
-thrift.receiver.ip =localhost
-thrift.receiver.port =7712
-thrift.server.admin.username =admin
-thrift.server.admin.password =admin
-cep.stats.publisher.enabled =true
-lb.private.ip =
-lb.public.ip =
-enable.artifact.update =true
-auto.commit =false
-auto.checkout =true
-artifact.update.interval =15
-artifact.clone.retries =5
-artifact.clone.interval =10
-port.check.timeout =600000
-enable.data.publisher =false
-monitoring.server.ip =localhost
-monitoring.server.port =7612
-monitoring.server.secure.port =7712
-monitoring.server.admin.username =admin
-monitoring.server.admin.password =admin
-#log.file.paths =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
-log.file.paths =/tmp/agent.screen.log
-metadata.service.url =https://localhost:9443
-super.tenant.repository.path =/repository/deployment/server/
-tenant.repository.path =/repository/tenants/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/components/org.apache.stratos.python.cartridge.agent/src/test/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/jndi.properties b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/jndi.properties
deleted file mode 100644
index beefe3c..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/jndi.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-connectionfactoryName=TopicConnectionFactory
-java.naming.provider.url=tcp://localhost:61617
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/components/org.apache.stratos.python.cartridge.agent/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/log4j.properties b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/log4j.properties
deleted file mode 100644
index c0c6e78..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Set root logger level and appenders
-log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
-
-# CONSOLE_APPENDER is set to be a ConsoleAppender.
-log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
-
-# The standard error log where all the warnings, errors and fatal errors will be logged
-log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
-log4j.appender.FILE_APPENDER.File=cartridge-agent.log
-log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
-log4j.appender.FILE_APPENDER.threshold=DEBUG
-
-# CONSOLE_APPENDER uses PatternLayout.
-log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
-
-log4j.logger.org.apache.stratos.cartridge.agent=INFO
-log4j.logger.org.apache.stratos.messaging=INFO
-log4j.logger.org.apache.stratos.common.util=DEBUG
-log4j.logger.org.wso2.andes.client=ERROR
-log4j.logger.org.apache.activemq.jndi.ActiveMQInitialContextFactory=ERROR
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/components/org.apache.stratos.python.cartridge.agent/src/test/resources/logging.ini
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/logging.ini b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/logging.ini
deleted file mode 100644
index 15cad9b..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/logging.ini
+++ /dev/null
@@ -1,52 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-[formatters]
-keys=default
-
-[formatter_default]
-format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
-class=logging.Formatter
-
-[handlers]
-keys=console, error_file, log_file
-
-[handler_console]
-class=logging.StreamHandler
-formatter=default
-args=tuple()
-
-[handler_log_file]
-class=logging.FileHandler
-level=DEBUG
-formatter=default
-args=("agent.log", "w")
-
-[handler_error_file]
-class=logging.FileHandler
-level=ERROR
-formatter=default
-args=("error.log", "w")
-
-[loggers]
-keys=root
-
-[logger_root]
-level=DEBUG
-formatter=default
-handlers=console,error_file,log_file
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params
deleted file mode 100644
index 165508e..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params
+++ /dev/null
@@ -1 +0,0 @@
-APPLICATION_ID=single_group_v1,APPLICATION_PATH=/tmp/tomcat/webapps,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single_group_v1-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' ,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,KUB
ERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=4500,
MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,REPO_URL=https://github.com/imesh/stratos-tomcat-applications.git,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI
0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWmVIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params2
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params2 b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params2
deleted file mode 100644
index 0d29753..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params2
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-APPLICATION_ID=application1,SERVICE_NAME=php,HOST_NAME=php.php.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=php,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single-cartridge-app-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=9080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=php.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/stratos-pca-test-app-path/,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null,MP_IP=192.168.1.4,MB_PORT=1883,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/pom.xml b/products/python-cartridge-agent/integration/pom.xml
new file mode 100755
index 0000000..e92bbb4
--- /dev/null
+++ b/products/python-cartridge-agent/integration/pom.xml
@@ -0,0 +1,161 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>python-cartridge-agent-parent</artifactId>
+ <version>4.1.2</version>
+ </parent>
+
+ <artifactId>python-agent-integration</artifactId>
+ <packaging>jar</packaging>
+ <name>Python Cartridge Agent - Integration Tests</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/test/resources/test-conf</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>live</id>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/test/resources/test-conf</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <inherited>false</inherited>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/pca-testing1.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ <workingDirectory>${basedir}/target</workingDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-exec</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2.wso2</groupId>
+ <artifactId>axis2-client</artifactId>
+ <version>${axis2.wso2.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents.wso2</groupId>
+ <artifactId>httpcore</artifactId>
+ <version>4.3.0.wso2v1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents.wso2</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.2.5.wso2v1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.mock.iaas.client</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.wso2.andes.wso2</groupId>
+ <artifactId>andes-client</artifactId>
+ <version>0.13.wso2v8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-all</artifactId>
+ <version>5.10.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-mqtt</artifactId>
+ <version>5.10.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.messaging</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
new file mode 100755
index 0000000..86fc7c3
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
@@ -0,0 +1,21 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class ADCTest {
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
new file mode 100755
index 0000000..93f4c1e
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
@@ -0,0 +1,578 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.python.cartridge.agent.test;
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.commons.exec.*;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.apache.stratos.messaging.listener.instance.status.InstanceActivatedEventListener;
+import org.apache.stratos.messaging.listener.instance.status.InstanceStartedEventListener;
+import org.apache.stratos.messaging.message.receiver.instance.status.InstanceStatusEventReceiver;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
+import org.apache.stratos.messaging.util.MessagingUtil;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.io.*;
+import java.net.ServerSocket;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import static junit.framework.Assert.assertTrue;
+
+public class PythonCartridgeAgentTest {
+
+ private static final Log log = LogFactory.getLog(PythonCartridgeAgentTest.class);
+ private static final String RESOURCES_PATH = "/suite-1";
+ private static final String NEW_LINE = System.getProperty("line.separator");
+ // private static final long TIMEOUT = 1440000;
+ private static final long TIMEOUT = 120000;
+ private static final String CLUSTER_ID = "php.php.domain";
+ private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
+ private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-1";
+ private static final String APP_ID = "application-1";
+ private static final String MEMBER_ID = "php.member-1";
+ private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+ private static final String NETWORK_PARTITION_ID = "network-partition-1";
+ private static final String PARTITION_ID = "partition-1";
+ private static final String TENANT_ID = "-1234";
+ private static final String SERVICE_NAME = "php";
+ public static final String SOURCE_PATH = "/tmp/stratos-pca-test-app-path/";
+
+ private static List<ServerSocket> serverSocketList;
+ private static Map<String, Executor> executorList;
+
+ private boolean instanceStarted;
+ private boolean instanceActivated;
+ private ByteArrayOutputStreamLocal outputStream;
+ private boolean eventReceiverInitiated = false;
+ private TopologyEventReceiver topologyEventReceiver;
+ private InstanceStatusEventReceiver instanceStatusEventReceiver;
+ private BrokerService broker = new BrokerService();
+ private static final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
+
+ private static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "activemq.amqp.bind.address";
+ private static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "activemq.mqtt.bind.address";
+ private static final String CEP_PORT = "cep.port";
+ private static final String DISTRIBUTION_NAME = "distribution.name";
+
+ private int cepPort;
+ private String amqpBindAddress;
+ private String mqttBindAddress;
+ private String distributionName;
+ private Properties integrationProperties;
+
+ public PythonCartridgeAgentTest() {
+ if (integrationProperties == null) {
+ integrationProperties = new Properties();
+ try {
+ integrationProperties
+ .load(PythonCartridgeAgentTest.class.getResourceAsStream("/integration-test.properties"));
+ distributionName = integrationProperties.getProperty(DISTRIBUTION_NAME);
+ amqpBindAddress = integrationProperties.getProperty(ACTIVEMQ_AMQP_BIND_ADDRESS);
+ mqttBindAddress = integrationProperties.getProperty(ACTIVEMQ_MQTT_BIND_ADDRESS);
+ cepPort = Integer.parseInt(integrationProperties.getProperty(CEP_PORT));
+ log.info("PCA integration properties: " + integrationProperties.toString());
+ }
+ catch (IOException e) {
+ log.error("Error loading integration-test.properties file from classpath. Please make sure that file " +
+ "exists in classpath.", e);
+ }
+ }
+ }
+
+ /**
+ * Setup method for test class
+ */
+ @BeforeSuite
+ public static void oneTimeSetUp() {
+ // Set jndi.properties.dir system property for initializing event publishers and receivers
+ System.setProperty("jndi.properties.dir", getResourcesPath());
+ }
+
+ /**
+ * Setup method for test method testPythonCartridgeAgent
+ */
+ @BeforeSuite
+ public void setup() {
+ serverSocketList = new ArrayList<ServerSocket>();
+ executorList = new HashMap<String, Executor>();
+ try {
+ broker.addConnector(amqpBindAddress);
+ broker.addConnector(mqttBindAddress);
+ broker.setBrokerName("testBroker");
+ broker.setDataDirectory(
+ PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
+ "/activemq-data");
+ broker.start();
+ log.info("Broker service started!");
+ }
+ catch (Exception e) {
+ log.error("Error while setting up broker service", e);
+ }
+ if (!this.eventReceiverInitiated) {
+ ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 15);
+ topologyEventReceiver = new TopologyEventReceiver();
+ topologyEventReceiver.setExecutorService(executorService);
+ topologyEventReceiver.execute();
+
+ instanceStatusEventReceiver = new InstanceStatusEventReceiver();
+ instanceStatusEventReceiver.setExecutorService(executorService);
+ instanceStatusEventReceiver.execute();
+
+ this.instanceStarted = false;
+ instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ log.info("Instance started event received");
+ instanceStarted = true;
+ }
+ });
+
+ this.instanceActivated = false;
+ instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ log.info("Instance activated event received");
+ instanceActivated = true;
+ }
+ });
+
+ this.eventReceiverInitiated = true;
+ }
+ // Simulate CEP server socket
+ startServerSocket(cepPort);
+ String agentPath = setupPythonAgent();
+ log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
+ log.info("Starting python cartridge agent...");
+ this.outputStream = executeCommand("python " + agentPath + "/agent.py > " +
+ PythonCartridgeAgentTest.class.getResource(File.separator).getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
+ "/cartridge-agent.log");
+ }
+
+ /**
+ * TearDown method for test method testPythonCartridgeAgent
+ */
+ @AfterSuite
+ public void tearDown() {
+ for (Map.Entry<String, Executor> entry : executorList.entrySet()) {
+ try {
+ String commandText = entry.getKey();
+ Executor executor = entry.getValue();
+ ExecuteWatchdog watchdog = executor.getWatchdog();
+ if (watchdog != null) {
+ log.info("Terminating process: " + commandText);
+ watchdog.destroyProcess();
+ }
+ }
+ catch (Exception ignore) {
+ }
+ }
+ for (ServerSocket serverSocket : serverSocketList) {
+ try {
+ log.info("Stopping socket server: " + serverSocket.getLocalSocketAddress());
+ serverSocket.close();
+ }
+ catch (IOException ignore) {
+ }
+ }
+
+ try {
+ log.info("Deleting source checkout folder...");
+ FileUtils.deleteDirectory(new File(SOURCE_PATH));
+ }
+ catch (Exception ignore) {
+
+ }
+
+ this.instanceStatusEventReceiver.terminate();
+ this.topologyEventReceiver.terminate();
+
+ this.instanceActivated = false;
+ this.instanceStarted = false;
+ try {
+ broker.stop();
+ }
+ catch (Exception e) {
+ log.error("Error while stopping the broker service", e);
+ }
+ }
+
+
+ /**
+ * This method returns a collection of {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent}
+ * objects as parameters to the test
+ *
+ * @return
+ */
+
+ public static ArrayList<ArtifactUpdatedEvent> getArtifactUpdatedEventsAsParams() {
+ ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
+
+ ArtifactUpdatedEvent privateRepoEvent = createTestArtifactUpdatedEvent();
+ privateRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/testrepo.git");
+ privateRepoEvent.setRepoUserName("testapache2211");
+ privateRepoEvent.setRepoPassword("RExPDGa4GkPJj4kJDzSROQ==");
+
+ ArtifactUpdatedEvent privateRepoEvent2 = createTestArtifactUpdatedEvent();
+ privateRepoEvent2.setRepoURL("https://testapache2211@bitbucket.org/testapache2211/testrepo.git");
+ privateRepoEvent2.setRepoUserName("testapache2211");
+ privateRepoEvent2.setRepoPassword("iF7qT+BKKPE3PGV1TeDsJA==");
+
+ ArrayList<ArtifactUpdatedEvent> list = new ArrayList<ArtifactUpdatedEvent>();
+ list.add(privateRepoEvent);
+ list.add(privateRepoEvent2);
+ list.add(publicRepoEvent);
+ return list;
+ }
+
+ /**
+ * Creates an {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent} object with a public
+ * repository URL
+ *
+ * @return
+ */
+ private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
+ ArtifactUpdatedEvent publicRepoEvent = new ArtifactUpdatedEvent();
+ publicRepoEvent.setClusterId(CLUSTER_ID);
+ publicRepoEvent.setTenantId(TENANT_ID);
+ publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
+ publicRepoEvent.setCommitEnabled(true);
+ return publicRepoEvent;
+ }
+
+ @Test(timeOut = TIMEOUT)
+ public void testPythonCartridgeAgent() {
+ Thread communicatorThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed()) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if (newLines.size() > 0) {
+ for (String line : newLines) {
+ if (line.contains("Subscribed to 'topology/#'")) {
+ sleep(1000);
+ // Send complete topology event
+ log.info("Publishing complete topology event...");
+ Topology topology = createTestTopology();
+ CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+ publishEvent(completeTopologyEvent);
+ log.info("Complete topology event published");
+
+ sleep(3000);
+ // Publish member initialized event
+ log.info("Publishing member initialized event...");
+ MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+ SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+ PARTITION_ID
+ );
+ publishEvent(memberInitializedEvent);
+ log.info("Member initialized event published");
+
+ // Simulate server socket
+ startServerSocket(8080);
+ }
+ if (line.contains("Artifact repository found")) {
+ // Send artifact updated event
+ ArrayList<ArtifactUpdatedEvent> list = getArtifactUpdatedEventsAsParams();
+ for (ArtifactUpdatedEvent artifactUpdatedEvent : list) {
+ publishEvent(artifactUpdatedEvent);
+ }
+ }
+
+ if (line.contains("Exception in thread") || line.contains("ERROR")) {
+ //throw new RuntimeException(line);
+ }
+ log.info(line);
+ }
+ }
+ sleep(100);
+ }
+ }
+ });
+
+ communicatorThread.start();
+
+ while (!instanceActivated) {
+ // wait until the instance activated event is received.
+ sleep(2000);
+ }
+
+ assertTrue("Instance started event was not received", instanceStarted);
+ assertTrue("Instance activated event was not received", instanceActivated);
+ }
+
+ /**
+ * Publish messaging event
+ *
+ * @param event
+ */
+ private void publishEvent(Event event) {
+ String topicName = MessagingUtil.getMessageTopicName(event);
+ EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
+ eventPublisher.publish(event);
+ }
+
+ /**
+ * Start server socket
+ *
+ * @param port
+ */
+ private void startServerSocket(final int port) {
+ Thread socketThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ ServerSocket serverSocket = new ServerSocket(port);
+ serverSocketList.add(serverSocket);
+ log.info("Server socket started on port: " + port);
+ serverSocket.accept();
+ }
+ catch (IOException e) {
+ String message = "Could not start server socket: [port] " + port;
+ log.error(message, e);
+ throw new RuntimeException(message, e);
+ }
+ }
+ });
+ socketThread.start();
+ }
+
+ /**
+ * Create test topology
+ *
+ * @return
+ */
+ private Topology createTestTopology() {
+ Topology topology = new Topology();
+ Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+ topology.addService(service);
+
+ Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+ AUTOSCALING_POLICY_NAME, APP_ID);
+ service.addCluster(cluster);
+
+ Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+ CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+ System.currentTimeMillis());
+
+ member.setDefaultPrivateIP("10.0.0.1");
+ member.setDefaultPublicIP("20.0.0.1");
+ Properties properties = new Properties();
+ properties.setProperty("prop1", "value1");
+ member.setProperties(properties);
+ member.setStatus(MemberStatus.Created);
+ cluster.addMember(member);
+
+ return topology;
+ }
+
+ /**
+ * Return new lines found in the output
+ *
+ * @param currentOutputLines current output lines
+ * @param output output
+ * @return
+ */
+ private List<String> getNewLines(List<String> currentOutputLines, String output) {
+ List<String> newLines = new ArrayList<String>();
+
+ if (StringUtils.isNotBlank(output)) {
+ String[] lines = output.split(NEW_LINE);
+ for (String line : lines) {
+ if (!currentOutputLines.contains(line)) {
+ currentOutputLines.add(line);
+ newLines.add(line);
+ }
+ }
+ }
+ return newLines;
+ }
+
+ public static String getResourcesPath() {
+ return PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../../src/test/resources" + RESOURCES_PATH;
+ }
+
+ /**
+ * Sleep current thread
+ *
+ * @param time
+ */
+ private void sleep(long time) {
+ try {
+ Thread.sleep(time);
+ }
+ catch (InterruptedException ignore) {
+ }
+ }
+
+ /**
+ * Copy python agent distribution to a new folder, extract it and copy sample configuration files
+ *
+ * @return
+ */
+ private String setupPythonAgent() {
+ try {
+ log.info("Setting up python cartridge agent...");
+
+
+ String srcAgentPath = PythonCartridgeAgentTest.class.getResource("/").getPath() +
+ "/../../../distribution/target/" + distributionName + ".zip";
+ String unzipDestPath =
+ PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME + "/";
+ //FileUtils.copyFile(new File(srcAgentPath), new File(destAgentPath));
+ unzip(srcAgentPath, unzipDestPath);
+ String destAgentPath = PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" +
+ PYTHON_AGENT_DIR_NAME + "/" + distributionName;
+
+ String srcAgentConfPath = getResourcesPath() + "/agent.conf";
+ String destAgentConfPath = destAgentPath + "/agent.conf";
+ FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
+
+ String srcLoggingIniPath = getResourcesPath() + "/logging.ini";
+ String destLoggingIniPath = destAgentPath + "/logging.ini";
+ FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
+
+ String srcPayloadPath = getResourcesPath() + "/payload";
+ String destPayloadPath = destAgentPath + "/payload";
+ FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
+
+ log.info("Changing extension scripts permissions");
+ File extensionsPath = new File(destAgentPath + "/extensions/bash");
+ File[] extensions = extensionsPath.listFiles();
+ for (File extension : extensions) {
+ extension.setExecutable(true);
+ }
+
+ log.info("Python cartridge agent setup completed");
+
+ return destAgentPath;
+ }
+ catch (Exception e) {
+ String message = "Could not copy cartridge agent distribution";
+ log.error(message, e);
+ throw new RuntimeException(message, e);
+ }
+ }
+
+ public void unzip(String zipFilePath, String destDirectory) throws IOException {
+ File destDir = new File(destDirectory);
+ if (!destDir.exists()) {
+ destDir.mkdir();
+ }
+ ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
+ ZipEntry entry = zipIn.getNextEntry();
+ // iterates over entries in the zip file
+ while (entry != null) {
+ String filePath = destDirectory + File.separator + entry.getName();
+ if (!entry.isDirectory()) {
+ // if the entry is a file, extracts it
+ extractFile(zipIn, filePath);
+ } else {
+ // if the entry is a directory, make the directory
+ File dir = new File(filePath);
+ dir.mkdir();
+ }
+ zipIn.closeEntry();
+ entry = zipIn.getNextEntry();
+ }
+ zipIn.close();
+ }
+
+ private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
+ BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
+ byte[] bytesIn = new byte[4096];
+ int read = 0;
+ while ((read = zipIn.read(bytesIn)) != -1) {
+ bos.write(bytesIn, 0, read);
+ }
+ bos.close();
+ }
+
+ /**
+ * Execute shell command
+ *
+ * @param commandText
+ */
+ private ByteArrayOutputStreamLocal executeCommand(final String commandText) {
+ final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
+ try {
+ CommandLine commandline = CommandLine.parse(commandText);
+ DefaultExecutor exec = new DefaultExecutor();
+ PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
+ exec.setWorkingDirectory(new File(
+ PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME));
+ exec.setStreamHandler(streamHandler);
+ ExecuteWatchdog watchdog = new ExecuteWatchdog(TIMEOUT);
+ exec.setWatchdog(watchdog);
+ exec.execute(commandline, new ExecuteResultHandler() {
+ @Override
+ public void onProcessComplete(int i) {
+ log.info(commandText + " process completed");
+ }
+
+ @Override
+ public void onProcessFailed(ExecuteException e) {
+ log.error(commandText + " process failed", e);
+ }
+ });
+ executorList.put(commandText, exec);
+ return outputStream;
+ }
+ catch (Exception e) {
+ log.error(outputStream.toString(), e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Implements ByteArrayOutputStream.isClosed() method
+ */
+ private class ByteArrayOutputStreamLocal extends ByteArrayOutputStream {
+ private boolean closed;
+
+ @Override
+ public void close() throws IOException {
+ super.close();
+ closed = true;
+ }
+
+ public boolean isClosed() {
+ return closed;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/log4j.properties b/products/python-cartridge-agent/integration/src/test/resources/log4j.properties
new file mode 100755
index 0000000..c0c6e78
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/log4j.properties
@@ -0,0 +1,41 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Set root logger level and appenders
+log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
+
+# CONSOLE_APPENDER is set to be a ConsoleAppender.
+log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
+
+# The standard error log where all the warnings, errors and fatal errors will be logged
+log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
+log4j.appender.FILE_APPENDER.File=cartridge-agent.log
+log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
+log4j.appender.FILE_APPENDER.threshold=DEBUG
+
+# CONSOLE_APPENDER uses PatternLayout.
+log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
+
+log4j.logger.org.apache.stratos.cartridge.agent=INFO
+log4j.logger.org.apache.stratos.messaging=INFO
+log4j.logger.org.apache.stratos.common.util=DEBUG
+log4j.logger.org.wso2.andes.client=ERROR
+log4j.logger.org.apache.activemq.jndi.ActiveMQInitialContextFactory=ERROR
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
new file mode 100755
index 0000000..a13f950
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite1">
+ <test name="PCATest">
+ <classes>
+ <class name="org.apache.stratos.python.cartridge.agent.test.PythonCartridgeAgentTest"/>
+ </classes>
+ </test>
+</suite>
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml
new file mode 100755
index 0000000..c292953
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite2">
+ <test name="PCATest">
+ <classes>
+ <class name="org.apache.stratos.python.cartridge.agent.test.ADCTest"/>
+ </classes>
+ </test>
+</suite>
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
new file mode 100755
index 0000000..04f4a0c
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[agent]
+mb.ip =localhost
+mb.port =1884
+listen.address =localhost
+thrift.receiver.ip =localhost
+thrift.receiver.port =7712
+thrift.server.admin.username =admin
+thrift.server.admin.password =admin
+cep.stats.publisher.enabled =true
+lb.private.ip =
+lb.public.ip =
+enable.artifact.update =true
+auto.commit =false
+auto.checkout =true
+artifact.update.interval =15
+artifact.clone.retries =5
+artifact.clone.interval =10
+port.check.timeout =600000
+enable.data.publisher =false
+monitoring.server.ip =localhost
+monitoring.server.port =7612
+monitoring.server.secure.port =7712
+monitoring.server.admin.username =admin
+monitoring.server.admin.password =admin
+#log.file.paths =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
+log.file.paths =/tmp/agent.screen.log
+metadata.service.url =https://localhost:9443
+super.tenant.repository.path =/repository/deployment/server/
+tenant.repository.path =/repository/tenants/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties b/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini b/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file
[46/50] [abbrv] stratos git commit: Conflict resolved
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/pom.xml b/products/python-cartridge-agent/modules/integration/pom.xml
new file mode 100755
index 0000000..81ef628
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/pom.xml
@@ -0,0 +1,251 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>python-cartridge-agent-parent</artifactId>
+ <version>4.2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>python-agent-integration</artifactId>
+ <packaging>jar</packaging>
+ <name>Python Cartridge Agent - Integration Tests</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/test/resources/test-conf</directory>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>src/test/resources/common</directory>
+ </resource>
+ </resources>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>live</id>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/test/resources/test-conf</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/*</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>default-test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <inherited>false</inherited>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/pca-testing1.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ <workingDirectory>${basedir}/target</workingDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>adc-test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <inherited>false</inherited>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/pca-testing2.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ <workingDirectory>${basedir}/target</workingDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>adc-mt-test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <inherited>false</inherited>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/pca-testing3.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ <workingDirectory>${basedir}/target</workingDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>adc-mt-tenant-user-test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <inherited>false</inherited>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/pca-testing4.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ <workingDirectory>${basedir}/target</workingDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-exec</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.common</artifactId>
+ <version>${project.version}</version>
+ </dependency-->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.1.1</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.apache.axis2.wso2</groupId>
+ <artifactId>axis2-client</artifactId>
+ <version>${axis2.wso2.version}</version>
+ </dependency-->
+ <!--dependency>
+ <groupId>org.apache.httpcomponents.wso2</groupId>
+ <artifactId>httpcore</artifactId>
+ <version>4.3.0.wso2v1</version>
+ </dependency-->
+ <!--dependency>
+ <groupId>org.apache.httpcomponents.wso2</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.2.5.wso2v1</version>
+ </dependency-->
+ <!--dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.mock.iaas.client</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency-->
+ <!--dependency>
+ <groupId>org.wso2.andes.wso2</groupId>
+ <artifactId>andes-client</artifactId>
+ <version>0.13.wso2v8</version>
+ </dependency-->
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-all</artifactId>
+ <version>5.10.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-mqtt</artifactId>
+ <version>5.10.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.messaging</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.databridge.commons</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.databridge.commons.thrift</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.databridge.agent.thrift</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.wso2.carbon.analytics-common</groupId>
+ <artifactId>org.wso2.carbon.databridge.receiver.thrift</artifactId>
+ <version>${carbon.analytics.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.wso2.carbon.analytics-common</groupId>
+ <artifactId>org.wso2.carbon.databridge.receiver.binary</artifactId>
+ <version>${carbon.analytics.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.wso2.carbon.analytics-common</groupId>
+ <artifactId>org.wso2.carbon.databridge.core</artifactId>
+ <version>${carbon.analytics.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.wso2.carbon.analytics-common</groupId>
+ <artifactId>org.wso2.carbon.databridge.commons</artifactId>
+ <version>${carbon.analytics.common.version}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTenantUserTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTenantUserTest.java b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTenantUserTest.java
new file mode 100644
index 0000000..07dd6b2
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTenantUserTest.java
@@ -0,0 +1,213 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import static junit.framework.Assert.assertTrue;
+
+public class ADCMTAppTenantUserTest extends PythonAgentTestManager {
+ private static final Log log = LogFactory.getLog(ADCMTAppTenantUserTest.class);
+ private static final int ADC_TIMEOUT = 180000;
+ private static final String SUITE_NAME = "suite-4";
+ private static final String APPLICATION_PATH = "/tmp/pca-test-suite-4";
+ private static final String CLUSTER_ID = "tomcat.domain";
+ private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-4";
+ private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-4";
+ private static final String APP_ID = "application-4";
+ private static final String MEMBER_ID = "tomcat.member-1";
+ private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+ private static final String NETWORK_PARTITION_ID = "network-partition-1";
+ private static final String PARTITION_ID = "partition-1";
+ private static final String TENANT_ID = "4";
+ private static final String SERVICE_NAME = "tomcat-mt";
+
+ private boolean hasADCTestCompleted = false;
+
+ @BeforeSuite
+ public void setupADCMTAppTest() {
+ // Set jndi.properties.dir system property for initializing event publishers and receivers
+ System.setProperty("jndi.properties.dir", getResourcesPath(SUITE_NAME));
+
+ // start Python agent with configurations provided in resource path
+ setup(SUITE_NAME);
+
+ // Simulate server socket
+ startServerSocket(8080);
+ }
+
+ /**
+ * TearDown method for test method testPythonCartridgeAgent
+ */
+ @AfterSuite
+ public void tearDownADCMTAppTest() {
+ // TODO: app path is duplicated in Java test and payload
+ tearDown(APPLICATION_PATH);
+ }
+
+ @Test(timeOut = ADC_TIMEOUT)
+ public void testADCForMTApps() {
+ startCommunicatorThread();
+ assertAgentActivation();
+ Thread adcTestThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ log.info("Running ADC MT Test thread...");
+ // Send artifact updated event
+ publishEvent(getArtifactUpdatedEventForPublicRepo());
+ log.info("Publishing artifact updated event for repo: " +
+ getArtifactUpdatedEventForPublicRepo().getRepoURL());
+
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed() && !hasADCTestCompleted) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if (newLines.size() > 0) {
+ for (String line : newLines) {
+ if (line.contains("Git clone executed")) {
+ log.info("Agent has completed git clone. Asserting the operation...");
+ assertRepoClone(getArtifactUpdatedEventForPublicRepo());
+ hasADCTestCompleted = true;
+ }
+ }
+ }
+ sleep(1000);
+ }
+ }
+ });
+ adcTestThread.start();
+
+ while (!hasADCTestCompleted) {
+ // wait until the instance activated event is received.
+ sleep(1000);
+ }
+ }
+
+ private void assertAgentActivation() {
+ Thread startupTestThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ while (!eventReceiverInitiated) {
+ sleep(1000);
+ }
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed()) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if (newLines.size() > 0) {
+ for (String line : newLines) {
+ if (line.contains("Subscribed to 'topology/#'")) {
+ sleep(2000);
+ // Send complete topology event
+ log.info("Publishing complete topology event...");
+ Topology topology = createTestTopology();
+ CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+ publishEvent(completeTopologyEvent);
+ log.info("Complete topology event published");
+
+ // Publish member initialized event
+ log.info("Publishing member initialized event...");
+ MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+ SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+ PARTITION_ID
+ );
+ publishEvent(memberInitializedEvent);
+ log.info("Member initialized event published");
+ }
+
+ // Send artifact updated event to activate the instance first
+ if (line.contains("Artifact repository found")) {
+ publishEvent(getArtifactUpdatedEventForPublicRepo());
+ log.info("Artifact updated event published");
+ }
+ log.info(line);
+ }
+ }
+ sleep(1000);
+ }
+ }
+ });
+ startupTestThread.start();
+
+ while (!instanceStarted || !instanceActivated) {
+ // wait until the instance activated event is received.
+ // this will assert whether instance got activated within timeout period; no need for explicit assertions
+ sleep(2000);
+ }
+ }
+
+ private ArtifactUpdatedEvent getArtifactUpdatedEventForPublicRepo() {
+ ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
+ publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
+ return publicRepoEvent;
+ }
+
+ private void assertRepoClone(ArtifactUpdatedEvent artifactUpdatedEvent) {
+ File file = new File(APPLICATION_PATH + "/repository/tenants/4/test1.txt");
+ assertTrue("Git clone failed for repo [url] " + artifactUpdatedEvent.getRepoURL(),
+ file.exists());
+ }
+
+ private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
+ ArtifactUpdatedEvent artifactUpdatedEvent = new ArtifactUpdatedEvent();
+ artifactUpdatedEvent.setClusterId(CLUSTER_ID);
+ artifactUpdatedEvent.setTenantId(TENANT_ID);
+ return artifactUpdatedEvent;
+ }
+
+ /**
+ * Create test topology
+ *
+ * @return
+ */
+ private Topology createTestTopology() {
+ Topology topology = new Topology();
+ Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+ topology.addService(service);
+
+ Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+ AUTOSCALING_POLICY_NAME, APP_ID);
+ service.addCluster(cluster);
+
+ Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+ CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+ System.currentTimeMillis());
+
+ member.setDefaultPrivateIP("10.0.0.1");
+ member.setDefaultPublicIP("20.0.0.1");
+ Properties properties = new Properties();
+ properties.setProperty("prop1", "value1");
+ member.setProperties(properties);
+ member.setStatus(MemberStatus.Created);
+ cluster.addMember(member);
+
+ return topology;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
new file mode 100644
index 0000000..dbab83e
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
@@ -0,0 +1,213 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import static junit.framework.Assert.assertTrue;
+
+public class ADCMTAppTest extends PythonAgentTestManager {
+ private static final Log log = LogFactory.getLog(ADCMTAppTest.class);
+ private static final int ADC_TIMEOUT = 180000;
+ private static final String SUITE_NAME = "suite-3";
+ private static final String APPLICATION_PATH = "/tmp/pca-test-suite-3";
+ private static final String CLUSTER_ID = "tomcat.domain";
+ private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-3";
+ private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-3";
+ private static final String APP_ID = "application-3";
+ private static final String MEMBER_ID = "tomcat.member-1";
+ private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+ private static final String NETWORK_PARTITION_ID = "network-partition-1";
+ private static final String PARTITION_ID = "partition-1";
+ private static final String TENANT_ID = "-1234";
+ private static final String SERVICE_NAME = "tomcat-mt";
+
+ private boolean hasADCTestCompleted = false;
+
+ @BeforeSuite
+ public void setupADCMTAppTest() {
+ // Set jndi.properties.dir system property for initializing event publishers and receivers
+ System.setProperty("jndi.properties.dir", getResourcesPath(SUITE_NAME));
+
+ // start Python agent with configurations provided in resource path
+ setup(SUITE_NAME);
+
+ // Simulate server socket
+ startServerSocket(8080);
+ }
+
+ /**
+ * TearDown method for test method testPythonCartridgeAgent
+ */
+ @AfterSuite
+ public void tearDownADCMTAppTest() {
+ // TODO: app path is duplicated in Java test and payload
+ tearDown(APPLICATION_PATH);
+ }
+
+ @Test(timeOut = ADC_TIMEOUT)
+ public void testADCForMTApps() {
+ startCommunicatorThread();
+ assertAgentActivation();
+ Thread adcTestThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ log.info("Running ADC MT Test thread...");
+ // Send artifact updated event
+ publishEvent(getArtifactUpdatedEventForPublicRepo());
+ log.info("Publishing artifact updated event for repo: " +
+ getArtifactUpdatedEventForPublicRepo().getRepoURL());
+
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed() && !hasADCTestCompleted) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if (newLines.size() > 0) {
+ for (String line : newLines) {
+ if (line.contains("Git clone executed")) {
+ log.info("Agent has completed git clone. Asserting the operation...");
+ assertRepoClone(getArtifactUpdatedEventForPublicRepo());
+ hasADCTestCompleted = true;
+ }
+ }
+ }
+ sleep(1000);
+ }
+ }
+ });
+ adcTestThread.start();
+
+ while (!hasADCTestCompleted) {
+ // wait until the instance activated event is received.
+ sleep(1000);
+ }
+ }
+
+ private void assertAgentActivation() {
+ Thread startupTestThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ while (!eventReceiverInitiated) {
+ sleep(1000);
+ }
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed()) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if (newLines.size() > 0) {
+ for (String line : newLines) {
+ if (line.contains("Subscribed to 'topology/#'")) {
+ sleep(2000);
+ // Send complete topology event
+ log.info("Publishing complete topology event...");
+ Topology topology = createTestTopology();
+ CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+ publishEvent(completeTopologyEvent);
+ log.info("Complete topology event published");
+
+ // Publish member initialized event
+ log.info("Publishing member initialized event...");
+ MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+ SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+ PARTITION_ID
+ );
+ publishEvent(memberInitializedEvent);
+ log.info("Member initialized event published");
+ }
+
+ // Send artifact updated event to activate the instance first
+ if (line.contains("Artifact repository found")) {
+ publishEvent(getArtifactUpdatedEventForPublicRepo());
+ log.info("Artifact updated event published");
+ }
+ log.info(line);
+ }
+ }
+ sleep(1000);
+ }
+ }
+ });
+ startupTestThread.start();
+
+ while (!instanceStarted || !instanceActivated) {
+ // wait until the instance activated event is received.
+ // this will assert whether instance got activated within timeout period; no need for explicit assertions
+ sleep(2000);
+ }
+ }
+
+ private ArtifactUpdatedEvent getArtifactUpdatedEventForPublicRepo() {
+ ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
+ publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
+ return publicRepoEvent;
+ }
+
+ private void assertRepoClone(ArtifactUpdatedEvent artifactUpdatedEvent) {
+ File file = new File(APPLICATION_PATH + "/repository/deployment/server/test1.txt");
+ assertTrue("Git clone failed for repo [url] " + artifactUpdatedEvent.getRepoURL(),
+ file.exists());
+ }
+
+ private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
+ ArtifactUpdatedEvent artifactUpdatedEvent = new ArtifactUpdatedEvent();
+ artifactUpdatedEvent.setClusterId(CLUSTER_ID);
+ artifactUpdatedEvent.setTenantId(TENANT_ID);
+ return artifactUpdatedEvent;
+ }
+
+ /**
+ * Create test topology
+ *
+ * @return
+ */
+ private Topology createTestTopology() {
+ Topology topology = new Topology();
+ Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+ topology.addService(service);
+
+ Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+ AUTOSCALING_POLICY_NAME, APP_ID);
+ service.addCluster(cluster);
+
+ Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+ CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+ System.currentTimeMillis());
+
+ member.setDefaultPrivateIP("10.0.0.1");
+ member.setDefaultPublicIP("20.0.0.1");
+ Properties properties = new Properties();
+ properties.setProperty("prop1", "value1");
+ member.setProperties(properties);
+ member.setStatus(MemberStatus.Created);
+ cluster.addMember(member);
+
+ return topology;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
new file mode 100755
index 0000000..86fc7c3
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
@@ -0,0 +1,21 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class ADCTest {
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
new file mode 100755
index 0000000..615cd8e
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.python.cartridge.agent.test;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+public class AgentStartupTest extends PythonAgentTestManager {
+ private static final Log log = LogFactory.getLog(AgentStartupTest.class);
+ private static final int STARTUP_TIMEOUT = 120000;
+ private static final String SUITE_NAME = "suite-1";
+ private static final String CLUSTER_ID = "php.php.domain";
+ private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
+ private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-1";
+ private static final String APP_ID = "application-1";
+ private static final String MEMBER_ID = "php.member-1";
+ private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+ private static final String NETWORK_PARTITION_ID = "network-partition-1";
+ private static final String PARTITION_ID = "partition-1";
+ private static final String TENANT_ID = "-1234";
+ private static final String SERVICE_NAME = "php";
+ private boolean startupTestCompleted = false;
+
+ @BeforeSuite
+ public void setupAgentStartupTest() {
+ // Set jndi.properties.dir system property for initializing event publishers and receivers
+ System.setProperty("jndi.properties.dir", getResourcesPath(SUITE_NAME));
+
+ // start Python agent with configurations provided in resource path
+ setup(SUITE_NAME);
+
+ // Simulate server socket
+ startServerSocket(8080);
+ }
+
+
+ /**
+ * TearDown method for test method testPythonCartridgeAgent
+ */
+ @AfterSuite
+ public void tearDownAgentStartupTest() {
+ tearDown();
+ }
+
+ @Test(timeOut = STARTUP_TIMEOUT)
+ public void testPythonCartridgeAgent() {
+ startCommunicatorThread();
+ Thread startupTestThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ while (!eventReceiverInitiated) {
+ sleep(2000);
+ }
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed()) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if (newLines.size() > 0) {
+ for (String line : newLines) {
+ if (line.contains("Subscribed to 'topology/#'")) {
+ sleep(2000);
+ // Send complete topology event
+ log.info("Publishing complete topology event...");
+ Topology topology = createTestTopology();
+ CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+ publishEvent(completeTopologyEvent);
+ log.info("Complete topology event published");
+
+ // Publish member initialized event
+ log.info("Publishing member initialized event...");
+ MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+ SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+ PARTITION_ID
+ );
+ publishEvent(memberInitializedEvent);
+ log.info("Member initialized event published");
+ }
+ // TODO: properly mock the CEP server
+ if (line.contains("Published event to thrift stream")) {
+ startupTestCompleted = true;
+ }
+ }
+ }
+ sleep(1000);
+ }
+ }
+ });
+
+ startupTestThread.start();
+
+ while (!instanceStarted || !instanceActivated || !startupTestCompleted) {
+ // wait until the instance activated event is received.
+ // this will assert whether instance got activated within timeout period; no need for explicit assertions
+ sleep(2000);
+ }
+ }
+
+
+ /**
+ * Create test topology
+ *
+ * @return
+ */
+ private Topology createTestTopology() {
+ Topology topology = new Topology();
+ Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+ topology.addService(service);
+
+ Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+ AUTOSCALING_POLICY_NAME, APP_ID);
+ service.addCluster(cluster);
+
+ Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+ CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+ System.currentTimeMillis());
+
+ member.setDefaultPrivateIP("10.0.0.1");
+ member.setDefaultPublicIP("20.0.0.1");
+ Properties properties = new Properties();
+ properties.setProperty("prop1", "value1");
+ member.setProperties(properties);
+ member.setStatus(MemberStatus.Created);
+ cluster.addMember(member);
+
+ return topology;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/DataPublisherTestUtil.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/DataPublisherTestUtil.java b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/DataPublisherTestUtil.java
new file mode 100644
index 0000000..7f1d985
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/DataPublisherTestUtil.java
@@ -0,0 +1,46 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+
+public class DataPublisherTestUtil {
+ public static final String LOCAL_HOST = "localhost";
+
+ public static void setTrustStoreParams() {
+ String trustStore = PythonAgentTestManager.getResourcesPath("common");
+ System.setProperty("javax.net.ssl.trustStore", trustStore + File.separator + "client-truststore.jks");
+ System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
+ }
+
+ public static void setKeyStoreParams() {
+ String keyStore = PythonAgentTestManager.getResourcesPath("common");
+ System.setProperty("Security.KeyStore.Location", keyStore + File.separator + "wso2carbon.jks");
+ System.setProperty("Security.KeyStore.Password", "wso2carbon");
+ }
+
+ public static String getDataAgentConfigPath() {
+ String filePath = PythonAgentTestManager.getResourcesPath("common");
+ return filePath + File.separator + "data-agent-config.xml";
+ }
+
+ public static String getDataBridgeConfigPath() {
+ String filePath = PythonAgentTestManager.getResourcesPath("common");
+ return filePath + File.separator + "data-bridge-config.xml";
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
new file mode 100644
index 0000000..2394392
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
@@ -0,0 +1,497 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.commons.exec.*;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.listener.instance.status.InstanceActivatedEventListener;
+import org.apache.stratos.messaging.listener.instance.status.InstanceStartedEventListener;
+import org.apache.stratos.messaging.message.receiver.instance.status.InstanceStatusEventReceiver;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
+import org.apache.stratos.messaging.util.MessagingUtil;
+
+import java.io.*;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+public class PythonAgentTestManager {
+ protected final Properties integrationProperties = new Properties();
+ public static final String PATH_SEP = File.separator;
+ private static final Log log = LogFactory.getLog(PythonAgentTestManager.class);
+ protected BrokerService broker = new BrokerService();
+
+ public final long TIMEOUT = 180000;
+ public static final String NEW_LINE = System.getProperty("line.separator");
+ public static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "activemq.amqp.bind.address";
+ public static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "activemq.mqtt.bind.address";
+ public static final String CEP_PORT = "cep.port";
+ public static final String CEP_SSL_PORT = "cep.ssl.port";
+ public static final String DISTRIBUTION_NAME = "distribution.name";
+ protected final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
+
+ protected Map<Integer, ServerSocket> serverSocketMap = new HashMap<>();
+ protected Map<String, Executor> executorList = new HashMap<String, Executor>();
+
+ protected int cepPort;
+ protected int cepSSLPort;
+ protected String amqpBindAddress;
+ protected String mqttBindAddress;
+ protected String distributionName;
+
+ protected boolean eventReceiverInitiated = false;
+ protected TopologyEventReceiver topologyEventReceiver;
+ protected InstanceStatusEventReceiver instanceStatusEventReceiver;
+ protected boolean instanceStarted;
+ protected boolean instanceActivated;
+ protected ByteArrayOutputStreamLocal outputStream;
+ private ThriftTestServer thriftTestServer;
+
+ /**
+ * Setup method for test method testPythonCartridgeAgent
+ */
+ protected void setup(String resourcePath) {
+ try {
+ startBroker();
+ }
+ catch (Exception e) {
+ log.error("Error while starting MB", e);
+ return;
+ }
+ if (!this.eventReceiverInitiated) {
+ ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 15);
+ topologyEventReceiver = new TopologyEventReceiver();
+ topologyEventReceiver.setExecutorService(executorService);
+ topologyEventReceiver.execute();
+
+ instanceStatusEventReceiver = new InstanceStatusEventReceiver();
+ instanceStatusEventReceiver.setExecutorService(executorService);
+ instanceStatusEventReceiver.execute();
+
+ this.instanceStarted = false;
+ instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ log.info("Instance started event received");
+ instanceStarted = true;
+ }
+ });
+
+ this.instanceActivated = false;
+ instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ log.info("Instance activated event received");
+ instanceActivated = true;
+ }
+ });
+
+ this.eventReceiverInitiated = true;
+ }
+
+ // Start Thrift server to emulate CEP
+ thriftTestServer = new ThriftTestServer();
+ try {
+ File file = new File(getResourcesPath("common") + PATH_SEP + "stratos-health-stream-def.json");
+ FileInputStream fis = new FileInputStream(file);
+ byte[] data = new byte[(int) file.length()];
+ fis.read(data);
+ fis.close();
+ String str = new String(data, "UTF-8");
+ if (str.equals("")) {
+ log.warn("Stream definition of health stat stream is empty. Thrift server will not function properly");
+ }
+ thriftTestServer.addStreamDefinition(str, -1234);
+ // start with non-ssl port; test server will automatically bind to ssl port
+ thriftTestServer.start(cepPort);
+ log.info("Started Thrift server with stream definition: " + str);
+ }
+ catch (Exception e) {
+ log.error("Could not start Thrift test server", e);
+ }
+
+
+ String agentPath = setupPythonAgent(resourcePath);
+ log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
+ log.info("Starting python cartridge agent...");
+ this.outputStream = executeCommand("python " + agentPath + PATH_SEP + "agent.py");
+ }
+
+
+ protected void tearDown() {
+ tearDown(null);
+ }
+
+ /**
+ * TearDown method for test method testPythonCartridgeAgent
+ */
+ protected void tearDown(String sourcePath) {
+ for (Map.Entry<String, Executor> entry : executorList.entrySet()) {
+ try {
+ String commandText = entry.getKey();
+ Executor executor = entry.getValue();
+ log.info("Terminating process: " + commandText);
+ executor.setExitValue(0);
+ executor.getWatchdog().destroyProcess();
+ }
+ catch (Exception ignore) {
+ }
+ }
+ // wait until everything cleans up to avoid connection errors
+ sleep(1000);
+ for (ServerSocket serverSocket : serverSocketMap.values()) {
+ try {
+ log.info("Stopping socket server: " + serverSocket.getLocalSocketAddress());
+ serverSocket.close();
+ }
+ catch (IOException ignore) {
+ }
+ }
+ try {
+ if (thriftTestServer != null) {
+ thriftTestServer.stop();
+ }
+ }
+ catch (Exception e) {
+ log.error("Could not stop Thrift test server", e);
+ }
+
+ try {
+ log.info("Deleting source checkout folder...");
+ FileUtils.deleteDirectory(new File(sourcePath));
+ }
+ catch (Exception ignore) {
+ }
+ this.instanceStatusEventReceiver.terminate();
+ this.topologyEventReceiver.terminate();
+
+ this.instanceActivated = false;
+ this.instanceStarted = false;
+ try {
+ broker.stop();
+ }
+ catch (Exception e) {
+ log.error("Error while stopping the broker service", e);
+ }
+ }
+
+ public PythonAgentTestManager() {
+ try {
+ integrationProperties
+ .load(PythonAgentTestManager.class.getResourceAsStream(PATH_SEP + "integration-test.properties"));
+ distributionName = integrationProperties.getProperty(DISTRIBUTION_NAME);
+ amqpBindAddress = integrationProperties.getProperty(ACTIVEMQ_AMQP_BIND_ADDRESS);
+ mqttBindAddress = integrationProperties.getProperty(ACTIVEMQ_MQTT_BIND_ADDRESS);
+ cepPort = Integer.parseInt(integrationProperties.getProperty(CEP_PORT));
+ cepSSLPort = Integer.parseInt(integrationProperties.getProperty(CEP_SSL_PORT));
+ log.info("PCA integration properties: " + integrationProperties.toString());
+ }
+ catch (IOException e) {
+ log.error("Error loading integration-test.properties file from classpath. Please make sure that file " +
+ "exists in classpath.", e);
+ }
+ }
+
+ protected void startBroker() throws Exception {
+ broker.addConnector(amqpBindAddress);
+ broker.addConnector(mqttBindAddress);
+ broker.setBrokerName("testBroker");
+ broker.setDataDirectory(
+ PythonAgentTestManager.class.getResource(PATH_SEP).getPath() + PATH_SEP + ".." + PATH_SEP +
+ PYTHON_AGENT_DIR_NAME + PATH_SEP + "activemq-data");
+ broker.start();
+ log.info("Broker service started!");
+ }
+
+ protected void startCommunicatorThread() {
+ Thread communicatorThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed()) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if (newLines.size() > 0) {
+ for (String line : newLines) {
+ if (line.contains("Exception in thread") || line.contains("ERROR")) {
+ try {
+ throw new RuntimeException(line);
+ }
+ catch (Exception e) {
+ log.error("ERROR found in PCA log", e);
+ }
+ }
+ log.info("[PCA] " + line);
+ }
+ }
+ sleep(100);
+ }
+ }
+ });
+ communicatorThread.start();
+ }
+
+ /**
+ * Start server socket
+ *
+ * @param port
+ */
+ protected void startServerSocket(final int port) {
+ Thread socketThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ while (true) { // do this infinitely until test is complete
+ try {
+ ServerSocket serverSocket = new ServerSocket(port);
+ serverSocketMap.put(port, serverSocket);
+ log.info("Server socket started on port: " + port);
+ Socket socket = serverSocket.accept();
+ log.info("Client connected to [port] " + port);
+
+ InputStream is = socket.getInputStream();
+ byte[] buffer = new byte[1024];
+ int read;
+ while (true) {
+ if (socket.isClosed()) {
+ log.info("Socket for [port] " + port + " has been closed.");
+ break;
+ }
+ if ((read = is.read(buffer)) != -1) {
+ String output = new String(buffer, 0, read);
+ log.info("Message received for [port] " + port + ", [message] " + output);
+ }
+ }
+ }
+ catch (IOException e) {
+ String message = "Could not start server socket: [port] " + port;
+ log.error(message, e);
+ throw new RuntimeException(message, e);
+ }
+ }
+ }
+ });
+ socketThread.start();
+ }
+
+
+ protected static String getResourcesPath() {
+ return PythonAgentTestManager.class.getResource(PATH_SEP).getPath() + PATH_SEP + ".." + PATH_SEP +
+ ".." + PATH_SEP + "src" + PATH_SEP + "test" + PATH_SEP + "resources";
+ }
+
+ protected static String getResourcesPath(String resourcesPath) {
+ return PythonAgentTestManager.class.getResource(PATH_SEP).getPath() + ".." + PATH_SEP + ".." +
+ PATH_SEP + "src" + PATH_SEP + "test" + PATH_SEP + "resources" + PATH_SEP + resourcesPath;
+ }
+
+ /**
+ * Copy python agent distribution to a new folder, extract it and copy sample configuration files
+ *
+ * @return
+ */
+ protected String setupPythonAgent(String resourcesPath) {
+ try {
+ log.info("Setting up python cartridge agent...");
+
+
+ String srcAgentPath = PythonAgentTestManager.class.getResource(PATH_SEP).getPath() +
+ PATH_SEP + ".." + PATH_SEP + ".." + PATH_SEP + ".." + PATH_SEP + "distribution" + PATH_SEP +
+ "target" + PATH_SEP + distributionName + ".zip";
+ String unzipDestPath =
+ PythonAgentTestManager.class.getResource(PATH_SEP).getPath() + PATH_SEP + ".." + PATH_SEP +
+ PYTHON_AGENT_DIR_NAME + PATH_SEP;
+ //FileUtils.copyFile(new File(srcAgentPath), new File(destAgentPath));
+ unzip(srcAgentPath, unzipDestPath);
+ String destAgentPath = PythonAgentTestManager.class.getResource(PATH_SEP).getPath() + PATH_SEP + ".." +
+ PATH_SEP + PYTHON_AGENT_DIR_NAME + PATH_SEP + distributionName;
+
+ String srcAgentConfPath = getResourcesPath(resourcesPath) + PATH_SEP + "agent.conf";
+ String destAgentConfPath = destAgentPath + PATH_SEP + "agent.conf";
+ FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
+
+ String srcLoggingIniPath = getResourcesPath(resourcesPath) + PATH_SEP + "logging.ini";
+ String destLoggingIniPath = destAgentPath + PATH_SEP + "logging.ini";
+ FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
+
+ String srcPayloadPath = getResourcesPath(resourcesPath) + PATH_SEP + "payload";
+ String destPayloadPath = destAgentPath + PATH_SEP + "payload";
+ FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
+
+ log.info("Changing extension scripts permissions");
+ File extensionsPath = new File(destAgentPath + PATH_SEP + "extensions" + PATH_SEP + "bash");
+ File[] extensions = extensionsPath.listFiles();
+ for (File extension : extensions) {
+ extension.setExecutable(true);
+ }
+
+ log.info("Python cartridge agent setup completed");
+
+ return destAgentPath;
+ }
+ catch (Exception e) {
+ String message = "Could not copy cartridge agent distribution";
+ log.error(message, e);
+ throw new RuntimeException(message, e);
+ }
+ }
+
+ private void unzip(String zipFilePath, String destDirectory) throws IOException {
+ File destDir = new File(destDirectory);
+ if (!destDir.exists()) {
+ destDir.mkdir();
+ }
+ ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
+ ZipEntry entry = zipIn.getNextEntry();
+ // iterates over entries in the zip file
+ while (entry != null) {
+ String filePath = destDirectory + File.separator + entry.getName();
+ if (!entry.isDirectory()) {
+ // if the entry is a file, extracts it
+ extractFile(zipIn, filePath);
+ } else {
+ // if the entry is a directory, make the directory
+ File dir = new File(filePath);
+ dir.mkdir();
+ }
+ zipIn.closeEntry();
+ entry = zipIn.getNextEntry();
+ }
+ zipIn.close();
+ }
+
+ private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
+ BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
+ byte[] bytesIn = new byte[4096];
+ int read = 0;
+ while ((read = zipIn.read(bytesIn)) != -1) {
+ bos.write(bytesIn, 0, read);
+ }
+ bos.close();
+ }
+
+ /**
+ * Execute shell command
+ *
+ * @param commandText
+ */
+ protected ByteArrayOutputStreamLocal executeCommand(final String commandText) {
+ final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
+ try {
+ CommandLine commandline = CommandLine.parse(commandText);
+ DefaultExecutor exec = new DefaultExecutor();
+ PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
+ exec.setWorkingDirectory(new File(
+ PythonAgentTestManager.class.getResource(PATH_SEP).getPath() + PATH_SEP + ".." + PATH_SEP +
+ PYTHON_AGENT_DIR_NAME));
+ exec.setStreamHandler(streamHandler);
+ ExecuteWatchdog watchdog = new ExecuteWatchdog(TIMEOUT);
+ exec.setWatchdog(watchdog);
+ exec.execute(commandline, new ExecuteResultHandler() {
+ @Override
+ public void onProcessComplete(int i) {
+ log.info(commandText + " process completed");
+ }
+
+ @Override
+ public void onProcessFailed(ExecuteException e) {
+ log.error(commandText + " process failed", e);
+ }
+ });
+ executorList.put(commandText, exec);
+ return outputStream;
+ }
+ catch (Exception e) {
+ log.error(outputStream.toString(), e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Sleep current thread
+ *
+ * @param time
+ */
+ protected void sleep(long time) {
+ try {
+ Thread.sleep(time);
+ }
+ catch (InterruptedException ignore) {
+ }
+ }
+
+ /**
+ * Return new lines found in the output
+ *
+ * @param currentOutputLines current output lines
+ * @param output output
+ * @return
+ */
+ protected List<String> getNewLines(List<String> currentOutputLines, String output) {
+ List<String> newLines = new ArrayList<String>();
+
+ if (StringUtils.isNotBlank(output)) {
+ String[] lines = output.split(NEW_LINE);
+ for (String line : lines) {
+ if (!currentOutputLines.contains(line)) {
+ currentOutputLines.add(line);
+ newLines.add(line);
+ }
+ }
+ }
+ return newLines;
+ }
+
+ /**
+ * Publish messaging event
+ *
+ * @param event
+ */
+ protected void publishEvent(Event event) {
+ String topicName = MessagingUtil.getMessageTopicName(event);
+ EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
+ eventPublisher.publish(event);
+ }
+
+
+ /**
+ * Implements ByteArrayOutputStream.isClosed() method
+ */
+ protected class ByteArrayOutputStreamLocal extends org.apache.commons.io.output.ByteArrayOutputStream {
+ private boolean closed;
+
+ @Override
+ public void close() throws IOException {
+ super.close();
+ closed = true;
+ }
+
+ public boolean isClosed() {
+ return closed;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ThriftTestServer.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ThriftTestServer.java b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ThriftTestServer.java
new file mode 100644
index 0000000..aaa9ba0
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ThriftTestServer.java
@@ -0,0 +1,213 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.log4j.Logger;
+import org.wso2.carbon.databridge.commons.Credentials;
+import org.wso2.carbon.databridge.commons.Event;
+import org.wso2.carbon.databridge.commons.StreamDefinition;
+import org.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionException;
+import org.wso2.carbon.databridge.commons.utils.EventDefinitionConverterUtils;
+import org.wso2.carbon.databridge.core.AgentCallback;
+import org.wso2.carbon.databridge.core.DataBridge;
+import org.wso2.carbon.databridge.core.Utils.AgentSession;
+import org.wso2.carbon.databridge.core.definitionstore.InMemoryStreamDefinitionStore;
+import org.wso2.carbon.databridge.core.exception.DataBridgeException;
+import org.wso2.carbon.databridge.core.exception.StreamDefinitionStoreException;
+import org.wso2.carbon.databridge.core.internal.authentication.AuthenticationHandler;
+import org.wso2.carbon.databridge.receiver.thrift.ThriftDataReceiver;
+import org.wso2.carbon.user.api.UserStoreException;
+
+import java.net.SocketException;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class ThriftTestServer {
+ Logger log = Logger.getLogger(ThriftTestServer.class);
+ ThriftDataReceiver thriftDataReceiver;
+ InMemoryStreamDefinitionStore streamDefinitionStore;
+ AtomicInteger numberOfEventsReceived;
+ RestarterThread restarterThread;
+
+ public void startTestServer() throws DataBridgeException, InterruptedException {
+ ThriftTestServer thriftTestServer = new ThriftTestServer();
+ thriftTestServer.start(7611);
+ Thread.sleep(100000000);
+ thriftTestServer.stop();
+ }
+
+
+ public void addStreamDefinition(StreamDefinition streamDefinition, int tenantId)
+ throws StreamDefinitionStoreException {
+ streamDefinitionStore.saveStreamDefinitionToStore(streamDefinition, tenantId);
+ }
+
+ public void addStreamDefinition(String streamDefinitionStr, int tenantId)
+ throws StreamDefinitionStoreException, MalformedStreamDefinitionException {
+ StreamDefinition streamDefinition = EventDefinitionConverterUtils.convertFromJson(streamDefinitionStr);
+ getStreamDefinitionStore().saveStreamDefinitionToStore(streamDefinition, tenantId);
+ }
+
+ private InMemoryStreamDefinitionStore getStreamDefinitionStore() {
+ if (streamDefinitionStore == null) {
+ streamDefinitionStore = new InMemoryStreamDefinitionStore();
+ }
+ return streamDefinitionStore;
+ }
+
+ public void start(int receiverPort) throws DataBridgeException {
+ DataPublisherTestUtil.setKeyStoreParams();
+ streamDefinitionStore = getStreamDefinitionStore();
+ numberOfEventsReceived = new AtomicInteger(0);
+ DataBridge databridge = new DataBridge(new AuthenticationHandler() {
+ @Override
+ public boolean authenticate(String userName,
+ String password) {
+ log.info("Thrift authentication returning true");
+ return true;// allays authenticate to true
+
+ }
+
+ @Override
+ public String getTenantDomain(String userName) {
+ return "admin";
+ }
+
+ @Override
+ public int getTenantId(String tenantDomain) throws UserStoreException {
+ return -1234;
+ }
+
+ @Override
+ public void initContext(AgentSession agentSession) {
+ //To change body of implemented methods use File | Settings | File Templates.
+ log.info("Initializing Thrift agent context");
+ }
+
+ @Override
+ public void destroyContext(AgentSession agentSession) {
+
+ }
+ }, streamDefinitionStore, DataPublisherTestUtil.getDataBridgeConfigPath());
+
+ thriftDataReceiver = new ThriftDataReceiver(receiverPort, databridge);
+
+ databridge.subscribe(new AgentCallback() {
+ int totalSize = 0;
+
+ public void definedStream(StreamDefinition streamDefinition,
+ int tenantId) {
+ log.info("StreamDefinition " + streamDefinition);
+ }
+
+ @Override
+ public void removeStream(StreamDefinition streamDefinition, int tenantId) {
+ log.info("StreamDefinition remove " + streamDefinition);
+ }
+
+ @Override
+ public void receive(List<Event> eventList, Credentials credentials) {
+ numberOfEventsReceived.addAndGet(eventList.size());
+ log.info("Received events : " + numberOfEventsReceived);
+// log.info("eventListSize=" + eventList.size() + " eventList " + eventList + " for username " + credentials.getUsername());
+ }
+
+ });
+
+ String address = "localhost";
+ log.info("Test Server starting on " + address);
+ thriftDataReceiver.start(address);
+ log.info("Test Server Started");
+ }
+
+ public int getNumberOfEventsReceived() {
+ if (numberOfEventsReceived != null) {
+ return numberOfEventsReceived.get();
+ } else {
+ return 0;
+ }
+ }
+
+ public void resetReceivedEvents() {
+ numberOfEventsReceived.set(0);
+ }
+
+ public void stop() {
+ thriftDataReceiver.stop();
+ log.info("Test Server Stopped");
+ }
+
+ public void stopAndStartDuration(int port, long stopAfterTimeMilliSeconds, long startAfterTimeMS)
+ throws SocketException, DataBridgeException {
+ restarterThread = new RestarterThread(port, stopAfterTimeMilliSeconds, startAfterTimeMS);
+ Thread thread = new Thread(restarterThread);
+ thread.start();
+ }
+
+ public int getEventsReceivedBeforeLastRestart() {
+ return restarterThread.eventReceived;
+ }
+
+
+ class RestarterThread implements Runnable {
+ int eventReceived;
+ int port;
+
+ long stopAfterTimeMilliSeconds;
+ long startAfterTimeMS;
+
+ RestarterThread(int port, long stopAfterTime, long startAfterTime) {
+ this.port = port;
+ stopAfterTimeMilliSeconds = stopAfterTime;
+ startAfterTimeMS = startAfterTime;
+ }
+
+ @Override
+ public void run() {
+ try {
+ Thread.sleep(stopAfterTimeMilliSeconds);
+ }
+ catch (InterruptedException e) {
+ }
+ if (thriftDataReceiver != null) {
+ thriftDataReceiver.stop();
+ }
+
+ eventReceived = getNumberOfEventsReceived();
+
+ log.info("Number of events received in server shutdown :" + eventReceived);
+ try {
+ Thread.sleep(startAfterTimeMS);
+ }
+ catch (InterruptedException e) {
+ }
+
+ try {
+ if (thriftDataReceiver != null) {
+ thriftDataReceiver.start(DataPublisherTestUtil.LOCAL_HOST);
+ } else {
+ start(port);
+ }
+ }
+ catch (DataBridgeException e) {
+ log.error(e);
+ }
+
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/common/client-truststore.jks
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/common/client-truststore.jks b/products/python-cartridge-agent/modules/integration/src/test/resources/common/client-truststore.jks
new file mode 100644
index 0000000..2d22c24
Binary files /dev/null and b/products/python-cartridge-agent/modules/integration/src/test/resources/common/client-truststore.jks differ
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/common/data-bridge-config.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/common/data-bridge-config.xml b/products/python-cartridge-agent/modules/integration/src/test/resources/common/data-bridge-config.xml
new file mode 100644
index 0000000..13ca54c
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/common/data-bridge-config.xml
@@ -0,0 +1,75 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<dataBridgeConfiguration>
+
+ <workerThreads>10</workerThreads>
+ <eventBufferCapacity>10000</eventBufferCapacity>
+ <clientTimeoutMin>30</clientTimeoutMin>
+
+ <dataReceiver name="Thrift">
+ <config name="tcpPort">7611</config>
+ <config name="sslPort">7711</config>
+ </dataReceiver>
+
+ <dataReceiver name="Binary">
+ <config name="tcpPort">9611</config>
+ <config name="sslPort">9711</config>
+ <config name="sslReceiverThreadPoolSize">100</config>
+ <config name="tcpReceiverThreadPoolSize">100</config>
+ </dataReceiver>
+
+ <!--<streamDefinitions>
+ <streamDefinition>
+ {
+ 'name':'org.wso2.esb.MediatorStatistics',
+ 'version':'1.3.0',
+ 'nickName': 'Stock Quote Information',
+ 'description': 'Some Desc',
+ 'metaData':[
+ {'name':'ipAdd','type':'STRING'}
+ ],
+ 'payloadData':[
+ {'name':'symbol','type':'STRING'},
+ {'name':'price','type':'DOUBLE'},
+ {'name':'volume','type':'INT'},
+ {'name':'max','type':'DOUBLE'},
+ {'name':'min','type':'Double'}
+ ]
+ }
+ </streamDefinition>
+ <streamDefinition domainName="wso2">
+ {
+ 'name':'org.wso2.esb.MediatorStatistics',
+ 'version':'1.3.4',
+ 'nickName': 'Stock Quote Information',
+ 'description': 'Some Other Desc',
+ 'metaData':[
+ {'name':'ipAdd','type':'STRING'}
+ ],
+ 'payloadData':[
+ {'name':'symbol','type':'STRING'},
+ {'name':'price','type':'DOUBLE'},
+ {'name':'volume','type':'INT'}
+ ]
+ }
+ </streamDefinition>
+ </streamDefinitions>-->
+
+</dataBridgeConfiguration>
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/common/log4j.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/common/log4j.properties b/products/python-cartridge-agent/modules/integration/src/test/resources/common/log4j.properties
new file mode 100755
index 0000000..c0c6e78
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/common/log4j.properties
@@ -0,0 +1,41 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Set root logger level and appenders
+log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
+
+# CONSOLE_APPENDER is set to be a ConsoleAppender.
+log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
+
+# The standard error log where all the warnings, errors and fatal errors will be logged
+log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
+log4j.appender.FILE_APPENDER.File=cartridge-agent.log
+log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
+log4j.appender.FILE_APPENDER.threshold=DEBUG
+
+# CONSOLE_APPENDER uses PatternLayout.
+log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
+
+log4j.logger.org.apache.stratos.cartridge.agent=INFO
+log4j.logger.org.apache.stratos.messaging=INFO
+log4j.logger.org.apache.stratos.common.util=DEBUG
+log4j.logger.org.wso2.andes.client=ERROR
+log4j.logger.org.apache.activemq.jndi.ActiveMQInitialContextFactory=ERROR
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/common/stratos-health-stream-def.json
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/common/stratos-health-stream-def.json b/products/python-cartridge-agent/modules/integration/src/test/resources/common/stratos-health-stream-def.json
new file mode 100644
index 0000000..4d36c19
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/common/stratos-health-stream-def.json
@@ -0,0 +1 @@
+{"name":"cartridge_agent_health_stats","version":"1.0.0","nickName":"agent health stats","description":"agent health stats","payloadData":[{"name":"cluster_id", "type": "STRING"},{"name":"cluster_instance_id", "type": "STRING"},{"name":"network_partition_id", "type": "STRING"},{"name":"member_id", "type": "STRING"},{"name":"partition_id", "type": "STRING"},{"name":"health_description", "type": "STRING"},{"name":"value", "type": "DOUBLE"}]}
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/common/thrift-agent-config.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/common/thrift-agent-config.xml b/products/python-cartridge-agent/modules/integration/src/test/resources/common/thrift-agent-config.xml
new file mode 100644
index 0000000..dbb2ba3
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/common/thrift-agent-config.xml
@@ -0,0 +1,64 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<DataAgentsConfiguration>
+ <Agent>
+ <Name>Thrift</Name>
+ <DataEndpointClass>org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftDataEndpoint</DataEndpointClass>
+ <!--<TrustSore>src/main/resources/client-truststore.jks</TrustSore>-->
+ <!--<TrustSorePassword>wso2carbon</TrustSorePassword>-->
+ <QueueSize>32768</QueueSize>
+ <BatchSize>200</BatchSize>
+ <CorePoolSize>5</CorePoolSize>
+ <MaxPoolSize>10</MaxPoolSize>
+ <SocketTimeoutMS>30000</SocketTimeoutMS>
+ <KeepAliveTimeInPool>20</KeepAliveTimeInPool>
+ <ReconnectionInterval>30</ReconnectionInterval>
+ <MaxTransportPoolSize>250</MaxTransportPoolSize>
+ <MaxIdleConnections>250</MaxIdleConnections>
+ <EvictionTimePeriod>5500</EvictionTimePeriod>
+ <MinIdleTimeInPool>5000</MinIdleTimeInPool>
+ <SecureMaxTransportPoolSize>250</SecureMaxTransportPoolSize>
+ <SecureMaxIdleConnections>250</SecureMaxIdleConnections>
+ <SecureEvictionTimePeriod>5500</SecureEvictionTimePeriod>
+ <SecureMinIdleTimeInPool>5000</SecureMinIdleTimeInPool>
+ </Agent>
+
+ <Agent>
+ <Name>Binary</Name>
+ <DataEndpointClass>org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint</DataEndpointClass>
+ <!--<TrustSore>src/main/resources/client-truststore.jks</TrustSore>-->
+ <!--<TrustSorePassword>wso2carbon</TrustSorePassword>-->
+ <QueueSize>32768</QueueSize>
+ <BatchSize>200</BatchSize>
+ <CorePoolSize>5</CorePoolSize>
+ <MaxPoolSize>10</MaxPoolSize>
+ <SocketTimeoutMS>30000</SocketTimeoutMS>
+ <KeepAliveTimeInPool>20</KeepAliveTimeInPool>
+ <ReconnectionInterval>30</ReconnectionInterval>
+ <MaxTransportPoolSize>250</MaxTransportPoolSize>
+ <MaxIdleConnections>250</MaxIdleConnections>
+ <EvictionTimePeriod>5500</EvictionTimePeriod>
+ <MinIdleTimeInPool>5000</MinIdleTimeInPool>
+ <SecureMaxTransportPoolSize>250</SecureMaxTransportPoolSize>
+ <SecureMaxIdleConnections>250</SecureMaxIdleConnections>
+ <SecureEvictionTimePeriod>5500</SecureEvictionTimePeriod>
+ <SecureMinIdleTimeInPool>5000</SecureMinIdleTimeInPool>
+ </Agent>
+</DataAgentsConfiguration>
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/common/wso2carbon.jks
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/common/wso2carbon.jks b/products/python-cartridge-agent/modules/integration/src/test/resources/common/wso2carbon.jks
new file mode 100644
index 0000000..7942c53
Binary files /dev/null and b/products/python-cartridge-agent/modules/integration/src/test/resources/common/wso2carbon.jks differ
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing1.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing1.xml b/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing1.xml
new file mode 100755
index 0000000..a13f950
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing1.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite1">
+ <test name="PCATest">
+ <classes>
+ <class name="org.apache.stratos.python.cartridge.agent.test.PythonCartridgeAgentTest"/>
+ </classes>
+ </test>
+</suite>
[08/50] [abbrv] stratos git commit: Update the get cartridge group
service method
Posted by ga...@apache.org.
Update the get cartridge group service method
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/02eafdf5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/02eafdf5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/02eafdf5
Branch: refs/heads/master
Commit: 02eafdf534d4643db2e56a126d230a7d6fe9cb6a
Parents: 861d6ac
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 21 12:38:56 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 21 12:38:56 2015 +0530
----------------------------------------------------------------------
.../services/impl/AutoscalerServiceImpl.java | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/02eafdf5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index e5fd50d..6c47116 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@ -907,12 +907,14 @@ public class AutoscalerServiceImpl implements AutoscalerService {
}
try {
ServiceGroup[] serviceGroups=getServiceGroupsByTenant(tenantId);
- for(ServiceGroup serviceGroup:serviceGroups){
- if(serviceGroup.getName().equals(name)){
- selectedGroup=serviceGroup;
- }
- else{
- ServiceGroup[] innerGroups=serviceGroup.getGroups();
+ for(ServiceGroup serviceGroup:serviceGroups) {
+ if (serviceGroup.getName().equals(name)) {
+ selectedGroup = serviceGroup;
+ return selectedGroup;
+ }
+ }
+ for(ServiceGroup serviceGroup:serviceGroups) {
+ ServiceGroup[] innerGroups=serviceGroup.getGroups();
while(innerGroups!=null){
for(ServiceGroup nestedGroup:innerGroups) {
if(nestedGroup.getName().equals(name)){
@@ -923,7 +925,6 @@ public class AutoscalerServiceImpl implements AutoscalerService {
}
}
}
- }
}
return selectedGroup;
} catch (Exception e) {
[50/50] [abbrv] stratos git commit: Resolve conflict
Posted by ga...@apache.org.
Resolve conflict
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/238c3c48
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/238c3c48
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/238c3c48
Branch: refs/heads/master
Commit: 238c3c48c3e6209ea2061a6fa7694e88de20491e
Parents: 218fc1f
Author: gayangunarathne <ga...@wso2.com>
Authored: Tue Sep 1 17:58:53 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Tue Sep 1 17:58:53 2015 +0530
----------------------------------------------------------------------
.../src/test/resources/stratos-testing.xml | 37 +++++++++++---------
1 file changed, 20 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/238c3c48/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/stratos-testing.xml b/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
index b9107c8..7a2c1e1 100644
--- a/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
+++ b/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
@@ -21,7 +21,7 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="StratosIntegrationSuite">
- <!--
+
<test name="CartridgeTest">
<classes>
<class name="org.apache.stratos.integration.tests.group.CartridgeTest" />
@@ -53,30 +53,33 @@
<class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest" />
</classes>
</test>
+
<test name="SampleApplicationsTest">
<classes>
<class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest" />
</classes>
</test>
- <test name="ApplicationBurstingTest">
+
+<!--
+ <test name="ApplicationBurstingTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest" />
+ </classes>
+ </test>
+ <test name="SingleClusterScalingTest">
<classes>
- <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest" />
+ <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest" />
</classes>
</test>
- <test name="SingleClusterScalingTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest" />
- </classes>
- </test>
- <test name="PartitionRoundRobinClusterTest">
+ <test name="PartitionRoundRobinClusterTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest" />
+ </classes>
+ </test>
+
+ <test name="GroupTerminationBehaviorTest">
<classes>
- <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest" />
+ <class name="org.apache.stratos.integration.tests.application.GroupTerminationBehaviorTest" />
</classes>
- </test>
-
- <test name="GroupTerminationBehaviorTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.GroupTerminationBehaviorTest" />
- </classes>
- </test>-->
+ </test>-->
</suite>
[34/50] [abbrv] stratos git commit: Update with uuid
Posted by ga...@apache.org.
Update with uuid
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/599e543a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/599e543a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/599e543a
Branch: refs/heads/master
Commit: 599e543a816bbe8b2d6ec957b2e6b7333dc3d5b6
Parents: 1156a56
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 28 19:37:06 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 28 19:37:06 2015 +0530
----------------------------------------------------------------------
.../cloud/controller/iaases/kubernetes/KubernetesIaas.java | 2 +-
.../simple/single-cartridge-app/scripts/common/deploy.sh | 4 ++++
.../simple/single-cartridge-app/scripts/kubernetes/deploy.sh | 8 +++++---
3 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/599e543a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
index 23c5514..b9c15dc 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
@@ -394,7 +394,7 @@ public class KubernetesIaas extends Iaas {
memory = Integer.parseInt(memoryProperty.getValue());
}
- IaasProvider iaasProvider = CloudControllerContext.getInstance().getIaasProviderOfPartition(cartridge.getType(), partition.getUuid());
+ IaasProvider iaasProvider = CloudControllerContext.getInstance().getIaasProviderOfPartition(cartridge.getUuid(), partition.getUuid());
if (iaasProvider == null) {
String message = "Could not find iaas provider: [partition] " + partition.getUuid();
log.error(message);
http://git-wip-us.apache.org/repos/asf/stratos/blob/599e543a/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh b/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh
index bd7f988..b54439e 100755
--- a/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh
+++ b/samples/applications/simple/single-cartridge-app/scripts/common/deploy.sh
@@ -37,6 +37,7 @@ network_partitions_path=`cd "${script_path}/../../../../../network-partitions/${
deployment_policies_path=`cd "${script_path}/../../../../../deployment-policies"; pwd`
application_policies_path=`cd "${script_path}/../../../../../application-policies"; pwd`
tenants_path=`cd "${script_path}/../../../../../tenants"; pwd`
+kubernetes_clusters_path=`cd "${script_path}/../../../../../kubernetes-clusters"; pwd`
set -e
@@ -53,6 +54,9 @@ echo ${autoscaling_policies_path}/autoscaling-policy-1.json
echo "Adding autoscale policy..."
curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/autoscalingPolicies
+echo "Adding kubernetes cluster..."
+curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-2.json" -k -u ${username}:${password} https://${host_ip}:${host_port}/api/kubernetesClusters
+
echo "Adding network partitions..."
curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-1.json" -k -v -u ${username}:${password} https://${host_ip}:${host_port}/api/networkPartitions
http://git-wip-us.apache.org/repos/asf/stratos/blob/599e543a/samples/applications/simple/single-cartridge-app/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/simple/single-cartridge-app/scripts/kubernetes/deploy.sh b/samples/applications/simple/single-cartridge-app/scripts/kubernetes/deploy.sh
index 548c166..f4b463c 100755
--- a/samples/applications/simple/single-cartridge-app/scripts/kubernetes/deploy.sh
+++ b/samples/applications/simple/single-cartridge-app/scripts/kubernetes/deploy.sh
@@ -23,6 +23,8 @@
host_ip="localhost"
host_port=9443
iaas="kubernetes"
+username="admin@test$2.com"
+password="admin123"
prgdir=`dirname "$0"`
script_path=`cd "$prgdir"; pwd`
@@ -30,7 +32,7 @@ common_folder=`cd "${script_path}/../common"; pwd`
kubernetes_clusters_path=`cd "${script_path}/../../../../../kubernetes-clusters"; pwd`
-echo "Adding kubernetes cluster..."
-curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-2.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
+#echo "Adding kubernetes cluster..."
+#curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-2.json" -k -u ${username}:${password} https://${host_ip}:${host_port}/api/kubernetesClusters
-bash ${common_folder}/deploy.sh ${iaas}
\ No newline at end of file
+bash ${common_folder}/deploy.sh ${iaas} $1
[36/50] [abbrv] stratos git commit: Update cluster with serviceName
Posted by ga...@apache.org.
Update cluster with serviceName
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3ab0f9e5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3ab0f9e5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3ab0f9e5
Branch: refs/heads/master
Commit: 3ab0f9e56b238f521965f602a5d30d87a5b626c2
Parents: 1f5df1c
Author: gayangunarathne <ga...@wso2.com>
Authored: Sat Aug 29 00:59:18 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Sat Aug 29 00:59:18 2015 +0530
----------------------------------------------------------------------
.../applications/ApplicationUtils.java | 2 +-
.../context/cluster/ClusterContextFactory.java | 2 +-
.../messaging/topology/TopologyBuilder.java | 2 +-
.../messaging/domain/topology/Cluster.java | 24 ++++++++++----------
.../artifacts/application.json | 2 +-
samples/cartridges/kubernetes/php.json | 2 +-
6 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/3ab0f9e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
index c048034..4eec5f9 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
@@ -222,7 +222,7 @@ public class ApplicationUtils {
//basicPayloadData.setDeployment("default");//currently hard coded to default
basicPayloadData.setMultitenant(String.valueOf(cartridge.getMultiTenant()));
basicPayloadData.setPortMappings(createPortMappingPayloadString(cartridge));
- basicPayloadData.setServiceName(cartridge.getType());
+ basicPayloadData.setServiceName(cartridge.getUuid());
basicPayloadData.setProvider(cartridge.getProvider());
if (repoUrl != null) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/3ab0f9e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java
index 92a6b0a..5637cd3 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java
@@ -37,7 +37,7 @@ public class ClusterContextFactory {
return null;
}
- String autoscalePolicyName = cluster.getAutoscalePolicyUuid();
+ String autoscalePolicyName = cluster.getAutoscalePolicyName();
if (log.isDebugEnabled()) {
log.debug("Autoscaler policy name: " + autoscalePolicyName);
http://git-wip-us.apache.org/repos/asf/stratos/blob/3ab0f9e5/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
index 60fd806..142b16f 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
@@ -385,7 +385,7 @@ public class TopologyBuilder {
try {
TopologyManager.acquireWriteLock();
Cluster cluster = service.removeCluster(ctxt.getClusterId());
- deploymentPolicy = cluster.getDeploymentPolicyUuid();
+ deploymentPolicy = cluster.getDeploymentPolicyName();
TopologyManager.updateTopology(topology);
} finally {
TopologyManager.releaseWriteLock();
http://git-wip-us.apache.org/repos/asf/stratos/blob/3ab0f9e5/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
index 2437730..babf38c 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
@@ -40,8 +40,8 @@ public class Cluster implements Serializable {
private final String serviceName;
private final String clusterId;
- private final String autoscalePolicyUuid;
- private final String deploymentPolicyUuid;
+ private final String autoscalePolicyName;
+ private final String deploymentPolicyName;
private List<String> hostNames;
private String tenantRange;
@@ -66,8 +66,8 @@ public class Cluster implements Serializable {
public Cluster(Cluster cluster) {
this.serviceName = cluster.getServiceName();
this.clusterId = cluster.getClusterId();
- this.deploymentPolicyUuid = cluster.getDeploymentPolicyUuid();
- this.autoscalePolicyUuid = cluster.getAutoscalePolicyUuid();
+ this.deploymentPolicyName = cluster.getDeploymentPolicyName();
+ this.autoscalePolicyName = cluster.getAutoscalePolicyName();
this.appId = cluster.getAppId();
this.setHostNames(cluster.getHostNames());
this.memberMap = cluster.getMemberMap();
@@ -86,8 +86,8 @@ public class Cluster implements Serializable {
String autoscalePolicyName, String appId) {
this.serviceName = serviceName;
this.clusterId = clusterId;
- this.deploymentPolicyUuid = deploymentPolicyName;
- this.autoscalePolicyUuid = autoscalePolicyName;
+ this.deploymentPolicyName = deploymentPolicyName;
+ this.autoscalePolicyName = autoscalePolicyName;
this.setHostNames(new ArrayList<String>());
this.memberMap = new HashMap<String, Member>();
this.appId = appId;
@@ -154,12 +154,12 @@ public class Cluster implements Serializable {
this.properties = properties;
}
- public String getAutoscalePolicyUuid() {
- return autoscalePolicyUuid;
+ public String getAutoscalePolicyName() {
+ return autoscalePolicyName;
}
- public String getDeploymentPolicyUuid() {
- return deploymentPolicyUuid;
+ public String getDeploymentPolicyName() {
+ return deploymentPolicyName;
}
public String getLoadBalanceAlgorithmName() {
@@ -363,8 +363,8 @@ public class Cluster implements Serializable {
public String toString() {
return String.format("[serviceName=%s, clusterId=%s, autoscalePolicyName=%s, deploymentPolicyName=%s, " +
"hostNames=%s, tenantRange=%s, loadBalanceAlgorithmName=%s, appId=%s, parentId=%s, " +
- "accessUrls=%s, kubernetesServices=%s]", serviceName, clusterId, autoscalePolicyUuid,
- deploymentPolicyUuid, hostNames, tenantRange, loadBalanceAlgorithmName, appId, parentId,
+ "accessUrls=%s, kubernetesServices=%s]", serviceName, clusterId, autoscalePolicyName,
+ deploymentPolicyName, hostNames, tenantRange, loadBalanceAlgorithmName, appId, parentId,
accessUrls, kubernetesServices);
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/3ab0f9e5/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 4043e4f..14eb119 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": "https://github.com/lakwarus/single-cartridge.git",
+ "repoUrl": "",
"repoUsername": "",
"repoPassword": ""
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/3ab0f9e5/samples/cartridges/kubernetes/php.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/php.json b/samples/cartridges/kubernetes/php.json
index 85adc13..260fb22 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"
}
],
[23/50] [abbrv] stratos git commit: Upgrading fabric8 kubernetes api
version to 2.2.16 and removing forked code
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/resources/log4j.properties b/dependencies/fabric8/kubernetes-api/src/main/resources/log4j.properties
deleted file mode 100644
index 393e087..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# Root logger option
-log4j.rootLogger=INFO, stdout
-
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/Apply.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/Apply.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/Apply.java
deleted file mode 100644
index 4f19fb7..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/Apply.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import java.io.File;
-
-/**
- * Applies the given JSON file to the kubernetes environment
- */
-public class Apply {
- public static void main(String... args) {
- if (args.length < 1) {
- System.out.println("Usage jsonFileToApply");
- return;
- }
- try {
- KubernetesClient kube = new KubernetesClient();
- System.out.println("Connecting to kubernetes on: " + kube.getAddress());
-
- File file = new File(args[0]);
- System.out.println("Applying file: " + file);
- if (!file.exists() || !file.isFile()) {
- System.out.println("File does not exist! " + file.getAbsolutePath());
- return;
- }
- Controller controller = new Controller(kube);
- String answer = controller.apply(file);
-
- System.out.println("Applied!: " + answer);
- } catch (Exception e) {
- System.out.println("FAILED: " + e);
- e.printStackTrace();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigComparePodTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigComparePodTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigComparePodTest.java
deleted file mode 100644
index 80ae51a..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigComparePodTest.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- * <p/>
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.Pod;
-import io.fabric8.kubernetes.api.model.PodBuilder;
-import io.fabric8.kubernetes.api.model.PodStatus;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static io.fabric8.kubernetes.api.ConfigCompareServiceTest.assertCompareConfig;
-
-public class ConfigComparePodTest {
-
- private static final transient Logger LOG = LoggerFactory.getLogger(ConfigComparePodTest.class);
-
- @Test
- public void testPodsEqual() throws Exception {
- Pod entity1 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- Pod entity2 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, true);
- }
-
- @Test
- public void testPodsEqualWithDifferentStatus() throws Exception {
- Pod entity1 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- PodStatus status2 = new PodStatus();
- status2.setHostIP("abc");
-
- Pod entity2 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- withStatus(status2).
- build();
-
- assertCompareConfig(entity1, entity2, true);
- }
-
- @Test
- public void testPodsLabelsNotEqual() throws Exception {
- Pod entity1 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- Pod entity2 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "notSame").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testPodsAnnotationsNotEqual() throws Exception {
- Pod entity1 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- Pod entity2 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "notSame").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testPodsImageEqual() throws Exception {
- Pod entity1 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- Pod entity2 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("notSame").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
- @Test
- public void testPodsContainerEnvEqual() throws Exception {
- Pod entity1 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- Pod entity2 = new PodBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("notSame").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigCompareReplicationControllerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigCompareReplicationControllerTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigCompareReplicationControllerTest.java
deleted file mode 100644
index 24ef845..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigCompareReplicationControllerTest.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- * <p/>
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.ReplicationController;
-import io.fabric8.kubernetes.api.model.ReplicationControllerBuilder;
-import io.fabric8.kubernetes.api.model.ReplicationControllerStatus;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static io.fabric8.kubernetes.api.ConfigCompareServiceTest.assertCompareConfig;
-
-public class ConfigCompareReplicationControllerTest {
-
- private static final transient Logger LOG = LoggerFactory.getLogger(ConfigCompareReplicationControllerTest.class);
-
- @Test
- public void testReplicationControllersEqual() throws Exception {
- ReplicationController entity1 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- ReplicationController entity2 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, true);
- }
-
- @Test
- public void testReplicationControllersEqualWithDifferentStatus() throws Exception {
- ReplicationController entity1 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- ReplicationControllerStatus status = new ReplicationControllerStatus();
- status.setReplicas(7);
- ReplicationController entity2 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- withStatus(status).
- build();
-
- assertCompareConfig(entity1, entity2, true);
- }
-
- @Test
- public void testReplicationControllersLabelsNotEqual() throws Exception {
- ReplicationController entity1 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- ReplicationController entity2 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("notSame", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testReplicationControllersSelectorNotEqual() throws Exception {
- ReplicationController entity1 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- ReplicationController entity2 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "notSame").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testReplicationControllersReplicasNotEqual() throws Exception {
- ReplicationController entity1 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- ReplicationController entity2 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(4).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testReplicationControllersAnnotationsNotEqual() throws Exception {
- ReplicationController entity1 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- ReplicationController entity2 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "notEqual").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testReplicationControllersImageEqual() throws Exception {
- ReplicationController entity1 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- ReplicationController entity2 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("notEqual").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testReplicationControllersContainerEnvEqual() throws Exception {
- ReplicationController entity1 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- ReplicationController entity2 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("notEqual").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testReplicationControllersAddVolumeNotEqual() throws Exception {
- ReplicationController entity1 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewVolumeMount().withName("cheese").withMountPath("/foo/cheese").endVolumeMount().
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- ReplicationController entity2 = new ReplicationControllerBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- withReplicas(2).
- withNewTemplate().withNewMetadata().
- addToLabels("podLabel1", "podValue1").
- addToLabels("podLabel2", "podValue2").
- addToAnnotations("podAnnotation1", "podAnnValue1").
- endMetadata().
- withNewSpec().
- addNewContainer().
- withImage("fabric8/jenkins").
- addNewEnv().withName("foo").withValue("bar").endEnv().
- // TODO....
- // addNewPort().endPort().
- endContainer().
- endSpec().
- endTemplate().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigCompareServiceTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigCompareServiceTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigCompareServiceTest.java
deleted file mode 100644
index 1c90d3d..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigCompareServiceTest.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- * <p/>
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.Service;
-import io.fabric8.kubernetes.api.model.ServiceBuilder;
-import io.fabric8.kubernetes.api.model.util.IntOrString;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.junit.Assert.assertEquals;
-
-public class ConfigCompareServiceTest {
-
- private static final transient Logger LOG = LoggerFactory.getLogger(ConfigCompareServiceTest.class);
-
- @Test
- public void testServicesEqual() throws Exception {
- Service entity1 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- Service entity2 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label2", "value2").
- addToLabels("label1", "value1").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, true);
- }
- @Test
-
- public void testServicesEqualWithStatusdifferences() throws Exception {
- Service entity1 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- withResourceVersion("1").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- Service entity2 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label2", "value2").
- addToLabels("label1", "value1").
- withResourceVersion("2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, true);
- }
-
- @Test
- public void testServicesPortNotEqual() throws Exception {
- Service entity1 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- Service entity2 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label2", "value2").
- addToLabels("label1", "value1").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(456).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testServicesContainerPortNotEqual() throws Exception {
- Service entity1 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- Service entity2 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label2", "value2").
- addToLabels("label1", "value1").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(555)).
- endPort().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testServicesLabelsNotEqual() throws Exception {
- Service entity1 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- Service entity2 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label2", "value2").
- addToLabels("notSame", "value1").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- @Test
- public void testServicesSelectorNotEqual() throws Exception {
- Service entity1 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label1", "value1").
- addToLabels("label2", "value2").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("label2", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- Service entity2 = new ServiceBuilder().withNewMetadata().withName("foo").
- addToLabels("label2", "value2").
- addToLabels("label1", "value1").
- endMetadata().
- withNewSpec().
- addToSelector("label1", "value1").
- addToSelector("notSame", "value2").
- addNewPort().
- withPort(123).
- withTargetPort(new IntOrString(456)).
- endPort().
- endSpec().
- build();
-
- assertCompareConfig(entity1, entity2, false);
- }
-
- public static void assertCompareConfig(Object entity1, Object entity2, boolean expected) {
- boolean actual = UserConfigurationCompare.configEqual(entity1, entity2);
- assertEquals("Configuration compare for " + entity1 + " and " + entity2, expected, actual);
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigFileParseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigFileParseTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigFileParseTest.java
deleted file mode 100644
index 07aa012..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ConfigFileParseTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.config.Config;
-import io.fabric8.kubernetes.api.extensions.Configs;
-import io.fabric8.kubernetes.api.model.config.Context;
-import org.junit.Test;
-
-import java.io.File;
-
-import static io.fabric8.kubernetes.api.extensions.Configs.getOpenShiftConfigFile;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ConfigFileParseTest {
- @Test
- public void testParseConfig() throws Exception {
- FindOpenShiftNamespaceTest.setOPenShfitConfigFileProperty();
-
- File file = getOpenShiftConfigFile();
- assertThat(file).isFile().exists();
-
- Config config = Configs.parseConfigs();
- assertThat(config).isNotNull();
-
- String currentContextName = config.getCurrentContext();
- assertThat(currentContextName).describedAs("currentContext").isEqualTo("default/localhost:8443/admin");
- System.out.println("Found current context name: " + currentContextName);
-
- Context context = Configs.getCurrentContext(config);
- assertThat(context).describedAs("currentContext").isNotNull();
-
- assertThat(context.getNamespace()).describedAs("namespace").isEqualTo("jimmi-does-rock");
- assertThat(context.getUser()).describedAs("user").isEqualTo("admin/localhost:8443");
- assertThat(context.getCluster()).describedAs("cluster").isEqualTo("172-28-128-4:8443");
-
- String token = Configs.getUserToken(config, context);
- assertThat(token).describedAs("token").isEqualTo("ExpectedToken");
-
- System.out.println("User " + context.getUser() + " has token: " + token);
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/Example.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/Example.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/Example.java
deleted file mode 100644
index 56cbaaa..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/Example.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.*;
-
-import java.util.*;
-
-import static io.fabric8.kubernetes.api.KubernetesHelper.getPorts;
-import static io.fabric8.kubernetes.api.KubernetesHelper.getSelector;
-
-/**
- * A simple example program testing out the REST API
- */
-public class Example {
- public static void main(String... args) {
- KubernetesFactory kubeFactory = new KubernetesFactory();
- if (args.length > 0) {
- kubeFactory.setAddress(args[0]);
- }
- System.out.println("Connecting to kubernetes on: " + kubeFactory.getAddress());
-
- try {
- Kubernetes kube = kubeFactory.createKubernetes();
- listPods(kube);
- listServices(kube);
- listReplicationControllers(kube);
- createPod(kube, kubeFactory);
- listPods(kube);
- } catch (Exception e) {
- System.out.println("FAILED: " + e);
- e.printStackTrace();
- }
- }
-
- protected static void createPod(Kubernetes kubernetes, KubernetesFactory kubernetesFactory) throws Exception {
- String name = "console2";
- String image = "fabric8/hawtio";
-
- Pod pod = new Pod();
- pod.getMetadata().setName(name);
-
- Map<String, String> labels = new HashMap<>();
- labels.put("fabric8", "true");
- labels.put("container", name);
-
- pod.getMetadata().setLabels(labels);
- PodSpec podSpec = new PodSpec();
- pod.setSpec(podSpec);
-
- Container manifestContainer = new Container();
- manifestContainer.setName(name);
- manifestContainer.setImage(image);
-
- List<Container> containers = new ArrayList<>();
- containers.add(manifestContainer);
- podSpec.setContainers(containers);
-
- System.out.println("About to create pod on " + kubernetesFactory.getAddress() + " with " + pod);
- kubernetes.createPod(pod, "mynamespace");
- System.out.println("Created pod: " + name);
- System.out.println();
- }
-
- protected static void listPods(Kubernetes kube) {
- System.out.println("Looking up pods");
- PodList pods = kube.getPods(Kubernetes.NAMESPACE_ALL);
- //System.out.println("Got pods: " + pods);
- List<Pod> items = pods.getItems();
- for (Pod item : items) {
- System.out.println("Pod " + KubernetesHelper.getName(item) + " created: " + item.getMetadata().getCreationTimestamp());
- PodSpec spec = item.getSpec();
- if (spec != null) {
- List<Container> containers = spec.getContainers();
- if (containers != null) {
- for (Container container : containers) {
- System.out.println("Container " + container.getImage() + " " + container.getCommand() + " ports: " + container.getPorts());
- }
- }
- }
- Map<String, ContainerStatus> currentContainers = KubernetesHelper.getCurrentContainers(item);
- System.out.println("Has " + currentContainers.size() + " container(s)");
- Set<Map.Entry<String, ContainerStatus>> entries = currentContainers.entrySet();
- for (Map.Entry<String, ContainerStatus> entry : entries) {
- String id = entry.getKey();
- ContainerStatus info = entry.getValue();
- System.out.println("Current container: " + id + " info: " + info);
- }
- }
- System.out.println();
-
- }
-
- protected static void listServices(Kubernetes kube) {
- System.out.println("Looking up services");
- ServiceList services = kube.getServices(Kubernetes.NAMESPACE_ALL);
- List<Service> serviceItems = services.getItems();
- for (Service service : serviceItems) {
- System.out.println("Service " + KubernetesHelper.getName(service) + " labels: " + service.getMetadata().getLabels() + " selector: " + getSelector(service) + " ports: " + getPorts(service));
- }
- System.out.println();
-
- }
-
- protected static void listReplicationControllers(Kubernetes kube) {
- System.out.println("Looking up replicationControllers");
- ReplicationControllerList replicationControllers = kube.getReplicationControllers(Kubernetes.NAMESPACE_ALL);
- List<ReplicationController> items = replicationControllers.getItems();
- for (ReplicationController item : items) {
- ReplicationControllerSpec replicationControllerSpec = item.getSpec();
- if (replicationControllerSpec != null) {
- System.out.println("ReplicationController " + KubernetesHelper.getName(item) + " labels: " + item.getMetadata().getLabels()
- + " replicas: " + replicationControllerSpec.getReplicas() + " replicatorSelector: " + replicationControllerSpec.getSelector() + " podTemplate: " + replicationControllerSpec.getTemplate());
- } else {
- System.out.println("ReplicationController " + KubernetesHelper.getName(item) + " labels: " + item.getMetadata().getLabels() + " no replicationControllerSpec");
- }
- }
- System.out.println();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/FindOpenShiftNamespaceTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/FindOpenShiftNamespaceTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/FindOpenShiftNamespaceTest.java
deleted file mode 100644
index 28abff8..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/FindOpenShiftNamespaceTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.extensions.Configs;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class FindOpenShiftNamespaceTest {
-
- @Test
- public void testFindsCorrectOpenShiftNamespace() throws Exception {
- setOPenShfitConfigFileProperty();
- String namespace = KubernetesClient.findDefaultOpenShiftNamespace();
-
- assertEquals("default namespace", "jimmi-does-rock", namespace);
- }
-
- public static void setOPenShfitConfigFileProperty() {
- String basedir = System.getProperty("basedir", ".");
- String configFile = basedir + "/src/test/resources/config.yml";
-
- System.setProperty(Configs.OPENSHIFT_CONFIG_FILE_PROPERTY, configFile);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/KubernetesHelperTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/KubernetesHelperTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/KubernetesHelperTest.java
deleted file mode 100644
index 4a23a8b..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/KubernetesHelperTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.ObjectMeta;
-import io.fabric8.kubernetes.api.model.Pod;
-import io.fabric8.kubernetes.api.model.PodList;
-import org.junit.Test;
-
-import java.util.HashMap;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-
-public class KubernetesHelperTest {
-
- @Test
- public void testRemoveEmptyPods() throws Exception {
-
- Pod pod1 = new Pod();
- pod1.setMetadata(new ObjectMeta());
- pod1.getMetadata().setName("test1");
-
- Pod pod2 = new Pod();
- pod2.setMetadata(new ObjectMeta());
-
- PodList podSchema = new PodList();
- podSchema.getItems().add(pod1);
- podSchema.getItems().add(pod2);
-
- KubernetesHelper.removeEmptyPods(podSchema);
-
- assertNotNull(podSchema);
- assertEquals(1, podSchema.getItems().size());
- }
-
- @Test
- public void testfilterMatchesIdOrLabels() throws Exception {
- String text = "container=java,name=foo,food=cheese";
- String id = "foo";
- HashMap<String, String> map = new HashMap<>();
- map.put("container", "java");
- map.put("name", "foo");
- map.put("food", "cheese");
- assertTrue(text + " should = " + map, KubernetesHelper.filterMatchesIdOrLabels(text, id, map));
- }
-
- @Test
- public void testfilterMatchesIdOrLabelsNoLabels() throws Exception {
- String text = "container=java,name=foo,food=cheese";
- String id = "foo";
- HashMap<String, String> map = null;
- assertFalse(text + " should not = " + map, KubernetesHelper.filterMatchesIdOrLabels(text, id, map));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseDateTimeTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseDateTimeTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseDateTimeTest.java
deleted file mode 100644
index b0207bf..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseDateTimeTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Date;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ParseDateTimeTest {
-
- private static final transient Logger LOG = LoggerFactory.getLogger(ParseDateTimeTest.class);
-
- @Test
- public void testParseDateTime() throws Exception {
- Date date = KubernetesHelper.parseDate("2015-03-26T17:11:55Z");
- assertThat(date).isNotNull();
- System.out.println("Parsed date: " + date);
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseExamplesTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseExamplesTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseExamplesTest.java
deleted file mode 100644
index b963c0e..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseExamplesTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import io.fabric8.kubernetes.api.model.*;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.List;
-
-import static io.fabric8.kubernetes.api.KubernetesHelper.getContainerPorts;
-import static io.fabric8.utils.Files.assertDirectoryExists;
-import static io.fabric8.utils.Files.assertFileExists;
-import static org.junit.Assert.*;
-
-/**
- * Parses the example JSON
- */
-public class ParseExamplesTest {
-
- private static final transient Logger LOG = LoggerFactory.getLogger(ParseExamplesTest.class);
-
- public static final String SYSTEM_PROPERTY_KUBE_DIR = "kube.dir";
-
- @Test
- public void testParsePodList() throws Exception {
- KubernetesList podList = assertParseExampleFile("pod-list.json", KubernetesList.class);
- List<HasMetadata> items = podList.getItems();
- assertNotEmpty("items", items);
-
- Pod pod = (Pod) items.get(0);
- assertNotNull("pod1", pod);
- assertEquals("pod1.name", "my-pod-1", KubernetesHelper.getName(pod));
- PodSpec podSpec = pod.getSpec();
- assertNotNull("pod1.podSpec", podSpec);
- List<Container> containers = podSpec.getContainers();
- assertNotEmpty("pod1.podSpec.containers", containers);
- Container container = containers.get(0);
- assertNotNull("pod1.podSpec.container[0]", container);
- assertEquals("pod1.podSpec.container[0].name", "nginx", container.getName());
- assertEquals("pod1.podSpec.container[0].image", "dockerfile/nginx", container.getImage());
-
- LOG.info("pod1 container1 " + container);
-
- String json = KubernetesHelper.toJson(podList);
- LOG.info("Got JSON: " + json);
- }
-
- @Test
- public void testParsePodListEmptyResults() throws Exception {
- PodList podList = assertParseExampleFile("pod-list-empty-results.json", PodList.class);
- List<Pod> items = podList.getItems();
- assertNotEmpty("items", items);
-
- Pod pod = items.get(0);
- assertNotNull("pod1", pod);
- assertEquals("127.0.0.1", pod.getStatus().getHostIP());
- }
-
- @Test
- public void testParseService() throws Exception {
- Service service = assertParseExampleFile("service.json", Service.class);
-
- assertEquals("Service", service.getKind());
-
- Integer expectedPort = 9090;
- assertEquals(expectedPort, getContainerPorts(service).iterator().next());
-
- ObjectMapper mapper = KubernetesFactory.createObjectMapper();
-
- //mapper.writer().writeValue(System.out, service);
- }
-
- @Test
- public void testParsePod() throws Exception {
- assertParseExampleFile("pod.json", Pod.class);
- }
-
- public static void assertNotEmpty(String name, Collection collection) {
- assertNotNull(name + " is null!", collection);
- assertFalse(name + " should not be empty!", collection.isEmpty());
- }
-
- public static <T> T assertParseExampleFile(String fileName, Class<T> clazz) throws Exception {
- ObjectMapper mapper = KubernetesFactory.createObjectMapper();
- File exampleFile = new File(getKubernetesExamplesDir(), fileName);
- assertFileExists(exampleFile);
- T answer = mapper.reader(clazz).readValue(exampleFile);
- assertNotNull("Null returned while unmarshalling " + exampleFile, answer);
- LOG.info("Parsed: " + fileName + " as: " + answer);
- return answer;
- }
-
- public static File getKubernetesSourceDir() {
- //String path = System.getProperty(SYSTEM_PROPERTY_KUBE_DIR, "../../../kubernetes");
- String basedir = System.getProperty("basedir", ".");
- String kubeSourceDir = basedir + "/src/main/kubernetes";
- String path = System.getProperty(SYSTEM_PROPERTY_KUBE_DIR, kubeSourceDir);
- File kubeDir = new File(path);
- assertTrue("Kube directory " + kubeDir
- + " does not exist! Please supply the correct value in the " + SYSTEM_PROPERTY_KUBE_DIR + " system property value",
- kubeDir.exists());
- return kubeDir;
- }
-
- public static File getKubernetesExamplesDir() {
- File answer = new File(getKubernetesSourceDir(), "api/examples");
- assertDirectoryExists(answer);
- return answer;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseServiceTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseServiceTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseServiceTest.java
deleted file mode 100644
index 96b99b4..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseServiceTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.Service;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Set;
-
-import static io.fabric8.kubernetes.api.KubernetesHelper.getContainerPorts;
-import static io.fabric8.kubernetes.api.KubernetesHelper.getPorts;
-import static io.fabric8.utils.Files.assertFileExists;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Parses the example JSON
- */
-public class ParseServiceTest {
-
- private static final transient Logger LOG = LoggerFactory.getLogger(ParseServiceTest.class);
-
- @Test
- public void testParseFabric8MQService() throws Exception {
- Service service = assertParseTestFile("fmq-service.json", Service.class);
- Set<Integer> ports = getPorts(service);
- assertNotNull("ports", ports);
- Set<Integer> containerPorts = getContainerPorts(service);
- assertTrue("containerPorts " + containerPorts, containerPorts.iterator().next().intValue() > 0);
-
- String json = KubernetesHelper.toJson(service);
- LOG.info("Got JSON: " + json);
- }
-
- public <T> T assertParseTestFile(String relativePath, Class<T> clazz) throws IOException {
- String baseDirPath = System.getProperty("basedir", ".");
- File baseDir = new File(baseDirPath);
- File json = new File(baseDirPath, "target/test-classes/" + relativePath);
- assertFileExists(json);
-
- Object answer = KubernetesHelper.loadJson(json);
- assertNotNull("Null returned while unmarshalling " + json, answer);
- LOG.info("Parsed: " + json + " as: " + answer);
- assertTrue("Result " + answer + " is not an instance of " + clazz.getName() + " but was " + (answer == null ? "null" : answer.getClass().getName()),
- clazz.isInstance(answer));
- return clazz.cast(answer);
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseTest.java
deleted file mode 100644
index 7df3ffc..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ParseTest.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import io.fabric8.kubernetes.api.model.*;
-import io.fabric8.openshift.api.model.template.Template;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.util.List;
-
-import static io.fabric8.kubernetes.api.KubernetesHelper.getContainerPorts;
-import static io.fabric8.kubernetes.api.KubernetesHelper.toJson;
-import static io.fabric8.kubernetes.api.ParseExamplesTest.assertNotEmpty;
-import static io.fabric8.utils.Files.assertDirectoryExists;
-import static io.fabric8.utils.Files.assertFileExists;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.*;
-
-/**
- * Parses the example JSON
- */
-public class ParseTest {
-
- private static final transient Logger LOG = LoggerFactory.getLogger(ParseTest.class);
-
- public static final String SYSTEM_PROPERTY_KUBE_DIR = "kube.dir";
-
- @Test
- public void testParsePodList() throws Exception {
- KubernetesList podList = assertParseExampleFile("pod-list.json", KubernetesList.class);
- List<HasMetadata> items = podList.getItems();
- assertNotEmpty("items", items);
-
- Pod pod = (Pod) items.get(0);
- assertNotNull("pod1", pod);
- assertEquals("pod1.id", "my-pod-1", KubernetesHelper.getName(pod));
- PodSpec podSpec = pod.getSpec();
- assertNotNull("pod1.podSpec", podSpec);
- List<Container> containers = podSpec.getContainers();
- assertNotEmpty("pod1.podSpec.manifest.containers", containers);
- Container container = containers.get(0);
- assertNotNull("pod1.podSpec.container[0]", container);
- assertEquals("pod1.podSpec.container[0].name", "nginx", container.getName());
- assertEquals("pod1.podSpec.container[0].image", "dockerfile/nginx", container.getImage());
-
- LOG.info("pod1 container1 " + container);
-
- String json = toJson(podList);
- LOG.info("Got JSON: " + json);
- }
-
- @Test
- public void testParsePodListEmptyResults() throws Exception {
- PodList podList = assertParseExampleFile("pod-list-empty-results.json", PodList.class);
- List<Pod> items = podList.getItems();
- assertNotEmpty("items", items);
-
- Pod pod = items.get(0);
- assertNotNull("pod1", pod);
- assertEquals("127.0.0.1", pod.getStatus().getHostIP());
- }
-
- @Test
- public void testParseService() throws Exception {
- Service service = assertParseExampleFile("service.json", Service.class);
-
- assertEquals("Service", service.getKind());
-
- Integer expectedPort = 9090;
- assertEquals(expectedPort, getContainerPorts(service).iterator().next());
-
- ObjectMapper mapper = KubernetesFactory.createObjectMapper();
-
- //mapper.writer().writeValue(System.out, service);
- }
-
- @Test
- public void testParsePod() throws Exception {
- assertParseExampleFile("pod.json", Pod.class);
- }
-
- @Test
- public void testParseTemplate() throws Exception {
- Template template = assertParseExampleFile("template.json", Template.class);
- List<HasMetadata> objects = template.getObjects();
- assertNotEmpty("objects", objects);
- assertTrue("size is " + objects.size(), objects.size() == 2);
- Object service = objects.get(0);
- assertThat(service).isInstanceOf(Service.class);
-
- Object rc = objects.get(1);
- assertThat(rc).isInstanceOf(ReplicationController.class);
-
- System.out.println("Generated JSON: " + toJson(template));
- }
-
- @Test
- public void testParseList() throws Exception {
- KubernetesList list = assertParseExampleFile("list.json", KubernetesList.class);
- List<HasMetadata> objects = list.getItems();
- assertNotEmpty("objects", objects);
- assertEquals("size", 2, objects.size());
- Object service = objects.get(0);
- assertThat(service).isInstanceOf(Service.class);
-
- Object rc = objects.get(1);
- assertThat(rc).isInstanceOf(ReplicationController.class);
-
- System.out.println("Generated JSON: " + toJson(list));
- }
-
- public static <T> T assertParseExampleFile(String fileName, Class<T> clazz) throws Exception {
- ObjectMapper mapper = KubernetesFactory.createObjectMapper();
- File exampleFile = new File(getKubernetesExamplesDir(), fileName);
- assertFileExists(exampleFile);
- Object answer = mapper.reader(clazz).readValue(exampleFile);
- assertNotNull("Null returned while unmarshalling " + exampleFile, answer);
- LOG.info("Parsed: " + fileName + " as: " + answer);
- assertTrue("Is not an instance of " + clazz.getSimpleName() + " was: "+ answer.getClass().getName(), clazz.isInstance(answer));
- return clazz.cast(answer);
- }
-
- public static File getKubernetesSourceDir() {
- //String path = System.getProperty(SYSTEM_PROPERTY_KUBE_DIR, "../../../kubernetes");
- String basedir = System.getProperty("basedir", ".");
- String kubeSourceDir = basedir + "/src/main/kubernetes";
- String path = System.getProperty(SYSTEM_PROPERTY_KUBE_DIR, kubeSourceDir);
- File kubeDir = new File(path);
- assertTrue("Kube directory " + kubeDir
- + " does not exist! Please supply the correct value in the " + SYSTEM_PROPERTY_KUBE_DIR + " system property value",
- kubeDir.exists());
- return kubeDir;
- }
-
- public static File getKubernetesExamplesDir() {
- File answer = new File(getKubernetesSourceDir(), "api/examples");
- assertDirectoryExists(answer);
- return answer;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/PodIdToReplicationControllerIDExample.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/PodIdToReplicationControllerIDExample.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/PodIdToReplicationControllerIDExample.java
deleted file mode 100644
index 45a1d61..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/PodIdToReplicationControllerIDExample.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.ReplicationController;
-
-/**
- */
-public class PodIdToReplicationControllerIDExample {
- public static void main(String[] args) {
- if (args.length < 2) {
- System.out.println("Arguments: kuberneteMasterUrl podID");
- return;
- }
- String kuberneteMasterUrl = args[0];
- String podID = args[1];
- System.out.println("Looking up ReplicationController for pod ID: " + podID);
- KubernetesClient client = new KubernetesClient(kuberneteMasterUrl);
- ReplicationController replicationController = client.getReplicationControllerForPod(podID);
- if (replicationController != null) {
- String id = KubernetesHelper.getName(replicationController);
- System.out.println("Found replication controller: " + id);
- } else {
- System.out.println("Could not find replication controller!");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ProcessTemplateLocallyTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ProcessTemplateLocallyTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ProcessTemplateLocallyTest.java
deleted file mode 100644
index 18c0044..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ProcessTemplateLocallyTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.extensions.Templates;
-import io.fabric8.kubernetes.api.model.HasMetadata;
-import io.fabric8.kubernetes.api.model.KubernetesList;
-import io.fabric8.openshift.api.model.template.Template;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-import static io.fabric8.kubernetes.api.KubernetesHelper.toJson;
-import static io.fabric8.kubernetes.api.ParseExamplesTest.assertNotEmpty;
-import static io.fabric8.kubernetes.api.ParseTest.assertParseExampleFile;
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * Parses the example JSON
- */
-public class ProcessTemplateLocallyTest {
- private static final transient Logger LOG = LoggerFactory.getLogger(ProcessTemplateLocallyTest.class);
-
- @Test
- public void testProcessTemplateLocally() throws Exception {
- Template template = assertParseExampleFile("template.json", Template.class);
- List<HasMetadata> objects = template.getObjects();
- assertNotEmpty("objects", objects);
-
-
- KubernetesList list = Templates.processTemplatesLocally(template);
- assertThat(list).describedAs("results").isNotNull();
- List<HasMetadata> items = list.getItems();
- assertThat(items).describedAs("items").isNotNull();
-
- System.out.println("Created JSON: " + toJson(list));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/TemplatesTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/TemplatesTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/TemplatesTest.java
deleted file mode 100644
index 8dc8c19..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/TemplatesTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- * <p/>
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.extensions.Templates;
-import io.fabric8.kubernetes.api.model.KubernetesList;
-import io.fabric8.kubernetes.api.model.KubernetesListBuilder;
-import io.fabric8.kubernetes.api.model.Service;
-import io.fabric8.kubernetes.api.model.ServiceBuilder;
-import io.fabric8.openshift.api.model.template.Template;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class TemplatesTest {
-
- private static final transient Logger LOG = LoggerFactory.getLogger(TemplatesTest.class);
-
- @Test
- public void testCombineResourcesIntoTemplate() throws Exception {
- Service templateService = new ServiceBuilder().withNewMetadata().withName("templateService").endMetadata().build();
-
- KubernetesList list = new KubernetesListBuilder().
- addNewServiceItem().withNewMetadata().withName("service1").endMetadata().endServiceItem().
- addNewTemplateItem().
- addNewParameter().withName("PARAM1").withValue("ABC").endParameter().
- addToObjects(templateService).endTemplateItem().
- addNewServiceItem().withNewMetadata().withName("service2").endMetadata().endServiceItem().build();
-
- Object result = Templates.combineTemplates(list);
- System.out.println("Combined as " + KubernetesHelper.toJson(result));
- assertThat(result).isInstanceOf(Template.class);
-
- }
-}
[29/50] [abbrv] stratos git commit: Removing additional maven
property fabric8-version and reusing kubernetes.api.version
Posted by ga...@apache.org.
Removing additional maven property fabric8-version and reusing kubernetes.api.version
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/247b4504
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/247b4504
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/247b4504
Branch: refs/heads/master
Commit: 247b450424cd1452e4ab7ee499f2369ab5742867
Parents: 12c0ea0
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Jul 26 05:51:56 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Thu Aug 27 16:43:12 2015 +0530
----------------------------------------------------------------------
dependencies/fabric8/kubernetes-api/pom.xml | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/247b4504/dependencies/fabric8/kubernetes-api/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/pom.xml b/dependencies/fabric8/kubernetes-api/pom.xml
index feec23b..1ecf13e 100644
--- a/dependencies/fabric8/kubernetes-api/pom.xml
+++ b/dependencies/fabric8/kubernetes-api/pom.xml
@@ -46,7 +46,7 @@
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>cxf-utils</artifactId>
- <version>${fabric8-version}</version>
+ <version>${kubernetes.api.version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
@@ -125,7 +125,7 @@
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-codegen</artifactId>
- <version>${fabric8-version}</version>
+ <version>${kubernetes.api.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -177,8 +177,4 @@
</plugin>
</plugins>
</build>
-
- <properties>
- <fabric8-version>2.2.16</fabric8-version>
- </properties>
</project>
[45/50] [abbrv] stratos git commit: Conflict resolved
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing2.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing2.xml b/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing2.xml
new file mode 100755
index 0000000..c292953
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing2.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite2">
+ <test name="PCATest">
+ <classes>
+ <class name="org.apache.stratos.python.cartridge.agent.test.ADCTest"/>
+ </classes>
+ </test>
+</suite>
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing3.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing3.xml b/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing3.xml
new file mode 100755
index 0000000..f20cf20
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing3.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite3">
+ <test name="PCATest">
+ <classes>
+ <class name="org.apache.stratos.python.cartridge.agent.test.ADCMTAppTest"/>
+ </classes>
+ </test>
+</suite>
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing4.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing4.xml b/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing4.xml
new file mode 100755
index 0000000..6462774
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/pca-testing4.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite4">
+ <test name="PCATest">
+ <classes>
+ <class name="org.apache.stratos.python.cartridge.agent.test.ADCMTAppTenantUserTest"/>
+ </classes>
+ </test>
+</suite>
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/agent.conf b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/agent.conf
new file mode 100755
index 0000000..04f4a0c
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/agent.conf
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[agent]
+mb.ip =localhost
+mb.port =1884
+listen.address =localhost
+thrift.receiver.ip =localhost
+thrift.receiver.port =7712
+thrift.server.admin.username =admin
+thrift.server.admin.password =admin
+cep.stats.publisher.enabled =true
+lb.private.ip =
+lb.public.ip =
+enable.artifact.update =true
+auto.commit =false
+auto.checkout =true
+artifact.update.interval =15
+artifact.clone.retries =5
+artifact.clone.interval =10
+port.check.timeout =600000
+enable.data.publisher =false
+monitoring.server.ip =localhost
+monitoring.server.port =7612
+monitoring.server.secure.port =7712
+monitoring.server.admin.username =admin
+monitoring.server.admin.password =admin
+#log.file.paths =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
+log.file.paths =/tmp/agent.screen.log
+metadata.service.url =https://localhost:9443
+super.tenant.repository.path =/repository/deployment/server/
+tenant.repository.path =/repository/tenants/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/jndi.properties b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/jndi.properties
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/logging.ini b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/logging.ini
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/payload/launch-params b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/payload/launch-params
new file mode 100755
index 0000000..165508e
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/payload/launch-params
@@ -0,0 +1 @@
+APPLICATION_ID=single_group_v1,APPLICATION_PATH=/tmp/tomcat/webapps,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single_group_v1-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' ,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,KUB
ERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=4500,
MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,REPO_URL=https://github.com/imesh/stratos-tomcat-applications.git,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI
0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWmVIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/agent.conf b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/agent.conf
new file mode 100755
index 0000000..136433d
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/agent.conf
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[agent]
+mb.ip =localhost
+mb.port =1885
+listen.address =localhost
+thrift.receiver.ip =localhost
+thrift.receiver.port =7712
+thrift.server.admin.username =admin
+thrift.server.admin.password =admin
+cep.stats.publisher.enabled =true
+lb.private.ip =
+lb.public.ip =
+enable.artifact.update =true
+auto.commit =false
+auto.checkout =true
+artifact.update.interval =15
+artifact.clone.retries =5
+artifact.clone.interval =10
+port.check.timeout =600000
+enable.data.publisher =false
+monitoring.server.ip =localhost
+monitoring.server.port =7612
+monitoring.server.secure.port =7712
+monitoring.server.admin.username =admin
+monitoring.server.admin.password =admin
+#log.file.paths =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
+log.file.paths =/tmp/agent.screen.log
+metadata.service.url =https://localhost:9443
+super.tenant.repository.path =/repository/deployment/server/
+tenant.repository.path =/repository/tenants/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/jndi.properties b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/jndi.properties
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/logging.ini b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/logging.ini
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/payload/launch-params b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/payload/launch-params
new file mode 100755
index 0000000..0d29753
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/payload/launch-params
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+APPLICATION_ID=application1,SERVICE_NAME=php,HOST_NAME=php.php.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=php,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single-cartridge-app-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=9080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=php.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/stratos-pca-test-app-path/,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null,MP_IP=192.168.1.4,MB_PORT=1883,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/agent.conf b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/agent.conf
new file mode 100755
index 0000000..0ee1dce
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/agent.conf
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[agent]
+mb.ip =localhost
+mb.port =1885
+listen.address =localhost
+thrift.receiver.ip =localhost
+thrift.receiver.port =7712
+thrift.server.admin.username =admin
+thrift.server.admin.password =admin
+cep.stats.publisher.enabled =true
+lb.private.ip =
+lb.public.ip =
+enable.artifact.update =true
+auto.commit =true
+auto.checkout =true
+artifact.update.interval =15
+artifact.clone.retries =5
+artifact.clone.interval =10
+port.check.timeout =600000
+enable.data.publisher =false
+monitoring.server.ip =localhost
+monitoring.server.port =7612
+monitoring.server.secure.port =7712
+monitoring.server.admin.username =admin
+monitoring.server.admin.password =admin
+log.file.paths =/tmp/agent.screen-adc-mt-test.log
+metadata.service.url =https://localhost:9443
+super.tenant.repository.path =/repository/deployment/server/
+tenant.repository.path =/repository/tenants/
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/jndi.properties b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/jndi.properties
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/logging.ini b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/logging.ini
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/payload/launch-params b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/payload/launch-params
new file mode 100755
index 0000000..ed8c67f
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/payload/launch-params
@@ -0,0 +1 @@
+APPLICATION_ID=application-3,SERVICE_NAME=tomcat-mt,HOST_NAME=tomcat.stratos.org,MULTITENANT=true,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=tomcat,CLUSTER_ID=tomcat.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=8080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=tomcat.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/pca-test-suite-3,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/agent.conf b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/agent.conf
new file mode 100755
index 0000000..f945968
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/agent.conf
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[agent]
+mb.ip =localhost
+mb.port =1885
+listen.address =localhost
+thrift.receiver.ip =localhost
+thrift.receiver.port =7712
+thrift.server.admin.username =admin
+thrift.server.admin.password =admin
+cep.stats.publisher.enabled =true
+lb.private.ip =
+lb.public.ip =
+enable.artifact.update =true
+auto.commit =true
+auto.checkout =true
+artifact.update.interval =15
+artifact.clone.retries =5
+artifact.clone.interval =10
+port.check.timeout =600000
+enable.data.publisher =false
+monitoring.server.ip =localhost
+monitoring.server.port =7612
+monitoring.server.secure.port =7712
+monitoring.server.admin.username =admin
+monitoring.server.admin.password =admin
+log.file.paths =/tmp/agent.screen-adc-mt-tenant-user-test.log
+metadata.service.url =https://localhost:9443
+super.tenant.repository.path =/repository/deployment/server/
+tenant.repository.path =/repository/tenants/
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/jndi.properties b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/jndi.properties
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/logging.ini b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/logging.ini
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/payload/launch-params b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/payload/launch-params
new file mode 100755
index 0000000..b701066
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-4/payload/launch-params
@@ -0,0 +1 @@
+APPLICATION_ID=application-4,SERVICE_NAME=tomcat-mt,HOST_NAME=tomcat.stratos.org,MULTITENANT=true,TENANT_ID=4,TENANT_RANGE=*,CARTRIDGE_ALIAS=tomcat,CLUSTER_ID=tomcat.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=8080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=tomcat.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/pca-test-suite-4,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/src/test/resources/test-conf/integration-test.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/test-conf/integration-test.properties b/products/python-cartridge-agent/modules/integration/src/test/resources/test-conf/integration-test.properties
new file mode 100755
index 0000000..1242841
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/test-conf/integration-test.properties
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Stratos distribution properties added via filters during the build
+distribution.version=${project.version}
+distribution.name=${python.cartridge.agent.distribution.name}-${project.version}
+activemq.amqp.bind.address=tcp://localhost:61617
+activemq.mqtt.bind.address=mqtt://localhost:1885
+cep.port=7712
+stratos.endpoint=http://localhost:9763
+stratos.admin.username=admin
+stratos.admin.password=admin
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/pom.xml b/products/python-cartridge-agent/pom.xml
index 5e00c1c..a84be77 100755
--- a/products/python-cartridge-agent/pom.xml
+++ b/products/python-cartridge-agent/pom.xml
@@ -32,7 +32,7 @@
<description>Apache Stratos Python Cartridge Agent Product</description>
<modules>
- <module>distribution</module>
- <module>integration</module>
+ <module>modules/distribution</module>
+
</modules>
-</project>
\ No newline at end of file
+</project>
[35/50] [abbrv] stratos git commit: Update cluster with serviceName
Posted by ga...@apache.org.
Update cluster with serviceName
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1f5df1c1
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1f5df1c1
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1f5df1c1
Branch: refs/heads/master
Commit: 1f5df1c154760cb70d670d074617d11871375a20
Parents: 599e543
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 28 21:00:01 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 28 21:00:01 2015 +0530
----------------------------------------------------------------------
.../autoscaler/context/cluster/ClusterContext.java | 2 +-
.../context/cluster/ClusterContextFactory.java | 2 +-
.../autoscaler/monitor/cluster/ClusterMonitor.java | 6 +++---
.../autoscaler/services/impl/AutoscalerServiceImpl.java | 2 +-
.../controller/messaging/topology/TopologyBuilder.java | 6 +++---
.../LoadBalancerCommonTopologyEventReceiver.java | 2 +-
.../stratos/messaging/domain/topology/Cluster.java | 12 ++++++------
.../messaging/event/topology/ClusterCreatedEvent.java | 2 +-
.../ApplicationClustersCreatedMessageProcessor.java | 2 +-
.../topology/ClusterCreatedMessageProcessor.java | 4 ++--
.../rest/endpoint/util/converter/ObjectConverter.java | 4 ++--
samples/kubernetes-clusters/kubernetes-cluster-1.json | 2 +-
samples/kubernetes-clusters/kubernetes-cluster-2.json | 2 +-
13 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContext.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContext.java
index 9e35f4e..8055cb0 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContext.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContext.java
@@ -312,7 +312,7 @@ public class ClusterContext extends AbstractClusterContext {
ClusterLevelPartitionContext clusterLevelPartitionContext = new ClusterLevelPartitionContext(
partition3,
clusterInstance.getNetworkPartitionUuid(), this.deploymentPolicyId);
- clusterLevelPartitionContext.setServiceName(cluster.getServiceUuid());
+ clusterLevelPartitionContext.setServiceName(cluster.getServiceName());
clusterLevelPartitionContext.setProperties(cluster.getProperties());
//add members to partition Context
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java
index b0d960a..92a6b0a 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContextFactory.java
@@ -43,7 +43,7 @@ public class ClusterContextFactory {
log.debug("Autoscaler policy name: " + autoscalePolicyName);
}
- return new ClusterContext(cluster.getClusterId(), cluster.getServiceUuid(),
+ return new ClusterContext(cluster.getClusterId(), cluster.getServiceName(),
autoscalePolicyName, hasScalingDependents,
deploymentPolicyId);
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
index f4c3d0c..f700dbc 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
@@ -116,7 +116,7 @@ public class ClusterMonitor extends Monitor {
readConfigurations();
this.groupScalingEnabledSubtree = groupScalingEnabledSubtree;
this.setCluster(new Cluster(cluster));
- this.serviceUuid = cluster.getServiceUuid();
+ this.serviceUuid = cluster.getServiceName();
this.monitoringStarted = new AtomicBoolean(false);
this.hasScalingDependents = hasScalingDependents;
this.deploymentPolicyId = deploymentPolicyId;
@@ -1450,11 +1450,11 @@ public class ClusterMonitor extends Monitor {
cluster.getClusterId()));
}
} else {
- createClusterInstance(cluster.getServiceUuid(), cluster.getClusterId(), null, parentInstanceId, partitionId,
+ createClusterInstance(cluster.getServiceName(), cluster.getClusterId(), null, parentInstanceId, partitionId,
parentMonitorInstance.getNetworkPartitionUuid());
if (log.isDebugEnabled()) {
log.debug(String.format("Cluster instance created: [application-id] %s [service-name] %s " +
- "[cluster-id] %s", appId, cluster.getServiceUuid(), cluster.getClusterId()));
+ "[cluster-id] %s", appId, cluster.getServiceName(), cluster.getClusterId()));
}
}
return true;
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index 3b42d29..76d527b 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@ -1238,7 +1238,7 @@ public class AutoscalerServiceImpl implements AutoscalerService {
if(cluster != null) {
Collection<ClusterInstance> allClusterInstances = cluster.getClusterInstances();
for (ClusterInstance clusterInstance : allClusterInstances) {
- ClusterStatusEventPublisher.sendClusterTerminatedEvent(applicationId, cluster.getServiceUuid(),
+ ClusterStatusEventPublisher.sendClusterTerminatedEvent(applicationId, cluster.getServiceName(),
clusterId, clusterInstance.getInstanceId());
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
index f76c928..60fd806 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
@@ -188,9 +188,9 @@ public class TopologyBuilder {
try {
Topology topology = TopologyManager.getTopology();
for (Cluster cluster : appClusters) {
- Service service = topology.getService(cluster.getServiceUuid());
+ Service service = topology.getService(cluster.getServiceName());
if (service == null) {
- log.error("Service " + cluster.getServiceUuid()
+ log.error("Service " + cluster.getServiceName()
+ " not found in Topology, unable to create Application cluster");
} else {
service.addCluster(cluster);
@@ -204,7 +204,7 @@ public class TopologyBuilder {
log.debug("Creating cluster port mappings: [application-id] " + appUuid);
for (Cluster cluster : appClusters) {
- String cartridgeUuid = cluster.getServiceUuid();
+ String cartridgeUuid = cluster.getServiceName();
Cartridge cartridge = CloudControllerContext.getInstance().getCartridge(cartridgeUuid);
if (cartridge == null) {
throw new CloudControllerException("Cartridge not found: [cartridge-uuid] " + cartridgeUuid);
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
index 0e08bf2..c42bfc6 100644
--- a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
+++ b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
@@ -405,7 +405,7 @@ public class LoadBalancerCommonTopologyEventReceiver extends TopologyEventReceiv
private org.apache.stratos.load.balancer.common.domain.Cluster transformCluster(Cluster messagingCluster) {
org.apache.stratos.load.balancer.common.domain.Cluster cluster =
- new org.apache.stratos.load.balancer.common.domain.Cluster(messagingCluster.getServiceUuid(),
+ new org.apache.stratos.load.balancer.common.domain.Cluster(messagingCluster.getServiceName(),
messagingCluster.getClusterId());
cluster.setTenantRange(messagingCluster.getTenantRange());
if (messagingCluster.getHostNames() != null) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
index 647fa89..2437730 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
@@ -38,7 +38,7 @@ public class Cluster implements Serializable {
private static final long serialVersionUID = -361960242360176077L;
- private final String serviceUuid;
+ private final String serviceName;
private final String clusterId;
private final String autoscalePolicyUuid;
private final String deploymentPolicyUuid;
@@ -64,7 +64,7 @@ public class Cluster implements Serializable {
private List<KubernetesService> kubernetesServices;
public Cluster(Cluster cluster) {
- this.serviceUuid = cluster.getServiceUuid();
+ this.serviceName = cluster.getServiceName();
this.clusterId = cluster.getClusterId();
this.deploymentPolicyUuid = cluster.getDeploymentPolicyUuid();
this.autoscalePolicyUuid = cluster.getAutoscalePolicyUuid();
@@ -84,7 +84,7 @@ public class Cluster implements Serializable {
public Cluster(String serviceName, String clusterId, String deploymentPolicyName,
String autoscalePolicyName, String appId) {
- this.serviceUuid = serviceName;
+ this.serviceName = serviceName;
this.clusterId = clusterId;
this.deploymentPolicyUuid = deploymentPolicyName;
this.autoscalePolicyUuid = autoscalePolicyName;
@@ -96,8 +96,8 @@ public class Cluster implements Serializable {
this.kubernetesServices = new ArrayList<KubernetesService>();
}
- public String getServiceUuid() {
- return serviceUuid;
+ public String getServiceName() {
+ return serviceName;
}
public String getClusterId() {
@@ -363,7 +363,7 @@ public class Cluster implements Serializable {
public String toString() {
return String.format("[serviceName=%s, clusterId=%s, autoscalePolicyName=%s, deploymentPolicyName=%s, " +
"hostNames=%s, tenantRange=%s, loadBalanceAlgorithmName=%s, appId=%s, parentId=%s, " +
- "accessUrls=%s, kubernetesServices=%s]", serviceUuid, clusterId, autoscalePolicyUuid,
+ "accessUrls=%s, kubernetesServices=%s]", serviceName, clusterId, autoscalePolicyUuid,
deploymentPolicyUuid, hostNames, tenantRange, loadBalanceAlgorithmName, appId, parentId,
accessUrls, kubernetesServices);
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java
index 2c4139b..2befa89 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java
@@ -37,7 +37,7 @@ public class ClusterCreatedEvent extends TopologyEvent implements Serializable {
@Override
public String toString() {
- return "ClusterCreatedEvent [serviceName=" + cluster.getServiceUuid() + ", " +
+ return "ClusterCreatedEvent [serviceName=" + cluster.getServiceName() + ", " +
"application=" + cluster.getAppId() + " , cluster= " + cluster.getClusterId() + " ]";
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ApplicationClustersCreatedMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ApplicationClustersCreatedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ApplicationClustersCreatedMessageProcessor.java
index 2ae7e29..8c3644c 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ApplicationClustersCreatedMessageProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ApplicationClustersCreatedMessageProcessor.java
@@ -73,7 +73,7 @@ public class ApplicationClustersCreatedMessageProcessor extends MessageProcessor
List<Cluster> clusters = event.getClusterList();
for (Cluster cluster : clusters) {
- String serviceUuid = cluster.getServiceUuid();
+ String serviceUuid = cluster.getServiceName();
String clusterId = cluster.getClusterId();
TopologyUpdater.acquireWriteLockForService(serviceUuid);
try {
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java
index 8c415db..036fe19 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java
@@ -52,7 +52,7 @@ public class ClusterCreatedMessageProcessor extends MessageProcessor {
// Parse complete message and build event
ClusterCreatedEvent event = (ClusterCreatedEvent) MessagingUtil.jsonToObject(message, ClusterCreatedEvent.class);
- String serviceName = event.getCluster().getServiceUuid();
+ String serviceName = event.getCluster().getServiceName();
TopologyUpdater.acquireWriteLockForService(serviceName);
try {
return doProcess(event, topology);
@@ -73,7 +73,7 @@ public class ClusterCreatedMessageProcessor extends MessageProcessor {
private boolean doProcess(ClusterCreatedEvent event, Topology topology) {
Cluster cluster = event.getCluster();
- String serviceName = cluster.getServiceUuid();
+ String serviceName = cluster.getServiceName();
String clusterId = cluster.getClusterId();
// Apply service filter
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/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 0301b2b..e414954 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
@@ -644,7 +644,7 @@ public class ObjectConverter {
ClusterBean clusterBean = new
ClusterBean();
clusterBean.setAlias(alias);
- clusterBean.setServiceName(cluster.getServiceUuid());
+ clusterBean.setServiceName(cluster.getServiceName());
clusterBean.setClusterId(cluster.getClusterId());
clusterBean.setLbCluster(cluster.isLbCluster());
clusterBean.setTenantRange(cluster.getTenantRange());
@@ -702,7 +702,7 @@ public class ObjectConverter {
Cluster cluster, String alias) {
ClusterInstanceBean clusterInstanceBean = new ClusterInstanceBean();
clusterInstanceBean.setAlias(alias);
- clusterInstanceBean.setServiceName(cluster.getServiceUuid());
+ clusterInstanceBean.setServiceName(cluster.getServiceName());
clusterInstanceBean.setClusterId(cluster.getClusterId());
clusterInstanceBean.setInstanceId(instanceId);
clusterInstanceBean.setParentInstanceId(instanceId);
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/samples/kubernetes-clusters/kubernetes-cluster-1.json
----------------------------------------------------------------------
diff --git a/samples/kubernetes-clusters/kubernetes-cluster-1.json b/samples/kubernetes-clusters/kubernetes-cluster-1.json
index 399ba83..ce72f2b 100644
--- a/samples/kubernetes-clusters/kubernetes-cluster-1.json
+++ b/samples/kubernetes-clusters/kubernetes-cluster-1.json
@@ -38,7 +38,7 @@
},
{
"name": "payload_parameter.MB_PORT",
- "value": "1883"
+ "value": "1884"
},
{
"name": "payload_parameter.CEP_IP",
http://git-wip-us.apache.org/repos/asf/stratos/blob/1f5df1c1/samples/kubernetes-clusters/kubernetes-cluster-2.json
----------------------------------------------------------------------
diff --git a/samples/kubernetes-clusters/kubernetes-cluster-2.json b/samples/kubernetes-clusters/kubernetes-cluster-2.json
index 0bd2260..2472793 100644
--- a/samples/kubernetes-clusters/kubernetes-cluster-2.json
+++ b/samples/kubernetes-clusters/kubernetes-cluster-2.json
@@ -38,7 +38,7 @@
},
{
"name": "payload_parameter.MB_PORT",
- "value": "1883"
+ "value": "1884"
},
{
"name": "payload_parameter.CEP_IP",
[48/50] [abbrv] stratos git commit: Conflict resolved
Posted by ga...@apache.org.
Conflict resolved
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/94f22784
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/94f22784
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/94f22784
Branch: refs/heads/master
Commit: 94f22784ac428222d14398f7dda478248c7dc985
Parents: 499fe3e
Author: Akila Perera <ra...@gmail.com>
Authored: Tue Sep 1 02:10:54 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Tue Sep 1 16:57:54 2015 +0530
----------------------------------------------------------------------
.../python.cartridge.agent/test/ADCTest.java | 216 ++++++++++++++++++-
.../src/test/resources/suite-1/agent.conf | 46 ----
.../resources/suite-1/payload/launch-params | 2 +-
.../src/test/resources/suite-2/agent.conf | 46 ----
.../resources/suite-2/payload/launch-params | 19 +-
products/python-cartridge-agent/pom.xml | 2 +-
6 files changed, 218 insertions(+), 113 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/94f22784/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
index 86fc7c3..d1355e1 100755
--- a/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
+++ b/products/python-cartridge-agent/modules/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
@@ -17,5 +17,219 @@ package org.apache.stratos.python.cartridge.agent.test;/*
* under the License.
*/
-public class ADCTest {
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.UUID;
+
+import static junit.framework.Assert.assertTrue;
+
+public class ADCTest extends PythonAgentTestManager {
+ private static final Log log = LogFactory.getLog(ADCTest.class);
+ private static final int ADC_TIMEOUT = 180000;
+ private static final String SUITE_NAME = "suite-2";
+ private static final String APPLICATION_PATH = "/tmp/pca-test-suite-2";
+ private static final String CLUSTER_ID = "tomcat.domain";
+ private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-2";
+ private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-2";
+ private static final String APP_ID = "application-2";
+ private static final String MEMBER_ID = "tomcat.member-1";
+ private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+ private static final String NETWORK_PARTITION_ID = "network-partition-1";
+ private static final String PARTITION_ID = "partition-1";
+ private static final String TENANT_ID = "-1234";
+ private static final String SERVICE_NAME = "tomcat";
+
+ private boolean hasADCTestCompleted = false;
+
+ @BeforeSuite
+ public void setupADCTest() {
+ // Set jndi.properties.dir system property for initializing event publishers and receivers
+ System.setProperty("jndi.properties.dir", getResourcesPath(SUITE_NAME));
+
+ // start Python agent with configurations provided in resource path
+ setup(SUITE_NAME);
+
+ // Simulate server socket
+ startServerSocket(8080);
+ }
+
+ /**
+ * TearDown method for test method testPythonCartridgeAgent
+ */
+ @AfterSuite
+ public void tearDownADCTest() {
+ // TODO: app path is duplicated in Java test and payload
+ tearDown(APPLICATION_PATH);
+ }
+
+
+ @Test(timeOut = ADC_TIMEOUT)
+ public void testADC() {
+ startCommunicatorThread();
+ assertAgentActivation();
+ Thread adcTestThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ log.info("Running ADC Test thread...");
+ // Send artifact updated event
+ publishEvent(getArtifactUpdatedEventForPrivateRepo());
+ log.info("Publishing artifact updated event for repo: " +
+ getArtifactUpdatedEventForPrivateRepo().getRepoURL());
+
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed() && !hasADCTestCompleted) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if (newLines.size() > 0) {
+ for (String line : newLines) {
+ if (line.contains("Git clone executed")) {
+ log.info("Agent has completed git clone. Asserting the operation...");
+ assertRepoClone(getArtifactUpdatedEventForPrivateRepo());
+ File file = new File(APPLICATION_PATH + "/pca-live-" + UUID.randomUUID());
+ try {
+ file.createNewFile();
+ }
+ catch (IOException e) {
+ log.error("Could not create file", e);
+ }
+ }
+ if (line.contains("Pushed artifacts for tenant")) {
+ log.info("ADC Test completed");
+ hasADCTestCompleted = true;
+ }
+ }
+ }
+ sleep(1000);
+ }
+ }
+ });
+ adcTestThread.start();
+
+ while (!hasADCTestCompleted) {
+ // wait until the instance activated event is received.
+ sleep(1000);
+ }
+ }
+
+ private void assertAgentActivation() {
+ Thread startupTestThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ while (!eventReceiverInitiated) {
+ sleep(1000);
+ }
+ List<String> outputLines = new ArrayList<String>();
+ while (!outputStream.isClosed()) {
+ List<String> newLines = getNewLines(outputLines, outputStream.toString());
+ if (newLines.size() > 0) {
+ for (String line : newLines) {
+ if (line.contains("Subscribed to 'topology/#'")) {
+ sleep(2000);
+ // Send complete topology event
+ log.info("Publishing complete topology event...");
+ Topology topology = createTestTopology();
+ CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+ publishEvent(completeTopologyEvent);
+ log.info("Complete topology event published");
+
+ // Publish member initialized event
+ log.info("Publishing member initialized event...");
+ MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+ SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+ PARTITION_ID
+ );
+ publishEvent(memberInitializedEvent);
+ log.info("Member initialized event published");
+ }
+
+ // Send artifact updated event to activate the instance first
+ if (line.contains("Artifact repository found")) {
+ publishEvent(getArtifactUpdatedEventForPrivateRepo());
+ log.info("Artifact updated event published");
+ }
+ log.info(line);
+ }
+ }
+ sleep(1000);
+ }
+ }
+ });
+ startupTestThread.start();
+
+ while (!instanceStarted || !instanceActivated) {
+ // wait until the instance activated event is received.
+ // this will assert whether instance got activated within timeout period; no need for explicit assertions
+ sleep(2000);
+ }
+ }
+
+ private void assertRepoClone(ArtifactUpdatedEvent artifactUpdatedEvent) {
+ File file = new File(APPLICATION_PATH + "/README.text");
+ assertTrue("Git clone failed for repo [url] " + artifactUpdatedEvent.getRepoURL(),
+ file.exists());
+ }
+
+
+ public static ArtifactUpdatedEvent getArtifactUpdatedEventForPublicRepo() {
+ ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
+ publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
+ return publicRepoEvent;
+ }
+
+ public static ArtifactUpdatedEvent getArtifactUpdatedEventForPrivateRepo() {
+ ArtifactUpdatedEvent privateRepoEvent = createTestArtifactUpdatedEvent();
+ privateRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/testrepo.git");
+ privateRepoEvent.setRepoUserName("testapache2211");
+ privateRepoEvent.setRepoPassword("RExPDGa4GkPJj4kJDzSROQ==");
+ return privateRepoEvent;
+ }
+
+ private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
+ ArtifactUpdatedEvent artifactUpdatedEvent = new ArtifactUpdatedEvent();
+ artifactUpdatedEvent.setClusterId(CLUSTER_ID);
+ artifactUpdatedEvent.setTenantId(TENANT_ID);
+ return artifactUpdatedEvent;
+ }
+
+ /**
+ * Create test topology
+ *
+ * @return
+ */
+ private Topology createTestTopology() {
+ Topology topology = new Topology();
+ Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+ topology.addService(service);
+
+ Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+ AUTOSCALING_POLICY_NAME, APP_ID);
+ service.addCluster(cluster);
+
+ Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+ CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+ System.currentTimeMillis());
+
+ member.setDefaultPrivateIP("10.0.0.1");
+ member.setDefaultPublicIP("20.0.0.1");
+ Properties properties = new Properties();
+ properties.setProperty("prop1", "value1");
+ member.setProperties(properties);
+ member.setStatus(MemberStatus.Created);
+ cluster.addMember(member);
+
+ return topology;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/94f22784/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/agent.conf b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/agent.conf
deleted file mode 100755
index 04f4a0c..0000000
--- a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/agent.conf
+++ /dev/null
@@ -1,46 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-[agent]
-mb.ip =localhost
-mb.port =1884
-listen.address =localhost
-thrift.receiver.ip =localhost
-thrift.receiver.port =7712
-thrift.server.admin.username =admin
-thrift.server.admin.password =admin
-cep.stats.publisher.enabled =true
-lb.private.ip =
-lb.public.ip =
-enable.artifact.update =true
-auto.commit =false
-auto.checkout =true
-artifact.update.interval =15
-artifact.clone.retries =5
-artifact.clone.interval =10
-port.check.timeout =600000
-enable.data.publisher =false
-monitoring.server.ip =localhost
-monitoring.server.port =7612
-monitoring.server.secure.port =7712
-monitoring.server.admin.username =admin
-monitoring.server.admin.password =admin
-#log.file.paths =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
-log.file.paths =/tmp/agent.screen.log
-metadata.service.url =https://localhost:9443
-super.tenant.repository.path =/repository/deployment/server/
-tenant.repository.path =/repository/tenants/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/94f22784/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/payload/launch-params b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/payload/launch-params
index 165508e..5b98406 100755
--- a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/payload/launch-params
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-1/payload/launch-params
@@ -1 +1 @@
-APPLICATION_ID=single_group_v1,APPLICATION_PATH=/tmp/tomcat/webapps,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single_group_v1-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' ,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,KUB
ERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=4500,
MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,REPO_URL=https://github.com/imesh/stratos-tomcat-applications.git,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI
0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWmVIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
+APPLICATION_ID=application-1,APPLICATION_PATH=/tmp/pca-test-suite-1,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' ,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,
KUBERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=45
00,MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWm
VIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/94f22784/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/agent.conf b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/agent.conf
deleted file mode 100755
index 136433d..0000000
--- a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/agent.conf
+++ /dev/null
@@ -1,46 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-[agent]
-mb.ip =localhost
-mb.port =1885
-listen.address =localhost
-thrift.receiver.ip =localhost
-thrift.receiver.port =7712
-thrift.server.admin.username =admin
-thrift.server.admin.password =admin
-cep.stats.publisher.enabled =true
-lb.private.ip =
-lb.public.ip =
-enable.artifact.update =true
-auto.commit =false
-auto.checkout =true
-artifact.update.interval =15
-artifact.clone.retries =5
-artifact.clone.interval =10
-port.check.timeout =600000
-enable.data.publisher =false
-monitoring.server.ip =localhost
-monitoring.server.port =7612
-monitoring.server.secure.port =7712
-monitoring.server.admin.username =admin
-monitoring.server.admin.password =admin
-#log.file.paths =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
-log.file.paths =/tmp/agent.screen.log
-metadata.service.url =https://localhost:9443
-super.tenant.repository.path =/repository/deployment/server/
-tenant.repository.path =/repository/tenants/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/94f22784/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/payload/launch-params b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/payload/launch-params
index 0d29753..aa4fcc3 100755
--- a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/payload/launch-params
+++ b/products/python-cartridge-agent/modules/integration/src/test/resources/suite-2/payload/launch-params
@@ -1,18 +1 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-APPLICATION_ID=application1,SERVICE_NAME=php,HOST_NAME=php.php.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=php,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single-cartridge-app-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=9080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=php.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/stratos-pca-test-app-path/,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null,MP_IP=192.168.1.4,MB_PORT=1883,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
+APPLICATION_ID=application1,SERVICE_NAME=tomcat,HOST_NAME=tomcat.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=tomcat,CLUSTER_ID=tomcat.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=8080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=tomcat.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/pca-test-suite-2,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/94f22784/products/python-cartridge-agent/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/pom.xml b/products/python-cartridge-agent/pom.xml
index a84be77..2e72823 100755
--- a/products/python-cartridge-agent/pom.xml
+++ b/products/python-cartridge-agent/pom.xml
@@ -35,4 +35,4 @@
<module>modules/distribution</module>
</modules>
-</project>
+</project>
\ No newline at end of file
[40/50] [abbrv] stratos git commit: Merge with tenant-isolation branch
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 8216d55,4b8fc3f..66ccf12
--- 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
@@@ -63,9 -67,10 +67,10 @@@ import java.net.URI
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
+ import java.util.UUID;
/**
- * Stratos API v4.1 for Stratos 4.1.0 release.
+ * Stratos API v4.1 for Stratos 4.2.0 release.
*/
@Path("/")
public class StratosApiV41 extends AbstractApi {
@@@ -1253,10 -1312,17 +1315,18 @@@
return Response.status(Response.Status.CONFLICT).entity(new ResponseMessageBean(
ResponseMessageBean.ERROR, message)).build();
}
- StratosApiV41Utils.undeployApplication(applicationId, force);
+
+ ApplicationContext applicationContext = null;
+ try {
+ applicationContext = AutoscalerServiceClient.getInstance().getApplicationByTenant(applicationId,
+ carbonContext.getTenantId());
+ } catch (RemoteException e) {
+ throw new RestAPIException(e.getMessage());
+ }
+ StratosApiV41Utils.undeployApplication(applicationContext.getApplicationUuid(), force);
return Response.accepted().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
- String.format("Application undeploy process started successfully: [application-id] %s", applicationId))).build();
+ String.format("Application undeploy process started successfully: [application-id] %s",
+ applicationId))).build();
}
/**
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/dependencies/fabric8/pom.xml
----------------------------------------------------------------------
diff --cc dependencies/fabric8/pom.xml
index 5ecc4db,a67c452..6cde28b
--- a/dependencies/fabric8/pom.xml
+++ b/dependencies/fabric8/pom.xml
@@@ -35,4 -36,19 +35,4 @@@
<modules>
<module>kubernetes-api</module>
</modules>
- </project>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <encoding>UTF-8</encoding>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ </project>
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/distribution/src/main/conf/drools/scaling.drl
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/distribution/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --cc products/stratos/modules/distribution/src/main/conf/thrift-client-config.xml
index 5cacada,0000000..f730c42
mode 100644,000000..100644
--- a/products/stratos/modules/distribution/src/main/conf/thrift-client-config.xml
+++ b/products/stratos/modules/distribution/src/main/conf/thrift-client-config.xml
@@@ -1,27 -1,0 +1,39 @@@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
- <!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
++<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP and WSO2 DAS-->
+<thriftClientConfiguration>
- <username>admin</username>
- <password>admin</password>
- <ip>localhost</ip>
- <port>7611</port>
++ <config>
++ <name>cep</name>
++ <statsPublisherEnabled>true</statsPublisherEnabled>
++ <username>admin</username>
++ <password>admin</password>
++ <ip>localhost</ip>
++ <port>7611</port>
++ </config>
++ <config>
++ <name>das</name>
++ <statsPublisherEnabled>false</statsPublisherEnabled>
++ <username>admin</username>
++ <password>admin</password>
++ <ip>localhost</ip>
++ <port>7612</port>
++ </config>
+</thriftClientConfiguration>
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/RestConstants.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
----------------------------------------------------------------------
diff --cc products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
index 437b162,0000000..a1998e1
mode 100644,000000..100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
@@@ -1,44 -1,0 +1,44 @@@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.integration.tests.users;
+
+import org.apache.stratos.integration.tests.RestConstants;
+import org.apache.stratos.integration.tests.StratosTestServerManager;
+import org.testng.annotations.Test;
+
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * Handling users
+ */
+public class TenantTest extends StratosTestServerManager {
+ private static final String RESOURCES_PATH = "/user-test";
+
+
+ @Test
+ public void addUser() {
+ String tenantId = "tenant-1";
- boolean addedUser1 = restClient.addEntity(RESOURCES_PATH + "/" +
++ boolean addedUser1 = restClientAdmin.addEntity(RESOURCES_PATH + "/" +
+ tenantId + ".json",
+ RestConstants.USERS, RestConstants.USERS_NAME);
+ assertTrue(addedUser1);
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
----------------------------------------------------------------------
diff --cc products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
index c15250f,0000000..1b083df
mode 100644,000000..100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
@@@ -1,115 -1,0 +1,115 @@@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.integration.tests.users;
+
+import com.google.gson.reflect.TypeToken;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.beans.UserInfoBean;
+import org.apache.stratos.common.beans.cartridge.CartridgeBean;
+import org.apache.stratos.integration.tests.RestConstants;
+import org.apache.stratos.integration.tests.StratosTestServerManager;
+import org.testng.annotations.Test;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+
+import static junit.framework.Assert.*;
+
+/**
+ * Handling users
+ */
+public class UserTest extends StratosTestServerManager {
+ private static final Log log = LogFactory.getLog(UserTest.class);
+ private static final String RESOURCES_PATH = "/user-test";
+
+ @Test
+ public void addUser() {
+ try {
+ log.info("-------------------------------Started users test case-------------------------------");
+ String userId = "user-1";
- boolean addedUser1 = restClient.addEntity(RESOURCES_PATH + "/" +
++ boolean addedUser1 = restClientAdmin.addEntity(RESOURCES_PATH + "/" +
+ userId + ".json",
+ RestConstants.USERS, RestConstants.USERS_NAME);
+ assertTrue(addedUser1);
+
+ Type listType = new TypeToken<ArrayList<UserInfoBean>>() {
+ }.getType();
+
- List<UserInfoBean> userInfoBeanList = (List<UserInfoBean>) restClient.listEntity(RestConstants.USERS,
++ List<UserInfoBean> userInfoBeanList = (List<UserInfoBean>) restClientAdmin.listEntity(RestConstants.USERS,
+ listType, RestConstants.USERS_NAME);
+
+ UserInfoBean bean1 = null;
+ for (UserInfoBean userInfoBean : userInfoBeanList) {
+ if (userInfoBean.getUserName().equals(userId)) {
+ bean1 = userInfoBean;
+ }
+ }
+ assertNotNull(bean1);
+ /*assertEquals(bean1.getEmail(), "foo@bar.com");
+ assertEquals(bean1.getFirstName(), "Frank");
+ assertEquals(bean1.getRole(), "admin");
+ assertEquals(bean1.getLastName(), "Myers");
+ assertEquals(bean1.getCredential(), "kim12345");*/
+
- boolean updatedUser1 = restClient.updateEntity(RESOURCES_PATH + "/" +
++ boolean updatedUser1 = restClientAdmin.updateEntity(RESOURCES_PATH + "/" +
+ userId + "-v1.json",
+ RestConstants.USERS, RestConstants.USERS_NAME);
+ assertTrue(updatedUser1);
+
- userInfoBeanList = (List<UserInfoBean>) restClient.listEntity(RestConstants.USERS,
++ userInfoBeanList = (List<UserInfoBean>) restClientAdmin.listEntity(RestConstants.USERS,
+ listType, RestConstants.USERS_NAME);
+
+ for (UserInfoBean userInfoBean : userInfoBeanList) {
+ if (userInfoBean.getUserName().equals(userId)) {
+ bean1 = userInfoBean;
+ }
+ }
+ assertNotNull(bean1);
+ /*assertEquals(bean1.getEmail(), "user-1@bar.com");
+ assertEquals(bean1.getFirstName(), "Frankn");
+ assertEquals(bean1.getRole(), "admin");
+ assertEquals(bean1.getLastName(), "Myersn");
+ assertEquals(bean1.getCredential(), "kim123456");*/
+
- boolean removedUser1 = restClient.removeEntity(RestConstants.USERS,
++ boolean removedUser1 = restClientAdmin.removeEntity(RestConstants.USERS,
+ userId, RestConstants.USERS_NAME);
+ assertTrue(removedUser1);
+
- userInfoBeanList = (List<UserInfoBean>) restClient.listEntity(RestConstants.USERS,
++ userInfoBeanList = (List<UserInfoBean>) restClientAdmin.listEntity(RestConstants.USERS,
+ listType, RestConstants.USERS_NAME);
+
+ bean1 = null;
+ for (UserInfoBean userInfoBean : userInfoBeanList) {
+ if (userInfoBean.getUserName().equals(userId)) {
+ bean1 = userInfoBean;
+ }
+ }
+ assertNull(bean1);
+
+ log.info("-------------------------Ended users test case-------------------------");
+
+ } catch (Exception e) {
+ log.error("An error occurred while handling application bursting", e);
+ assertTrue("An error occurred while handling application bursting", false);
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
----------------------------------------------------------------------
diff --cc products/stratos/modules/integration/src/test/resources/stratos-testing.xml
index e8a48d2,ede5ff3..bb58de5
--- a/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
+++ b/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
@@@ -21,71 -21,65 +21,59 @@@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="StratosIntegrationSuite">
- <test name="UserTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.users.UserTest" />
- </classes>
- </test>
- <test name="CartridgeTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.group.CartridgeTest" />
- </classes>
- </test>
- <test name="CartridgeGroupTest" >
- <classes>
- <class name="org.apache.stratos.integration.tests.group.CartridgeGroupTest" />
- </classes>
- </test>
- <test name="NetworkPartitionTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.policies.NetworkPartitionTest" />
- </classes>
- </test>
- <test name="ApplicationPolicyTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.policies.ApplicationPolicyTest" />
- </classes>
- </test>
- <test name="DeploymentPolicyTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.policies.DeploymentPolicyTest" />
- </classes>
- </test>
- <test name="AutoscalingPolicyTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest" />
- </classes>
- </test>
- <test name="SampleApplicationsTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest" />
- </classes>
- </test>
- <test name="ApplicationUpdateTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.ApplicationUpdateTest" />
- </classes>
- </test>
- <test name="SingleClusterScalingTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest" />
- </classes>
- </test>
- <test name="ApplicationBurstingTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest" />
- </classes>
- </test>
- <test name="PartitionRoundRobinClusterTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest" />
- </classes>
- </test>
- <test name="GroupStartupOrderTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.GroupStartupOrderTest" />
- </classes>
- </test>
+
+ <test name="CartridgeTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.group.CartridgeTest" />
+ </classes>
+ </test>
+ <test name="CartridgeGroupTest" >
+ <classes>
+ <class name="org.apache.stratos.integration.tests.group.CartridgeGroupTest" />
+ </classes>
+ </test>
+
+ <test name="NetworkPartitionTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.policies.NetworkPartitionTest" />
+ </classes>
+ </test>
+ <test name="ApplicationPolicyTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.policies.ApplicationPolicyTest" />
+ </classes>
+ </test>
+ <test name="DeploymentPolicyTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.policies.DeploymentPolicyTest" />
+ </classes>
+ </test>
+ <test name="AutoscalingPolicyTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest" />
+ </classes>
+ </test>
+ <test name="SampleApplicationsTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest" />
+ </classes>
+ </test>
+ <test name="ApplicationBurstingTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest" />
+ </classes>
+ </test>
-
- <test name="ApplicationUpdateTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.ApplicationUpdateTest" />
- </classes>
- </test>
+ <test name="SingleClusterScalingTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest" />
+ </classes>
+ </test>
+ <test name="PartitionRoundRobinClusterTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest" />
+ </classes>
+ </test>
+
<test name="GroupTerminationBehaviorTest">
<classes>
<class name="org.apache.stratos.integration.tests.application.GroupTerminationBehaviorTest" />
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/samples/cartridges/kubernetes/php.json
----------------------------------------------------------------------
diff --cc samples/cartridges/kubernetes/php.json
index 6fa8399,260fb22..128b6da
--- a/samples/cartridges/kubernetes/php.json
+++ b/samples/cartridges/kubernetes/php.json
@@@ -23,7 -22,7 +23,7 @@@
"iaasProvider": [
{
"type": "kubernetes",
- "imageId": "stratos/php:4.2.0",
- "imageId": "stratos/php:4.1.0",
++ "imageId": "stratos/php:4.1.",
"networkInterfaces": [
],
"property": [
[22/50] [abbrv] stratos git commit: Upgrading fabric8 kubernetes api
version to 2.2.16 and removing forked code
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/TriggerBuild.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/TriggerBuild.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/TriggerBuild.java
deleted file mode 100644
index abb0c89..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/TriggerBuild.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-/**
- * Triggers a build using the Java API
- */
-public class TriggerBuild {
- public static void main(String... args) {
- if (args.length < 1) {
- System.out.println("Usage: buildConfigName namespace secret type");
- return;
- }
- String name = args[0];
- String namespace = "default";
- if (args.length > 1) {
- namespace = args[1];
- }
-
- KubernetesClient client = new KubernetesClient();
-
- System.out.println("Connecting to kubernetes on: " + client.getAddress());
-
- try {
- String uuid = client.triggerBuildAndGetUuid(name, namespace);
- System.out.println("Build triggered: got UUID: " + uuid);
- } catch (Exception e) {
- System.out.println("FAILED: " + e);
- e.printStackTrace();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/UsingBadAddressTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/UsingBadAddressTest.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/UsingBadAddressTest.java
deleted file mode 100644
index 40b650e..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/UsingBadAddressTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.utils.Asserts;
-import io.fabric8.utils.Block;
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- */
-public class UsingBadAddressTest {
- protected String badAddress = "cheese://does.notexist.redhat.com:666";
-
- @Test
- public void testUseBadAddressFails() throws Exception {
- Asserts.assertException(new Block() {
- @Override
- public void invoke() throws Exception {
- new KubernetesFactory(badAddress);
- }
- });
- }
-
- @Test
- public void testUseBadAddressWithoutValidation() throws Exception {
- KubernetesFactory factory = new KubernetesFactory(badAddress, false);
- assertThat(factory).isNotNull();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewEndpoints.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewEndpoints.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewEndpoints.java
deleted file mode 100644
index 445de7f..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewEndpoints.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.*;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static io.fabric8.utils.Lists.notNullList;
-
-/**
- * Views the endpoints for all services or the given service id and namespace
- */
-public class ViewEndpoints {
- public static void main(String... args) {
- System.out.println("Usage: [serviceId] [namespace]");
- KubernetesClient client = new KubernetesClient();
-
- System.out.println("Connecting to kubernetes on: " + client.getAddress());
-
- try {
- String service = null;
- String namespace = null;
- if (args.length > 0) {
- service = args[0];
- }
- if (args.length > 1) {
- namespace = args[1];
- }
- listEndpoints(client, service, namespace);
- } catch (Exception e) {
- System.out.println("FAILED: " + e);
- e.printStackTrace();
- }
- }
-
- protected static void listEndpoints(KubernetesClient client, String service, String namespace) throws Exception {
- if (service != null) {
- Endpoints endpoints = client.endpointsForService(service, namespace);
- display(endpoints);
-
- } else {
- EndpointsList endpointsList = client.getEndpoints();
- if (endpointsList != null) {
- List<Endpoints> items = notNullList(endpointsList.getItems());
- for (Endpoints item : items) {
- display(item);
- }
- }
- }
- }
-
- protected static void display(Endpoints endpoints) {
- if (endpoints != null) {
- String name = endpoints.getMetadata().getName();
- String namespace = endpoints.getMetadata().getNamespace();
- List<String> urls = new ArrayList<>();
- List<EndpointSubset> endpointsSubsets = endpoints.getSubsets();
-
- for (EndpointSubset endpointSubset : endpointsSubsets) {
- for (EndpointAddress endpointAddress : endpointSubset.getAddresses()) {
- for (EndpointPort endpointPort : endpointSubset.getPorts()) {
- urls.add(endpointAddress.getIP() + ":" + endpointPort.getPort());
- }
- }
- }
-
- System.out.println("Service: " + name + " namespace: " + namespace + " urls: " + urls);
- } else {
- System.out.println("null endpoints");
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewNodes.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewNodes.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewNodes.java
deleted file mode 100644
index da577ce..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewNodes.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.Node;
-import io.fabric8.kubernetes.api.model.NodeList;
-
-import java.util.List;
-
-import static io.fabric8.utils.Lists.notNullList;
-
-/**
- * Views the minions
- */
-public class ViewNodes {
- public static void main(String... args) {
- KubernetesClient client = new KubernetesClient();
-
- System.out.println("Connecting to kubernetes on: " + client.getAddress());
-
- try {
- listMinions(client);
- } catch (Exception e) {
- System.out.println("FAILED: " + e);
- e.printStackTrace();
- }
- }
-
- protected static void listMinions(KubernetesClient client) throws Exception {
- NodeList nodeList = client.getNodes();
- if (nodeList != null) {
- List<Node> items = notNullList(nodeList.getItems());
- for (Node item : items) {
- display(item);
- }
- }
- }
-
- protected static void display(Node node) {
- if (node != null) {
- String id = node.getMetadata().getName();
- System.out.println("Node: " + id + " resources: " + node.getStatus().getCapacity());
- } else {
- System.out.println("null node");
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewServiceIPs.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewServiceIPs.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewServiceIPs.java
deleted file mode 100644
index 0ea2bb6..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/ViewServiceIPs.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import java.util.Set;
-
-/**
- * Views the endpoints for all services or the given service id and namespace
- */
-public class ViewServiceIPs {
- public static void main(String... args) {
- System.out.println("Usage: [serviceName]");
-
- try {
- String service = null;
- if (args.length > 0) {
- service = args[0];
- }
-
- Set<String> addresses = KubernetesHelper.lookupServiceInDns(service);
- if (addresses != null) {
- System.out.println("addresses: " + addresses);
- } else {
- System.out.println("null addresses");
- }
- } catch (Exception e) {
- System.out.println("FAILED: " + e);
- e.printStackTrace();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuilds.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuilds.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuilds.java
deleted file mode 100644
index 40fd5de..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuilds.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Copyright 2005-2014 Red Hat, Inc.
- *
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.builds.BuildFinishedEvent;
-import io.fabric8.kubernetes.api.builds.BuildListener;
-import io.fabric8.kubernetes.api.builds.BuildWatcher;
-import io.fabric8.kubernetes.api.builds.Links;
-
-/**
- * Triggers a build using the Java API
- */
-public class WatchBuilds {
- public static void main(String... args) {
- String namespace = null;
- if (args.length > 0) {
- namespace = args[0];
- }
-
- String consoleLink = Links.getFabric8ConsoleLink();
-
- KubernetesClient client = new KubernetesClient();
- BuildListener buildListener = new BuildListener() {
- @Override
- public void onBuildFinished(BuildFinishedEvent event) {
- System.out.println("Build: " + event.getUid()
- + " for config: " + event.getConfigName()
- + " finished. Status: " + event.getStatus()
- + " link: " + event.getBuildLink());
- }
- };
- BuildWatcher watcher = new BuildWatcher(client, buildListener, namespace, consoleLink);
-
- long pollTime = 3000;
- watcher.schedule(pollTime);
-
- watcher.join();
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuildsExample.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuildsExample.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuildsExample.java
deleted file mode 100644
index 2105ba2..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchBuildsExample.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.openshift.api.model.Build;
-import org.eclipse.jetty.websocket.client.WebSocketClient;
-
-public class WatchBuildsExample {
-
- public static void main(String... args) throws Exception {
- KubernetesClient kube = new KubernetesClient();
- System.out.println("Connecting to kubernetes on: " + kube.getAddress());
- WebSocketClient client = kube.watchBuilds(new ExampleWatcher());
- Thread.sleep(10000l);
- client.stop();
- }
-
- static class ExampleWatcher extends AbstractWatcher<Build> {
- @Override
- public void eventReceived(Action action, Build object) {
- System.out.println(action + ": " + object);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchPodsExample.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchPodsExample.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchPodsExample.java
deleted file mode 100644
index ded366d..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchPodsExample.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.Pod;
-import org.eclipse.jetty.websocket.client.WebSocketClient;
-
-public class WatchPodsExample {
-
- public static void main(String... args) throws Exception {
- KubernetesClient kube = new KubernetesClient();
- System.out.println("Connecting to kubernetes on: " + kube.getAddress());
- WebSocketClient client = kube.watchPods("default", null, new ExampleWatcher());
- Thread.sleep(10000l);
- client.stop();
- }
-
- static class ExampleWatcher extends AbstractWatcher<Pod> {
- @Override
- public void eventReceived(Watcher.Action action, Pod object) {
- System.out.println(action + ": " + object);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchServicesExample.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchServicesExample.java b/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchServicesExample.java
deleted file mode 100644
index 13fb9a1..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/java/io/fabric8/kubernetes/api/WatchServicesExample.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.Service;
-import org.eclipse.jetty.websocket.client.WebSocketClient;
-
-public class WatchServicesExample {
-
- public static void main(String... args) throws Exception {
- KubernetesClient kube = new KubernetesClient();
- System.out.println("Connecting to kubernetes on: " + kube.getAddress());
- WebSocketClient client = kube.watchServices("jimmi", null, new ExampleWatcher());
- Thread.sleep(10000l);
- client.stop();
- }
-
- static class ExampleWatcher extends AbstractWatcher<Service> {
- @Override
- public void eventReceived(Action action, Service object) {
- System.out.println(action + ": " + object);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/resources/config.yml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/resources/config.yml b/dependencies/fabric8/kubernetes-api/src/test/resources/config.yml
deleted file mode 100644
index dd471d0..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/resources/config.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-apiVersion: v1
-clusters:
-- cluster:
- insecure-skip-tls-verify: true
- server: https://localhost:8443
- name: localhost-8443-0
-- cluster:
- insecure-skip-tls-verify: true
- server: https://localhost:8443
- name: localhost-8443-1
-- cluster:
- insecure-skip-tls-verify: true
- server: https://localhost:8443
- name: 172-28-128-4:8443
-- cluster:
- insecure-skip-tls-verify: true
- server: https://localhost:8443
- name: localhost:8443
-contexts:
-- context:
- cluster: localhost:8443
- namespace: claus
- user: admin/localhost:8443
- name: claus/localhost:8443/admin
-- context:
- cluster: 172-28-128-4:8443
- namespace: jimmi-does-rock
- user: admin/localhost:8443
- name: default/localhost:8443/admin
-- context:
- cluster: localhost:8443
- namespace: james
- user: admin/localhost:8443
- name: james/localhost:8443/admin
-- context:
- cluster: localhost:8443
- namespace: roland
- user: admin/localhost:8443
- name: roland/localhost:8443/admin
-current-context: default/localhost:8443/admin
-kind: Config
-preferences: {}
-users:
-- name: admin/somewhere:8443
- user:
- token: DEF
-- name: admin/somewhere-else:8443
- user:
- token: ABC
-- name: admin/localhost:8443
- user:
- token: ExpectedToken
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/resources/errorexample.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/resources/errorexample.json b/dependencies/fabric8/kubernetes-api/src/test/resources/errorexample.json
deleted file mode 100644
index 3338c5d..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/resources/errorexample.json
+++ /dev/null
@@ -1,77 +0,0 @@
-{
- "id": "nova-compute-controller",
- "apiVersion": "v1beta1",
- "desiredState": {
- "replicas": 6,
- "podTemplate": {
- "desiredState": {
- "manifest": {
- "id": "nova-compute-controller",
- "containers": [
- {
- "ports": [
- {
- "hostPort": 12000,
- "containerPort": 12000
- }
- ],
- "name": "nova-compute",
- "image": "kollaglue/fedora-rdo-nova-compute",
- "env": [
- {
- "name": "DB_ROOT_PASSWORD",
- "value": "password"
- },
- {
- "name": "NOVA_DB_PASSWORD",
- "value": "novadbpassword"
- },
- {
- "name": "KEYSTONE_ADMIN_TOKEN",
- "value": "ADMINTOKEN"
- }
- ],
- "privileged": true
- },
- {
- "ports": [
- {
- "hostPort": 12001,
- "containerPort": 12001
- }
- ],
- "name": "nova-network",
- "image": "kollaglue/fedora-rdo-nova-network",
- "env": [
- {
- "name": "DB_ROOT_PASSWORD",
- "value": "password"
- },
- {
- "name": "NOVA_DB_PASSWORD",
- "value": "novadbpassword"
- },
- {
- "name": "KEYSTONE_ADMIN_TOKEN",
- "value": "ADMINTOKEN"
- }
- ],
- "privileged": true
- }
- ],
- "version": "v1beta1"
- }
- },
- "labels": {
- "name": "nova-compute"
- }
- },
- "replicaSelector": {
- "name": "nova-compute"
- }
- },
- "labels": {
- "name": "nova-compute"
- },
- "kind": "ReplicationController"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/resources/fmq-service.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/resources/fmq-service.json b/dependencies/fabric8/kubernetes-api/src/test/resources/fmq-service.json
deleted file mode 100644
index 4b704ba..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/resources/fmq-service.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "kind": "Service",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "fabric8-mq-service"
- },
- "spec": {
- "ports": [
- {
- "port": 6163,
- "targetPort": 6162
- }
- ],
- "selector": {
- "container": "java",
- "name": "fabric8MQ",
- "group": "fabric8MQ"
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/resources/glance-api-service.yaml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/resources/glance-api-service.yaml b/dependencies/fabric8/kubernetes-api/src/test/resources/glance-api-service.yaml
deleted file mode 100644
index 42e8c5c..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/resources/glance-api-service.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-apiVersion: v1beta1
-containerPort: 9292
-id: glance-api
-kind: Service
-port: 9292
-selector:
- name: glance
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/test/resources/log4j.properties b/dependencies/fabric8/kubernetes-api/src/test/resources/log4j.properties
deleted file mode 100644
index 50114a0..0000000
--- a/dependencies/fabric8/kubernetes-api/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Copyright 2005-2014 Red Hat, Inc.
-#
-# Red Hat licenses this file to you under the Apache License, version
-# 2.0 (the "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# permissions and limitations under the License.
-#
-
-log4j.rootLogger=INFO, stdout
-
-#The logging properties used during tests..
-# CONSOLE appender not used by default
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%-5p %-30.30c{1} - %m%n
-log4j.appender.stdout.threshold=DEBUG
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/README.md
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/README.md b/dependencies/fabric8/kubernetes-model/README.md
deleted file mode 100644
index 6019aa8..0000000
--- a/dependencies/fabric8/kubernetes-model/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-## Fabric8 Kubernetes Client API Model
-
-Fabric8 Kubernetes Client API Model 2.1.11 has been forked to fix issue [1]. The fix has been merged to master branch,
-once the next Fabric8 release is published to Nexus this fork can be removed.
-
-[1] [origin-schema-generator/pull/50] (https://github.com/fabric8io/origin-schema-generator/pull/50)
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/pom.xml b/dependencies/fabric8/kubernetes-model/pom.xml
deleted file mode 100644
index f8edfa5..0000000
--- a/dependencies/fabric8/kubernetes-model/pom.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2005-2014 Red Hat, Inc.
-
- Red Hat licenses this file to you under the Apache License, version
- 2.0 (the "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied. See the License for the specific language governing
- permissions and limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.stratos</groupId>
- <artifactId>stratos-dependencies-fabric8</artifactId>
- <version>4.1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>kubernetes-model</artifactId>
- <version>2.1.11-stratosv1</version>
- <packaging>bundle</packaging>
-
- <name>Fabric8 :: Kubernetes Generated Model</name>
-
- <properties>
- <clone-kube>true</clone-kube>
- <kube.dir>${basedir}/src/main/resources</kube.dir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>io.sundr</groupId>
- <artifactId>sundr-annotations</artifactId>
- <version>0.0.16</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.module</groupId>
- <artifactId>jackson-module-jaxb-annotations</artifactId>
- <version>2.4.0</version>
- </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- <version>1.1.0.Final</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.jsonschema2pojo</groupId>
- <artifactId>jsonschema2pojo-maven-plugin</artifactId>
- <version>0.4.10</version>
- <configuration>
- <sourceDirectory>${kube.dir}/schema</sourceDirectory>
- <targetPackage>io.fabric8.kubernetes.api.model</targetPackage>
- <includeConstructors>true</includeConstructors>
- <includeJsr303Annotations>true</includeJsr303Annotations>
- <outputDirectory>${basedir}/target/generated-sources</outputDirectory>
- <customAnnotator>io.fabric8.kubernetes.annotator.KubernetesTypeAnnotator</customAnnotator>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>io.fabric8.schemagenerator</groupId>
- <artifactId>kubernetes-annotator</artifactId>
- <version>0.0.45</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <configuration>
- <target>
- <echo>removing the duplicate generated calss</echo>
- <delete file="${basedir}/target/generated-sources/io/fabric8/kubernetes/api/model/util/IntOrString.java" verbose="true" />
- <delete file="${basedir}/target/generated-sources/io/fabric8/kubernetes/api/model/resource/Quantity.java" verbose="true" />
- <delete file="${basedir}/target/generated-sources/io/fabric8/openshift/api/model/template/Template.java" verbose="true" />
- <delete file="${basedir}/target/generated-sources/io/fabric8/kubernetes/api/model/HasMetadata.java" verbose="true" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <version>2.3.7</version>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
- <Export-Package>
- io.fabric8.kubernetes.api.model
- </Export-Package>
- <Import-Package>
- org.osgi.framework,
- *;resolution:=optional
- </Import-Package>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.9.1</version>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>${build.outputDirectory}/schema/kube-schema.json</file>
- <type>json</type>
- <classifier>schema</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.5</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-gpg-plugin</artifactId>
- <version>1.5</version>
- <configuration>
- <passphrase>${gpg.passphrase}</passphrase>
- <useAgent>true</useAgent>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesBaseConfig.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesBaseConfig.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesBaseConfig.java
deleted file mode 100644
index b3ad7e7..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesBaseConfig.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package io.fabric8.config;
-
-import io.sundr.builder.annotations.ExternalBuildables;
-
-@ExternalBuildables(editableEnabled=false, validationEnabled = true, builderPackage = "io.fabric8.common", value = {
- "io.fabric8.kubernetes.api.model.base.ListMeta",
- "io.fabric8.kubernetes.api.model.base.ObjectMeta",
- "io.fabric8.kubernetes.api.model.base.ObjectReference",
- "io.fabric8.kubernetes.api.model.base.Status",
- "io.fabric8.kubernetes.api.model.base.StatusCause",
- "io.fabric8.kubernetes.api.model.base.StatusDetails"
-})
-public class KubernetesBaseConfig {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesConfig.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesConfig.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesConfig.java
deleted file mode 100644
index 9422353..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/KubernetesConfig.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package io.fabric8.config;
-
-import io.sundr.builder.annotations.ExternalBuildables;
-
-@ExternalBuildables(editableEnabled=false, validationEnabled = true, builderPackage = "io.fabric8.common", value = {
- "io.fabric8.kubernetes.api.model.BaseKubernetesList",
- "io.fabric8.kubernetes.api.model.KubernetesList",
-
- "io.fabric8.kubernetes.api.model.Capabilities",
- "io.fabric8.kubernetes.api.model.Container",
- "io.fabric8.kubernetes.api.model.ContainerPort",
- "io.fabric8.kubernetes.api.model.ContainerState",
- "io.fabric8.kubernetes.api.model.ContainerStateRunning",
- "io.fabric8.kubernetes.api.model.ContainerStateTerminated",
- "io.fabric8.kubernetes.api.model.ContainerStateWaiting",
- "io.fabric8.kubernetes.api.model.ContainerStatus",
- "io.fabric8.kubernetes.api.model.EmptyDirVolumeSource",
- "io.fabric8.kubernetes.api.model.EndpointAddress",
- "io.fabric8.kubernetes.api.model.EndpointPort",
- "io.fabric8.kubernetes.api.model.EndpointSubset",
- "io.fabric8.kubernetes.api.model.Endpoints",
- "io.fabric8.kubernetes.api.model.EndpointsList",
- "io.fabric8.kubernetes.api.model.EnvVar",
- "io.fabric8.kubernetes.api.model.EnvVarSource",
- "io.fabric8.kubernetes.api.model.ExecAction",
- "io.fabric8.kubernetes.api.model.GCEPersistentDiskVolumeSource",
- "io.fabric8.kubernetes.api.model.GitRepoVolumeSource",
- "io.fabric8.kubernetes.api.model.GlusterfsVolumeSource",
- "io.fabric8.kubernetes.api.model.HTTPGetAction",
- "io.fabric8.kubernetes.api.model.Handler",
- "io.fabric8.kubernetes.api.model.HostPathVolumeSource",
- "io.fabric8.kubernetes.api.model.ISCSIVolumeSource",
- "io.fabric8.kubernetes.api.model.KubeSchema",
- "io.fabric8.kubernetes.api.model.Lifecycle",
- "io.fabric8.kubernetes.api.model.ListMeta",
- "io.fabric8.kubernetes.api.model.NFSVolumeSource",
- "io.fabric8.kubernetes.api.model.Namespace",
- "io.fabric8.kubernetes.api.model.NamespaceList",
- "io.fabric8.kubernetes.api.model.NamespaceSpec",
- "io.fabric8.kubernetes.api.model.NamespaceStatus",
- "io.fabric8.kubernetes.api.model.Node",
- "io.fabric8.kubernetes.api.model.NodeAddress",
- "io.fabric8.kubernetes.api.model.NodeCondition",
- "io.fabric8.kubernetes.api.model.NodeList",
- "io.fabric8.kubernetes.api.model.NodeSpec",
- "io.fabric8.kubernetes.api.model.NodeStatus",
- "io.fabric8.kubernetes.api.model.NodeSystemInfo",
- "io.fabric8.kubernetes.api.model.ObjectFieldSelector",
- "io.fabric8.kubernetes.api.model.ObjectMeta",
- "io.fabric8.kubernetes.api.model.ObjectReference",
- "io.fabric8.kubernetes.api.model.Pod",
- "io.fabric8.kubernetes.api.model.PodCondition",
- "io.fabric8.kubernetes.api.model.PodList",
- "io.fabric8.kubernetes.api.model.PodSpec",
- "io.fabric8.kubernetes.api.model.PodStatus",
- "io.fabric8.kubernetes.api.model.PodTemplateSpec",
- "io.fabric8.kubernetes.api.model.Probe",
- "io.fabric8.kubernetes.api.model.ReplicationController",
- "io.fabric8.kubernetes.api.model.ReplicationControllerList",
- "io.fabric8.kubernetes.api.model.ReplicationControllerSpec",
- "io.fabric8.kubernetes.api.model.ReplicationControllerStatus",
- "io.fabric8.kubernetes.api.model.ResourceRequirements",
- "io.fabric8.kubernetes.api.model.Secret",
- "io.fabric8.kubernetes.api.model.SecretList",
- "io.fabric8.kubernetes.api.model.SecretVolumeSource",
- "io.fabric8.kubernetes.api.model.Service",
- "io.fabric8.kubernetes.api.model.ServiceAccount",
- "io.fabric8.kubernetes.api.model.ServiceAccountList",
- "io.fabric8.kubernetes.api.model.ServiceList",
- "io.fabric8.kubernetes.api.model.ServicePort",
- "io.fabric8.kubernetes.api.model.ServiceSpec",
- "io.fabric8.kubernetes.api.model.ServiceStatus",
- "io.fabric8.kubernetes.api.model.TCPSocketAction",
- "io.fabric8.kubernetes.api.model.Volume",
- "io.fabric8.kubernetes.api.model.VolumeMount",
-
- "io.fabric8.kubernetes.api.model.util.IntOrString",
- "io.fabric8.kubernetes.api.model.resource.Quantity"
-})
-public class KubernetesConfig {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/OpenshiftConfig.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/OpenshiftConfig.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/OpenshiftConfig.java
deleted file mode 100644
index 8a48f81..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/config/OpenshiftConfig.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package io.fabric8.config;
-
-import io.sundr.builder.annotations.ExternalBuildables;
-
-@ExternalBuildables(editableEnabled=false, validationEnabled = true, builderPackage = "io.fabric8.common", value = {
- "io.fabric8.openshift.api.model.Build",
- "io.fabric8.openshift.api.model.BuildConfig",
- "io.fabric8.openshift.api.model.BuildConfigList",
- "io.fabric8.openshift.api.model.BuildConfigSpec",
- "io.fabric8.openshift.api.model.BuildConfigStatus",
- "io.fabric8.openshift.api.model.BuildList",
- "io.fabric8.openshift.api.model.BuildOutput",
- "io.fabric8.openshift.api.model.BuildSource",
- "io.fabric8.openshift.api.model.BuildSpec",
- "io.fabric8.openshift.api.model.BuildStatus",
- "io.fabric8.openshift.api.model.BuildStrategy",
- "io.fabric8.openshift.api.model.BuildTriggerPolicy",
- "io.fabric8.openshift.api.model.CustomBuildStrategy",
- "io.fabric8.openshift.api.model.CustomDeploymentStrategyParams",
- "io.fabric8.openshift.api.model.DeploymentCause",
- "io.fabric8.openshift.api.model.DeploymentCauseImageTrigger",
- "io.fabric8.openshift.api.model.DeploymentConfig",
- "io.fabric8.openshift.api.model.DeploymentConfigList",
- "io.fabric8.openshift.api.model.DeploymentConfigSpec",
- "io.fabric8.openshift.api.model.DeploymentConfigStatus",
- "io.fabric8.openshift.api.model.DeploymentDetails",
- "io.fabric8.openshift.api.model.DeploymentStrategy",
- "io.fabric8.openshift.api.model.DeploymentTriggerImageChangeParams",
- "io.fabric8.openshift.api.model.DeploymentTriggerPolicy",
- "io.fabric8.openshift.api.model.DockerBuildStrategy",
- "io.fabric8.openshift.api.model.ExecNewPodHook",
- "io.fabric8.openshift.api.model.GitBuildSource",
- "io.fabric8.openshift.api.model.GitSourceRevision",
- "io.fabric8.openshift.api.model.Image",
- "io.fabric8.openshift.api.model.ImageChangeTrigger",
- "io.fabric8.openshift.api.model.ImageList",
- "io.fabric8.openshift.api.model.ImageStream",
- "io.fabric8.openshift.api.model.ImageStreamList",
- "io.fabric8.openshift.api.model.ImageStreamSpec",
- "io.fabric8.openshift.api.model.ImageStreamStatus",
- "io.fabric8.openshift.api.model.LifecycleHook",
- "io.fabric8.openshift.api.model.NamedTagEventList",
- "io.fabric8.openshift.api.model.NamedTagReference",
- "io.fabric8.openshift.api.model.OAuthAccessToken",
- "io.fabric8.openshift.api.model.OAuthAccessTokenList",
- "io.fabric8.openshift.api.model.OAuthAuthorizeToken",
- "io.fabric8.openshift.api.model.OAuthAuthorizeTokenList",
- "io.fabric8.openshift.api.model.OAuthClient",
- "io.fabric8.openshift.api.model.OAuthClientAuthorization",
- "io.fabric8.openshift.api.model.OAuthClientAuthorizationList",
- "io.fabric8.openshift.api.model.OAuthClientList",
- "io.fabric8.openshift.api.model.RecreateDeploymentStrategyParams",
- "io.fabric8.openshift.api.model.Route",
- "io.fabric8.openshift.api.model.RouteList",
- "io.fabric8.openshift.api.model.RouteSpec",
- "io.fabric8.openshift.api.model.RouteStatus",
- "io.fabric8.openshift.api.model.SourceBuildStrategy",
- "io.fabric8.openshift.api.model.SourceControlUser",
- "io.fabric8.openshift.api.model.SourceRevision",
- "io.fabric8.openshift.api.model.TLSConfig",
- "io.fabric8.openshift.api.model.TagEvent",
- "io.fabric8.openshift.api.model.WebHookTrigger",
- "io.fabric8.openshift.api.model.template.Template",
- "io.fabric8.openshift.api.model.template.Parameter"
-})
-public class OpenshiftConfig {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/HasMetadata.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/HasMetadata.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/HasMetadata.java
deleted file mode 100644
index 689791c..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/HasMetadata.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package io.fabric8.kubernetes.api.model;
-
-public interface HasMetadata extends KubernetesResource {
-
- ObjectMeta getMetadata();
- void setMetadata(ObjectMeta metadata);
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesKind.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesKind.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesKind.java
deleted file mode 100644
index bc051bf..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesKind.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package io.fabric8.kubernetes.api.model;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public enum KubernetesKind {
-
- List(KubernetesList.class),
- ServiceAccount(ServiceAccount.class),
- ServiceAccountList(ServiceAccountList.class),
- Service(Service.class),
- ServiceList(ServiceList.class),
- Pod(Pod.class),
- PodList(PodList.class),
- ReplicationController(ReplicationController.class),
- ReplicationControllerList(ReplicationControllerList.class),
- Namespace(Namespace.class),
- NamespaceList(NamespaceList.class),
- Secret(Secret.class),
- SecretList(SecretList.class),
- Endpoints(Endpoints.class),
- EndpointsList(EndpointsList.class),
- Node(Node.class),
- NodeList(NodeList.class),
- Build(io.fabric8.openshift.api.model.Build.class),
- BuildList(io.fabric8.openshift.api.model.BuildList.class),
- BuildConfig(io.fabric8.openshift.api.model.BuildConfig.class),
- BuildConfigList(io.fabric8.openshift.api.model.BuildConfigList.class),
- DeploymentConfig(io.fabric8.openshift.api.model.DeploymentConfig.class),
- DeploymentConfigList(io.fabric8.openshift.api.model.DeploymentConfigList.class),
- Image(io.fabric8.openshift.api.model.Image.class),
- ImageList(io.fabric8.openshift.api.model.ImageList.class),
- ImageStream(io.fabric8.openshift.api.model.ImageStream.class),
- ImageStreamList(io.fabric8.openshift.api.model.ImageStreamList.class),
- NameTagReference(io.fabric8.openshift.api.model.NamedTagReference.class),
- NameTagEventList(io.fabric8.openshift.api.model.NamedTagEventList.class),
- Route(io.fabric8.openshift.api.model.Route.class),
- RouteList(io.fabric8.openshift.api.model.RouteList.class),
- Template(io.fabric8.openshift.api.model.template.Template.class),
- TemplateList(io.fabric8.openshift.api.model.template.TemplateList.class),
- OAuthClient(io.fabric8.openshift.api.model.OAuthClient.class),
- OAuthClientList(io.fabric8.openshift.api.model.OAuthClientList.class),
- OAuthClientAuthorization(io.fabric8.openshift.api.model.OAuthClientAuthorization.class),
- OAuthClientAuthorizationList(io.fabric8.openshift.api.model.OAuthClientAuthorizationList.class),
- OAuthAuthorizeToken(io.fabric8.openshift.api.model.OAuthAuthorizeToken.class),
- OAuthAuthorizeTokenList(io.fabric8.openshift.api.model.OAuthAuthorizeTokenList.class),
- OAuthAccessToken(io.fabric8.openshift.api.model.OAuthAccessToken.class),
- OAuthAccessTokenList(io.fabric8.openshift.api.model.OAuthAccessTokenList.class);
-
- private static final Map<String, Class<? extends KubernetesResource>> map = new HashMap<String, Class<? extends KubernetesResource>>();
-
- static {
- for (KubernetesKind kind : KubernetesKind.values()) {
- map.put(kind.name(), kind.type);
- }
- }
-
- private final Class<? extends KubernetesResource> type;
-
- KubernetesKind(Class type) {
- this.type = type;
- }
-
- public Class getType() {
- return type;
- }
-
- public static Class<? extends KubernetesResource> getTypeForName(String name) {
- return map.get(name);
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesList.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesList.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesList.java
deleted file mode 100644
index 3450a46..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesList.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package io.fabric8.kubernetes.api.model;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import javax.annotation.Generated;
-import java.util.List;
-
-
-/**
- *
- *
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "annotations",
- "apiVersion",
- "creationTimestamp",
- "deletionTimestamp",
- "generateName",
- "id",
- "items",
- "kind",
- "namespace",
- "resourceVersion",
- "selfLink",
- "uid"
-})
-@JsonDeserialize(using = JsonDeserializer.None.class)
-public class KubernetesList extends BaseKubernetesList implements KubernetesResource {
-
- /**
- * No args constructor for use in serialization
- */
- public KubernetesList() {
- super();
- }
-
- public KubernetesList(KubernetesList.ApiVersion apiVersion,
- List<HasMetadata> items,
- String kind,
- ListMeta metadata) {
- super(apiVersion, items, kind, metadata);
- this.setItems(items);
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesResource.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesResource.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesResource.java
deleted file mode 100644
index bc2ba3d..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/KubernetesResource.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package io.fabric8.kubernetes.api.model;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import io.fabric8.kubernetes.internal.KubernetesDeserializer;
-
-@JsonDeserialize(using = KubernetesDeserializer.class)
-public interface KubernetesResource {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/resource/Quantity.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/resource/Quantity.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/resource/Quantity.java
deleted file mode 100644
index b614487..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/resource/Quantity.java
+++ /dev/null
@@ -1,135 +0,0 @@
-
-package io.fabric8.kubernetes.api.model.resource;
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-import javax.annotation.Generated;
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- *
- *
- */
-@JsonDeserialize(using = Quantity.Deserializer.class)
-@JsonSerialize(using = Quantity.Serializer.class)
-@Generated("org.jsonschema2pojo")
-public class Quantity {
-
- private String amount;
- private String format;
- private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
- /**
- * No args constructor for use in serialization
- *
- */
- public Quantity() {
- }
-
- /**
- *
- * @param Format
- * @param Amount
- */
- public Quantity(String amount) {
- this.amount = amount;
- }
-
- /**
- *
- * @param Format
- * @param Amount
- */
- public Quantity(String amount, String format) {
- this.amount = amount;
- this.format = format;
- }
-
- public String getAmount() {
- return amount;
- }
-
- public void setAmount(String amount) {
- this.amount = amount;
- }
-
- public String getFormat() {
- return format;
- }
-
- public void setFormat(String format) {
- this.format = format;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- @JsonAnyGetter
- public Map<String, Object> getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- @JsonAnySetter
- public void setAdditionalProperty(String name, Object value) {
- this.additionalProperties.put(name, value);
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(amount).append(format).append(additionalProperties).toHashCode();
- }
-
- @Override
- public boolean equals(Object other) {
- if (other == this) {
- return true;
- }
- if ((other instanceof Quantity) == false) {
- return false;
- }
- Quantity rhs = ((Quantity) other);
- return new EqualsBuilder().append(amount, rhs.amount).append(format, rhs.format).append(additionalProperties, rhs.additionalProperties).isEquals();
- }
-
- public static class Serializer extends JsonSerializer<Quantity> {
-
- @Override
- public void serialize(Quantity value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
- if (value != null && value.getAmount() != null) {
- jgen.writeNumber(value.getAmount());
- } else {
- jgen.writeNull();
- }
- }
- }
-
- public static class Deserializer extends JsonDeserializer<Quantity> {
-
- @Override
- public Quantity deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {
- ObjectCodec oc = jsonParser.getCodec();
- JsonNode node = oc.readTree(jsonParser);
- Quantity quantity = new Quantity(node.asText());
- return quantity;
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/util/IntOrString.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/util/IntOrString.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/util/IntOrString.java
deleted file mode 100644
index bbf9828..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/api/model/util/IntOrString.java
+++ /dev/null
@@ -1,195 +0,0 @@
-
-package io.fabric8.kubernetes.api.model.util;
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-import javax.annotation.Generated;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@Generated("org.jsonschema2pojo")
-@JsonDeserialize(using = IntOrString.Deserializer.class)
-@JsonSerialize(using = IntOrString.Serializer.class)
-@JsonPropertyOrder({
- "IntVal",
- "Kind",
- "StrVal"
-})
-public class IntOrString {
-
- @JsonProperty("IntVal")
- private Integer IntVal;
- @JsonProperty("Kind")
- private Integer Kind;
- @JsonProperty("StrVal")
- private String StrVal;
- @JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
- public IntOrString() {
- }
-
- //Builders are generated for the first non-empty constructor found.
- public IntOrString(Integer intVal, Integer kind, String strVal, Map<String, Object> additionalProperties) {
- IntVal = intVal;
- Kind = kind;
- StrVal = strVal;
- this.additionalProperties = additionalProperties;
- }
-
- public IntOrString(Integer intVal) {
- this(intVal, 0, null, new HashMap<String, Object>());
- }
-
- public IntOrString(String strVal) {
- this(null, 1, strVal, new HashMap<String, Object>());
- }
-
-
- /**
- *
- * @return
- * The IntVal
- */
- @JsonProperty("IntVal")
- public Integer getIntVal() {
- return IntVal;
- }
-
- /**
- *
- * @param IntVal
- * The IntVal
- */
- @JsonProperty("IntVal")
- public void setIntVal(Integer IntVal) {
- this.IntVal = IntVal;
- }
-
- /**
- *
- * @return
- * The Kind
- */
- @JsonProperty("Kind")
- public Integer getKind() {
- return Kind;
- }
-
- /**
- *
- * @param Kind
- * The Kind
- */
- @JsonProperty("Kind")
- public void setKind(Integer Kind) {
- this.Kind = Kind;
- }
-
- /**
- *
- * @return
- * The StrVal
- */
- @JsonProperty("StrVal")
- public String getStrVal() {
- return StrVal;
- }
-
- /**
- *
- * @param StrVal
- * The StrVal
- */
- @JsonProperty("StrVal")
- public void setStrVal(String StrVal) {
- this.StrVal = StrVal;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- @Override
- public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
- }
-
- @Override
- public boolean equals(Object other) {
- return EqualsBuilder.reflectionEquals(this, other);
- }
-
- @JsonAnyGetter
- public Map<String, Object> getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- @JsonAnySetter
- public void setAdditionalProperty(String name, Object value) {
- this.additionalProperties.put(name, value);
- }
-
- public static class Serializer extends JsonSerializer<IntOrString> {
-
- @Override
- public void serialize(IntOrString value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
- if (value != null) {
- Integer intValue = value.getIntVal();
- if (intValue != null) {
- jgen.writeNumber(intValue);
- } else {
- String stringValue = value.getStrVal();
- if (stringValue != null) {
- jgen.writeString(stringValue);
- } else {
- jgen.writeNull();
- }
- }
- } else {
- jgen.writeNull();
- }
- }
-
- }
-
- public static class Deserializer extends JsonDeserializer<IntOrString> {
-
- @Override
- public IntOrString deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {
- ObjectCodec oc = jsonParser.getCodec();
- JsonNode node = oc.readTree(jsonParser);
- IntOrString intOrString = new IntOrString();
- int asInt = node.asInt();
- if (asInt != 0) {
- intOrString.setIntVal(asInt);
- } else {
- intOrString.setStrVal(node.asText());
- }
- return intOrString;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataComparator.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataComparator.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataComparator.java
deleted file mode 100644
index 84469f5..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataComparator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package io.fabric8.kubernetes.internal;
-
-import io.fabric8.kubernetes.api.model.HasMetadata;
-import io.fabric8.kubernetes.api.model.Service;
-
-import java.util.Comparator;
-
-public class HasMetadataComparator implements Comparator<HasMetadata> {
- @Override
- public int compare(HasMetadata a, HasMetadata b) {
- if (a == null || b == null) {
- throw new NullPointerException("Cannot compare null HasMetadata objects");
- }
- if (a == b) {
- return 0;
- }
-
- if (a instanceof Service && !(b instanceof Service)) {
- return -1;
- }
- if (b instanceof Service && !(a instanceof Service)) {
- return 1;
- }
- int classCompare = a.getClass().getSimpleName().compareTo(b.getClass().getSimpleName());
- if (classCompare != 0) {
- return classCompare;
- }
- return a.getMetadata().getName().compareTo(b.getMetadata().getName());
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataSet.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataSet.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataSet.java
deleted file mode 100644
index a6795c3..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/HasMetadataSet.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package io.fabric8.kubernetes.internal;
-
-import io.fabric8.kubernetes.api.model.HasMetadata;
-
-import java.util.Collection;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-public class HasMetadataSet extends TreeSet<HasMetadata> {
-
- public HasMetadataSet() {
- super(new HasMetadataComparator());
- }
-
- public HasMetadataSet(Collection<? extends HasMetadata> c) {
- super(new HasMetadataComparator());
- addAll(c);
- }
-
- public HasMetadataSet(SortedSet<HasMetadata> s) {
- super(new HasMetadataComparator());
- addAll(s);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/KubernetesDeserializer.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/KubernetesDeserializer.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/KubernetesDeserializer.java
deleted file mode 100644
index bac84ee..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/kubernetes/internal/KubernetesDeserializer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package io.fabric8.kubernetes.internal;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import io.fabric8.kubernetes.api.model.KubernetesKind;
-import io.fabric8.kubernetes.api.model.KubernetesResource;
-
-import java.io.IOException;
-
-public class KubernetesDeserializer extends JsonDeserializer<KubernetesResource> {
-
- private static final String KIND = "kind";
-
- @Override
- public KubernetesResource deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
- ObjectNode node = jp.readValueAsTree();
- JsonNode kind = node.get(KIND);
- if (kind != null) {
- String value = kind.textValue();
- Class<? extends KubernetesResource> resourceType = KubernetesKind.getTypeForName(value);
- if (resourceType == null) {
- throw ctxt.mappingException("No resource type found for kind:" + value);
- } else {
- return jp.getCodec().treeToValue(node, resourceType);
- }
- }
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/openshift/api/model/template/Template.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/openshift/api/model/template/Template.java b/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/openshift/api/model/template/Template.java
deleted file mode 100644
index 08163ee..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/java/io/fabric8/openshift/api/model/template/Template.java
+++ /dev/null
@@ -1,306 +0,0 @@
-
-package io.fabric8.openshift.api.model.template;
-
-import com.fasterxml.jackson.annotation.*;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import io.fabric8.kubernetes.api.model.*;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-import javax.annotation.Generated;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import java.util.*;
-
-
-/**
- *
- *
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "apiVersion",
- "kind",
- "labels",
- "metadata",
- "objects",
- "parameters"
-})
-@JsonDeserialize(using = JsonDeserializer.None.class)
-public class Template implements HasMetadata {
-
- /**
- *
- * (Required)
- *
- */
- @JsonProperty("apiVersion")
- @NotNull
- private Template.ApiVersion apiVersion = Template.ApiVersion.fromValue("v1beta3");
- /**
- *
- * (Required)
- *
- */
- @JsonProperty("kind")
- @NotNull
- private java.lang.String kind = "Template";
- /**
- *
- *
- */
- @JsonProperty("labels")
- @Valid
- private Map<String, String> labels;
- /**
- *
- *
- */
- @JsonProperty("metadata")
- @Valid
- private ObjectMeta metadata;
- /**
- *
- *
- */
- @JsonProperty("objects")
- @Valid
- private List<HasMetadata> objects = new ArrayList<HasMetadata>();
- /**
- *
- *
- */
- @JsonProperty("parameters")
- @Valid
- private List<Parameter> parameters = new ArrayList<Parameter>();
- @JsonIgnore
- private Map<java.lang.String, java.lang.Object> additionalProperties = new HashMap<java.lang.String, java.lang.Object>();
-
-
- /**
- * No args constructor for use in serialization
- *
- */
- public Template() {
- }
-
- /**
- *
- * @param apiVersion
- * @param labels
- * @param parameters
- * @param objects
- * @param kind
- * @param metadata
- */
- public Template(Template.ApiVersion apiVersion, java.lang.String kind, Map<String, String> labels, ObjectMeta metadata, List<HasMetadata> objects, List<Parameter> parameters) {
- this.apiVersion = apiVersion;
- this.kind = kind;
- this.labels = labels;
- this.metadata = metadata;
- this.objects = objects;
- this.parameters = parameters;
-
- this.setObjects(objects);
- }
-
- /**
- *
- * (Required)
- *
- * @return
- * The apiVersion
- */
- @JsonProperty("apiVersion")
- public Template.ApiVersion getApiVersion() {
- return apiVersion;
- }
-
- /**
- *
- * (Required)
- *
- * @param apiVersion
- * The apiVersion
- */
- @JsonProperty("apiVersion")
- public void setApiVersion(Template.ApiVersion apiVersion) {
- this.apiVersion = apiVersion;
- }
-
- /**
- *
- * (Required)
- *
- * @return
- * The kind
- */
- @JsonProperty("kind")
- public java.lang.String getKind() {
- return kind;
- }
-
- /**
- *
- * (Required)
- *
- * @param kind
- * The kind
- */
- @JsonProperty("kind")
- public void setKind(java.lang.String kind) {
- this.kind = kind;
- }
-
- /**
- *
- *
- * @return
- * The labels
- */
- @JsonProperty("labels")
- public Map<String, String> getLabels() {
- return labels;
- }
-
- /**
- *
- *
- * @param labels
- * The labels
- */
- @JsonProperty("labels")
- public void setLabels(Map<String, String> labels) {
- this.labels = labels;
- }
-
- /**
- *
- *
- * @return
- * The metadata
- */
- @JsonProperty("metadata")
- public ObjectMeta getMetadata() {
- return metadata;
- }
-
- /**
- *
- *
- * @param metadata
- * The metadata
- */
- @JsonProperty("metadata")
- public void setMetadata(ObjectMeta metadata) {
- this.metadata = metadata;
- }
-
- /**
- *
- *
- * @return
- * The objects
- */
- @JsonProperty("objects")
- public List<HasMetadata> getObjects() {
- return objects;
- }
-
- public void setObjects(List<HasMetadata> objects) {
- this.objects = objects;
- }
-
- /**
- *
- *
- * @return
- * The parameters
- */
- @JsonProperty("parameters")
- public List<Parameter> getParameters() {
- return parameters;
- }
-
- /**
- *
- *
- * @param parameters
- * The parameters
- */
- @JsonProperty("parameters")
- public void setParameters(List<Parameter> parameters) {
- this.parameters = parameters;
- }
-
- @Override
- public java.lang.String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- @JsonAnyGetter
- public Map<java.lang.String, java.lang.Object> getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- @JsonAnySetter
- public void setAdditionalProperty(java.lang.String name, java.lang.Object value) {
- this.additionalProperties.put(name, value);
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(apiVersion).append(kind).append(labels).append(metadata).append(objects).append(parameters).append(additionalProperties).toHashCode();
- }
-
- @Override
- public boolean equals(java.lang.Object other) {
- if (other == this) {
- return true;
- }
- if ((other instanceof Template) == false) {
- return false;
- }
- Template rhs = ((Template) other);
- return new EqualsBuilder().append(apiVersion, rhs.apiVersion).append(kind, rhs.kind).append(labels, rhs.labels).append(metadata, rhs.metadata).append(objects, rhs.objects).append(parameters, rhs.parameters).append(additionalProperties, rhs.additionalProperties).isEquals();
- }
-
- @Generated("org.jsonschema2pojo")
- public static enum ApiVersion {
-
- V_1_BETA_3("v1beta3"),
- V_1("v1");
- private final java.lang.String value;
- private static Map<java.lang.String, Template.ApiVersion> constants = new HashMap<java.lang.String, Template.ApiVersion>();
-
- static {
- for (Template.ApiVersion c: values()) {
- constants.put(c.value, c);
- }
- }
-
- private ApiVersion(java.lang.String value) {
- this.value = value;
- }
-
- @JsonValue
- @Override
- public java.lang.String toString() {
- return this.value;
- }
-
- @JsonCreator
- public static Template.ApiVersion fromValue(java.lang.String value) {
- Template.ApiVersion constant = constants.get(value);
- if (constant == null) {
- throw new IllegalArgumentException(value);
- } else {
- return constant;
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/resources/log4j.properties b/dependencies/fabric8/kubernetes-model/src/main/resources/log4j.properties
deleted file mode 100644
index 393e087..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# Root logger option
-log4j.rootLogger=INFO, stdout
-
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
\ No newline at end of file
[32/50] [abbrv] stratos git commit: merge with master branch
Posted by ga...@apache.org.
merge with master branch
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/7194cb66
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/7194cb66
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/7194cb66
Branch: refs/heads/master
Commit: 7194cb66e16504b116ea4d45a594dbfa053e0c1b
Parents: 573b703
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 28 15:03:10 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 28 15:03:10 2015 +0530
----------------------------------------------------------------------
.../tests/application/GroupTerminationBehaviorTest.java | 5 -----
1 file changed, 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/7194cb66/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
index cbc5a65..475ddd4 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
@@ -160,11 +160,6 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
clusterIds.add(clusterIdC4);
clusterIds.add(clusterIdC2);
- assertGroupInactive(groupId, clusterIdC3);
-
- assertTerminatingOfNodes(groupId, clusterIds);
-
- assertTerminationOfNodes(groupId, clusterIds);
//Application active handling
topologyHandler.assertApplicationStatus(bean.getApplicationId(),
[05/50] [abbrv] stratos git commit: Merge branch 'tenant-isolation'
of https://github.com/apache/stratos into tenant-isolation-v1
Posted by ga...@apache.org.
Merge branch 'tenant-isolation' of https://github.com/apache/stratos into tenant-isolation-v1
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/4014dc5d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/4014dc5d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/4014dc5d
Branch: refs/heads/master
Commit: 4014dc5d69a6597cd73dfe5a6d5d6487ee4d618b
Parents: eb0d28f 2f2debf
Author: Dinithi <di...@wso2.com>
Authored: Fri Aug 21 10:23:06 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Fri Aug 21 10:23:06 2015 +0530
----------------------------------------------------------------------
.../common/threading/StratosThreadPool.java | 20 +++--
.../iaas/services/impl/MockIaasServiceImpl.java | 2 +-
extensions/das/pom.xml | 2 +-
.../integration/tests/TopologyHandler.java | 19 ++--
.../application/GroupStartupOrderTest.java | 34 +++++++-
.../GroupTerminationBehaviorTest.java | 64 ++++++++++----
.../application-policy-3.json.orig | 18 ----
...-G123-1-application-update-test-v1.json.orig | 91 --------------------
.../application.json.orig | 89 -------------------
9 files changed, 109 insertions(+), 230 deletions(-)
----------------------------------------------------------------------
[21/50] [abbrv] stratos git commit: Upgrading fabric8 kubernetes api
version to 2.2.16 and removing forked code
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/main/resources/schema/kube-schema.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/main/resources/schema/kube-schema.json b/dependencies/fabric8/kubernetes-model/src/main/resources/schema/kube-schema.json
deleted file mode 100644
index 01fb8c4..0000000
--- a/dependencies/fabric8/kubernetes-model/src/main/resources/schema/kube-schema.json
+++ /dev/null
@@ -1,4692 +0,0 @@
-{
- "id": "http://fabric8.io/fabric8/v2/Schema#",
- "$schema": "http://json-schema.org/schema#",
- "definitions": {
- "kubernetes_AWSElasticBlockStoreVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "fsType": {
- "type": "string",
- "description": "file system type to mount"
- },
- "partition": {
- "type": "integer",
- "description": "partition on the disk to mount (e.g."
- },
- "readOnly": {
- "type": "boolean",
- "description": "read-only if true"
- },
- "volumeID": {
- "type": "string",
- "description": "unique id of the PD resource in AWS"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.AWSElasticBlockStoreVolumeSource"
- },
- "kubernetes_Capabilities": {
- "type": "object",
- "description": "",
- "properties": {
- "add": {
- "type": "array",
- "description": "added capabilities",
- "items": {
- "type": "string",
- "description": "added capabilities"
- }
- },
- "drop": {
- "type": "array",
- "description": "droped capabilities",
- "items": {
- "type": "string",
- "description": "droped capabilities"
- }
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Capabilities"
- },
- "kubernetes_Container": {
- "type": "object",
- "description": "",
- "properties": {
- "args": {
- "type": "array",
- "description": "command array; the docker image's cmd is used if this is not provided; arguments to the entrypoint; cannot be updated",
- "items": {
- "type": "string",
- "description": "command array; the docker image's cmd is used if this is not provided; arguments to the entrypoint; cannot be updated"
- }
- },
- "capabilities": {
- "$ref": "#/definitions/kubernetes_Capabilities",
- "javaType": "io.fabric8.kubernetes.api.model.Capabilities"
- },
- "command": {
- "type": "array",
- "description": "entrypoint array; not executed within a shell; the docker image's entrypoint is used if this is not provided; cannot be updated",
- "items": {
- "type": "string",
- "description": "entrypoint array; not executed within a shell; the docker image's entrypoint is used if this is not provided; cannot be updated"
- }
- },
- "env": {
- "type": "array",
- "description": "list of environment variables to set in the container; cannot be updated",
- "items": {
- "$ref": "#/definitions/kubernetes_EnvVar",
- "javaType": "io.fabric8.kubernetes.api.model.EnvVar"
- }
- },
- "image": {
- "type": "string",
- "description": "Docker image name"
- },
- "imagePullPolicy": {
- "type": "string",
- "description": "image pull policy; one of Always"
- },
- "lifecycle": {
- "$ref": "#/definitions/kubernetes_Lifecycle",
- "javaType": "io.fabric8.kubernetes.api.model.Lifecycle"
- },
- "livenessProbe": {
- "$ref": "#/definitions/kubernetes_Probe",
- "javaType": "io.fabric8.kubernetes.api.model.Probe"
- },
- "name": {
- "type": "string",
- "description": "name of the container; must be a DNS_LABEL and unique within the pod; cannot be updated",
- "maxLength": 63,
- "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
- },
- "ports": {
- "type": "array",
- "description": "list of ports to expose from the container; cannot be updated",
- "items": {
- "$ref": "#/definitions/kubernetes_ContainerPort",
- "javaType": "io.fabric8.kubernetes.api.model.ContainerPort"
- }
- },
- "privileged": {
- "type": "boolean",
- "description": "whether or not the container is granted privileged status; defaults to false; cannot be updated; deprecated; See SecurityContext."
- },
- "readinessProbe": {
- "$ref": "#/definitions/kubernetes_Probe",
- "javaType": "io.fabric8.kubernetes.api.model.Probe"
- },
- "resources": {
- "$ref": "#/definitions/kubernetes_ResourceRequirements",
- "javaType": "io.fabric8.kubernetes.api.model.ResourceRequirements"
- },
- "securityContext": {
- "$ref": "#/definitions/kubernetes_SecurityContext",
- "javaType": "io.fabric8.kubernetes.api.model.SecurityContext"
- },
- "terminationMessagePath": {
- "type": "string",
- "description": "path at which the file to which the container's termination message will be written is mounted into the container's filesystem; message written is intended to be brief final status"
- },
- "volumeMounts": {
- "type": "array",
- "description": "pod volumes to mount into the container's filesyste; cannot be updated",
- "items": {
- "$ref": "#/definitions/kubernetes_VolumeMount",
- "javaType": "io.fabric8.kubernetes.api.model.VolumeMount"
- }
- },
- "workingDir": {
- "type": "string",
- "description": "container's working directory; defaults to image's default; cannot be updated"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Container"
- },
- "kubernetes_ContainerPort": {
- "type": "object",
- "description": "",
- "properties": {
- "containerPort": {
- "type": "integer",
- "description": "number of port to expose on the pod's IP address"
- },
- "hostIP": {
- "type": "string",
- "description": "host IP to bind the port to"
- },
- "hostPort": {
- "type": "integer",
- "description": "number of port to expose on the host; most containers do not need this"
- },
- "name": {
- "type": "string",
- "description": "name for the port that can be referred to by services; must be a DNS_LABEL and unique without the pod"
- },
- "protocol": {
- "type": "string",
- "description": "protocol for port; must be UDP or TCP; TCP if unspecified"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ContainerPort"
- },
- "kubernetes_ContainerState": {
- "type": "object",
- "description": "",
- "properties": {
- "running": {
- "$ref": "#/definitions/kubernetes_ContainerStateRunning",
- "javaType": "io.fabric8.kubernetes.api.model.ContainerStateRunning"
- },
- "termination": {
- "$ref": "#/definitions/kubernetes_ContainerStateTerminated",
- "javaType": "io.fabric8.kubernetes.api.model.ContainerStateTerminated"
- },
- "waiting": {
- "$ref": "#/definitions/kubernetes_ContainerStateWaiting",
- "javaType": "io.fabric8.kubernetes.api.model.ContainerStateWaiting"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ContainerState"
- },
- "kubernetes_ContainerStateRunning": {
- "type": "object",
- "description": "",
- "properties": {
- "startedAt": {
- "type": "string",
- "description": "time at which the container was last (re-)started"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ContainerStateRunning"
- },
- "kubernetes_ContainerStateTerminated": {
- "type": "object",
- "description": "",
- "properties": {
- "containerID": {
- "type": "string",
- "description": "container's ID in the format 'docker://\u003ccontainer_id\u003e'"
- },
- "exitCode": {
- "type": "integer",
- "description": "exit status from the last termination of the container"
- },
- "finishedAt": {
- "type": "string",
- "description": "time at which the container last terminated"
- },
- "message": {
- "type": "string",
- "description": "message regarding the last termination of the container"
- },
- "reason": {
- "type": "string",
- "description": "(brief) reason from the last termination of the container"
- },
- "signal": {
- "type": "integer",
- "description": "signal from the last termination of the container"
- },
- "startedAt": {
- "type": "string",
- "description": "time at which previous execution of the container started"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ContainerStateTerminated"
- },
- "kubernetes_ContainerStateWaiting": {
- "type": "object",
- "description": "",
- "properties": {
- "reason": {
- "type": "string",
- "description": "(brief) reason the container is not yet running"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ContainerStateWaiting"
- },
- "kubernetes_ContainerStatus": {
- "type": "object",
- "description": "",
- "properties": {
- "containerID": {
- "type": "string",
- "description": "container's ID in the format 'docker://\u003ccontainer_id\u003e'"
- },
- "image": {
- "type": "string",
- "description": "image of the container"
- },
- "imageID": {
- "type": "string",
- "description": "ID of the container's image"
- },
- "lastState": {
- "$ref": "#/definitions/kubernetes_ContainerState",
- "javaType": "io.fabric8.kubernetes.api.model.ContainerState"
- },
- "name": {
- "type": "string",
- "description": "name of the container; must be a DNS_LABEL and unique within the pod; cannot be updated",
- "maxLength": 63,
- "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
- },
- "ready": {
- "type": "boolean",
- "description": "specifies whether the container has passed its readiness probe"
- },
- "restartCount": {
- "type": "integer",
- "description": "the number of times the container has been restarted"
- },
- "state": {
- "$ref": "#/definitions/kubernetes_ContainerState",
- "javaType": "io.fabric8.kubernetes.api.model.ContainerState"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ContainerStatus"
- },
- "kubernetes_EmptyDirVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "medium": {
- "type": "string",
- "description": "type of storage used to back the volume; must be an empty string (default) or Memory"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.EmptyDirVolumeSource"
- },
- "kubernetes_EndpointAddress": {
- "type": "object",
- "description": "",
- "properties": {
- "IP": {
- "type": "string",
- "description": "IP address of the endpoint"
- },
- "targetRef": {
- "$ref": "#/definitions/kubernetes_ObjectReference",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectReference"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.EndpointAddress"
- },
- "kubernetes_EndpointPort": {
- "type": "object",
- "description": "",
- "properties": {
- "name": {
- "type": "string",
- "description": "name of this port",
- "maxLength": 63,
- "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
- },
- "port": {
- "type": "integer",
- "description": "port number of the endpoint"
- },
- "protocol": {
- "type": "string",
- "description": "protocol for this port; must be UDP or TCP; TCP if unspecified"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.EndpointPort"
- },
- "kubernetes_EndpointSubset": {
- "type": "object",
- "description": "",
- "properties": {
- "addresses": {
- "type": "array",
- "description": "IP addresses which offer the related ports",
- "items": {
- "$ref": "#/definitions/kubernetes_EndpointAddress",
- "javaType": "io.fabric8.kubernetes.api.model.EndpointAddress"
- }
- },
- "ports": {
- "type": "array",
- "description": "port numbers available on the related IP addresses",
- "items": {
- "$ref": "#/definitions/kubernetes_EndpointPort",
- "javaType": "io.fabric8.kubernetes.api.model.EndpointPort"
- }
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.EndpointSubset"
- },
- "kubernetes_Endpoints": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "Endpoints",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ObjectMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "subsets": {
- "type": "array",
- "description": "sets of addresses and ports that comprise a service",
- "items": {
- "$ref": "#/definitions/kubernetes_EndpointSubset",
- "javaType": "io.fabric8.kubernetes.api.model.EndpointSubset"
- }
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Endpoints",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.HasMetadata"
- ]
- },
- "kubernetes_EndpointsList": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "items": {
- "type": "array",
- "description": "list of endpoints",
- "items": {
- "$ref": "#/definitions/kubernetes_Endpoints",
- "javaType": "io.fabric8.kubernetes.api.model.Endpoints"
- }
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "EndpointsList",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.EndpointsList",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.KubernetesResource"
- ]
- },
- "kubernetes_EnvVar": {
- "type": "object",
- "description": "",
- "properties": {
- "name": {
- "type": "string",
- "description": "name of the environment variable; must be a C_IDENTIFIER",
- "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
- },
- "value": {
- "type": "string",
- "description": "value of the environment variable; defaults to empty string"
- },
- "valueFrom": {
- "$ref": "#/definitions/kubernetes_EnvVarSource",
- "javaType": "io.fabric8.kubernetes.api.model.EnvVarSource"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.EnvVar"
- },
- "kubernetes_EnvVarSource": {
- "type": "object",
- "description": "",
- "properties": {
- "fieldRef": {
- "$ref": "#/definitions/kubernetes_ObjectFieldSelector",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectFieldSelector"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.EnvVarSource"
- },
- "kubernetes_ExecAction": {
- "type": "object",
- "description": "",
- "properties": {
- "command": {
- "type": "array",
- "description": "command line to execute inside the container; working directory for the command is root ('/') in the container's file system; the command is exec'd",
- "items": {
- "type": "string",
- "description": "command line to execute inside the container; working directory for the command is root ('/') in the container's file system; the command is exec'd"
- }
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ExecAction"
- },
- "kubernetes_GCEPersistentDiskVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "fsType": {
- "type": "string",
- "description": "file system type to mount"
- },
- "partition": {
- "type": "integer",
- "description": "partition on the disk to mount (e.g."
- },
- "pdName": {
- "type": "string",
- "description": "unique name of the PD resource in GCE"
- },
- "readOnly": {
- "type": "boolean",
- "description": "read-only if true"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.GCEPersistentDiskVolumeSource"
- },
- "kubernetes_GitRepoVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "repository": {
- "type": "string",
- "description": "repository URL"
- },
- "revision": {
- "type": "string",
- "description": "commit hash for the specified revision"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.GitRepoVolumeSource"
- },
- "kubernetes_GlusterfsVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "endpoints": {
- "type": "string",
- "description": "gluster hosts endpoints name"
- },
- "path": {
- "type": "string",
- "description": "path to gluster volume"
- },
- "readOnly": {
- "type": "boolean",
- "description": "glusterfs volume to be mounted with read-only permissions"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.GlusterfsVolumeSource"
- },
- "kubernetes_HTTPGetAction": {
- "type": "object",
- "description": "",
- "properties": {
- "host": {
- "type": "string",
- "description": "hostname to connect to; defaults to pod IP"
- },
- "path": {
- "type": "string",
- "description": "path to access on the HTTP server"
- },
- "port": {
- "$ref": "#/definitions/kubernetes_util_IntOrString",
- "javaType": "io.fabric8.kubernetes.api.model.util.IntOrString"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.HTTPGetAction"
- },
- "kubernetes_Handler": {
- "type": "object",
- "description": "",
- "properties": {
- "exec": {
- "$ref": "#/definitions/kubernetes_ExecAction",
- "javaType": "io.fabric8.kubernetes.api.model.ExecAction"
- },
- "httpGet": {
- "$ref": "#/definitions/kubernetes_HTTPGetAction",
- "javaType": "io.fabric8.kubernetes.api.model.HTTPGetAction"
- },
- "tcpSocket": {
- "$ref": "#/definitions/kubernetes_TCPSocketAction",
- "javaType": "io.fabric8.kubernetes.api.model.TCPSocketAction"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Handler"
- },
- "kubernetes_HostPathVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "path": {
- "type": "string",
- "description": "path of the directory on the host"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.HostPathVolumeSource"
- },
- "kubernetes_ISCSIVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "fsType": {
- "type": "string",
- "description": "file system type to mount"
- },
- "iqn": {
- "type": "string",
- "description": "iSCSI Qualified Name"
- },
- "lun": {
- "type": "integer",
- "description": "iscsi target lun number"
- },
- "readOnly": {
- "type": "boolean",
- "description": "read-only if true"
- },
- "targetPortal": {
- "type": "string",
- "description": "iSCSI target portal"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ISCSIVolumeSource"
- },
- "kubernetes_Lifecycle": {
- "type": "object",
- "description": "",
- "properties": {
- "postStart": {
- "$ref": "#/definitions/kubernetes_Handler",
- "javaType": "io.fabric8.kubernetes.api.model.Handler"
- },
- "preStop": {
- "$ref": "#/definitions/kubernetes_Handler",
- "javaType": "io.fabric8.kubernetes.api.model.Handler"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Lifecycle"
- },
- "kubernetes_List": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "items": {
- "type": "array",
- "description": "list of objects",
- "items": {
- "$ref": "#/definitions/kubernetes_runtime_RawExtension",
- "javaType": "io.fabric8.kubernetes.api.model.HasMetadata"
- }
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "List",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.BaseKubernetesList",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.KubernetesResource"
- ]
- },
- "kubernetes_ListMeta": {
- "type": "object",
- "description": "",
- "properties": {
- "resourceVersion": {
- "type": "string",
- "description": "string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system"
- },
- "selfLink": {
- "type": "string",
- "description": "URL for the object; populated by the system"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- },
- "kubernetes_LoadBalancerIngress": {
- "type": "object",
- "description": "",
- "properties": {
- "hostname": {
- "type": "string",
- "description": "hostname of ingress point"
- },
- "ip": {
- "type": "string",
- "description": "IP address of ingress point"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.LoadBalancerIngress"
- },
- "kubernetes_LoadBalancerStatus": {
- "type": "object",
- "description": "",
- "properties": {
- "ingress": {
- "type": "array",
- "description": "load-balancer ingress points",
- "items": {
- "$ref": "#/definitions/kubernetes_LoadBalancerIngress",
- "javaType": "io.fabric8.kubernetes.api.model.LoadBalancerIngress"
- }
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.LoadBalancerStatus"
- },
- "kubernetes_LocalObjectReference": {
- "type": "object",
- "description": "",
- "properties": {
- "name": {
- "type": "string",
- "description": "name of the referent"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.LocalObjectReference"
- },
- "kubernetes_NFSVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "path": {
- "type": "string",
- "description": "the path that is exported by the NFS server"
- },
- "readOnly": {
- "type": "boolean",
- "description": "forces the NFS export to be mounted with read-only permissions"
- },
- "server": {
- "type": "string",
- "description": "the hostname or IP address of the NFS server"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NFSVolumeSource"
- },
- "kubernetes_Namespace": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "Namespace",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ObjectMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "spec": {
- "$ref": "#/definitions/kubernetes_NamespaceSpec",
- "javaType": "io.fabric8.kubernetes.api.model.NamespaceSpec"
- },
- "status": {
- "$ref": "#/definitions/kubernetes_NamespaceStatus",
- "javaType": "io.fabric8.kubernetes.api.model.NamespaceStatus"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Namespace",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.HasMetadata"
- ]
- },
- "kubernetes_NamespaceList": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "items": {
- "type": "array",
- "description": "items is the list of Namespace objects in the list",
- "items": {
- "$ref": "#/definitions/kubernetes_Namespace",
- "javaType": "io.fabric8.kubernetes.api.model.Namespace"
- }
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "NamespaceList",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NamespaceList",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.KubernetesResource"
- ]
- },
- "kubernetes_NamespaceSpec": {
- "type": "object",
- "description": "",
- "properties": {
- "finalizers": {
- "type": "array",
- "description": "an opaque list of values that must be empty to permanently remove object from storage",
- "items": {
- "type": "string",
- "description": "an opaque list of values that must be empty to permanently remove object from storage"
- }
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NamespaceSpec"
- },
- "kubernetes_NamespaceStatus": {
- "type": "object",
- "description": "",
- "properties": {
- "phase": {
- "type": "string",
- "description": "phase is the current lifecycle phase of the namespace"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NamespaceStatus"
- },
- "kubernetes_Node": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "Node",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ObjectMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "spec": {
- "$ref": "#/definitions/kubernetes_NodeSpec",
- "javaType": "io.fabric8.kubernetes.api.model.NodeSpec"
- },
- "status": {
- "$ref": "#/definitions/kubernetes_NodeStatus",
- "javaType": "io.fabric8.kubernetes.api.model.NodeStatus"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Node",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.HasMetadata"
- ]
- },
- "kubernetes_NodeAddress": {
- "type": "object",
- "description": "",
- "properties": {
- "address": {
- "type": "string",
- "description": "the node address"
- },
- "type": {
- "type": "string",
- "description": "node address type"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NodeAddress"
- },
- "kubernetes_NodeCondition": {
- "type": "object",
- "description": "",
- "properties": {
- "lastHeartbeatTime": {
- "type": "string",
- "description": "last time we got an update on a given condition"
- },
- "lastTransitionTime": {
- "type": "string",
- "description": "last time the condition transit from one status to another"
- },
- "message": {
- "type": "string",
- "description": "human readable message indicating details about last transition"
- },
- "reason": {
- "type": "string",
- "description": "(brief) reason for the condition's last transition"
- },
- "status": {
- "type": "string",
- "description": "status of the condition"
- },
- "type": {
- "type": "string",
- "description": "type of node condition"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NodeCondition"
- },
- "kubernetes_NodeList": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "items": {
- "type": "array",
- "description": "list of nodes",
- "items": {
- "$ref": "#/definitions/kubernetes_Node",
- "javaType": "io.fabric8.kubernetes.api.model.Node"
- }
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "NodeList",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NodeList",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.KubernetesResource"
- ]
- },
- "kubernetes_NodeSpec": {
- "type": "object",
- "description": "",
- "properties": {
- "externalID": {
- "type": "string",
- "description": "external ID assigned to the node by some machine database (e.g. a cloud provider). Defaults to node name when empty."
- },
- "podCIDR": {
- "type": "string",
- "description": "pod IP range assigned to the node"
- },
- "unschedulable": {
- "type": "boolean",
- "description": "disable pod scheduling on the node"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NodeSpec"
- },
- "kubernetes_NodeStatus": {
- "type": "object",
- "description": "",
- "properties": {
- "addresses": {
- "type": "array",
- "description": "list of addresses reachable to the node",
- "items": {
- "$ref": "#/definitions/kubernetes_NodeAddress",
- "javaType": "io.fabric8.kubernetes.api.model.NodeAddress"
- }
- },
- "capacity": {
- "type": "object",
- "description": "compute resource capacity of the node; http://docs.k8s.io/resources.md",
- "additionalProperties": {
- "$ref": "#/definitions/kubernetes_resource_Quantity",
- "javaType": "io.fabric8.kubernetes.api.model.resource.Quantity"
- },
- "javaType": "java.util.Map\u003cString,io.fabric8.kubernetes.api.model.resource.Quantity\u003e"
- },
- "conditions": {
- "type": "array",
- "description": "list of node conditions observed",
- "items": {
- "$ref": "#/definitions/kubernetes_NodeCondition",
- "javaType": "io.fabric8.kubernetes.api.model.NodeCondition"
- }
- },
- "nodeInfo": {
- "$ref": "#/definitions/kubernetes_NodeSystemInfo",
- "javaType": "io.fabric8.kubernetes.api.model.NodeSystemInfo"
- },
- "phase": {
- "type": "string",
- "description": "most recently observed lifecycle phase of the node"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NodeStatus"
- },
- "kubernetes_NodeSystemInfo": {
- "type": "object",
- "description": "",
- "properties": {
- "bootID": {
- "type": "string",
- "description": "boot id is the boot-id reported by the node"
- },
- "containerRuntimeVersion": {
- "type": "string",
- "description": "Container runtime version reported by the node through runtime remote API (e.g. docker://1.5.0)"
- },
- "kernelVersion": {
- "type": "string",
- "description": "Kernel version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64)"
- },
- "kubeProxyVersion": {
- "type": "string",
- "description": "Kube-proxy version reported by the node"
- },
- "kubeletVersion": {
- "type": "string",
- "description": "Kubelet version reported by the node"
- },
- "machineID": {
- "type": "string",
- "description": "machine-id reported by the node"
- },
- "osImage": {
- "type": "string",
- "description": "OS image used reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy))"
- },
- "systemUUID": {
- "type": "string",
- "description": "system-uuid reported by the node"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.NodeSystemInfo"
- },
- "kubernetes_ObjectFieldSelector": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "version of the schema that fieldPath is written in terms of; defaults to v1beta3"
- },
- "fieldPath": {
- "type": "string",
- "description": "path of the field to select in the specified API version"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ObjectFieldSelector"
- },
- "kubernetes_ObjectMeta": {
- "type": "object",
- "description": "",
- "properties": {
- "annotations": {
- "type": "object",
- "description": "map of string keys and values that can be used by external tooling to store and retrieve arbitrary metadata about objects",
- "additionalProperties": {
- "type": "string",
- "description": "map of string keys and values that can be used by external tooling to store and retrieve arbitrary metadata about objects"
- },
- "javaType": "java.util.Map\u003cString,String\u003e"
- },
- "creationTimestamp": {
- "type": "string",
- "description": "RFC 3339 date and time at which the object was created; populated by the system"
- },
- "deletionTimestamp": {
- "type": "string",
- "description": "RFC 3339 date and time at which the object will be deleted; populated by the system when a graceful deletion is requested"
- },
- "generateName": {
- "type": "string",
- "description": "an optional prefix to use to generate a unique name; has the same validation rules as name; optional"
- },
- "labels": {
- "type": "object",
- "description": "map of string keys and values that can be used to organize and categorize objects; may match selectors of replication controllers and services",
- "additionalProperties": {
- "type": "string",
- "description": "map of string keys and values that can be used to organize and categorize objects; may match selectors of replication controllers and services"
- },
- "javaType": "java.util.Map\u003cString,String\u003e"
- },
- "name": {
- "type": "string",
- "description": "string that identifies an object. Must be unique within a namespace; cannot be updated",
- "maxLength": 63,
- "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
- },
- "namespace": {
- "type": "string",
- "description": "namespace of the object; must be a DNS_LABEL; cannot be updated",
- "maxLength": 253,
- "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
- },
- "resourceVersion": {
- "type": "string",
- "description": "string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system"
- },
- "selfLink": {
- "type": "string",
- "description": "URL for the object; populated by the system"
- },
- "uid": {
- "type": "string",
- "description": "unique UUID across space and time; populated by the system; read-only"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "kubernetes_ObjectReference": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "API version of the referent"
- },
- "fieldPath": {
- "type": "string",
- "description": "if referring to a piece of an object instead of an entire object"
- },
- "kind": {
- "type": "string",
- "description": "kind of the referent"
- },
- "name": {
- "type": "string",
- "description": "name of the referent"
- },
- "namespace": {
- "type": "string",
- "description": "namespace of the referent"
- },
- "resourceVersion": {
- "type": "string",
- "description": "specific resourceVersion to which this reference is made"
- },
- "uid": {
- "type": "string",
- "description": "uid of the referent"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ObjectReference"
- },
- "kubernetes_PersistentVolumeClaimVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "claimName": {
- "type": "string",
- "description": "the name of the claim in the same namespace to be mounted as a volume"
- },
- "readOnly": {
- "type": "boolean",
- "description": "mount volume as read-only when true; default false"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.PersistentVolumeClaimVolumeSource"
- },
- "kubernetes_Pod": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "Pod",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ObjectMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "spec": {
- "$ref": "#/definitions/kubernetes_PodSpec",
- "javaType": "io.fabric8.kubernetes.api.model.PodSpec"
- },
- "status": {
- "$ref": "#/definitions/kubernetes_PodStatus",
- "javaType": "io.fabric8.kubernetes.api.model.PodStatus"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Pod",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.HasMetadata"
- ]
- },
- "kubernetes_PodCondition": {
- "type": "object",
- "description": "",
- "properties": {
- "status": {
- "type": "string",
- "description": "status of the condition"
- },
- "type": {
- "type": "string",
- "description": "kind of the condition"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.PodCondition"
- },
- "kubernetes_PodList": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "items": {
- "type": "array",
- "description": "list of pods",
- "items": {
- "$ref": "#/definitions/kubernetes_Pod",
- "javaType": "io.fabric8.kubernetes.api.model.Pod"
- }
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "PodList",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.PodList",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.KubernetesResource"
- ]
- },
- "kubernetes_PodSpec": {
- "type": "object",
- "description": "",
- "properties": {
- "activeDeadlineSeconds": {
- "type": "integer",
- "description": "",
- "javaType": "Long"
- },
- "containers": {
- "type": "array",
- "description": "list of containers belonging to the pod; cannot be updated; containers cannot currently be added or removed; there must be at least one container in a Pod",
- "items": {
- "$ref": "#/definitions/kubernetes_Container",
- "javaType": "io.fabric8.kubernetes.api.model.Container"
- }
- },
- "dnsPolicy": {
- "type": "string",
- "description": "DNS policy for containers within the pod; one of 'ClusterFirst' or 'Default'"
- },
- "host": {
- "type": "string",
- "description": "host requested for this pod"
- },
- "hostNetwork": {
- "type": "boolean",
- "description": "host networking requested for this pod"
- },
- "imagePullSecrets": {
- "type": "array",
- "description": "list of references to secrets in the same namespace available for pulling the container images",
- "items": {
- "$ref": "#/definitions/kubernetes_LocalObjectReference",
- "javaType": "io.fabric8.kubernetes.api.model.LocalObjectReference"
- }
- },
- "nodeSelector": {
- "type": "object",
- "description": "selector which must match a node's labels for the pod to be scheduled on that node",
- "additionalProperties": {
- "type": "string",
- "description": "selector which must match a node's labels for the pod to be scheduled on that node"
- },
- "javaType": "java.util.Map\u003cString,String\u003e"
- },
- "restartPolicy": {
- "type": "string",
- "description": "restart policy for all containers within the pod; one of RestartPolicyAlways"
- },
- "serviceAccount": {
- "type": "string",
- "description": "name of the ServiceAccount to use to run this pod"
- },
- "terminationGracePeriodSeconds": {
- "type": "integer",
- "description": "optional duration in seconds the pod needs to terminate gracefully; may be decreased in delete request; value must be non-negative integer; the value zero indicates delete immediately; if this value is not set",
- "javaType": "Long"
- },
- "volumes": {
- "type": "array",
- "description": "list of volumes that can be mounted by containers belonging to the pod",
- "items": {
- "$ref": "#/definitions/kubernetes_Volume",
- "javaType": "io.fabric8.kubernetes.api.model.Volume"
- }
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.PodSpec"
- },
- "kubernetes_PodStatus": {
- "type": "object",
- "description": "",
- "properties": {
- "Condition": {
- "type": "array",
- "description": "current service state of pod",
- "items": {
- "$ref": "#/definitions/kubernetes_PodCondition",
- "javaType": "io.fabric8.kubernetes.api.model.PodCondition"
- }
- },
- "containerStatuses": {
- "type": "array",
- "description": "list of container statuses",
- "items": {
- "$ref": "#/definitions/kubernetes_ContainerStatus",
- "javaType": "io.fabric8.kubernetes.api.model.ContainerStatus"
- }
- },
- "hostIP": {
- "type": "string",
- "description": "IP address of the host to which the pod is assigned; empty if not yet scheduled"
- },
- "message": {
- "type": "string",
- "description": "human readable message indicating details about why the pod is in this condition"
- },
- "phase": {
- "type": "string",
- "description": "current condition of the pod."
- },
- "podIP": {
- "type": "string",
- "description": "IP address allocated to the pod; routable at least within the cluster; empty if not yet allocated"
- },
- "startTime": {
- "type": "string",
- "description": "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod."
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.PodStatus"
- },
- "kubernetes_PodTemplateSpec": {
- "type": "object",
- "description": "",
- "properties": {
- "metadata": {
- "$ref": "#/definitions/kubernetes_ObjectMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "spec": {
- "$ref": "#/definitions/kubernetes_PodSpec",
- "javaType": "io.fabric8.kubernetes.api.model.PodSpec"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.PodTemplateSpec"
- },
- "kubernetes_Probe": {
- "type": "object",
- "description": "",
- "properties": {
- "exec": {
- "$ref": "#/definitions/kubernetes_ExecAction",
- "javaType": "io.fabric8.kubernetes.api.model.ExecAction"
- },
- "httpGet": {
- "$ref": "#/definitions/kubernetes_HTTPGetAction",
- "javaType": "io.fabric8.kubernetes.api.model.HTTPGetAction"
- },
- "initialDelaySeconds": {
- "type": "integer",
- "description": "number of seconds after the container has started before liveness probes are initiated",
- "javaType": "Long"
- },
- "tcpSocket": {
- "$ref": "#/definitions/kubernetes_TCPSocketAction",
- "javaType": "io.fabric8.kubernetes.api.model.TCPSocketAction"
- },
- "timeoutSeconds": {
- "type": "integer",
- "description": "number of seconds after which liveness probes timeout; defaults to 1 second",
- "javaType": "Long"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Probe"
- },
- "kubernetes_RBDVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "fsType": {
- "type": "string",
- "description": "file system type to mount"
- },
- "image": {
- "type": "string",
- "description": "rados image name"
- },
- "keyring": {
- "type": "string",
- "description": "keyring is the path to key ring for rados user; default is /etc/ceph/keyring; optional"
- },
- "monitors": {
- "type": "array",
- "description": "a collection of Ceph monitors",
- "items": {
- "type": "string",
- "description": "a collection of Ceph monitors"
- }
- },
- "pool": {
- "type": "string",
- "description": "rados pool name; default is rbd; optional"
- },
- "readOnly": {
- "type": "boolean",
- "description": "rbd volume to be mounted with read-only permissions"
- },
- "secretRef": {
- "$ref": "#/definitions/kubernetes_LocalObjectReference",
- "javaType": "io.fabric8.kubernetes.api.model.LocalObjectReference"
- },
- "user": {
- "type": "string",
- "description": "rados user name; default is admin; optional"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.RBDVolumeSource"
- },
- "kubernetes_ReplicationController": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "ReplicationController",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ObjectMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "spec": {
- "$ref": "#/definitions/kubernetes_ReplicationControllerSpec",
- "javaType": "io.fabric8.kubernetes.api.model.ReplicationControllerSpec"
- },
- "status": {
- "$ref": "#/definitions/kubernetes_ReplicationControllerStatus",
- "javaType": "io.fabric8.kubernetes.api.model.ReplicationControllerStatus"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ReplicationController",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.HasMetadata"
- ]
- },
- "kubernetes_ReplicationControllerList": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "items": {
- "type": "array",
- "description": "list of replication controllers",
- "items": {
- "$ref": "#/definitions/kubernetes_ReplicationController",
- "javaType": "io.fabric8.kubernetes.api.model.ReplicationController"
- }
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "ReplicationControllerList",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ReplicationControllerList",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.KubernetesResource"
- ]
- },
- "kubernetes_ReplicationControllerSpec": {
- "type": "object",
- "description": "",
- "properties": {
- "replicas": {
- "type": "integer",
- "description": "number of replicas desired"
- },
- "selector": {
- "type": "object",
- "description": "label keys and values that must match in order to be controlled by this replication controller",
- "additionalProperties": {
- "type": "string",
- "description": "label keys and values that must match in order to be controlled by this replication controller"
- },
- "javaType": "java.util.Map\u003cString,String\u003e"
- },
- "template": {
- "$ref": "#/definitions/kubernetes_PodTemplateSpec",
- "javaType": "io.fabric8.kubernetes.api.model.PodTemplateSpec"
- },
- "templateRef": {
- "$ref": "#/definitions/kubernetes_ObjectReference",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectReference"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ReplicationControllerSpec"
- },
- "kubernetes_ReplicationControllerStatus": {
- "type": "object",
- "description": "",
- "properties": {
- "replicas": {
- "type": "integer",
- "description": "most recently oberved number of replicas"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ReplicationControllerStatus"
- },
- "kubernetes_ResourceRequirements": {
- "type": "object",
- "description": "",
- "properties": {
- "limits": {
- "type": "object",
- "description": "Maximum amount of compute resources allowed",
- "additionalProperties": {
- "$ref": "#/definitions/kubernetes_resource_Quantity",
- "javaType": "io.fabric8.kubernetes.api.model.resource.Quantity"
- },
- "javaType": "java.util.Map\u003cString,io.fabric8.kubernetes.api.model.resource.Quantity\u003e"
- },
- "requests": {
- "type": "object",
- "description": "Minimum amount of resources requested; requests are honored only for persistent volumes as of now",
- "additionalProperties": {
- "$ref": "#/definitions/kubernetes_resource_Quantity",
- "javaType": "io.fabric8.kubernetes.api.model.resource.Quantity"
- },
- "javaType": "java.util.Map\u003cString,io.fabric8.kubernetes.api.model.resource.Quantity\u003e"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ResourceRequirements"
- },
- "kubernetes_SELinuxOptions": {
- "type": "object",
- "description": "",
- "properties": {
- "level": {
- "type": "string",
- "description": "the level label to apply to the container"
- },
- "role": {
- "type": "string",
- "description": "the role label to apply to the container"
- },
- "type": {
- "type": "string",
- "description": "the type label to apply to the container"
- },
- "user": {
- "type": "string",
- "description": "the user label to apply to the container"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.SELinuxOptions"
- },
- "kubernetes_Secret": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "data": {
- "type": "object",
- "description": "data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading dot followed by valid DNS_SUBDOMAIN. Each value must be a base64 encoded string as described in https://tools.ietf.org/html/rfc4648#section-4",
- "additionalProperties": {
- "type": "array",
- "description": "data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading dot followed by valid DNS_SUBDOMAIN. Each value must be a base64 encoded string as described in https://tools.ietf.org/html/rfc4648#section-4",
- "items": {
- "type": "integer",
- "description": "data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading dot followed by valid DNS_SUBDOMAIN. Each value must be a base64 encoded string as described in https://tools.ietf.org/html/rfc4648#section-4"
- }
- },
- "javaType": "java.util.Map\u003cString,String\u003e"
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "Secret",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ObjectMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "type": {
- "type": "string",
- "description": "type facilitates programmatic handling of secret data"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Secret",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.HasMetadata"
- ]
- },
- "kubernetes_SecretList": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "items": {
- "type": "array",
- "description": "items is a list of secret objects",
- "items": {
- "$ref": "#/definitions/kubernetes_Secret",
- "javaType": "io.fabric8.kubernetes.api.model.Secret"
- }
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "SecretList",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.SecretList",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.KubernetesResource"
- ]
- },
- "kubernetes_SecretVolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "secretName": {
- "type": "string",
- "description": "secretName is the name of a secret in the pod's namespace"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.SecretVolumeSource"
- },
- "kubernetes_SecurityContext": {
- "type": "object",
- "description": "",
- "properties": {
- "capabilities": {
- "$ref": "#/definitions/kubernetes_Capabilities",
- "javaType": "io.fabric8.kubernetes.api.model.Capabilities"
- },
- "privileged": {
- "type": "boolean",
- "description": "run the container in privileged mode"
- },
- "runAsUser": {
- "type": "integer",
- "description": "the user id that runs the first process in the container",
- "javaType": "Long"
- },
- "seLinuxOptions": {
- "$ref": "#/definitions/kubernetes_SELinuxOptions",
- "javaType": "io.fabric8.kubernetes.api.model.SELinuxOptions"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.SecurityContext"
- },
- "kubernetes_Service": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "Service",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ObjectMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "spec": {
- "$ref": "#/definitions/kubernetes_ServiceSpec",
- "javaType": "io.fabric8.kubernetes.api.model.ServiceSpec"
- },
- "status": {
- "$ref": "#/definitions/kubernetes_ServiceStatus",
- "javaType": "io.fabric8.kubernetes.api.model.ServiceStatus"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Service",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.HasMetadata"
- ]
- },
- "kubernetes_ServiceAccount": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "ServiceAccount",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ObjectMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta"
- },
- "secrets": {
- "type": "array",
- "description": "list of secrets that can be used by pods running as this service account",
- "items": {
- "$ref": "#/definitions/kubernetes_ObjectReference",
- "javaType": "io.fabric8.kubernetes.api.model.ObjectReference"
- }
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ServiceAccount",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.HasMetadata"
- ]
- },
- "kubernetes_ServiceAccountList": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "items": {
- "type": "array",
- "description": "list of ServiceAccounts",
- "items": {
- "$ref": "#/definitions/kubernetes_ServiceAccount",
- "javaType": "io.fabric8.kubernetes.api.model.ServiceAccount"
- }
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "ServiceAccountList",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ServiceAccountList",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.KubernetesResource"
- ]
- },
- "kubernetes_ServiceList": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "items": {
- "type": "array",
- "description": "list of services",
- "items": {
- "$ref": "#/definitions/kubernetes_Service",
- "javaType": "io.fabric8.kubernetes.api.model.Service"
- }
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "ServiceList",
- "required": true
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.ListMeta"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ServiceList",
- "javaInterfaces": [
- "io.fabric8.kubernetes.api.model.KubernetesResource"
- ]
- },
- "kubernetes_ServicePort": {
- "type": "object",
- "description": "",
- "properties": {
- "name": {
- "type": "string",
- "description": "the name of this port; optional if only one port is defined",
- "maxLength": 63,
- "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
- },
- "nodePort": {
- "type": "integer",
- "description": "the port on each node on which this service is exposed"
- },
- "port": {
- "type": "integer",
- "description": "the port number that is exposed"
- },
- "protocol": {
- "type": "string",
- "description": "the protocol used by this port; must be UDP or TCP; TCP if unspecified"
- },
- "targetPort": {
- "$ref": "#/definitions/kubernetes_util_IntOrString",
- "javaType": "io.fabric8.kubernetes.api.model.util.IntOrString"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ServicePort"
- },
- "kubernetes_ServiceSpec": {
- "type": "object",
- "description": "",
- "properties": {
- "createExternalLoadBalancer": {
- "type": "boolean",
- "description": "set up a cloud-provider-specific load balancer on an external IP"
- },
- "portalIP": {
- "type": "string",
- "description": ""
- },
- "ports": {
- "type": "array",
- "description": "ports exposed by the service",
- "items": {
- "$ref": "#/definitions/kubernetes_ServicePort",
- "javaType": "io.fabric8.kubernetes.api.model.ServicePort"
- }
- },
- "publicIPs": {
- "type": "array",
- "description": "deprecated. externally visible IPs (e.g. load balancers) that should be proxied to this service",
- "items": {
- "type": "string",
- "description": "deprecated. externally visible IPs (e.g. load balancers) that should be proxied to this service"
- }
- },
- "selector": {
- "type": "object",
- "description": "label keys and values that must match in order to receive traffic for this service; if empty",
- "additionalProperties": {
- "type": "string",
- "description": "label keys and values that must match in order to receive traffic for this service; if empty"
- },
- "javaType": "java.util.Map\u003cString,String\u003e"
- },
- "sessionAffinity": {
- "type": "string",
- "description": "enable client IP based session affinity; must be ClientIP or None; defaults to None"
- },
- "type": {
- "type": "string",
- "description": "type of this service; must be ClusterIP"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ServiceSpec"
- },
- "kubernetes_ServiceStatus": {
- "type": "object",
- "description": "",
- "properties": {
- "loadBalancer": {
- "$ref": "#/definitions/kubernetes_LoadBalancerStatus",
- "javaType": "io.fabric8.kubernetes.api.model.LoadBalancerStatus"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.ServiceStatus"
- },
- "kubernetes_TCPSocketAction": {
- "type": "object",
- "description": "",
- "properties": {
- "port": {
- "$ref": "#/definitions/kubernetes_util_IntOrString",
- "javaType": "io.fabric8.kubernetes.api.model.util.IntOrString"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.TCPSocketAction"
- },
- "kubernetes_TypeMeta": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "version of the schema the object should have"
- },
- "kind": {
- "type": "string",
- "description": "kind of object"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.TypeMeta"
- },
- "kubernetes_Volume": {
- "type": "object",
- "description": "",
- "properties": {
- "awsElasticBlockStore": {
- "$ref": "#/definitions/kubernetes_AWSElasticBlockStoreVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.AWSElasticBlockStoreVolumeSource"
- },
- "emptyDir": {
- "$ref": "#/definitions/kubernetes_EmptyDirVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.EmptyDirVolumeSource"
- },
- "gcePersistentDisk": {
- "$ref": "#/definitions/kubernetes_GCEPersistentDiskVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.GCEPersistentDiskVolumeSource"
- },
- "gitRepo": {
- "$ref": "#/definitions/kubernetes_GitRepoVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.GitRepoVolumeSource"
- },
- "glusterfs": {
- "$ref": "#/definitions/kubernetes_GlusterfsVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.GlusterfsVolumeSource"
- },
- "hostPath": {
- "$ref": "#/definitions/kubernetes_HostPathVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.HostPathVolumeSource"
- },
- "iscsi": {
- "$ref": "#/definitions/kubernetes_ISCSIVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.ISCSIVolumeSource"
- },
- "name": {
- "type": "string",
- "description": "volume name; must be a DNS_LABEL and unique within the pod",
- "maxLength": 63,
- "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
- },
- "nfs": {
- "$ref": "#/definitions/kubernetes_NFSVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.NFSVolumeSource"
- },
- "persistentVolumeClaim": {
- "$ref": "#/definitions/kubernetes_PersistentVolumeClaimVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.PersistentVolumeClaimVolumeSource"
- },
- "rbd": {
- "$ref": "#/definitions/kubernetes_RBDVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.RBDVolumeSource"
- },
- "secret": {
- "$ref": "#/definitions/kubernetes_SecretVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.SecretVolumeSource"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.Volume"
- },
- "kubernetes_VolumeMount": {
- "type": "object",
- "description": "",
- "properties": {
- "mountPath": {
- "type": "string",
- "description": "path within the container at which the volume should be mounted"
- },
- "name": {
- "type": "string",
- "description": "name of the volume to mount"
- },
- "readOnly": {
- "type": "boolean",
- "description": "mounted read-only if true"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.VolumeMount"
- },
- "kubernetes_VolumeSource": {
- "type": "object",
- "description": "",
- "properties": {
- "awsElasticBlockStore": {
- "$ref": "#/definitions/kubernetes_AWSElasticBlockStoreVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.AWSElasticBlockStoreVolumeSource"
- },
- "emptyDir": {
- "$ref": "#/definitions/kubernetes_EmptyDirVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.EmptyDirVolumeSource"
- },
- "gcePersistentDisk": {
- "$ref": "#/definitions/kubernetes_GCEPersistentDiskVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.GCEPersistentDiskVolumeSource"
- },
- "gitRepo": {
- "$ref": "#/definitions/kubernetes_GitRepoVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.GitRepoVolumeSource"
- },
- "glusterfs": {
- "$ref": "#/definitions/kubernetes_GlusterfsVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.GlusterfsVolumeSource"
- },
- "hostPath": {
- "$ref": "#/definitions/kubernetes_HostPathVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.HostPathVolumeSource"
- },
- "iscsi": {
- "$ref": "#/definitions/kubernetes_ISCSIVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.ISCSIVolumeSource"
- },
- "nfs": {
- "$ref": "#/definitions/kubernetes_NFSVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.NFSVolumeSource"
- },
- "persistentVolumeClaim": {
- "$ref": "#/definitions/kubernetes_PersistentVolumeClaimVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.PersistentVolumeClaimVolumeSource"
- },
- "rbd": {
- "$ref": "#/definitions/kubernetes_RBDVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.RBDVolumeSource"
- },
- "secret": {
- "$ref": "#/definitions/kubernetes_SecretVolumeSource",
- "javaType": "io.fabric8.kubernetes.api.model.SecretVolumeSource"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.VolumeSource"
- },
- "kubernetes_base_ListMeta": {
- "type": "object",
- "description": "",
- "properties": {
- "resourceVersion": {
- "type": "string",
- "description": ""
- },
- "selfLink": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.base.ListMeta"
- },
- "kubernetes_base_Status": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": "",
- "default": "v1beta3",
- "required": true,
- "enum": [
- "v1beta3",
- "v1"
- ]
- },
- "code": {
- "type": "integer",
- "description": ""
- },
- "details": {
- "$ref": "#/definitions/kubernetes_base_StatusDetails",
- "javaType": "io.fabric8.kubernetes.api.model.base.StatusDetails"
- },
- "kind": {
- "type": "string",
- "description": "",
- "default": "Status",
- "required": true
- },
- "message": {
- "type": "string",
- "description": ""
- },
- "metadata": {
- "$ref": "#/definitions/kubernetes_base_ListMeta",
- "javaType": "io.fabric8.kubernetes.api.model.base.ListMeta"
- },
- "reason": {
- "type": "string",
- "description": ""
- },
- "status": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.base.Status"
- },
- "kubernetes_base_StatusCause": {
- "type": "object",
- "description": "",
- "properties": {
- "field": {
- "type": "string",
- "description": ""
- },
- "message": {
- "type": "string",
- "description": ""
- },
- "reason": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.base.StatusCause"
- },
- "kubernetes_base_StatusDetails": {
- "type": "object",
- "description": "",
- "properties": {
- "causes": {
- "type": "array",
- "description": "",
- "items": {
- "$ref": "#/definitions/kubernetes_base_StatusCause",
- "javaType": "io.fabric8.kubernetes.api.model.base.StatusCause"
- }
- },
- "id": {
- "type": "string",
- "description": ""
- },
- "kind": {
- "type": "string",
- "description": ""
- },
- "retryAfterSeconds": {
- "type": "integer",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.base.StatusDetails"
- },
- "kubernetes_base_TypeMeta": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": ""
- },
- "kind": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.base.TypeMeta"
- },
- "kubernetes_config_AuthInfo": {
- "type": "object",
- "description": "",
- "properties": {
- "client-certificate": {
- "type": "string",
- "description": ""
- },
- "client-certificate-data": {
- "type": "array",
- "description": "",
- "items": {
- "type": "integer",
- "description": ""
- }
- },
- "client-key": {
- "type": "string",
- "description": ""
- },
- "client-key-data": {
- "type": "array",
- "description": "",
- "items": {
- "type": "integer",
- "description": ""
- }
- },
- "extensions": {
- "type": "array",
- "description": "",
- "items": {
- "$ref": "#/definitions/kubernetes_config_NamedExtension",
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedExtension"
- }
- },
- "password": {
- "type": "string",
- "description": ""
- },
- "token": {
- "type": "string",
- "description": ""
- },
- "username": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.config.AuthInfo"
- },
- "kubernetes_config_Cluster": {
- "type": "object",
- "description": "",
- "properties": {
- "api-version": {
- "type": "string",
- "description": ""
- },
- "certificate-authority": {
- "type": "string",
- "description": ""
- },
- "certificate-authority-data": {
- "type": "array",
- "description": "",
- "items": {
- "type": "integer",
- "description": ""
- }
- },
- "extensions": {
- "type": "array",
- "description": "",
- "items": {
- "$ref": "#/definitions/kubernetes_config_NamedExtension",
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedExtension"
- }
- },
- "insecure-skip-tls-verify": {
- "type": "boolean",
- "description": ""
- },
- "server": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.config.Cluster"
- },
- "kubernetes_config_Config": {
- "type": "object",
- "description": "",
- "properties": {
- "apiVersion": {
- "type": "string",
- "description": ""
- },
- "clusters": {
- "type": "array",
- "description": "",
- "items": {
- "$ref": "#/definitions/kubernetes_config_NamedCluster",
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedCluster"
- }
- },
- "contexts": {
- "type": "array",
- "description": "",
- "items": {
- "$ref": "#/definitions/kubernetes_config_NamedContext",
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedContext"
- }
- },
- "current-context": {
- "type": "string",
- "description": ""
- },
- "extensions": {
- "type": "array",
- "description": "",
- "items": {
- "$ref": "#/definitions/kubernetes_config_NamedExtension",
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedExtension"
- }
- },
- "kind": {
- "type": "string",
- "description": ""
- },
- "preferences": {
- "$ref": "#/definitions/kubernetes_config_Preferences",
- "javaType": "io.fabric8.kubernetes.api.model.config.Preferences"
- },
- "users": {
- "type": "array",
- "description": "",
- "items": {
- "$ref": "#/definitions/kubernetes_config_NamedAuthInfo",
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedAuthInfo"
- }
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.config.Config"
- },
- "kubernetes_config_Context": {
- "type": "object",
- "description": "",
- "properties": {
- "cluster": {
- "type": "string",
- "description": ""
- },
- "extensions": {
- "type": "array",
- "description": "",
- "items": {
- "$ref": "#/definitions/kubernetes_config_NamedExtension",
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedExtension"
- }
- },
- "namespace": {
- "type": "string",
- "description": ""
- },
- "user": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.config.Context"
- },
- "kubernetes_config_NamedAuthInfo": {
- "type": "object",
- "description": "",
- "properties": {
- "name": {
- "type": "string",
- "description": ""
- },
- "user": {
- "$ref": "#/definitions/kubernetes_config_AuthInfo",
- "javaType": "io.fabric8.kubernetes.api.model.config.AuthInfo"
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedAuthInfo"
- },
- "kubernetes_config_NamedCluster": {
- "type": "object",
- "description": "",
- "properties": {
- "cluster": {
- "$ref": "#/definitions/kubernetes_config_Cluster",
- "javaType": "io.fabric8.kubernetes.api.model.config.Cluster"
- },
- "name": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedCluster"
- },
- "kubernetes_config_NamedContext": {
- "type": "object",
- "description": "",
- "properties": {
- "context": {
- "$ref": "#/definitions/kubernetes_config_Context",
- "javaType": "io.fabric8.kubernetes.api.model.config.Context"
- },
- "name": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedContext"
- },
- "kubernetes_config_NamedExtension": {
- "type": "object",
- "description": "",
- "properties": {
- "extension": {
- "$ref": "#/definitions/kubernetes_runtime_RawExtension",
- "javaType": "io.fabric8.kubernetes.api.model.HasMetadata"
- },
- "name": {
- "type": "string",
- "description": ""
- }
- },
- "additionalProperties": true,
- "javaType": "io.fabric8.kubernetes.api.model.config.NamedExtension"
- },
- "kubernetes_config_Preferences": {
- "type": "object",
- "description": "",
- "properties": {
- "colors": {
- "type": "boolean",
- "description": ""
- },
- "extensions": {
- "type": "array",
- "description": "",
- "items": {
- "$ref": "#/definition
<TRUNCATED>
[33/50] [abbrv] stratos git commit: Merge branch 'tenant-isolation'
of https://github.com/Thanu/stratos into tenant-isolation
Posted by ga...@apache.org.
Merge branch 'tenant-isolation' of https://github.com/Thanu/stratos into tenant-isolation
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1156a56e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1156a56e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1156a56e
Branch: refs/heads/master
Commit: 1156a56e591f7119fb304c67ce7c53fc267b7e9b
Parents: 7194cb6 f10b71e
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 28 15:04:13 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 28 15:04:13 2015 +0530
----------------------------------------------------------------------
.../publisher/ThriftClientConfigParser.java | 9 ++++--
.../statistics/publisher/ThriftClientInfo.java | 8 +++++
.../publisher/ThriftStatisticsPublisher.java | 6 ++--
.../cep/WSO2CEPHealthStatisticsPublisher.java | 3 +-
.../cep/WSO2CEPInFlightRequestPublisher.java | 3 +-
.../test/ThriftClientConfigParserTest.java | 2 ++
.../src/test/resources/thrift-client-config.xml | 2 ++
.../HealthStatsEventFormatter.xml | 30 -------------------
.../eventformatters/RIFEventFormatter.xml | 31 --------------------
.../DASDefaultWSO2EventOutputAdaptor.xml | 29 ------------------
products/stratos/conf/thrift-client-config.xml | 2 ++
11 files changed, 25 insertions(+), 100 deletions(-)
----------------------------------------------------------------------
[14/50] [abbrv] stratos git commit: Merge branch 'tenant-isolation'
of https://github.com/Thanu/stratos into tenant-isolation
Posted by ga...@apache.org.
Merge branch 'tenant-isolation' of https://github.com/Thanu/stratos into tenant-isolation
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/260f738b
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/260f738b
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/260f738b
Branch: refs/heads/master
Commit: 260f738b5d45b6e8f399f5a791721442bef254a0
Parents: c2abc57 81ec4e2
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 21 16:47:17 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 21 16:47:17 2015 +0530
----------------------------------------------------------------------
.../publisher/ThriftClientConfig.java | 34 +++++++--
.../publisher/ThriftClientConfigParser.java | 77 ++++++++++++++------
.../publisher/ThriftStatisticsPublisher.java | 9 ++-
.../cep/WSO2CEPHealthStatisticsPublisher.java | 5 +-
.../cep/WSO2CEPInFlightRequestPublisher.java | 3 +-
.../test/ThriftClientConfigParserTest.java | 18 +++--
.../src/test/resources/thrift-client-config.xml | 20 +++--
products/stratos/conf/thrift-client-config.xml | 20 +++--
8 files changed, 134 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/260f738b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/260f738b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPInFlightRequestPublisher.java
----------------------------------------------------------------------
[31/50] [abbrv] stratos git commit: Updating kubernetes service port
to node port to be used by the access URLs
Posted by ga...@apache.org.
Updating kubernetes service port to node port to be used by the access URLs
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/573b7038
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/573b7038
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/573b7038
Branch: refs/heads/master
Commit: 573b703801d3127c4afe8e9471140e29db1067d7
Parents: ff1b1a6
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Jul 26 14:52:19 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Thu Aug 27 16:43:36 2015 +0530
----------------------------------------------------------------------
.../stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/573b7038/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
index 4dcc472..23c5514 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
@@ -546,7 +546,7 @@ public class KubernetesIaas extends Iaas {
String[] minionPublicIPArray = minionPublicIPList.toArray(new String[minionPublicIPList.size()]);
kubernetesService.setPublicIPs(minionPublicIPArray);
kubernetesService.setProtocol(clusterPortMapping.getProtocol());
- kubernetesService.setPort(service.getSpec().getPorts().get(0).getPort());
+ kubernetesService.setPort(service.getSpec().getPorts().get(0).getNodePort());
kubernetesService.setContainerPort(containerPort);
kubernetesServices.add(kubernetesService);
[20/50] [abbrv] stratos git commit: Upgrading fabric8 kubernetes api
version to 2.2.16 and removing forked code
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/InlineTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/InlineTest.java b/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/InlineTest.java
deleted file mode 100644
index 72e6617..0000000
--- a/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/InlineTest.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package io.fabric8.kubernetes.api.model;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class InlineTest {
-
- @Test
- public void testIntOrString() throws JsonProcessingException {
- ServicePort port = new ServicePortBuilder().withNewTargetPort(2181).build();
- assertEquals(2181, port.getTargetPort().getIntVal().intValue());
-
- port = new ServicePortBuilder().withNewTargetPort("2181").build();
- assertEquals("2181", port.getTargetPort().getStrVal());
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/KubernetesListTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/KubernetesListTest.java b/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/KubernetesListTest.java
deleted file mode 100644
index e7b994d..0000000
--- a/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/KubernetesListTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package io.fabric8.kubernetes.api.model;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import org.hamcrest.CoreMatchers;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-public class KubernetesListTest {
-
- @Test
- public void testDefaultValues() throws JsonProcessingException {
- Service service = new ServiceBuilder()
- .withNewMetadata()
- .withName("test-service")
- .endMetadata()
- .build();
- assertNotNull(service.getApiVersion());
- assertEquals(service.getKind(), "Service");
-
- ReplicationController replicationController = new ReplicationControllerBuilder()
- .withNewMetadata()
- .withName("test-controller")
- .endMetadata()
- .build();
- assertNotNull(replicationController.getApiVersion());
- assertEquals(replicationController.getKind(), "ReplicationController");
-
- KubernetesList kubernetesList = new KubernetesListBuilder()
- .addNewServiceItem()
- .withNewMetadata()
- .withName("test-service")
- .endMetadata()
- .and()
- .addNewReplicationControllerItem()
- .withNewMetadata()
- .withName("test-controller")
- .endMetadata()
- .and()
- .build();
-
- assertNotNull(kubernetesList.getApiVersion());
- assertEquals(kubernetesList.getKind(), "List");
- assertThat(kubernetesList.getItems(), CoreMatchers.hasItem(service));
- assertThat(kubernetesList.getItems(), CoreMatchers.hasItem(replicationController));
- }
-
- @Test
- public void testVisitor() throws JsonProcessingException {
- KubernetesList list = new KubernetesListBuilder()
- .addNewPodItem()
- .withNewSpec()
- .addNewContainer()
- .withName("my-container")
- .withImage("my/image")
- .endContainer()
- .endSpec()
- .and()
- .build();
-
- list = new KubernetesListBuilder(list).accept(new io.fabric8.common.Visitor() {
- public void visit(Object item) {
- if (item instanceof io.fabric8.kubernetes.api.model.PodSpecBuilder) {
- ((io.fabric8.kubernetes.api.model.PodSpecBuilder)item).addNewContainer()
- .withName("other-container")
- .withImage("other/image")
- .and();
- }
- }
- }).build();
- }
-
-
- @Test
- public void testDefaultNullValues() throws JsonProcessingException {
- Container container = new ContainerBuilder().build();
- assertNull(container.getLifecycle());
- assertNull(container.getLivenessProbe());
-
-
- Pod pod = new PodBuilder().build();
- assertNull(pod.getSpec());
- assertNull(pod.getStatus());
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/UnmarshallTest.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/UnmarshallTest.java b/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/UnmarshallTest.java
deleted file mode 100644
index cd6d9df..0000000
--- a/dependencies/fabric8/kubernetes-model/src/test/java/io/fabric8/kubernetes/api/model/UnmarshallTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package io.fabric8.kubernetes.api.model;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import io.fabric8.common.Visitor;
-import io.fabric8.kubernetes.api.model.resource.Quantity;
-import io.fabric8.openshift.api.model.template.Template;
-import io.fabric8.openshift.api.model.template.TemplateBuilder;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static org.junit.Assert.assertEquals;
-
-public class UnmarshallTest {
-
- @Test
- public void testUnmarshallInt64ToLong() throws Exception {
- ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally
- Pod pod = (Pod) mapper.readValue(getClass().getResourceAsStream("/valid-pod.json"), KubernetesResource.class);
- assertEquals(pod.getSpec().getContainers().get(0).getResources().getLimits().get("memory"), new Quantity("5Mi"));
- assertEquals(pod.getSpec().getContainers().get(0).getResources().getLimits().get("cpu"), new Quantity("1"));
- }
-
- @Test
- public void testUnmarshallWithVisitors() throws Exception {
- ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally
- KubernetesList list = (KubernetesList) mapper.readValue(getClass().getResourceAsStream("/simple-list.json"), KubernetesResource.class);
- final AtomicInteger integer = new AtomicInteger();
- new KubernetesListBuilder(list).accept(new Visitor() {
- public void visit(Object o) {
- integer.incrementAndGet();
- }
- });
-
- //We just want to make sure that it visits nested objects when deserialization from json is used.
- // The exact number is volatile so we just care about the minimum number of objects (list, pod and service).
- Assert.assertTrue(integer.intValue() >= 3);
-
-
- Template template = (Template) mapper.readValue(getClass().getResourceAsStream("/simple-template.json"), KubernetesResource.class);
- integer.set(0);
- new TemplateBuilder(template).accept(new Visitor() {
- public void visit(Object o) {
- integer.incrementAndGet();
- }
- });
-
- //We just want to make sure that it visits nested objects when deserialization from json is used.
- // The exact number is volatile so we just care about the minimum number of objects (list, pod and service).
- Assert.assertTrue(integer.intValue() >= 2);
-
-
- ServiceList serviceList = (ServiceList) mapper.readValue(getClass().getResourceAsStream("/service-list.json"), KubernetesResource.class);
- integer.set(0);
- new ServiceListBuilder(serviceList).accept(new Visitor() {
- public void visit(Object o) {
- integer.incrementAndGet();
- }
- });
-
- //We just want to make sure that it visits nested objects when deserialization from json is used.
- // The exact number is volatile so we just care about the minimum number of objects (list, pod and service).
- Assert.assertTrue(integer.intValue() >= 2);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/test/resources/service-list.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/test/resources/service-list.json b/dependencies/fabric8/kubernetes-model/src/test/resources/service-list.json
deleted file mode 100644
index ef87d15..0000000
--- a/dependencies/fabric8/kubernetes-model/src/test/resources/service-list.json
+++ /dev/null
@@ -1,239 +0,0 @@
-{
- "kind": "ServiceList",
- "apiVersion": "v1beta3",
- "metadata": {
- "selfLink": "/api/v1beta3/services",
- "resourceVersion": "443"
- },
- "items": [
- {
- "metadata": {
- "name": "app-library",
- "namespace": "default",
- "selfLink": "/api/v1beta3/namespaces/default/services/app-library",
- "uid": "d2907fce-02e4-11e5-8091-08002719a237",
- "resourceVersion": "79",
- "creationTimestamp": "2015-05-25T13:49:11Z",
- "labels": {
- "component": "AppLibrary",
- "provider": "fabric8"
- }
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 80,
- "targetPort": 8080
- }
- ],
- "selector": {
- "component": "AppLibrary",
- "provider": "fabric8"
- },
- "portalIP": "172.30.17.111",
- "sessionAffinity": "None"
- },
- "status": {}
- },
- {
- "metadata": {
- "name": "app-library-jolokia",
- "namespace": "default",
- "selfLink": "/api/v1beta3/namespaces/default/services/app-library-jolokia",
- "uid": "d2a01536-02e4-11e5-8091-08002719a237",
- "resourceVersion": "81",
- "creationTimestamp": "2015-05-25T13:49:11Z"
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 8778,
- "targetPort": 8778
- }
- ],
- "selector": {
- "component": "AppLibrary",
- "provider": "fabric8"
- },
- "portalIP": "172.30.17.8",
- "sessionAffinity": "None"
- },
- "status": {}
- },
- {
- "metadata": {
- "name": "docker-registry",
- "namespace": "default",
- "selfLink": "/api/v1beta3/namespaces/default/services/docker-registry",
- "uid": "d1058b17-02e4-11e5-8091-08002719a237",
- "resourceVersion": "58",
- "creationTimestamp": "2015-05-25T13:49:08Z",
- "labels": {
- "docker-registry": "default"
- }
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 5000,
- "targetPort": 5000
- }
- ],
- "selector": {
- "docker-registry": "default"
- },
- "portalIP": "172.30.17.117",
- "sessionAffinity": "None"
- },
- "status": {}
- },
- {
- "metadata": {
- "name": "fabric8-console-service",
- "namespace": "default",
- "selfLink": "/api/v1beta3/namespaces/default/services/fabric8-console-service",
- "uid": "d3ec3762-02e4-11e5-8091-08002719a237",
- "resourceVersion": "93",
- "creationTimestamp": "2015-05-25T13:49:13Z"
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 80,
- "targetPort": 9090
- }
- ],
- "selector": {
- "component": "fabric8Console"
- },
- "portalIP": "172.30.17.249",
- "sessionAffinity": "None"
- },
- "status": {}
- },
- {
- "metadata": {
- "name": "fabric8-forge",
- "namespace": "default",
- "selfLink": "/api/v1beta3/namespaces/default/services/fabric8-forge",
- "uid": "d3615083-02e4-11e5-8091-08002719a237",
- "resourceVersion": "88",
- "creationTimestamp": "2015-05-25T13:49:12Z",
- "labels": {
- "component": "fabric8Forge",
- "provider": "fabric8"
- }
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 80,
- "targetPort": 8080
- }
- ],
- "selector": {
- "component": "fabric8Forge",
- "provider": "fabric8"
- },
- "portalIP": "172.30.17.159",
- "sessionAffinity": "None"
- },
- "status": {}
- },
- {
- "metadata": {
- "name": "kubernetes",
- "namespace": "default",
- "selfLink": "/api/v1beta3/namespaces/default/services/kubernetes",
- "uid": "bc84b6f4-02e4-11e5-8091-08002719a237",
- "resourceVersion": "5",
- "creationTimestamp": "2015-05-25T13:48:34Z",
- "labels": {
- "component": "apiserver",
- "provider": "kubernetes"
- }
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 443,
- "targetPort": 443
- }
- ],
- "selector": null,
- "portalIP": "172.30.17.2",
- "sessionAffinity": "None"
- },
- "status": {}
- },
- {
- "metadata": {
- "name": "kubernetes-ro",
- "namespace": "default",
- "selfLink": "/api/v1beta3/namespaces/default/services/kubernetes-ro",
- "uid": "bc85c655-02e4-11e5-8091-08002719a237",
- "resourceVersion": "4",
- "creationTimestamp": "2015-05-25T13:48:34Z",
- "labels": {
- "component": "apiserver",
- "provider": "kubernetes"
- }
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 80,
- "targetPort": 80
- }
- ],
- "selector": null,
- "portalIP": "172.30.17.1",
- "sessionAffinity": "None"
- },
- "status": {}
- },
- {
- "metadata": {
- "name": "router",
- "namespace": "default",
- "selfLink": "/api/v1beta3/namespaces/default/services/router",
- "uid": "d0391be9-02e4-11e5-8091-08002719a237",
- "resourceVersion": "52",
- "creationTimestamp": "2015-05-25T13:49:07Z",
- "labels": {
- "router": "router"
- }
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 80,
- "targetPort": 80
- }
- ],
- "selector": {
- "router": "router"
- },
- "portalIP": "172.30.17.219",
- "sessionAffinity": "None"
- },
- "status": {}
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/test/resources/simple-list.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/test/resources/simple-list.json b/dependencies/fabric8/kubernetes-model/src/test/resources/simple-list.json
deleted file mode 100644
index 7d0ac22..0000000
--- a/dependencies/fabric8/kubernetes-model/src/test/resources/simple-list.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "kind": "List",
- "apiVersion": "v1beta3",
- "items": [
- {
- "apiVersion": "v1beta3",
- "kind": "Pod",
- "metadata": {
- "name": "simple-pod"
- },
- "labels": {
- "name": "simple-pod"
- },
- "spec": {
- "containers": [
- {
- "name": "simple-container",
- "image": "simple-image",
- "resources": {
- "limits": {
- "cpu": "1",
- "memory": "5Mi"
- }
- }
- }
- ]
- }
- },
- {
- "apiVersion": "v1beta3",
- "kind": "Service",
- "metadata": {
- "annotations": {},
- "labels": {
- "component": "simple",
- "provider": "simple",
- "group": "simple"
- },
- "name": "simple-service"
- },
- "spec": {
- "ports": [
- {
- "port": 8080,
- "protocol": "TCP",
- "targetPort": 8181
- }
- ],
- "publicIPs": [],
- "selector": {
- "component": "simple",
- "provider": "simple",
- "group": "simple"
- }
- }
- }
- ]
-}
-
-
-
-
-
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/test/resources/simple-template.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/test/resources/simple-template.json b/dependencies/fabric8/kubernetes-model/src/test/resources/simple-template.json
deleted file mode 100644
index d10f517..0000000
--- a/dependencies/fabric8/kubernetes-model/src/test/resources/simple-template.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "apiVersion": "v1beta3",
- "kind": "Template",
- "labels": {},
- "metadata": {
- "annotations": {},
- "labels": {},
- "name": "console"
- },
- "objects": [
- {
- "apiVersion": "v1beta3",
- "kind": "Service",
- "metadata": {
- "annotations": {},
- "labels": {
- "component": "console",
- "provider": "simple"
- },
- "name": "simple"
- },
- "spec": {
- "ports": [
- {
- "port": 80,
- "protocol": "TCP",
- "targetPort": 9090
- }
- ],
- "publicIPs": ["${DOMAIN}"],
- "selector": {
- "component": "console",
- "provider": "simple"
- }
- }
- }
- ],
- "parameters": [
- {
- "description": "The target port",
- "name": "DOMAIN",
- "value": "my.domain.org"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-model/src/test/resources/valid-pod.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-model/src/test/resources/valid-pod.json b/dependencies/fabric8/kubernetes-model/src/test/resources/valid-pod.json
deleted file mode 100644
index 2802a24..0000000
--- a/dependencies/fabric8/kubernetes-model/src/test/resources/valid-pod.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "apiVersion":"v1beta3",
- "kind": "Pod",
- "metadata": {
- "name": "valid-pod"
- },
- "labels": {
- "name": "valid-pod"
- },
- "spec": {
- "containers": [{
- "name": "kubernetes-serve-hostname",
- "image": "gcr.io/google_containers/serve_hostname",
- "resources": {
- "limits": {
- "cpu": "1",
- "memory": "5Mi"
- }
- }
- }]
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/pom.xml b/dependencies/fabric8/pom.xml
index 1421ddf..a67c452 100644
--- a/dependencies/fabric8/pom.xml
+++ b/dependencies/fabric8/pom.xml
@@ -34,7 +34,6 @@
<description>Fabric8 fork</description>
<modules>
- <module>kubernetes-model</module>
<module>kubernetes-api</module>
</modules>
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
index 838dfb3..6fde34e 100644
--- a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
+++ b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
@@ -254,12 +254,7 @@
<dependency>
<groupId>org.apache.stratos</groupId>
<artifactId>kubernetes-api</artifactId>
- <version>2.1.11-stratosv1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.stratos</groupId>
- <artifactId>kubernetes-model</artifactId>
- <version>2.1.11-stratosv1</version>
+ <version>${kubernetes.api.stratos.version}</version>
</dependency>
</dependencies>
@@ -365,8 +360,7 @@
<bundleDef>org.apache.jclouds.api:sts:${jclouds.version}</bundleDef>
<bundleDef>javax.ws.rs:jsr311-api:1.1.1</bundleDef>
<bundleDef>org.apache.stratos:org.apache.stratos.messaging:${project.version}</bundleDef>
- <bundleDef>org.apache.stratos:kubernetes-api:2.1.11-stratosv1</bundleDef>
- <bundleDef>org.apache.stratos:kubernetes-model:2.1.11-stratosv1</bundleDef>
+ <bundleDef>org.apache.stratos:kubernetes-api:${kubernetes.api.stratos.version}</bundleDef>
</bundles>
<importBundles>
</importBundles>
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index eeffb26..8ba74d3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -554,5 +554,7 @@
<axis2.osgi.version>1.6.1.wso2v10</axis2.osgi.version>
<jclouds.version>1.8.1</jclouds.version>
<project.jclouds.stratos.version>1.8.1-stratos</project.jclouds.stratos.version>
+ <kubernetes.api.version>2.2.16</kubernetes.api.version>
+ <kubernetes.api.stratos.version>2.2.16-stratosv1</kubernetes.api.stratos.version>
</properties>
</project>
[47/50] [abbrv] stratos git commit: Conflict resolved
Posted by ga...@apache.org.
Conflict resolved
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/499fe3e4
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/499fe3e4
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/499fe3e4
Branch: refs/heads/master
Commit: 499fe3e474bf41bcd52a6f7c3f98b04d642de158
Parents: 880f098
Author: Akila Perera <ra...@gmail.com>
Authored: Tue Sep 1 02:10:54 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Tue Sep 1 16:41:05 2015 +0530
----------------------------------------------------------------------
.../extensions/py/ExtensionExecutor.py | 2 +-
.../cartridge.agent/modules/util/log.py | 2 +-
.../python-cartridge-agent/distribution/pom.xml | 58 ---
.../distribution/src/main/assembly/bin.xml | 55 --
.../distribution/src/main/license/LICENSE | 202 --------
.../distribution/src/main/notice/NOTICE | 5 -
.../distribution/src/main/readme/README | 32 --
.../python-cartridge-agent/integration/pom.xml | 161 ------
.../python.cartridge.agent/test/ADCTest.java | 21 -
.../src/test/resources/log4j.properties | 41 --
.../src/test/resources/pca-testing1.xml | 29 --
.../src/test/resources/pca-testing2.xml | 29 --
.../src/test/resources/suite-1/agent.conf | 46 --
.../src/test/resources/suite-1/jndi.properties | 22 -
.../src/test/resources/suite-1/logging.ini | 52 --
.../resources/suite-1/payload/launch-params | 1 -
.../src/test/resources/suite-2/agent.conf | 46 --
.../src/test/resources/suite-2/jndi.properties | 22 -
.../src/test/resources/suite-2/logging.ini | 52 --
.../resources/suite-2/payload/launch-params | 18 -
.../test-conf/integration-test.properties | 26 -
.../modules/distribution/pom.xml | 59 +++
.../distribution/src/main/assembly/bin.xml | 57 +++
.../distribution/src/main/license/LICENSE | 202 ++++++++
.../modules/distribution/src/main/notice/NOTICE | 5 +
.../modules/distribution/src/main/readme/README | 32 ++
.../modules/integration/.gitignore | 1 +
.../modules/integration/pom.xml | 251 ++++++++++
.../test/ADCMTAppTenantUserTest.java | 213 ++++++++
.../test/ADCMTAppTest.java | 213 ++++++++
.../python.cartridge.agent/test/ADCTest.java | 21 +
.../test/AgentStartupTest.java | 154 ++++++
.../test/DataPublisherTestUtil.java | 46 ++
.../test/PythonAgentTestManager.java | 497 +++++++++++++++++++
.../test/ThriftTestServer.java | 213 ++++++++
.../test/resources/common/client-truststore.jks | Bin 0 -> 37935 bytes
.../resources/common/data-bridge-config.xml | 75 +++
.../src/test/resources/common/log4j.properties | 41 ++
.../common/stratos-health-stream-def.json | 1 +
.../resources/common/thrift-agent-config.xml | 64 +++
.../src/test/resources/common/wso2carbon.jks | Bin 0 -> 33260 bytes
.../src/test/resources/pca-testing1.xml | 29 ++
.../src/test/resources/pca-testing2.xml | 29 ++
.../src/test/resources/pca-testing3.xml | 29 ++
.../src/test/resources/pca-testing4.xml | 29 ++
.../src/test/resources/suite-1/agent.conf | 46 ++
.../src/test/resources/suite-1/jndi.properties | 22 +
.../src/test/resources/suite-1/logging.ini | 52 ++
.../resources/suite-1/payload/launch-params | 1 +
.../src/test/resources/suite-2/agent.conf | 46 ++
.../src/test/resources/suite-2/jndi.properties | 22 +
.../src/test/resources/suite-2/logging.ini | 52 ++
.../resources/suite-2/payload/launch-params | 18 +
.../src/test/resources/suite-3/agent.conf | 45 ++
.../src/test/resources/suite-3/jndi.properties | 22 +
.../src/test/resources/suite-3/logging.ini | 52 ++
.../resources/suite-3/payload/launch-params | 1 +
.../src/test/resources/suite-4/agent.conf | 45 ++
.../src/test/resources/suite-4/jndi.properties | 22 +
.../src/test/resources/suite-4/logging.ini | 52 ++
.../resources/suite-4/payload/launch-params | 1 +
.../test-conf/integration-test.properties | 26 +
products/python-cartridge-agent/pom.xml | 6 +-
63 files changed, 2791 insertions(+), 923 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py
index 9c958da..655afc4 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/py/ExtensionExecutor.py
@@ -51,7 +51,7 @@ class ExtensionExecutor(ICartridgeAgentPlugin):
"""
log = LogFactory().get_log(__name__)
- working_dir = os.path.abspath(os.path.dirname(__file__)).split("modules")[0]
+ working_dir = os.path.abspath(os.path.dirname(__file__))
command = working_dir[:-2] + "bash/" + bash_file
current_env_vars = os.environ.copy()
extension_values.update(current_env_vars)
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/log.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/log.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/log.py
index 9bad214..6a0804e 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/log.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/log.py
@@ -27,7 +27,7 @@ class LogFactory(object):
class __LogFactory:
def __init__(self):
self.logs = {}
- logging_conf = os.path.abspath(os.path.dirname(__file__)).split("modules")[0] + "logging.ini"
+ logging_conf = os.path.abspath(os.path.dirname(__file__)) + "/../../logging.ini"
logging.config.fileConfig(logging_conf)
def get_log(self, name):
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/distribution/pom.xml b/products/python-cartridge-agent/distribution/pom.xml
deleted file mode 100644
index 09671c7..0000000
--- a/products/python-cartridge-agent/distribution/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.stratos</groupId>
- <artifactId>python-cartridge-agent-parent</artifactId>
- <version>4.2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>apache-stratos-python-cartridge-agent</artifactId>
- <packaging>pom</packaging>
- <name>Apache Stratos - Python Cartridge Agent</name>
- <description>Apache Stratos Python Cartridge Agent Distribution</description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>1-pre_dist</id>
- <phase>test</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/bin.xml</descriptor>
- </descriptors>
- <appendAssemblyId>false</appendAssemblyId>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/distribution/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/distribution/src/main/assembly/bin.xml b/products/python-cartridge-agent/distribution/src/main/assembly/bin.xml
deleted file mode 100644
index bca0b25..0000000
--- a/products/python-cartridge-agent/distribution/src/main/assembly/bin.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-<assembly>
- <id>bin</id>
- <formats>
- <format>zip</format>
- </formats>
- <fileSets>
- <fileSet>
- <directory>${project.basedir}/../../../components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent</directory>
- <outputDirectory>.</outputDirectory>
- <includes>
- <include>**/*</include>
- </includes>
- <fileMode>0755</fileMode>
- </fileSet>
- </fileSets>
- <files>
- <file>
- <source>${project.basedir}/src/main/notice/NOTICE</source>
- <outputDirectory>/</outputDirectory>
- <filtered>true</filtered>
- <fileMode>644</fileMode>
- </file>
- <file>
- <source>${project.basedir}/src/main/license/LICENSE</source>
- <outputDirectory>/</outputDirectory>
- <filtered>true</filtered>
- <fileMode>644</fileMode>
- </file>
- <file>
- <source>${project.basedir}/src/main/readme/README</source>
- <outputDirectory>/</outputDirectory>
- <filtered>true</filtered>
- <fileMode>644</fileMode>
- </file>
- </files>
-</assembly>
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/distribution/src/main/license/LICENSE b/products/python-cartridge-agent/distribution/src/main/license/LICENSE
deleted file mode 100644
index 7a4a3ea..0000000
--- a/products/python-cartridge-agent/distribution/src/main/license/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/distribution/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/distribution/src/main/notice/NOTICE b/products/python-cartridge-agent/distribution/src/main/notice/NOTICE
deleted file mode 100644
index c59ffa6..0000000
--- a/products/python-cartridge-agent/distribution/src/main/notice/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Stratos Python Cartridge Agent
-Copyright 2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/distribution/src/main/readme/README
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/distribution/src/main/readme/README b/products/python-cartridge-agent/distribution/src/main/readme/README
deleted file mode 100644
index 92066bf..0000000
--- a/products/python-cartridge-agent/distribution/src/main/readme/README
+++ /dev/null
@@ -1,32 +0,0 @@
-Python Cartridge Agent (PCA)
-============================
-
-Cartridge agent manages cartridge instance lifecycle and publishes its health statistics
-to Complex Event Processor (CEP). It provides a set of extension points for implementing
-logic required for configuring the server.
-
-How to run Live Tests
----------------------
-1. Install following packages
-
- apt-get install -y git python python-pip python-dev gcc zip
-
-2. Install dependent python modules:
- ```
- pip install paho-mqtt
- pip install psutil
- pip install pexpect
- pip install pycrypto
- pip install gitpython
- pip install yapsy
- ```
-
-3. Start ActiveMQ:
- ```
- <activemq-home>/bin/activemq start
- ```
-
-4. Run python cartridge agent live tests:
- ```
- mvn clean install -Plive
- ```
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/pom.xml b/products/python-cartridge-agent/integration/pom.xml
deleted file mode 100755
index e92bbb4..0000000
--- a/products/python-cartridge-agent/integration/pom.xml
+++ /dev/null
@@ -1,161 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.stratos</groupId>
- <artifactId>python-cartridge-agent-parent</artifactId>
- <version>4.1.2</version>
- </parent>
-
- <artifactId>python-agent-integration</artifactId>
- <packaging>jar</packaging>
- <name>Python Cartridge Agent - Integration Tests</name>
-
- <build>
- <resources>
- <resource>
- <directory>src/test/resources/test-conf</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </build>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/*</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>live</id>
- <build>
- <resources>
- <resource>
- <directory>src/test/resources/test-conf</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <inherited>false</inherited>
- <configuration>
- <suiteXmlFiles>
- <suiteXmlFile>src/test/resources/pca-testing1.xml</suiteXmlFile>
- </suiteXmlFiles>
- <workingDirectory>${basedir}/target</workingDirectory>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-exec</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.stratos</groupId>
- <artifactId>org.apache.stratos.common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>6.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2.wso2</groupId>
- <artifactId>axis2-client</artifactId>
- <version>${axis2.wso2.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents.wso2</groupId>
- <artifactId>httpcore</artifactId>
- <version>4.3.0.wso2v1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents.wso2</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.2.5.wso2v1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.stratos</groupId>
- <artifactId>org.apache.stratos.mock.iaas.client</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.wso2.andes.wso2</groupId>
- <artifactId>andes-client</artifactId>
- <version>0.13.wso2v8</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-all</artifactId>
- <version>5.10.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-mqtt</artifactId>
- <version>5.10.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.stratos</groupId>
- <artifactId>org.apache.stratos.messaging</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
deleted file mode 100755
index 86fc7c3..0000000
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.apache.stratos.python.cartridge.agent.test;/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-public class ADCTest {
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/log4j.properties b/products/python-cartridge-agent/integration/src/test/resources/log4j.properties
deleted file mode 100755
index c0c6e78..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Set root logger level and appenders
-log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
-
-# CONSOLE_APPENDER is set to be a ConsoleAppender.
-log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
-
-# The standard error log where all the warnings, errors and fatal errors will be logged
-log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
-log4j.appender.FILE_APPENDER.File=cartridge-agent.log
-log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
-log4j.appender.FILE_APPENDER.threshold=DEBUG
-
-# CONSOLE_APPENDER uses PatternLayout.
-log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
-
-log4j.logger.org.apache.stratos.cartridge.agent=INFO
-log4j.logger.org.apache.stratos.messaging=INFO
-log4j.logger.org.apache.stratos.common.util=DEBUG
-log4j.logger.org.wso2.andes.client=ERROR
-log4j.logger.org.apache.activemq.jndi.ActiveMQInitialContextFactory=ERROR
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
deleted file mode 100755
index a13f950..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-
-<suite name="PythonCartridgeAgentIntegrationSuite1">
- <test name="PCATest">
- <classes>
- <class name="org.apache.stratos.python.cartridge.agent.test.PythonCartridgeAgentTest"/>
- </classes>
- </test>
-</suite>
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml
deleted file mode 100755
index c292953..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-
-<suite name="PythonCartridgeAgentIntegrationSuite2">
- <test name="PCATest">
- <classes>
- <class name="org.apache.stratos.python.cartridge.agent.test.ADCTest"/>
- </classes>
- </test>
-</suite>
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
deleted file mode 100755
index 04f4a0c..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
+++ /dev/null
@@ -1,46 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-[agent]
-mb.ip =localhost
-mb.port =1884
-listen.address =localhost
-thrift.receiver.ip =localhost
-thrift.receiver.port =7712
-thrift.server.admin.username =admin
-thrift.server.admin.password =admin
-cep.stats.publisher.enabled =true
-lb.private.ip =
-lb.public.ip =
-enable.artifact.update =true
-auto.commit =false
-auto.checkout =true
-artifact.update.interval =15
-artifact.clone.retries =5
-artifact.clone.interval =10
-port.check.timeout =600000
-enable.data.publisher =false
-monitoring.server.ip =localhost
-monitoring.server.port =7612
-monitoring.server.secure.port =7712
-monitoring.server.admin.username =admin
-monitoring.server.admin.password =admin
-#log.file.paths =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
-log.file.paths =/tmp/agent.screen.log
-metadata.service.url =https://localhost:9443
-super.tenant.repository.path =/repository/deployment/server/
-tenant.repository.path =/repository/tenants/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties b/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties
deleted file mode 100755
index beefe3c..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-connectionfactoryName=TopicConnectionFactory
-java.naming.provider.url=tcp://localhost:61617
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini b/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini
deleted file mode 100755
index 15cad9b..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini
+++ /dev/null
@@ -1,52 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-[formatters]
-keys=default
-
-[formatter_default]
-format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
-class=logging.Formatter
-
-[handlers]
-keys=console, error_file, log_file
-
-[handler_console]
-class=logging.StreamHandler
-formatter=default
-args=tuple()
-
-[handler_log_file]
-class=logging.FileHandler
-level=DEBUG
-formatter=default
-args=("agent.log", "w")
-
-[handler_error_file]
-class=logging.FileHandler
-level=ERROR
-formatter=default
-args=("error.log", "w")
-
-[loggers]
-keys=root
-
-[logger_root]
-level=DEBUG
-formatter=default
-handlers=console,error_file,log_file
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
deleted file mode 100755
index 165508e..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
+++ /dev/null
@@ -1 +0,0 @@
-APPLICATION_ID=single_group_v1,APPLICATION_PATH=/tmp/tomcat/webapps,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single_group_v1-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' ,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,KUB
ERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=4500,
MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,REPO_URL=https://github.com/imesh/stratos-tomcat-applications.git,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI
0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWmVIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
deleted file mode 100755
index 136433d..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
+++ /dev/null
@@ -1,46 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-[agent]
-mb.ip =localhost
-mb.port =1885
-listen.address =localhost
-thrift.receiver.ip =localhost
-thrift.receiver.port =7712
-thrift.server.admin.username =admin
-thrift.server.admin.password =admin
-cep.stats.publisher.enabled =true
-lb.private.ip =
-lb.public.ip =
-enable.artifact.update =true
-auto.commit =false
-auto.checkout =true
-artifact.update.interval =15
-artifact.clone.retries =5
-artifact.clone.interval =10
-port.check.timeout =600000
-enable.data.publisher =false
-monitoring.server.ip =localhost
-monitoring.server.port =7612
-monitoring.server.secure.port =7712
-monitoring.server.admin.username =admin
-monitoring.server.admin.password =admin
-#log.file.paths =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
-log.file.paths =/tmp/agent.screen.log
-metadata.service.url =https://localhost:9443
-super.tenant.repository.path =/repository/deployment/server/
-tenant.repository.path =/repository/tenants/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties b/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties
deleted file mode 100755
index beefe3c..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-connectionfactoryName=TopicConnectionFactory
-java.naming.provider.url=tcp://localhost:61617
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini b/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini
deleted file mode 100755
index 15cad9b..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini
+++ /dev/null
@@ -1,52 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-[formatters]
-keys=default
-
-[formatter_default]
-format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
-class=logging.Formatter
-
-[handlers]
-keys=console, error_file, log_file
-
-[handler_console]
-class=logging.StreamHandler
-formatter=default
-args=tuple()
-
-[handler_log_file]
-class=logging.FileHandler
-level=DEBUG
-formatter=default
-args=("agent.log", "w")
-
-[handler_error_file]
-class=logging.FileHandler
-level=ERROR
-formatter=default
-args=("error.log", "w")
-
-[loggers]
-keys=root
-
-[logger_root]
-level=DEBUG
-formatter=default
-handlers=console,error_file,log_file
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
deleted file mode 100755
index 0d29753..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-APPLICATION_ID=application1,SERVICE_NAME=php,HOST_NAME=php.php.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=php,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single-cartridge-app-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=9080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=php.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/stratos-pca-test-app-path/,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null,MP_IP=192.168.1.4,MB_PORT=1883,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties b/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties
deleted file mode 100755
index 1242841..0000000
--- a/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Stratos distribution properties added via filters during the build
-distribution.version=${project.version}
-distribution.name=${python.cartridge.agent.distribution.name}-${project.version}
-activemq.amqp.bind.address=tcp://localhost:61617
-activemq.mqtt.bind.address=mqtt://localhost:1885
-cep.port=7712
-stratos.endpoint=http://localhost:9763
-stratos.admin.username=admin
-stratos.admin.password=admin
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/distribution/pom.xml b/products/python-cartridge-agent/modules/distribution/pom.xml
new file mode 100644
index 0000000..f4937df
--- /dev/null
+++ b/products/python-cartridge-agent/modules/distribution/pom.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>python-cartridge-agent-parent</artifactId>
+ <version>4.2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>python-cartridge-agent-distribution</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Stratos - Python Cartridge Agent</name>
+ <description>Apache Stratos Python Cartridge Agent Distribution</description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>1-pre_dist</id>
+ <phase>test</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ <configuration>
+ <finalName>${python.cartridge.agent.distribution.name}-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/distribution/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/distribution/src/main/assembly/bin.xml b/products/python-cartridge-agent/modules/distribution/src/main/assembly/bin.xml
new file mode 100644
index 0000000..f252371
--- /dev/null
+++ b/products/python-cartridge-agent/modules/distribution/src/main/assembly/bin.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<assembly>
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <directory>
+ ${project.basedir}/../../../../components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent
+ </directory>
+ <outputDirectory>.</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ </fileSets>
+ <files>
+ <file>
+ <source>${project.basedir}/src/main/notice/NOTICE</source>
+ <outputDirectory>/</outputDirectory>
+ <filtered>true</filtered>
+ <fileMode>644</fileMode>
+ </file>
+ <file>
+ <source>${project.basedir}/src/main/license/LICENSE</source>
+ <outputDirectory>/</outputDirectory>
+ <filtered>true</filtered>
+ <fileMode>644</fileMode>
+ </file>
+ <file>
+ <source>${project.basedir}/src/main/readme/README</source>
+ <outputDirectory>/</outputDirectory>
+ <filtered>true</filtered>
+ <fileMode>644</fileMode>
+ </file>
+ </files>
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/distribution/src/main/license/LICENSE b/products/python-cartridge-agent/modules/distribution/src/main/license/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/products/python-cartridge-agent/modules/distribution/src/main/license/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/distribution/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/distribution/src/main/notice/NOTICE b/products/python-cartridge-agent/modules/distribution/src/main/notice/NOTICE
new file mode 100644
index 0000000..c59ffa6
--- /dev/null
+++ b/products/python-cartridge-agent/modules/distribution/src/main/notice/NOTICE
@@ -0,0 +1,5 @@
+Apache Stratos Python Cartridge Agent
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/distribution/src/main/readme/README
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/distribution/src/main/readme/README b/products/python-cartridge-agent/modules/distribution/src/main/readme/README
new file mode 100644
index 0000000..92066bf
--- /dev/null
+++ b/products/python-cartridge-agent/modules/distribution/src/main/readme/README
@@ -0,0 +1,32 @@
+Python Cartridge Agent (PCA)
+============================
+
+Cartridge agent manages cartridge instance lifecycle and publishes its health statistics
+to Complex Event Processor (CEP). It provides a set of extension points for implementing
+logic required for configuring the server.
+
+How to run Live Tests
+---------------------
+1. Install following packages
+
+ apt-get install -y git python python-pip python-dev gcc zip
+
+2. Install dependent python modules:
+ ```
+ pip install paho-mqtt
+ pip install psutil
+ pip install pexpect
+ pip install pycrypto
+ pip install gitpython
+ pip install yapsy
+ ```
+
+3. Start ActiveMQ:
+ ```
+ <activemq-home>/bin/activemq start
+ ```
+
+4. Run python cartridge agent live tests:
+ ```
+ mvn clean install -Plive
+ ```
http://git-wip-us.apache.org/repos/asf/stratos/blob/499fe3e4/products/python-cartridge-agent/modules/integration/.gitignore
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/.gitignore b/products/python-cartridge-agent/modules/integration/.gitignore
new file mode 100644
index 0000000..4d01b31
--- /dev/null
+++ b/products/python-cartridge-agent/modules/integration/.gitignore
@@ -0,0 +1 @@
+cartridge-agent.log
[43/50] [abbrv] stratos git commit: Conflict resolved
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
new file mode 100755
index 0000000..165508e
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
@@ -0,0 +1 @@
+APPLICATION_ID=single_group_v1,APPLICATION_PATH=/tmp/tomcat/webapps,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single_group_v1-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' ,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,KUB
ERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=4500,
MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,REPO_URL=https://github.com/imesh/stratos-tomcat-applications.git,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI
0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWmVIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
new file mode 100755
index 0000000..136433d
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[agent]
+mb.ip =localhost
+mb.port =1885
+listen.address =localhost
+thrift.receiver.ip =localhost
+thrift.receiver.port =7712
+thrift.server.admin.username =admin
+thrift.server.admin.password =admin
+cep.stats.publisher.enabled =true
+lb.private.ip =
+lb.public.ip =
+enable.artifact.update =true
+auto.commit =false
+auto.checkout =true
+artifact.update.interval =15
+artifact.clone.retries =5
+artifact.clone.interval =10
+port.check.timeout =600000
+enable.data.publisher =false
+monitoring.server.ip =localhost
+monitoring.server.port =7612
+monitoring.server.secure.port =7712
+monitoring.server.admin.username =admin
+monitoring.server.admin.password =admin
+#log.file.paths =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
+log.file.paths =/tmp/agent.screen.log
+metadata.service.url =https://localhost:9443
+super.tenant.repository.path =/repository/deployment/server/
+tenant.repository.path =/repository/tenants/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties b/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini b/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
new file mode 100755
index 0000000..0d29753
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+APPLICATION_ID=application1,SERVICE_NAME=php,HOST_NAME=php.php.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=php,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single-cartridge-app-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=9080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=php.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/stratos-pca-test-app-path/,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null,MP_IP=192.168.1.4,MB_PORT=1883,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties b/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties
new file mode 100755
index 0000000..1242841
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Stratos distribution properties added via filters during the build
+distribution.version=${project.version}
+distribution.name=${python.cartridge.agent.distribution.name}-${project.version}
+activemq.amqp.bind.address=tcp://localhost:61617
+activemq.mqtt.bind.address=mqtt://localhost:1885
+cep.port=7712
+stratos.endpoint=http://localhost:9763
+stratos.admin.username=admin
+stratos.admin.password=admin
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/880f0988/products/python-cartridge-agent/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/pom.xml b/products/python-cartridge-agent/pom.xml
old mode 100644
new mode 100755
index 5dc6c23..5e00c1c
--- a/products/python-cartridge-agent/pom.xml
+++ b/products/python-cartridge-agent/pom.xml
@@ -32,8 +32,7 @@
<description>Apache Stratos Python Cartridge Agent Product</description>
<modules>
- <module>
- distribution
- </module>
+ <module>distribution</module>
+ <module>integration</module>
</modules>
</project>
\ No newline at end of file
[25/50] [abbrv] stratos git commit: Upgrading fabric8 kubernetes api
version to 2.2.16 and removing forked code
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/UserConfigurationCompare.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/UserConfigurationCompare.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/UserConfigurationCompare.java
deleted file mode 100644
index a04c900..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/UserConfigurationCompare.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.ObjectMeta;
-import io.fabric8.kubernetes.api.support.KindToClassMapping;
-import io.fabric8.utils.Objects;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.validation.constraints.NotNull;
-import java.beans.BeanInfo;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Helper methods to compare the user configuration on entities
- */
-public class UserConfigurationCompare {
- private static final transient Logger LOG = LoggerFactory.getLogger(UserConfigurationCompare.class);
-
- protected static final Set<String> ignoredProperties = new HashSet<>(Arrays.asList("status"));
-
-
- /**
- * This method detects if the user has changed the configuration of an entity.
- * <p/>
- * It compares the <b>user</b> configuration of 2 object trees ignoring any
- * runtime status or timestamp information.
- *
- * @return true if the configurations are equal.
- */
- public static boolean configEqual(Object entity1, Object entity2) {
- if (entity1 == entity2) {
- return true;
- } else if (entity1 == null || entity2 == null) {
- return false;
- } else if (entity1 instanceof Map) {
- return configEqualMap((Map) entity1, castTo(Map.class, entity2));
- } else if (entity2 instanceof Map) {
- return configEqualMap((Map) entity1, castTo(Map.class, entity2));
- } else if (entity2 instanceof ObjectMeta) {
- return configEqualObjectMeta((ObjectMeta) entity1, castTo(ObjectMeta.class, entity2));
- } else {
- Set<Class<?>> classes = new HashSet<>(KindToClassMapping.getKindToClassMap().values());
- Class<?> aClass = entity1.getClass();
- if (classes.contains(aClass)) {
- Object castEntity2 = castTo(aClass, entity2);
- if (castEntity2 == null) {
- return false;
- } else {
- return configEqualKubernetesDTO(entity1, entity2, aClass);
- }
- } else {
- return Objects.equal(entity1, entity2);
- }
- }
- }
-
-
- /**
- * Compares 2 instances of the given Kubernetes DTO class to see if the user has changed their configuration.
- * <p/>
- * This method will ignore properties {@link #ignoredProperties} such as status or timestamp properties
- */
- protected static boolean configEqualKubernetesDTO(@NotNull Object entity1, @NotNull Object entity2, @NotNull Class<?> clazz) {
- // lets iterate through the objects making sure we've not
- BeanInfo beanInfo = null;
- try {
- beanInfo = Introspector.getBeanInfo(clazz);
- } catch (IntrospectionException e) {
- LOG.warn("Failed to get beanInfo for " + clazz.getName() + ". " + e, e);
- return false;
- }
- try {
- PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
- for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
- String name = propertyDescriptor.getName();
- if (ignoredProperties.contains(name)) {
- continue;
- }
- Method readMethod = propertyDescriptor.getReadMethod();
- if (readMethod != null) {
- Object value1 = invokeMethod(entity1, readMethod);
- Object value2 = invokeMethod(entity2, readMethod);
- if (!configEqual(value1, value2)) {
- return false;
- }
- }
- }
- return true;
- } catch (Exception e) {
- return false;
- }
- }
-
- protected static Object invokeMethod(@NotNull Object entity, Method readMethod) throws InvocationTargetException, IllegalAccessException {
- try {
- return readMethod.invoke(entity);
- } catch (Exception e) {
- LOG.warn("Failed to invoke method " + readMethod + " on " + entity + ". " + e, e);
- throw e;
- }
- }
-
- protected static boolean configEqualObjectMeta(ObjectMeta entity1, ObjectMeta entity2) {
- if (entity1 == entity2) {
- return true;
- } else if (entity1 == null || entity2 == null) {
- return false;
- }
- // TODO should we ignore annotations?
- return Objects.equal(entity1.getName(), entity2.getName()) &&
- Objects.equal(entity1.getNamespace(), entity2.getNamespace()) &&
- configEqualMap(entity1.getLabels(), entity2.getLabels()) &&
- configEqualMap(entity1.getAnnotations(), entity2.getAnnotations());
- }
-
- protected static <T> T castTo(Class<T> clazz, Object entity) {
- if (clazz.isInstance(entity)) {
- return clazz.cast(entity);
- } else {
- if (entity != null) {
- LOG.warn("Invalid class " + entity.getClass().getName() + " when expecting " + clazz.getName() + " for instance: " + entity);
- }
- return null;
- }
- }
-
- protected static boolean configEqualMap(Map entity1, Map entity2) {
- if (entity1 == entity2) {
- return true;
- } else if (entity1 == null || entity2 == null) {
- return false;
- }
- int size1 = size(entity1);
- int size2 = size(entity2);
- if (size1 != size2) {
- return false;
- }
- Set<Map.Entry> entries = entity1.entrySet();
- for (Map.Entry entry : entries) {
- Object key = entry.getKey();
- Object value = entry.getValue();
- Object value2 = entity2.get(key);
- if (!configEqual(value, value2)) {
- return false;
- }
- }
- return true;
- }
-
- protected static boolean configEqualList(List v1, List v2) {
- int size1 = size(v1);
- int size2 = size(v2);
- if (size1 != size2) {
- return false;
- }
- int idx = 0;
- for (Object value : v1) {
- Object value2 = v2.get(idx++);
- if (!configEqual(value, value2)) {
- return false;
- }
- }
- return true;
- }
-
-
- protected static int size(Map map) {
- return (map == null) ? 0 : map.size();
- }
-
- protected static int size(Collection coll) {
- return (coll == null) ? 0 : coll.size();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Watcher.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Watcher.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Watcher.java
deleted file mode 100644
index a6447ce..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Watcher.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package io.fabric8.kubernetes.api;
-
-import io.fabric8.kubernetes.api.model.HasMetadata;
-
-public interface Watcher<T extends HasMetadata> {
-
- enum Action {
- ADDED, MODIFIED, DELETED, ERROR
- }
-
- void eventReceived(Action action, T object);
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builders/ListEnvVarBuilder.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builders/ListEnvVarBuilder.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builders/ListEnvVarBuilder.java
deleted file mode 100644
index e97ec01..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builders/ListEnvVarBuilder.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api.builders;
-
-import io.fabric8.kubernetes.api.model.EnvVar;
-import io.fabric8.utils.Strings;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A little helper class to build a <code>List<EnvVar></code> object
- */
-public class ListEnvVarBuilder {
- private List<EnvVar> envVars = new ArrayList<>();
-
- public void withEnvVar(String name, String value) {
- if (Strings.isNotBlank(name) && value != null) {
- EnvVar envVar = new EnvVar();
- envVar.setName(name);
- envVar.setValue(value);
- envVars.add(envVar);
- }
- }
-
- public List<EnvVar> build() {
- return envVars;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildFinishedEvent.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildFinishedEvent.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildFinishedEvent.java
deleted file mode 100644
index 071979c..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildFinishedEvent.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api.builds;
-
-import io.fabric8.openshift.api.model.Build;
-
-/**
- */
-public class BuildFinishedEvent {
- private final String uid;
- private final Build build;
- private final boolean loading;
- private final String buildLink;
-
- public BuildFinishedEvent(String uid, Build build, boolean loading, String buildLink) {
- this.uid = uid;
- this.build = build;
- this.loading = loading;
- this.buildLink = buildLink;
- }
-
- public String getUid() {
- return uid;
- }
-
- public Build getBuild() {
- return build;
- }
-
- public String getBuildLink() {
- return buildLink;
- }
-
- public boolean isLoading() {
- return loading;
- }
-
- public String getStatus() {
- return build.getStatus().getPhase();
- }
-
- public String getConfigName() {
- return Builds.getBuildConfigName(build);
- }
-
- public String getNamespace() {
- return Builds.getNamespace(build);
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildListener.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildListener.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildListener.java
deleted file mode 100644
index 3edf170..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildListener.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api.builds;
-
-/**
- * A strategy for processing completed builds
- */
-public interface BuildListener {
- /**
- * The build that has completed (successfully or not) and the flag indicating whether or not
- * this is the first time the watcher is being started up (so you should check if you've already
- * received and processed this event before).
- */
- void onBuildFinished(BuildFinishedEvent event);
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildWatcher.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildWatcher.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildWatcher.java
deleted file mode 100644
index 5fb1cf4..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/BuildWatcher.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api.builds;
-
-import io.fabric8.kubernetes.api.KubernetesClient;
-import io.fabric8.openshift.api.model.Build;
-import io.fabric8.openshift.api.model.BuildList;
-import io.fabric8.utils.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- */
-public class BuildWatcher {
- private static final transient Logger LOG = LoggerFactory.getLogger(BuildWatcher.class);
-
- private final KubernetesClient kubernetes;
- private final BuildListener buildListener;
- private final String namespace;
- private final String fabric8ConsoleLink;
- private boolean loading = true;
- private Set<String> seenBuildIds = Collections.<String>synchronizedSet(new HashSet<String>());
-
- public BuildWatcher(KubernetesClient kubernetes, BuildListener buildListener, String namespace, String fabric8ConsoleLink) {
- this.kubernetes = kubernetes;
- this.buildListener = buildListener;
- this.namespace = namespace;
- this.fabric8ConsoleLink = fabric8ConsoleLink;
- }
-
-
- public TimerTask schedule(long delay) {
- Timer timer = new Timer();
- return schedule(timer, delay);
- }
-
- public TimerTask schedule(Timer timer, long delay) {
- TimerTask task = new TimerTask() {
- @Override
- public void run() {
- poll();
- }
- };
- timer.schedule(task, delay, delay);
- return task;
- }
-
- public void poll() {
- boolean foundBuild = false;
- BuildList buildList = kubernetes.getBuilds(namespace);
- if (buildList != null) {
- List<Build> items = buildList.getItems();
- if (items != null) {
- for (Build build : items) {
- buildPolled(build);
- foundBuild = true;
- }
- }
- }
- if (foundBuild) {
- loading = false;
- }
- }
-
- protected void buildPolled(Build build) {
- String status = build.getStatus().getPhase();
- if (status != null) {
- if (Builds.isFinished(status)) {
- String uid = Builds.getUid(build);
- if (Strings.isNullOrBlank(uid)) {
- LOG.warn("Ignoring bad build which has no UID: " + build);
- } else {
- if (seenBuildIds.add(uid)) {
- String name = Builds.getName(build);
- String buildLink = Builds.createConsoleBuildLink(this.fabric8ConsoleLink, name);
- BuildFinishedEvent event = new BuildFinishedEvent(uid, build, loading, buildLink);
- buildListener.onBuildFinished(event);
- }
- }
- }
- }
- }
-
- /**
- * Waits until this watcher is finished (which by default is forever)
- */
- public void join() {
- Object lock = new Object();
- while (true) {
- synchronized(lock) {
- try {
- lock.wait();
- } catch (InterruptedException e) {
- // ignore
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/Builds.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/Builds.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/Builds.java
deleted file mode 100644
index 61f7330..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/Builds.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api.builds;
-
-import io.fabric8.kubernetes.api.KubernetesHelper;
-import io.fabric8.openshift.api.model.Build;
-import io.fabric8.openshift.api.model.BuildConfig;
-import io.fabric8.utils.Objects;
-import io.fabric8.utils.Strings;
-import io.fabric8.utils.URLUtils;
-
-import java.util.Collections;
-import java.util.Date;
-import java.util.Map;
-
-/**
- */
-public class Builds {
-
- public static class Status {
- public static final String COMPLETE = "Complete";
- public static final String FAIL = "Fail";
- public static final String ERROR = "Error";
- public static final String CANCELLED = "Cancelled";
- }
-
- public static boolean isCompleted(String status) {
- return Objects.equal(Status.COMPLETE, status);
- }
-
- public static boolean isCancelled(String status) {
- return Objects.equal(Status.CANCELLED, status);
- }
-
- public static boolean isFailed(String status) {
- if (status != null) {
- return status.startsWith(Status.FAIL) || status.startsWith(Status.ERROR);
- }
- return false;
- }
-
- public static boolean isFinished(String status) {
- return isCompleted(status) || isFailed(status) || isCancelled(status);
- }
-
- /**
- * Returns a unique UUID for a build
- */
- public static String getUid(Build build) {
- String answer = null;
- if (build != null) {
- answer = build.getMetadata().getUid();
- if (Strings.isNullOrBlank(answer)) {
- Map<String, Object> metadata = getMetadata(build);
- answer = getString(metadata, "uid");
- if (Strings.isNullOrBlank(answer)) {
- answer = getString(metadata, "id");
- }
- if (Strings.isNullOrBlank(answer)) {
- answer = getString(metadata, "name");
- }
- }
- if (Strings.isNullOrBlank(answer)) {
- answer = build.getMetadata().getName();
- }
- }
- return answer;
- }
-
- protected static String getString(Map<String, Object> metadata, String name) {
- Object answer = metadata.get(name);
- if (answer != null) {
- return answer.toString();
- }
- return null;
- }
-
- public static Map<String, Object> getMetadata(Build build) {
- if (build != null) {
- Map<String, Object> additionalProperties = build.getAdditionalProperties();
- if (additionalProperties != null) {
- Object metadata = additionalProperties.get("metadata");
- if (metadata instanceof Map) {
- return (Map<String, Object>) metadata;
- }
- }
- }
- return Collections.EMPTY_MAP;
-
- }
-
- public static Map<String, Object> getMetadata(BuildConfig build) {
- if (build != null) {
- Map<String, Object> additionalProperties = build.getAdditionalProperties();
- if (additionalProperties != null) {
- Object metadata = additionalProperties.get("metadata");
- if (metadata instanceof Map) {
- return (Map<String, Object>) metadata;
- }
- }
- }
- return Collections.EMPTY_MAP;
-
- }
-
- public static String getName(BuildConfig build) {
- String answer = null;
- if (build != null) {
- Map<String, Object> metadata = getMetadata(build);
- answer = getString(metadata, "name");
- if (Strings.isNullOrBlank(answer)) {
- answer = build.getMetadata().getName();
- }
- }
- return answer;
- }
-
- public static String getName(Build build) {
- String answer = null;
- if (build != null) {
- Map<String, Object> metadata = getMetadata(build);
- answer = getString(metadata, "name");
- if (Strings.isNullOrBlank(answer)) {
- answer = build.getMetadata().getName();
- }
- }
- return answer;
- }
-
- public static String getNamespace(Build build) {
- String answer = null;
- if (build != null) {
- Map<String, Object> metadata = getMetadata(build);
- answer = getString(metadata, "namespace");
- if (Strings.isNullOrBlank(answer)) {
- answer = build.getMetadata().getNamespace();
- }
- }
- return answer;
- }
-
-
- public static String getCreationTimestamp(Build build) {
- String answer = null;
- if (build != null) {
- Map<String, Object> metadata = getMetadata(build);
- answer = getString(metadata, "creationTimestamp");
- if (Strings.isNullOrBlank(answer)) {
- answer = build.getMetadata().getCreationTimestamp();
- }
- }
- return answer;
- }
-
- public static Date getCreationTimestampDate(Build build) {
- String text = getCreationTimestamp(build);
- if (Strings.isNullOrBlank(text)) {
- return null;
- } else {
- return KubernetesHelper.parseDate(text);
- }
- }
-
-
- public static String getBuildConfigName(Build build) {
- if (build != null) {
- Map<String, Object> metadata = getMetadata(build);
- Object labels = metadata.get("labels");
- if (labels instanceof Map) {
- Map<String,Object> labelMap = (Map<String,Object>) labels;
- return getString(labelMap, "buildconfig");
- }
- }
- return null;
- }
-
- /**
- * Returns the link to the build page in the console for the given build UUID
- */
- public static String createConsoleBuildLink(String fabricConsoleExternalUrl, String buildName) {
- return URLUtils.pathJoin(fabricConsoleExternalUrl, "kubernetes/builds", buildName);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/Links.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/Links.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/Links.java
deleted file mode 100644
index b7b544d..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/builds/Links.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api.builds;
-
-import io.fabric8.utils.Strings;
-
-/**
- */
-public class Links {
-
- private static final String DEFAULT_FABRIC8_CONSOLE = "http://fabric8.local/";
-
- public static String getFabric8ConsoleLink() {
- String answer = System.getenv("FABRIC8_CONSOLE");
- if (Strings.isNullOrBlank(answer)) {
- answer = DEFAULT_FABRIC8_CONSOLE;
- }
- return answer;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/extensions/Configs.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/extensions/Configs.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/extensions/Configs.java
deleted file mode 100644
index 11ce41c..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/extensions/Configs.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api.extensions;
-
-import io.fabric8.kubernetes.api.model.config.AuthInfo;
-import io.fabric8.kubernetes.api.model.config.Config;
-import io.fabric8.kubernetes.api.KubernetesHelper;
-import io.fabric8.kubernetes.api.model.config.Context;
-import io.fabric8.kubernetes.api.model.config.NamedAuthInfo;
-import io.fabric8.kubernetes.api.model.config.NamedContext;
-import io.fabric8.utils.Objects;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-/**
- * Helper class for working with the YAML config file thats located in
- * <code>~/.config/openshift/config</code> which is updated when you use commands
- * like <code>osc login</code> and <code>osc project myproject</code>
- */
-public class Configs {
- public static final String OPENSHIFT_CONFIG_FILE_PROPERTY = "openshift.config.file";
- public static final String OPENSHIFT_CONFIG_FILE_ENV_VAR = "OPENSHIFTCONFIG";
- private static final transient Logger LOG = LoggerFactory.getLogger(Configs.class);
-
- public static Config parseConfigs() {
- File file = getOpenShiftConfigFile();
- if (file.exists() && file.isFile()) {
- try {
- return KubernetesHelper.loadYaml(file, Config.class);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- return null;
- }
-
- /**
- * Returns the current context in the given config
- */
- public static Context getCurrentContext(Config config) {
- String contextName = config.getCurrentContext();
- if (contextName != null) {
- List<NamedContext> contexts = config.getContexts();
- if (contexts != null) {
- for (NamedContext context : contexts) {
- if (Objects.equal(contextName, context.getName())) {
- return context.getContext();
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the current user token for the config and current context
- */
- public static String getUserToken(Config config, Context context) {
- AuthInfo authInfo = getUserAuthInfo(config, context);
- if (authInfo != null) {
- return authInfo.getToken();
- }
- return null;
- }
-
- /**
- * Returns the current {@link AuthInfo} for the current context and user
- */
- public static AuthInfo getUserAuthInfo(Config config, Context context) {
- AuthInfo authInfo = null;
- if (config != null && context != null) {
- String user = context.getUser();
- if (user != null) {
- List<NamedAuthInfo> users = config.getUsers();
- if (users != null) {
- for (NamedAuthInfo namedAuthInfo : users) {
- if (Objects.equal(user, namedAuthInfo.getName())) {
- authInfo = namedAuthInfo.getUser();
- }
- }
- }
- }
- }
- return authInfo;
- }
-
- public static File getOpenShiftConfigFile() {
- String file = System.getProperty(OPENSHIFT_CONFIG_FILE_PROPERTY);
- if (file != null) {
- return new File(file);
- }
- file = System.getenv(OPENSHIFT_CONFIG_FILE_ENV_VAR);
- if (file != null) {
- return new File(file);
- }
- String homeDir = System.getProperty("user.home", ".");
- return new File(homeDir, ".config/openshift/config");
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/extensions/Templates.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/extensions/Templates.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/extensions/Templates.java
deleted file mode 100644
index 7ecce66..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/extensions/Templates.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api.extensions;
-
-import io.fabric8.kubernetes.api.KubernetesHelper;
-import io.fabric8.kubernetes.api.model.HasMetadata;
-import io.fabric8.kubernetes.api.model.KubernetesList;
-import io.fabric8.openshift.api.model.template.Parameter;
-import io.fabric8.openshift.api.model.template.Template;
-import io.fabric8.utils.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import static io.fabric8.kubernetes.api.KubernetesFactory.createObjectMapper;
-
-/**
- * Helper class for working with OpenShift Templates
- */
-public class Templates {
- private static final transient Logger LOG = LoggerFactory.getLogger(Templates.class);
-
- /**
- * Allows a list of resources to be combined into a single Template if one or more templates are contained inside the list
- * or just return the unchanged list if no templates are present.
- */
- public static Object combineTemplates(KubernetesList kubernetesList) {
- Template firstTemplate = null;
- List<HasMetadata> items = kubernetesList.getItems();
- for (HasMetadata item : items) {
- if (item instanceof Template) {
- Template template = (Template) item;
- if (firstTemplate == null) {
- firstTemplate = template;
- } else {
- firstTemplate = combineTemplates(firstTemplate, template);
- }
- }
- }
- if (firstTemplate != null) {
- for (HasMetadata object : items) {
- if (!(object instanceof Template)) {
- addTemplateObject(firstTemplate, object);
- }
- }
- }
- return firstTemplate != null ? firstTemplate : kubernetesList;
- }
-
- public static Template combineTemplates(Template firstTemplate, Template template) {
- List<HasMetadata> objects = template.getObjects();
- if (objects != null) {
- for (HasMetadata object : objects) {
- addTemplateObject(firstTemplate, object);
- }
- }
- List<Parameter> parameters = firstTemplate.getParameters();
- if (parameters == null) {
- parameters = new ArrayList<>();
- firstTemplate.setParameters(parameters);
- }
- combineParameters(parameters, template.getParameters());
- String name = KubernetesHelper.getName(template);
- if (Strings.isNotBlank(name)) {
- // lets merge all the fabric8 annotations using the template id qualifier as a postfix
- Map<String, String> annotations = KubernetesHelper.getOrCreateAnnotations(firstTemplate);
- Map<String, String> otherAnnotations = KubernetesHelper.getOrCreateAnnotations(template);
- Set<Map.Entry<String, String>> entries = otherAnnotations.entrySet();
- for (Map.Entry<String, String> entry : entries) {
- String key = entry.getKey();
- String value = entry.getValue();
- if (!annotations.containsKey(key)) {
- annotations.put(key, value);
- }
- }
- }
- return firstTemplate;
- }
-
- protected static void combineParameters(List<Parameter> parameters, List<Parameter> otherParameters) {
- if (otherParameters != null && otherParameters.size() > 0) {
- Map<String, Parameter> map = new HashMap<>();
- for (Parameter parameter : parameters) {
- map.put(parameter.getName(), parameter);
- }
- for (Parameter otherParameter : otherParameters) {
- String name = otherParameter.getName();
- Parameter original = map.get(name);
- if (original == null) {
- parameters.add(otherParameter);
- } else {
- if (Strings.isNotBlank(original.getValue())) {
- original.setValue(otherParameter.getValue());
- }
- }
- }
- }
- }
-
- public static void addTemplateObject(Template template, HasMetadata object) {
- List<HasMetadata> objects = template.getObjects();
- objects.add(object);
- template.setObjects(objects);
- }
-
-
- /**
- * If we have any templates inside the items then lets unpack them and combine any parameters
- * @param kubernetesList
- * @param items
- */
- public static Object combineTemplates(KubernetesList kubernetesList, List<HasMetadata> items) {
- Template template = null;
- for (HasMetadata item : items) {
- if (item instanceof Template) {
- Template aTemplate = (Template) item;
- if (template == null) {
- template = aTemplate;
- } else {
- template = combineTemplates(template, aTemplate);
- }
- }
- }
- if (template != null) {
- // lets move all the content into the template
- for (HasMetadata item : items) {
- if (!(item instanceof Template)) {
- addTemplateObject(template, item);
- }
- }
- List<HasMetadata> objects = template.getObjects();
- return template;
- } else {
- return kubernetesList;
- }
- }
-
-
- /**
- * Lets allow template parameters to be overridden with a Properties object
- */
- public static void overrideTemplateParameters(Template template, Map<String, String> properties, String propertyNamePrefix) {
- List<io.fabric8.openshift.api.model.template.Parameter> parameters = template.getParameters();
- if (parameters != null && properties != null) {
- boolean missingProperty = false;
- for (io.fabric8.openshift.api.model.template.Parameter parameter : parameters) {
- String parameterName = parameter.getName();
- String name = propertyNamePrefix + parameterName;
- String propertyValue = properties.get(name);
- if (Strings.isNotBlank(propertyValue)) {
- LOG.info("Overriding template parameter " + name + " with value: " + propertyValue);
- parameter.setValue(propertyValue);
- } else {
- missingProperty = true;
- LOG.info("No property defined for template parameter: " + name);
- }
- }
- if (missingProperty) {
- LOG.debug("current properties " + new TreeSet<>(properties.keySet()));
- }
- }
- }
-
- /**
- * Lets locally process the templates so that we can process templates on any kubernetes environment
- */
- public static KubernetesList processTemplatesLocally(Template entity) throws IOException {
- List<HasMetadata> objects = null;
- if (entity != null) {
- objects = entity.getObjects();
- if (objects == null || objects.isEmpty()) {
- return null;
- }
- }
- List<Parameter> parameters = entity.getParameters();
- if (parameters != null && !parameters.isEmpty()) {
- String json = "{\"kind\": \"List\", \"apiVersion\": \"" +
- KubernetesHelper.defaultApiVersion + "\",\n" +
- " \"items\": " +
- KubernetesHelper.toJson(objects) +
- " }";
-
- // lets make a few passes in case there's expressions in values
- for (int i = 0; i < 5; i++) {
- for (Parameter parameter : parameters) {
- String name = parameter.getName();
- String regex = "\\$\\{" + name + "\\}";
- String value = parameter.getValue();
-
- // TODO generate random strings for passwords etc!
- if (Strings.isNullOrBlank(value)) {
- throw new IllegalArgumentException("No value available for parameter name: " + name);
- }
- json = Strings.replaceAllWithoutRegex(json, regex, value);
- }
- }
- return createObjectMapper().reader(KubernetesList.class).readValue(json);
- } else {
- KubernetesList answer = new KubernetesList();
- answer.setItems(objects);
- return answer;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/support/KindToClassMapping.java
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/support/KindToClassMapping.java b/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/support/KindToClassMapping.java
deleted file mode 100644
index f729942..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/support/KindToClassMapping.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.kubernetes.api.support;
-
-
-import io.fabric8.kubernetes.api.model.*;
-import io.fabric8.kubernetes.api.model.base.ListMeta;
-import io.fabric8.kubernetes.api.model.base.Status;
-import io.fabric8.kubernetes.api.model.base.StatusCause;
-import io.fabric8.kubernetes.api.model.base.StatusDetails;
-import io.fabric8.kubernetes.api.model.config.AuthInfo;
-import io.fabric8.kubernetes.api.model.config.Cluster;
-import io.fabric8.kubernetes.api.model.config.Config;
-import io.fabric8.kubernetes.api.model.config.Context;
-import io.fabric8.kubernetes.api.model.config.NamedAuthInfo;
-import io.fabric8.kubernetes.api.model.config.NamedCluster;
-import io.fabric8.kubernetes.api.model.config.NamedContext;
-import io.fabric8.kubernetes.api.model.config.NamedExtension;
-import io.fabric8.kubernetes.api.model.config.Preferences;
-import io.fabric8.kubernetes.api.model.errors.StatusError;
-import io.fabric8.kubernetes.api.model.resource.Quantity;
-import io.fabric8.kubernetes.api.model.util.IntOrString;
-import io.fabric8.openshift.api.model.Build;
-import io.fabric8.openshift.api.model.BuildConfig;
-import io.fabric8.openshift.api.model.BuildConfigList;
-import io.fabric8.openshift.api.model.BuildConfigSpec;
-import io.fabric8.openshift.api.model.BuildConfigStatus;
-import io.fabric8.openshift.api.model.BuildList;
-import io.fabric8.openshift.api.model.BuildOutput;
-import io.fabric8.openshift.api.model.BuildSource;
-import io.fabric8.openshift.api.model.BuildSpec;
-import io.fabric8.openshift.api.model.BuildStatus;
-import io.fabric8.openshift.api.model.BuildStrategy;
-import io.fabric8.openshift.api.model.BuildTriggerPolicy;
-import io.fabric8.openshift.api.model.CustomBuildStrategy;
-import io.fabric8.openshift.api.model.CustomDeploymentStrategyParams;
-import io.fabric8.openshift.api.model.DeploymentCause;
-import io.fabric8.openshift.api.model.DeploymentCauseImageTrigger;
-import io.fabric8.openshift.api.model.DeploymentConfig;
-import io.fabric8.openshift.api.model.DeploymentConfigList;
-import io.fabric8.openshift.api.model.DeploymentConfigSpec;
-import io.fabric8.openshift.api.model.DeploymentConfigStatus;
-import io.fabric8.openshift.api.model.DeploymentDetails;
-import io.fabric8.openshift.api.model.DeploymentStrategy;
-import io.fabric8.openshift.api.model.DeploymentTriggerImageChangeParams;
-import io.fabric8.openshift.api.model.DeploymentTriggerPolicy;
-import io.fabric8.openshift.api.model.DockerBuildStrategy;
-import io.fabric8.openshift.api.model.ExecNewPodHook;
-import io.fabric8.openshift.api.model.GitBuildSource;
-import io.fabric8.openshift.api.model.GitSourceRevision;
-import io.fabric8.openshift.api.model.Image;
-import io.fabric8.openshift.api.model.ImageChangeTrigger;
-import io.fabric8.openshift.api.model.ImageList;
-import io.fabric8.openshift.api.model.ImageStream;
-import io.fabric8.openshift.api.model.ImageStreamList;
-import io.fabric8.openshift.api.model.ImageStreamSpec;
-import io.fabric8.openshift.api.model.ImageStreamStatus;
-import io.fabric8.openshift.api.model.LifecycleHook;
-import io.fabric8.openshift.api.model.NamedTagEventList;
-import io.fabric8.openshift.api.model.NamedTagReference;
-import io.fabric8.openshift.api.model.OAuthAccessToken;
-import io.fabric8.openshift.api.model.OAuthAccessTokenList;
-import io.fabric8.openshift.api.model.OAuthAuthorizeToken;
-import io.fabric8.openshift.api.model.OAuthAuthorizeTokenList;
-import io.fabric8.openshift.api.model.OAuthClient;
-import io.fabric8.openshift.api.model.OAuthClientAuthorization;
-import io.fabric8.openshift.api.model.OAuthClientAuthorizationList;
-import io.fabric8.openshift.api.model.OAuthClientList;
-import io.fabric8.openshift.api.model.RecreateDeploymentStrategyParams;
-import io.fabric8.openshift.api.model.RollingDeploymentStrategyParams;
-import io.fabric8.openshift.api.model.Route;
-import io.fabric8.openshift.api.model.RouteList;
-import io.fabric8.openshift.api.model.RouteSpec;
-import io.fabric8.openshift.api.model.RouteStatus;
-import io.fabric8.openshift.api.model.SourceBuildStrategy;
-import io.fabric8.openshift.api.model.SourceControlUser;
-import io.fabric8.openshift.api.model.SourceRevision;
-import io.fabric8.openshift.api.model.TLSConfig;
-import io.fabric8.openshift.api.model.TagEvent;
-import io.fabric8.openshift.api.model.WebHookTrigger;
-import io.fabric8.openshift.api.model.template.Parameter;
-import io.fabric8.openshift.api.model.template.Template;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Maps the Kubernetes kinds to the Jackson DTO classes
- */
-public class KindToClassMapping {
- private static Map<String,Class<?>> map = new HashMap<>();
-
- static {
- map.put("AWSElasticBlockStoreVolumeSource", AWSElasticBlockStoreVolumeSource.class);
- map.put("AuthInfo", AuthInfo.class);
- map.put("BaseKubernetesList", BaseKubernetesList.class);
- map.put("Build", Build.class);
- map.put("BuildConfig", BuildConfig.class);
- map.put("BuildConfigList", BuildConfigList.class);
- map.put("BuildConfigSpec", BuildConfigSpec.class);
- map.put("BuildConfigStatus", BuildConfigStatus.class);
- map.put("BuildList", BuildList.class);
- map.put("BuildOutput", BuildOutput.class);
- map.put("BuildSource", BuildSource.class);
- map.put("BuildSpec", BuildSpec.class);
- map.put("BuildStatus", BuildStatus.class);
- map.put("BuildStrategy", BuildStrategy.class);
- map.put("BuildTriggerPolicy", BuildTriggerPolicy.class);
- map.put("Capabilities", Capabilities.class);
- map.put("Cluster", Cluster.class);
- map.put("Config", Config.class);
- map.put("Container", Container.class);
- map.put("ContainerPort", ContainerPort.class);
- map.put("ContainerState", ContainerState.class);
- map.put("ContainerStateRunning", ContainerStateRunning.class);
- map.put("ContainerStateTerminated", ContainerStateTerminated.class);
- map.put("ContainerStateWaiting", ContainerStateWaiting.class);
- map.put("ContainerStatus", ContainerStatus.class);
- map.put("Context", Context.class);
- map.put("CustomBuildStrategy", CustomBuildStrategy.class);
- map.put("CustomDeploymentStrategyParams", CustomDeploymentStrategyParams.class);
- map.put("DeploymentCause", DeploymentCause.class);
- map.put("DeploymentCauseImageTrigger", DeploymentCauseImageTrigger.class);
- map.put("DeploymentConfig", DeploymentConfig.class);
- map.put("DeploymentConfigList", DeploymentConfigList.class);
- map.put("DeploymentConfigSpec", DeploymentConfigSpec.class);
- map.put("DeploymentConfigStatus", DeploymentConfigStatus.class);
- map.put("DeploymentDetails", DeploymentDetails.class);
- map.put("DeploymentStrategy", DeploymentStrategy.class);
- map.put("DeploymentTriggerImageChangeParams", DeploymentTriggerImageChangeParams.class);
- map.put("DeploymentTriggerPolicy", DeploymentTriggerPolicy.class);
- map.put("DockerBuildStrategy", DockerBuildStrategy.class);
- map.put("EmptyDirVolumeSource", EmptyDirVolumeSource.class);
- map.put("EndpointAddress", EndpointAddress.class);
- map.put("EndpointPort", EndpointPort.class);
- map.put("EndpointSubset", EndpointSubset.class);
- map.put("Endpoints", Endpoints.class);
- map.put("EndpointsList", EndpointsList.class);
- map.put("EnvVar", EnvVar.class);
- map.put("EnvVarSource", EnvVarSource.class);
- map.put("ExecAction", ExecAction.class);
- map.put("ExecNewPodHook", ExecNewPodHook.class);
- map.put("GCEPersistentDiskVolumeSource", GCEPersistentDiskVolumeSource.class);
- map.put("GitBuildSource", GitBuildSource.class);
- map.put("GitRepoVolumeSource", GitRepoVolumeSource.class);
- map.put("GitSourceRevision", GitSourceRevision.class);
- map.put("GlusterfsVolumeSource", GlusterfsVolumeSource.class);
- map.put("HTTPGetAction", HTTPGetAction.class);
- map.put("Handler", Handler.class);
- map.put("HasMetadata", HasMetadata.class);
- map.put("HostPathVolumeSource", HostPathVolumeSource.class);
- map.put("ISCSIVolumeSource", ISCSIVolumeSource.class);
- map.put("Image", Image.class);
- map.put("ImageChangeTrigger", ImageChangeTrigger.class);
- map.put("ImageList", ImageList.class);
- map.put("ImageStream", ImageStream.class);
- map.put("ImageStreamList", ImageStreamList.class);
- map.put("ImageStreamSpec", ImageStreamSpec.class);
- map.put("ImageStreamStatus", ImageStreamStatus.class);
- map.put("IntOrString", IntOrString.class);
- map.put("KubeSchema", KubeSchema.class);
- map.put("KubernetesList", KubernetesList.class);
- map.put("Lifecycle", Lifecycle.class);
- map.put("LifecycleHook", LifecycleHook.class);
- map.put("ListMeta", ListMeta.class);
- map.put("NFSVolumeSource", NFSVolumeSource.class);
- map.put("NamedAuthInfo", NamedAuthInfo.class);
- map.put("NamedCluster", NamedCluster.class);
- map.put("NamedContext", NamedContext.class);
- map.put("NamedExtension", NamedExtension.class);
- map.put("NamedTagEventList", NamedTagEventList.class);
- map.put("NamedTagReference", NamedTagReference.class);
- map.put("Namespace", Namespace.class);
- map.put("NamespaceList", NamespaceList.class);
- map.put("NamespaceSpec", NamespaceSpec.class);
- map.put("NamespaceStatus", NamespaceStatus.class);
- map.put("Node", Node.class);
- map.put("NodeAddress", NodeAddress.class);
- map.put("NodeCondition", NodeCondition.class);
- map.put("NodeList", NodeList.class);
- map.put("NodeSpec", NodeSpec.class);
- map.put("NodeStatus", NodeStatus.class);
- map.put("NodeSystemInfo", NodeSystemInfo.class);
- map.put("OAuthAccessToken", OAuthAccessToken.class);
- map.put("OAuthAccessTokenList", OAuthAccessTokenList.class);
- map.put("OAuthAuthorizeToken", OAuthAuthorizeToken.class);
- map.put("OAuthAuthorizeTokenList", OAuthAuthorizeTokenList.class);
- map.put("OAuthClient", OAuthClient.class);
- map.put("OAuthClientAuthorization", OAuthClientAuthorization.class);
- map.put("OAuthClientAuthorizationList", OAuthClientAuthorizationList.class);
- map.put("OAuthClientList", OAuthClientList.class);
- map.put("ObjectFieldSelector", ObjectFieldSelector.class);
- map.put("ObjectMeta", ObjectMeta.class);
- map.put("ObjectReference", ObjectReference.class);
- map.put("Parameter", Parameter.class);
- map.put("PersistentVolumeClaimVolumeSource", PersistentVolumeClaimVolumeSource.class);
- map.put("Pod", Pod.class);
- map.put("PodCondition", PodCondition.class);
- map.put("PodList", PodList.class);
- map.put("PodSpec", PodSpec.class);
- map.put("PodStatus", PodStatus.class);
- map.put("PodTemplateSpec", PodTemplateSpec.class);
- map.put("Preferences", Preferences.class);
- map.put("Probe", Probe.class);
- map.put("Quantity", Quantity.class);
- map.put("RecreateDeploymentStrategyParams", RecreateDeploymentStrategyParams.class);
- map.put("ReplicationController", ReplicationController.class);
- map.put("ReplicationControllerList", ReplicationControllerList.class);
- map.put("ReplicationControllerSpec", ReplicationControllerSpec.class);
- map.put("ReplicationControllerStatus", ReplicationControllerStatus.class);
- map.put("ResourceRequirements", ResourceRequirements.class);
- map.put("RollingDeploymentStrategyParams", RollingDeploymentStrategyParams.class);
- map.put("Route", Route.class);
- map.put("RouteList", RouteList.class);
- map.put("SourceBuildStrategy", SourceBuildStrategy.class);
- map.put("RouteSpec", RouteSpec.class);
- map.put("RouteStatus", RouteStatus.class);
- map.put("SELinuxOptions", SELinuxOptions.class);
- map.put("Secret", Secret.class);
- map.put("SecretList", SecretList.class);
- map.put("SecretVolumeSource", SecretVolumeSource.class);
- map.put("SecurityContext", SecurityContext.class);
- map.put("Service", Service.class);
- map.put("ServiceAccount", ServiceAccount.class);
- map.put("ServiceAccountList", ServiceAccountList.class);
- map.put("ServiceList", ServiceList.class);
- map.put("ServicePort", ServicePort.class);
- map.put("ServiceSpec", ServiceSpec.class);
- map.put("ServiceStatus", ServiceStatus.class);
- map.put("SourceBuildStrategy", SourceBuildStrategy.class);
- map.put("SourceControlUser", SourceControlUser.class);
- map.put("SourceRevision", SourceRevision.class);
- map.put("Status", Status.class);
- map.put("StatusCause", StatusCause.class);
- map.put("StatusDetails", StatusDetails.class);
- map.put("StatusError", StatusError.class);
- map.put("TCPSocketAction", TCPSocketAction.class);
- map.put("TLSConfig", TLSConfig.class);
- map.put("TagEvent", TagEvent.class);
- map.put("Template", Template.class);
- map.put("Volume", Volume.class);
- map.put("VolumeMount", VolumeMount.class);
- map.put("WebHookTrigger", WebHookTrigger.class);
- }
-
- public static Map<String,Class<?>> getKindToClassMap() {
- return map;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/Dockerfile
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/Dockerfile b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/Dockerfile
deleted file mode 100644
index 78444b3..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/Dockerfile
+++ /dev/null
@@ -1,5 +0,0 @@
-FROM google/nodejs
-RUN npm i -g raml2html
-ADD . /data
-CMD ["-i", "/data/kubernetes.raml", "-o", "/data/kubernetes.html"]
-ENTRYPOINT ["raml2html"]
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/controller-list.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/controller-list.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/controller-list.json
deleted file mode 100644
index 2977476..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/controller-list.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "kind": "ReplicationControllerList",
- "apiVersion": "v1beta1",
- "items": [
- {
- "id": "testRun",
- "desiredState": {
- "replicas": 2,
- "replicaSelector": {
- "name": "testRun"
- },
- "podTemplate": {
- "desiredState": {
- "manifest": {
- "version": "v1beta1",
- "image": "dockerfile/nginx",
- "networkPorts": [
- {
- "hostPort": 8080,
- "containerPort": 80
- }
- ]
- }
- },
- "labels": {
- "name": "testRun"
- }
- }
- },
- "labels": {
- "name": "testRun"
- }
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/controller.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/controller.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/controller.json
deleted file mode 100644
index 6697ce1..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/controller.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "kind": "ReplicationController",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "nginx-controller",
- "labels": {"name": "nginx"}
- },
- "spec": {
- "replicas": 2,
- "selector": {"name": "nginx"},
- "template": {
- "metadata": {
- "labels": {"name": "nginx"}
- },
- "spec": {
- "containers": [{
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [{"containerPort": 80}]
- }]
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/external-service.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/external-service.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/external-service.json
deleted file mode 100644
index 00dfa13..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/external-service.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "id": "example",
- "kind": "Service",
- "apiVersion": "v1beta1",
- "port": 8000,
- "labels": {
- "name": "nginx"
- },
- "selector": {
- "name": "nginx"
- },
- "createExternalLoadBalancer": true
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/list.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/list.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/list.json
deleted file mode 100644
index 3c2566f..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/list.json
+++ /dev/null
@@ -1,98 +0,0 @@
-{
- "kind" : "List",
- "apiVersion" : "v1beta3",
- "items" : [ {
- "kind": "Service",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "fabric8-console-service",
- "namespace": "default",
- "selfLink": "/api/v1beta1/services/fabric8-console-service?namespace=default",
- "uid": "a2dac9a2-f22a-11e4-b882-fa163ee36154",
- "resourceVersion": "61428",
- "creationTimestamp": "2015-05-04T06:56:06Z",
- "labels": {
- "component": "console",
- "provider": "fabric8"
- }
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 80,
- "targetPort": 9090
- }
- ],
- "selector": {
- "component": "console",
- "provider": "fabric8"
- },
- "portalIP": "172.30.129.192",
- "sessionAffinity": "None"
- },
- "status": {}
- }, {
- "kind": "ReplicationController",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "fabric8-console-controller",
- "namespace": "default",
- "selfLink": "/api/v1beta1/replicationControllers/fabric8-console-controller?namespace=default",
- "uid": "d4253743-f22a-11e4-b882-fa163ee36154",
- "resourceVersion": "61718",
- "creationTimestamp": "2015-05-04T06:57:28Z",
- "labels": {
- "component": "console",
- "provider": "fabric8"
- }
- },
- "spec": {
- "replicas": 1,
- "selector": {
- "component": "console",
- "provider": "fabric8"
- },
- "template": {
- "metadata": {
- "creationTimestamp": null,
- "labels": {
- "component": "console",
- "provider": "fabric8"
- }
- },
- "spec": {
- "volumes": [],
- "containers": [
- {
- "name": "fabric8-console-container",
- "image": "fabric8/hawtio-kubernetes",
- "ports": [
- {
- "name": "http",
- "containerPort": 9090,
- "protocol": "TCP"
- },
- {
- "name": "jolokia",
- "containerPort": 8778,
- "protocol": "TCP"
- }
- ],
- "resources": {},
- "terminationMessagePath": "/dev/termination-log",
- "imagePullPolicy": "Always",
- "capabilities": {}
- }
- ],
- "restartPolicy": "Always",
- "dnsPolicy": "ClusterFirst"
- }
- }
- },
- "status": {
- "replicas": 1
- }
- }]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod-list-empty-results.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod-list-empty-results.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod-list-empty-results.json
deleted file mode 100644
index 2793f49..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod-list-empty-results.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "kind": "PodList",
- "selfLink": "/api/v1beta1/pods",
- "resourceVersion": 56138,
- "apiVersion": "v1beta3",
- "items": [
- {
- "kind": "Pod",
- "apiVersion": "v1beta3",
- "metadata": {
- },
- "status": {
- "phase": "Running",
- "hostIP": "127.0.0.1",
- "podIP": "172.17.0.180"
- }
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod-list.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod-list.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod-list.json
deleted file mode 100644
index 261a052..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod-list.json
+++ /dev/null
@@ -1,93 +0,0 @@
-{
- "kind": "List",
- "apiVersion": "v1beta3",
- "items": [
- {
- "kind": "Pod",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "my-pod-1",
- "generateName": "nexus-controller-",
- "namespace": "default",
- "selfLink": "/api/v1beta1/pods/nexus-controller-qq4p9?namespace=default",
- "uid": "2cf18435-f310-11e4-b882-fa163ee36154",
- "resourceVersion": "89638",
- "creationTimestamp": "2015-05-05T10:19:12Z",
- "labels": {
- "component": "nexus",
- "provider": "fabric8"
- }
- },
- "spec": {
- "volumes": [
- {
- "name": "nexus-storage",
- "hostPath": null,
- "emptyDir": {
- "medium": ""
- },
- "gcePersistentDisk": null,
- "gitRepo": null,
- "secret": null,
- "nfs": null,
- "iscsi": null,
- "glusterfs": null
- }
- ],
- "containers": [
- {
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [
- {
- "name": "http",
- "containerPort": 8081,
- "protocol": "TCP"
- }
- ],
- "resources": {},
- "volumeMounts": [
- {
- "name": "nexus-storage",
- "mountPath": "/sonatype-work/storage"
- }
- ],
- "terminationMessagePath": "/dev/termination-log",
- "imagePullPolicy": "IfNotPresent",
- "capabilities": {}
- }
- ],
- "restartPolicy": "Always",
- "dnsPolicy": "ClusterFirst",
- "host": "jimmi-docker-2.osop.rhcloud.com"
- },
- "status": {
- "phase": "Running",
- "Condition": [
- {
- "type": "Ready",
- "status": "True"
- }
- ],
- "hostIP": "fe80::f816:3eff:fee3:6154",
- "podIP": "172.17.0.180",
- "containerStatuses": [
- {
- "name": "nexus-container",
- "state": {
- "running": {
- "startedAt": "2015-05-05T10:19:51Z"
- }
- },
- "lastState": {},
- "ready": true,
- "restartCount": 0,
- "image": "fabric8/nexus",
- "imageID": "docker://0723d5f32ce06d8a72b6c2c3b3df84e4f8369e4ca6b836e312899118f2fe6575",
- "containerID": "docker://65dce1c091f9fac1679ed0c555df58b2f60a17cc5f85922358b28a1fd6b3f1f4"
- }
- ]
- }
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod.json
deleted file mode 100644
index 72d2f40..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/pod.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "kind": "Pod",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "php",
- "labels": {
- "name": "foo"
- }
- },
- "spec": {
- "containers": [
- {
- "name": "nginx",
- "image": "dockerfile/nginx",
- "ports": [
- {
- "hostPort": 8080,
- "containerPort": 80,
- "protocol": "TCP"
- }
- ],
- "livenessProbe": {
- "httpGet": {
- "path": "/index.html",
- "port": 8080
- },
- "initialDelaySeconds": 30,
- "timeoutSeconds": 1
- },
- "imagePullPolicy": "IfNotPresent"
- }
- ]
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/service-list.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/service-list.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/service-list.json
deleted file mode 100644
index 9f95f67..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/service-list.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "kind": "ServiceList",
- "apiVersion": "v1beta1",
- "items": [
- {
- "id": "example1",
- "port": 8000,
- "labels": {
- "name": "nginx"
- },
- "selector": {
- "name": "nginx"
- }
- },
- {
- "id": "example2",
- "port": 8080,
- "labels": {
- "env": "prod",
- "name": "jetty"
- },
- "selector": {
- "env": "prod",
- "name": "jetty"
- }
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/service.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/service.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/service.json
deleted file mode 100644
index 42388e7..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/service.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "kind": "Service",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "fabric8-console-service",
- "namespace": "default",
- "selfLink": "/api/v1beta1/services/fabric8-console-service?namespace=default",
- "uid": "a2dac9a2-f22a-11e4-b882-fa163ee36154",
- "resourceVersion": "61428",
- "creationTimestamp": "2015-05-04T06:56:06Z",
- "labels": {
- "component": "console",
- "provider": "fabric8"
- }
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 80,
- "targetPort": 9090
- }
- ],
- "selector": {
- "component": "console",
- "provider": "fabric8"
- },
- "portalIP": "172.30.129.192",
- "sessionAffinity": "None"
- },
- "status": {}
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/12c0ea00/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/template.json
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/template.json b/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/template.json
deleted file mode 100644
index 5e40e67..0000000
--- a/dependencies/fabric8/kubernetes-api/src/main/kubernetes/api/examples/template.json
+++ /dev/null
@@ -1,146 +0,0 @@
-{
- "kind": "Template",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "jenkins",
- "namespace": "default",
- "selfLink": "/osapi/v1beta1/templates/jenkins?namespace=default",
- "uid": "420dc894-f24f-11e4-b882-fa163ee36154",
- "resourceVersion": "66310",
- "creationTimestamp": "2015-05-04T11:18:15Z"
- },
- "objects": [
- {
- "kind": "Service",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "jenkins",
- "creationTimestamp": null,
- "labels": {
- "component": "jenkins",
- "provider": "fabric8"
- }
- },
- "spec": {
- "ports": [
- {
- "name": "",
- "protocol": "TCP",
- "port": 80,
- "targetPort": 8080
- }
- ],
- "selector": {
- "component": "jenkins",
- "provider": "fabric8"
- },
- "portalIP": "",
- "sessionAffinity": "None"
- },
- "status": {}
- },
- {
- "kind": "ReplicationController",
- "apiVersion": "v1beta3",
- "metadata": {
- "name": "jenkins-controller",
- "creationTimestamp": null,
- "labels": {
- "component": "jenkins",
- "provider": "fabric8"
- }
- },
- "spec": {
- "replicas": 1,
- "selector": {
- "component": "jenkins",
- "provider": "fabric8"
- },
- "template": {
- "metadata": {
- "creationTimestamp": null,
- "labels": {
- "component": "jenkins",
- "provider": "fabric8"
- }
- },
- "spec": {
- "volumes": [
- {
- "name": "docker-socket",
- "hostPath": {
- "path": "/var/run/docker.sock"
- },
- "emptyDir": null,
- "gcePersistentDisk": null,
- "gitRepo": null,
- "secret": null,
- "nfs": null,
- "iscsi": null,
- "glusterfs": null
- },
- {
- "name": "jenkins-workspace",
- "hostPath": null,
- "emptyDir": {
- "medium": ""
- },
- "gcePersistentDisk": null,
- "gitRepo": null,
- "secret": null,
- "nfs": null,
- "iscsi": null,
- "glusterfs": null
- }
- ],
- "containers": [
- {
- "name": "jenkins-container",
- "image": "fabric8/jenkins",
- "ports": [
- {
- "name": "http",
- "containerPort": 8080,
- "protocol": "TCP"
- }
- ],
- "env": [
- {
- "name": "SEED_GIT_URL",
- "value": "${SEED_GIT_URL}"
- }
- ],
- "resources": {},
- "volumeMounts": [
- {
- "name": "jenkins-workspace",
- "mountPath": "/var/jenkins_home/workspace"
- },
- {
- "name": "docker-socket",
- "mountPath": "/var/run/docker.sock"
- }
- ],
- "terminationMessagePath": "/dev/termination-log",
- "imagePullPolicy": "IfNotPresent",
- "capabilities": {}
- }
- ],
- "restartPolicy": "Always",
- "dnsPolicy": "ClusterFirst"
- }
- }
- },
- "status": {
- "replicas": 0
- }
- }
- ],
- "parameters": [
- {
- "name": "SEED_GIT_URL",
- "description": "The git URL of the seed build used to generate builds",
- "value": "https://github.com/fabric8io/jenkins-pipeline-dsl.git"
- }
- ]
-}
[15/50] [abbrv] stratos git commit: Merge branch 'tenant-isolation'
of https://github.com/apache/stratos into tenant-isolation-v1
Posted by ga...@apache.org.
Merge branch 'tenant-isolation' of https://github.com/apache/stratos into tenant-isolation-v1
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/c987f4dd
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/c987f4dd
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/c987f4dd
Branch: refs/heads/master
Commit: c987f4dd5e012c56beb2b8eaafc5c1559ca04280
Parents: c814a3d 260f738
Author: Dinithi <di...@wso2.com>
Authored: Fri Aug 21 17:40:46 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Fri Aug 21 17:40:46 2015 +0530
----------------------------------------------------------------------
.../publisher/ThriftClientConfig.java | 34 +++++++--
.../publisher/ThriftClientConfigParser.java | 77 ++++++++++++++------
.../publisher/ThriftStatisticsPublisher.java | 9 ++-
.../cep/WSO2CEPHealthStatisticsPublisher.java | 7 +-
.../cep/WSO2CEPInFlightRequestPublisher.java | 5 +-
.../test/ThriftClientConfigParserTest.java | 18 +++--
.../src/test/resources/thrift-client-config.xml | 20 +++--
.../DASDefaultWSO2EventOutputAdaptor.xml | 4 +-
products/stratos/conf/thrift-client-config.xml | 20 +++--
9 files changed, 138 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
[30/50] [abbrv] stratos git commit: Fixing kubernetes api bundle's
export packages and port ranges in kubernetes clusters in samples
Posted by ga...@apache.org.
Fixing kubernetes api bundle's export packages and port ranges in kubernetes clusters in samples
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/ff1b1a66
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/ff1b1a66
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/ff1b1a66
Branch: refs/heads/master
Commit: ff1b1a66f7f77e44ac415a9efb15c5409d2e1763
Parents: 247b450
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Jul 26 14:50:09 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Thu Aug 27 16:43:25 2015 +0530
----------------------------------------------------------------------
components/org.apache.stratos.kubernetes.client/pom.xml | 1 +
dependencies/fabric8/kubernetes-api/pom.xml | 2 ++
.../org.apache.stratos.event.processor.server.feature/pom.xml | 2 +-
samples/kubernetes-clusters/kubernetes-cluster-1.json | 4 ++--
samples/kubernetes-clusters/kubernetes-cluster-2.json | 4 ++--
samples/kubernetes-clusters/kubernetes-cluster-ec2.json | 4 ++--
6 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/ff1b1a66/components/org.apache.stratos.kubernetes.client/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/pom.xml b/components/org.apache.stratos.kubernetes.client/pom.xml
index 287688b..4676ee3 100644
--- a/components/org.apache.stratos.kubernetes.client/pom.xml
+++ b/components/org.apache.stratos.kubernetes.client/pom.xml
@@ -72,6 +72,7 @@
</Export-Package>
<Import-Package>
io.fabric8.kubernetes.api.*;version=${kubernetes.api.stratos.version},
+ io.fabric8.kubernetes.api.model.*;version=${kubernetes.api.stratos.version},
*;resolution:=optional
</Import-Package>
<DynamicImport-Package>*</DynamicImport-Package>
http://git-wip-us.apache.org/repos/asf/stratos/blob/ff1b1a66/dependencies/fabric8/kubernetes-api/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/pom.xml b/dependencies/fabric8/kubernetes-api/pom.xml
index 1ecf13e..605d358 100644
--- a/dependencies/fabric8/kubernetes-api/pom.xml
+++ b/dependencies/fabric8/kubernetes-api/pom.xml
@@ -142,6 +142,8 @@
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Export-Package>
io.fabric8.kubernetes.api.*;version=${kubernetes.api.stratos.version},
+ io.fabric8.kubernetes.api.model.*;version=${kubernetes.api.stratos.version},
+ io.fabric8.kubernetes.internal.*,
</Export-Package>
<Import-Package>
!javax.xml.bind.annotation.adapters,
http://git-wip-us.apache.org/repos/asf/stratos/blob/ff1b1a66/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml b/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml
index 0260e8c..18b26b2 100644
--- a/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml
+++ b/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml
@@ -29,7 +29,7 @@
<version>4.1.0-SNAPSHOT</version>
<artifactId>org.apache.stratos.event.processor.server.feature</artifactId>
<packaging>pom</packaging>
- <name>Apache Stratos - Event Processor Server Feature</name>
+ <name>Apache Stratos - Event Processor Server Feature</name>
<url>http://apache.org</url>
<description>This feature contains the core bundles required for Back-end Event Processor functionality
</description>
http://git-wip-us.apache.org/repos/asf/stratos/blob/ff1b1a66/samples/kubernetes-clusters/kubernetes-cluster-1.json
----------------------------------------------------------------------
diff --git a/samples/kubernetes-clusters/kubernetes-cluster-1.json b/samples/kubernetes-clusters/kubernetes-cluster-1.json
index 4b07b41..399ba83 100644
--- a/samples/kubernetes-clusters/kubernetes-cluster-1.json
+++ b/samples/kubernetes-clusters/kubernetes-cluster-1.json
@@ -10,8 +10,8 @@
]
},
"portRange": {
- "upper": "5000",
- "lower": "4500"
+ "upper": "32767",
+ "lower": "30000"
},
"kubernetesHosts": [
{
http://git-wip-us.apache.org/repos/asf/stratos/blob/ff1b1a66/samples/kubernetes-clusters/kubernetes-cluster-2.json
----------------------------------------------------------------------
diff --git a/samples/kubernetes-clusters/kubernetes-cluster-2.json b/samples/kubernetes-clusters/kubernetes-cluster-2.json
index 6e2ac93..0bd2260 100644
--- a/samples/kubernetes-clusters/kubernetes-cluster-2.json
+++ b/samples/kubernetes-clusters/kubernetes-cluster-2.json
@@ -10,8 +10,8 @@
]
},
"portRange": {
- "upper": "5000",
- "lower": "4500"
+ "upper": "32767",
+ "lower": "30000"
},
"kubernetesHosts": [
{
http://git-wip-us.apache.org/repos/asf/stratos/blob/ff1b1a66/samples/kubernetes-clusters/kubernetes-cluster-ec2.json
----------------------------------------------------------------------
diff --git a/samples/kubernetes-clusters/kubernetes-cluster-ec2.json b/samples/kubernetes-clusters/kubernetes-cluster-ec2.json
index 0affc00..02a26f9 100644
--- a/samples/kubernetes-clusters/kubernetes-cluster-ec2.json
+++ b/samples/kubernetes-clusters/kubernetes-cluster-ec2.json
@@ -10,8 +10,8 @@
]
},
"portRange": {
- "upper": "5000",
- "lower": "4500"
+ "upper": "32767",
+ "lower": "30000"
},
"kubernetesHosts": [
{
[07/50] [abbrv] stratos git commit: Update executor service with
blocking queue
Posted by ga...@apache.org.
Update executor service with blocking queue
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/861d6ac1
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/861d6ac1
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/861d6ac1
Branch: refs/heads/master
Commit: 861d6ac17a23e86934d969b1794ab4b200aeefa8
Parents: a776ca1
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 21 11:52:06 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 21 11:52:06 2015 +0530
----------------------------------------------------------------------
.../org/apache/stratos/common/threading/StratosThreadPool.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/861d6ac1/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
index 45da339..fc709c7 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
@@ -32,6 +32,7 @@ import java.util.concurrent.*;
public class StratosThreadPool {
private static final Log log = LogFactory.getLog(StratosThreadPool.class);
+ private static final int MAXIMUM_POOL_SIZE = 1000;
private static Map<String, ExecutorService> executorServiceMap = new ConcurrentHashMap<String, ExecutorService>();
private static Map<String, ScheduledExecutorService> scheduledServiceMap = new ConcurrentHashMap<String, ScheduledExecutorService>();
@@ -51,9 +52,9 @@ public class StratosThreadPool {
synchronized (executorServiceMapLock) {
if (executorService == null) {
final BlockingQueue<Runnable> queue = new ArrayBlockingQueue(threadPoolSize);
- ThreadPoolExecutor threadPool=new ThreadPoolExecutor(threadPoolSize, 1000,
+ ThreadPoolExecutor threadPool=new ThreadPoolExecutor(threadPoolSize, MAXIMUM_POOL_SIZE,
0L, TimeUnit.MILLISECONDS,
- queue);// Executors.newFixedThreadPool(threadPoolSize);
+ queue);
threadPool.setRejectedExecutionHandler(new RejectedExecutionHandler() {
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
try {
[49/50] [abbrv] stratos git commit: Conflict resolved
Posted by ga...@apache.org.
Conflict resolved
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/218fc1f5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/218fc1f5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/218fc1f5
Branch: refs/heads/master
Commit: 218fc1f5cfbe3b0c99a0deead82c0cb339fc79bf
Parents: 94f2278 d5f11fc
Author: gayangunarathne <ga...@wso2.com>
Authored: Tue Sep 1 17:22:30 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Tue Sep 1 17:22:30 2015 +0530
----------------------------------------------------------------------
.../applications/topic/ApplicationBuilder.java | 1 -
.../org.apache.stratos.cartridge.agent/pom.xml | 2 -
.../test/resources/test-conf/test.properties | 20 +
.../context/CloudControllerContext.java | 4 +
.../application/ApplicationEventReceiver.java | 4 +-
.../status/ClusterStatusTopicReceiver.java | 9 -
.../status/InstanceStatusTopicReceiver.java | 5 -
.../messaging/topology/TopologyManager.java | 16 +-
.../console/README.md | 9 +-
.../mock/iaas/client/MockIaasApiClient.java | 4 +-
.../cartridge.agent/cartridge.agent/config.py | 13 +-
.../cartridge.agent/cartridge.agent/entity.py | 5 +-
.../extensions/bash/CreateLVSDummyInterface.sh | 26 +
.../extensions/bash/MemberInitializedEvent.sh | 26 +
.../cartridge.agent/healthstats.py | 2 +-
.../modules/artifactmgt/git/agentgithandler.py | 37 +-
.../cartridge.agent/modules/databridge/agent.py | 7 +-
.../modules/databridge/thrift/publisher.py | 9 +-
.../thrift/thrift/transport/TSSLSocket.py | 357 ++++----
.../modules/event/eventhandler.py | 33 +-
.../cartridge.agent/publisher.py | 1 -
.../rest/endpoint/api/StratosApiV41.java | 2 +-
dependencies/org.wso2.carbon.ui/pom.xml | 92 +-
.../HealthStatisticsEventBuilder.xml | 31 -
.../LoadBalancerStatisticsEventBuilder.xml | 31 -
.../AverageInFlightRequestsEventFormatter.xml | 32 -
.../AverageLoadAverageEventFormatter.xml | 32 -
.../AverageMemoryConsumptionEventFormatter.xml | 32 -
.../FaultMessageEventFormatter.xml | 32 -
.../GradientInFlightRequestsEventFormatter.xml | 32 -
.../GradientLoadAverageEventFormatter.xml | 32 -
.../GradientMemoryConsumptionEventFormatter.xml | 32 -
.../MemberAverageLoadAverageEventFormatter.xml | 32 -
...erAverageMemoryConsumptionEventFormatter.xml | 32 -
.../MemberGradientLoadAverageEventFormatter.xml | 32 -
...rGradientMemoryConsumptionEventFormatter.xml | 32 -
...econdDerivativeLoadAverageEventFormatter.xml | 32 -
...erivativeMemoryConsumptionEventFormatter.xml | 32 -
...DerivativeInFlightRequestsEventFormatter.xml | 32 -
...econdDerivativeLoadAverageEventFormatter.xml | 32 -
...erivativeMemoryConsumptionEventFormatter.xml | 32 -
.../executionplans/AverageHeathRequest.xml | 71 --
.../AverageInFlightRequestsFinder.xml | 48 --
.../executionplans/GradientOfHealthRequest.xml | 71 --
.../GradientOfRequestsInFlightFinder.xml | 48 --
.../SecondDerivativeOfHealthRequest.xml | 68 --
...SecondDerivativeOfRequestsInFlightFinder.xml | 48 --
.../DefaultWSO2EventInputAdaptor.xml | 24 -
.../DefaultWSO2EventOutputAdaptor.xml | 29 -
.../outputeventadaptors/JMSOutputAdaptor.xml | 30 -
.../streamdefinitions/stream-manager-config.xml | 311 -------
extensions/cep/distribution/README.md | 12 -
extensions/cep/distribution/pom.xml | 66 --
.../cep/distribution/src/assembly/bin.xml | 59 --
.../cep/distribution/src/main/license/LICENSE | 204 -----
.../cep/distribution/src/main/notice/NOTICE | 7 -
.../HealthStatisticsEventBuilder.xml | 31 +
.../LoadBalancerStatisticsEventBuilder.xml | 31 +
.../AverageInFlightRequestsEventFormatter.xml | 32 +
.../AverageLoadAverageEventFormatter.xml | 32 +
.../AverageMemoryConsumptionEventFormatter.xml | 32 +
.../FaultMessageEventFormatter.xml | 32 +
.../GradientInFlightRequestsEventFormatter.xml | 32 +
.../GradientLoadAverageEventFormatter.xml | 32 +
.../GradientMemoryConsumptionEventFormatter.xml | 32 +
.../MemberAverageLoadAverageEventFormatter.xml | 32 +
...erAverageMemoryConsumptionEventFormatter.xml | 32 +
.../MemberGradientLoadAverageEventFormatter.xml | 32 +
...rGradientMemoryConsumptionEventFormatter.xml | 32 +
...econdDerivativeLoadAverageEventFormatter.xml | 32 +
...erivativeMemoryConsumptionEventFormatter.xml | 32 +
...DerivativeInFlightRequestsEventFormatter.xml | 32 +
...econdDerivativeLoadAverageEventFormatter.xml | 32 +
...erivativeMemoryConsumptionEventFormatter.xml | 32 +
.../executionplans/AverageHeathRequest.xml | 71 ++
.../AverageInFlightRequestsFinder.xml | 48 ++
.../executionplans/GradientOfHealthRequest.xml | 71 ++
.../GradientOfRequestsInFlightFinder.xml | 48 ++
.../SecondDerivativeOfHealthRequest.xml | 68 ++
...SecondDerivativeOfRequestsInFlightFinder.xml | 48 ++
.../DefaultWSO2EventInputAdaptor.xml | 24 +
.../DefaultWSO2EventOutputAdaptor.xml | 29 +
.../outputeventadaptors/JMSOutputAdaptor.xml | 30 +
.../streamdefinitions/stream-manager-config.xml | 311 +++++++
extensions/cep/modules/distribution/README.md | 12 +
extensions/cep/modules/distribution/pom.xml | 66 ++
.../modules/distribution/src/assembly/bin.xml | 59 ++
.../distribution/src/main/license/LICENSE | 204 +++++
.../modules/distribution/src/main/notice/NOTICE | 7 +
.../cep/modules/stratos-cep-extension/pom.xml | 63 ++
.../cep/extension/CEPTopologyEventReceiver.java | 99 +++
.../cep/extension/ConcatWindowProcessor.java | 54 ++
.../extension/FaultHandlingWindowProcessor.java | 349 ++++++++
.../GradientFinderWindowProcessor.java | 283 +++++++
...equestHandlingCapabilityWindowProcessor.java | 68 ++
.../SecondDerivativeFinderWindowProcessor.java | 301 +++++++
extensions/cep/pom.xml | 38 +
extensions/cep/stratos-cep-extension/pom.xml | 63 --
.../cep/extension/CEPTopologyEventReceiver.java | 99 ---
.../cep/extension/ConcatWindowProcessor.java | 54 --
.../extension/FaultHandlingWindowProcessor.java | 349 --------
.../GradientFinderWindowProcessor.java | 283 -------
...equestHandlingCapabilityWindowProcessor.java | 68 --
.../SecondDerivativeFinderWindowProcessor.java | 301 -------
.../load-balancer/haproxy-extension/INSTALL.md | 32 -
.../load-balancer/haproxy-extension/README.md | 20 -
.../load-balancer/haproxy-extension/pom.xml | 109 ---
.../haproxy-extension/src/main/assembly/bin.xml | 106 ---
.../src/main/bin/haproxy-extension.sh | 50 --
.../src/main/conf/jndi.properties | 22 -
.../src/main/conf/log4j.properties | 40 -
.../src/main/conf/thrift-client-config.xml | 27 -
.../stratos/haproxy/extension/Constants.java | 39 -
.../stratos/haproxy/extension/HAProxy.java | 158 ----
.../haproxy/extension/HAProxyConfigWriter.java | 147 ----
.../haproxy/extension/HAProxyContext.java | 157 ----
.../extension/HAProxyStatisticsReader.java | 108 ---
.../apache/stratos/haproxy/extension/Main.java | 85 --
.../haproxy-extension/src/main/license/LICENSE | 481 -----------
.../haproxy-extension/src/main/notice/NOTICE | 402 ---------
.../src/main/resources/velocity.properties | 26 -
.../src/main/scripts/get-weight.sh | 23 -
.../src/main/security/client-truststore.jks | Bin 35240 -> 0 bytes
.../src/main/templates/haproxy.cfg.template | 17 -
.../load-balancer/lvs-extension/INSTALL.md | 37 -
.../load-balancer/lvs-extension/README.md | 18 -
extensions/load-balancer/lvs-extension/pom.xml | 109 ---
.../lvs-extension/src/main/assembly/bin.xml | 106 ---
.../lvs-extension/src/main/bin/lvs-extension.sh | 54 --
.../lvs-extension/src/main/conf/jndi.properties | 22 -
.../src/main/conf/log4j.properties | 40 -
.../src/main/conf/thrift-client-config.xml | 25 -
.../apache/stratos/lvs/extension/Constants.java | 43 -
.../org/apache/stratos/lvs/extension/LVS.java | 158 ----
.../stratos/lvs/extension/LVSConfigWriter.java | 237 ------
.../stratos/lvs/extension/LVSContext.java | 203 -----
.../lvs/extension/LVSStatisticsReader.java | 80 --
.../org/apache/stratos/lvs/extension/Main.java | 85 --
.../lvs-extension/src/main/license/LICENSE | 481 -----------
.../lvs-extension/src/main/notice/NOTICE | 395 ---------
.../src/main/resources/velocity.properties | 26 -
.../src/main/security/client-truststore.jks | Bin 35240 -> 0 bytes
.../src/main/templates/keepalived.conf.template | 59 --
.../modules/haproxy-extension/INSTALL.md | 32 +
.../modules/haproxy-extension/README.md | 20 +
.../modules/haproxy-extension/pom.xml | 110 +++
.../haproxy-extension/src/main/assembly/bin.xml | 106 +++
.../src/main/bin/haproxy-extension.sh | 50 ++
.../src/main/conf/jndi.properties | 22 +
.../src/main/conf/log4j.properties | 40 +
.../src/main/conf/thrift-client-config.xml | 27 +
.../stratos/haproxy/extension/Constants.java | 39 +
.../stratos/haproxy/extension/HAProxy.java | 158 ++++
.../haproxy/extension/HAProxyConfigWriter.java | 152 ++++
.../haproxy/extension/HAProxyContext.java | 157 ++++
.../extension/HAProxyStatisticsReader.java | 108 +++
.../apache/stratos/haproxy/extension/Main.java | 85 ++
.../haproxy-extension/src/main/license/LICENSE | 481 +++++++++++
.../haproxy-extension/src/main/notice/NOTICE | 402 +++++++++
.../src/main/resources/velocity.properties | 26 +
.../src/main/scripts/get-weight.sh | 23 +
.../src/main/security/client-truststore.jks | Bin 0 -> 35240 bytes
.../src/main/templates/haproxy.cfg.template | 17 +
.../modules/lvs-extension/INSTALL.md | 37 +
.../modules/lvs-extension/README.md | 18 +
.../load-balancer/modules/lvs-extension/pom.xml | 110 +++
.../lvs-extension/src/main/assembly/bin.xml | 106 +++
.../lvs-extension/src/main/bin/lvs-extension.sh | 54 ++
.../lvs-extension/src/main/conf/jndi.properties | 22 +
.../src/main/conf/log4j.properties | 40 +
.../src/main/conf/thrift-client-config.xml | 25 +
.../apache/stratos/lvs/extension/Constants.java | 43 +
.../org/apache/stratos/lvs/extension/LVS.java | 158 ++++
.../stratos/lvs/extension/LVSConfigWriter.java | 241 ++++++
.../stratos/lvs/extension/LVSContext.java | 203 +++++
.../lvs/extension/LVSStatisticsReader.java | 80 ++
.../org/apache/stratos/lvs/extension/Main.java | 85 ++
.../lvs-extension/src/main/license/LICENSE | 481 +++++++++++
.../lvs-extension/src/main/notice/NOTICE | 395 +++++++++
.../src/main/resources/velocity.properties | 26 +
.../src/main/security/client-truststore.jks | Bin 0 -> 35240 bytes
.../src/main/templates/keepalived.conf.template | 59 ++
.../modules/nginx-extension/INSTALL.md | 33 +
.../modules/nginx-extension/README.md | 27 +
.../modules/nginx-extension/pom.xml | 110 +++
.../nginx-extension/src/main/assembly/bin.xml | 106 +++
.../src/main/bin/nginx-extension.sh | 50 ++
.../src/main/conf/jndi.properties | 22 +
.../src/main/conf/log4j.properties | 40 +
.../src/main/conf/thrift-client-config.xml | 27 +
.../stratos/nginx/extension/Constants.java | 39 +
.../apache/stratos/nginx/extension/Main.java | 85 ++
.../apache/stratos/nginx/extension/Nginx.java | 140 ++++
.../nginx/extension/NginxConfigWriter.java | 181 ++++
.../stratos/nginx/extension/NginxContext.java | 157 ++++
.../nginx/extension/NginxStatisticsReader.java | 124 +++
.../nginx-extension/src/main/license/LICENSE | 481 +++++++++++
.../nginx-extension/src/main/notice/NOTICE | 402 +++++++++
.../src/main/resources/velocity.properties | 26 +
.../src/main/security/client-truststore.jks | Bin 0 -> 35240 bytes
.../src/main/templates/nginx.cfg.template | 8 +
.../load-balancer/nginx-extension/INSTALL.md | 33 -
.../load-balancer/nginx-extension/README.md | 27 -
.../load-balancer/nginx-extension/pom.xml | 109 ---
.../nginx-extension/src/main/assembly/bin.xml | 106 ---
.../src/main/bin/nginx-extension.sh | 50 --
.../src/main/conf/jndi.properties | 22 -
.../src/main/conf/log4j.properties | 40 -
.../src/main/conf/thrift-client-config.xml | 27 -
.../stratos/nginx/extension/Constants.java | 39 -
.../apache/stratos/nginx/extension/Main.java | 85 --
.../apache/stratos/nginx/extension/Nginx.java | 140 ----
.../nginx/extension/NginxConfigWriter.java | 177 ----
.../stratos/nginx/extension/NginxContext.java | 157 ----
.../nginx/extension/NginxStatisticsReader.java | 124 ---
.../nginx-extension/src/main/license/LICENSE | 481 -----------
.../nginx-extension/src/main/notice/NOTICE | 402 ---------
.../src/main/resources/velocity.properties | 26 -
.../src/main/security/client-truststore.jks | Bin 35240 -> 0 bytes
.../src/main/templates/nginx.cfg.template | 8 -
extensions/load-balancer/pom.xml | 8 +-
extensions/pom.xml | 3 +-
pom.xml | 23 +
.../modules/distribution/INSTALL.txt | 2 +-
.../modules/distribution/pom.xml | 5 +-
.../distribution/src/main/assembly/bin.xml | 1 -
.../load-balancer/modules/distribution/pom.xml | 3 +-
.../distribution/src/main/assembly/bin.xml | 121 +--
.../src/main/assembly/filter.properties | 2 +-
.../test/PythonCartridgeAgentTest.java | 578 -------------
.../src/test/resources/pca-testing1.xml | 2 +-
.../src/test/resources/suite-1/agent.conf | 45 +
.../src/test/resources/suite-2/agent.conf | 45 +
.../src/test/resources/suite-3/agent.conf | 45 -
products/stratos-cli/distribution/INSTALL.txt | 42 -
products/stratos-cli/distribution/README.txt | 75 --
products/stratos-cli/distribution/pom.xml | 84 --
.../distribution/src/main/assembly/bin.xml | 88 --
.../distribution/src/main/bin/stratos.bat | 80 --
.../distribution/src/main/bin/stratos.sh | 42 -
.../distribution/src/main/conf/log4j.properties | 37 -
.../distribution/src/main/license/LICENSE | 836 -------------------
.../distribution/src/main/notice/NOTICE | 85 --
.../modules/distribution/INSTALL.txt | 42 +
.../stratos-cli/modules/distribution/README.txt | 75 ++
.../stratos-cli/modules/distribution/pom.xml | 85 ++
.../distribution/src/main/assembly/bin.xml | 88 ++
.../distribution/src/main/bin/stratos.bat | 80 ++
.../distribution/src/main/bin/stratos.sh | 42 +
.../distribution/src/main/conf/log4j.properties | 37 +
.../distribution/src/main/license/LICENSE | 836 +++++++++++++++++++
.../modules/distribution/src/main/notice/NOTICE | 85 ++
products/stratos-cli/pom.xml | 5 +-
.../stratos/modules/distribution/INSTALL.txt | 2 +-
products/stratos/modules/distribution/pom.xml | 6 +-
.../modules/distribution/src/assembly/bin.xml | 228 ++---
.../distribution/src/assembly/filter.properties | 1 -
.../distribution/src/main/conf/axis2/axis2.xml | 8 +-
.../distribution/src/main/conf/carbon.xml | 2 +-
products/stratos/modules/integration/pom.xml | 6 +
.../tests/rest/IntegrationMockClient.java | 7 +-
.../src/test/resources/stratos-testing.xml | 4 +-
.../test-conf/integration-test.properties | 26 +
tools/config-scripts/ec2/config.sh | 6 +-
tools/config-scripts/gce/config.sh | 4 -
tools/config-scripts/openstack/config.sh | 6 +-
.../base-image/Dockerfile | 13 +-
.../service-images/php/Dockerfile | 4 +-
.../php/packs/plugins/PhpServerStarterPlugin.py | 36 -
.../plugins/PhpServerStarterPlugin.yapsy-plugin | 26 -
.../php/plugins/PhpServerStarterPlugin.py | 36 +
.../plugins/PhpServerStarterPlugin.yapsy-plugin | 26 +
.../service-images/tomcat/Dockerfile | 2 +-
.../service-images/tomcat/packs/.gitignore | 4 +
.../packs/plugins/TomcatServerStarterPlugin.py | 38 -
.../TomcatServerStarterPlugin.yapsy-plugin | 25 -
.../tomcat/plugins/TomcatServerStarterPlugin.py | 38 +
.../TomcatServerStarterPlugin.yapsy-plugin | 25 +
tools/puppet3/modules/agent/files/README.txt | 2 +-
tools/puppet3/modules/haproxy/files/README.txt | 2 +-
tools/puppet3/modules/lb/files/README.txt | 2 +-
.../modules/python_agent/files/README.txt | 2 +-
tools/stratos-installer/README.md | 3 +-
283 files changed, 11482 insertions(+), 11807 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/218fc1f5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/218fc1f5/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/218fc1f5/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 66ccf12,af0ff89..1192db9
--- 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
@@@ -67,10 -63,9 +67,10 @@@ import java.net.URI
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
+import java.util.UUID;
/**
- * Stratos API v4.1 for Stratos 4.2.0 release.
+ * Stratos API v4.1
*/
@Path("/")
public class StratosApiV41 extends AbstractApi {
http://git-wip-us.apache.org/repos/asf/stratos/blob/218fc1f5/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
----------------------------------------------------------------------
diff --cc extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
index 0000000,4c4c7e0..9e0a833
mode 000000,100644..100644
--- a/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
+++ b/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
@@@ -1,0 -1,309 +1,311 @@@
+ <?xml version='1.0'?>
+ <!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+ -->
+
+ <streamManagerConfiguration xmlns="http://wso2.org/carbon/streammanager">
+ <!-- in-flight requests stream definitions start -->
+ <streamDefinition name="in_flight_requests" version="1.0.0">
- <description>in-flight request count</description>
- <nickName>in-flight requests</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="in_flight_request_count" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>in-flight request count</description>
++ <nickName>in-flight requests</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="timestamp" type="long"/>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="in_flight_request_count" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="gradient_in_flight_requests" version="1.0.0">
- <description>gradient of in flight request count</description>
- <nickName>gradient in flight requests</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="count" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>gradient of in flight request count</description>
++ <nickName>gradient in flight requests</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="count" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="average_in_flight_requests" version="1.0.0">
- <description>average of in-flight request count</description>
- <nickName>average in-flight requests</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="count" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>average of in-flight request count</description>
++ <nickName>average in-flight requests</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="count" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="second_derivative_in_flight_requests" version="1.0.0">
- <description>second derivative of in-flight request count</description>
- <nickName>second derivative in-flight requests</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="count" type="double"/>
- </payloadData>
++ <description>second derivative of in-flight request count</description>
++ <nickName>second derivative in-flight requests</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="count" type="double"/>
++ </payloadData>
+ </streamDefinition>
+ <!-- in-flight requests stream definitions end -->
+
+ <!-- cartridge agent health stats stream definitions start -->
+ <streamDefinition name="cartridge_agent_health_stats" version="1.0.0">
- <description>agent health stats</description>
- <nickName>agent health stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_id" type="String" />
- <property name="partition_id" type="String" />
- <property name="health_description" type="String"/>
- <property name="value" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>agent health stats</description>
++ <nickName>agent health stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="timestamp" type="long"/>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="member_id" type="String"/>
++ <property name="partition_id" type="String"/>
++ <property name="health_description" type="String"/>
++ <property name="value" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="average_load_average_stats" version="1.0.0">
- <description>average load average stats</description>
- <nickName>average load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="average_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>average load average stats</description>
++ <nickName>average load average stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="average_load_average" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="average_memory_consumption_stats" version="1.0.0">
- <description>average memory consumption stats</description>
- <nickName>average memory consumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="average_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>average memory consumption stats</description>
++ <nickName>average memory consumption stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="average_memory_consumption" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="gradient_load_average_stats" version="1.0.0">
- <description>gradient load average stats</description>
- <nickName>gradient load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="gradient_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>gradient load average stats</description>
++ <nickName>gradient load average stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="gradient_load_average" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="gradient_memory_consumption_stats" version="1.0.0">
- <description>gradient memoryconsumption stats</description>
- <nickName>gradient memoryconsumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="gradient_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>gradient memoryconsumption stats</description>
++ <nickName>gradient memoryconsumption stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="gradient_memory_consumption" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="second_derivative_memory_consumption_stats" version="1.0.0">
- <description>second derivative memory consumption stats</description>
- <nickName>second derivative memory consumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="second_derivative_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>second derivative memory consumption stats</description>
++ <nickName>second derivative memory consumption stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="second_derivative_memory_consumption" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="second_derivative_load_average_stats" version="1.0.0">
- <description>second derivative load average stats</description>
- <nickName>second derivative load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="second_derivative_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>second derivative load average stats</description>
++ <nickName>second derivative load average stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="second_derivative_load_average" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="fault_message" version="1.0.0">
- <description>fault message</description>
- <nickName>fault message</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_id" type="String"/>
- <property name="partition_id" type="String"/>
- </payloadData>
++ <description>fault message</description>
++ <nickName>fault message</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="member_id" type="String"/>
++ <property name="partition_id" type="String"/>
++ </payloadData>
+ </streamDefinition>
+ <!-- cartridge agent health stats stream definitions end -->
+
+ <!-- This is for member_id wise grouping-->
+ <streamDefinition name="member_average_load_average_stats" version="1.0.0">
- <description>average load average stats</description>
- <nickName>average load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_average_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>average load average stats</description>
++ <nickName>average load average stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="member_id" type="String"/>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="member_average_load_average" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="member_average_memory_consumption_stats" version="1.0.0">
- <description>average memory consumption stats</description>
- <nickName>average memory consumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String"/>
- <property name="cluster_id" type="String"/>
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_average_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>average memory consumption stats</description>
++ <nickName>average memory consumption stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="member_id" type="String"/>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="member_average_memory_consumption" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="member_gradient_load_average_stats" version="1.0.0">
- <description>gradient load average stats</description>
- <nickName>gradient load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_gradient_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>gradient load average stats</description>
++ <nickName>gradient load average stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="member_id" type="String"/>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="member_gradient_load_average" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="member_gradient_memory_consumption_stats" version="1.0.0">
- <description>gradient memoryconsumption stats</description>
- <nickName>gradient memoryconsumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_gradient_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>gradient memoryconsumption stats</description>
++ <nickName>gradient memoryconsumption stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="member_id" type="String"/>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="member_gradient_memory_consumption" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="member_second_derivative_memory_consumption_stats" version="1.0.0">
- <description>second derivative memory consumption stats</description>
- <nickName>second derivative memory consumption stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_second_derivative_memory_consumption" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>second derivative memory consumption stats</description>
++ <nickName>second derivative memory consumption stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="member_id" type="String"/>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="member_second_derivative_memory_consumption" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ <streamDefinition name="member_second_derivative_load_average_stats" version="1.0.0">
- <description>second derivative load average stats</description>
- <nickName>second derivative load average stats</nickName>
- <metaData>
- </metaData>
- <correlationData>
- </correlationData>
- <payloadData>
- <property name="member_id" type="String" />
- <property name="cluster_id" type="String" />
- <property name="cluster_instance_id" type="String"/>
- <property name="network_partition_id" type="String"/>
- <property name="member_second_derivative_load_average" type="double"/>
- </payloadData>
- </streamDefinition>
++ <description>second derivative load average stats</description>
++ <nickName>second derivative load average stats</nickName>
++ <metaData>
++ </metaData>
++ <correlationData>
++ </correlationData>
++ <payloadData>
++ <property name="member_id" type="String"/>
++ <property name="cluster_id" type="String"/>
++ <property name="cluster_instance_id" type="String"/>
++ <property name="network_partition_id" type="String"/>
++ <property name="member_second_derivative_load_average" type="double"/>
++ </payloadData>
++ </streamDefinition>
+
+ </streamManagerConfiguration>
http://git-wip-us.apache.org/repos/asf/stratos/blob/218fc1f5/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/agent.conf
----------------------------------------------------------------------
diff --cc products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/agent.conf
index 0ee1dce,0ee1dce..0000000
deleted file mode 100755,100755
--- a/products/python-cartridge-agent/modules/integration/src/test/resources/suite-3/agent.conf
+++ /dev/null
@@@ -1,45 -1,45 +1,0 @@@
--# Licensed to the Apache Software Foundation (ASF) under one
--# or more contributor license agreements. See the NOTICE file
--# distributed with this work for additional information
--# regarding copyright ownership. The ASF licenses this file
--# to you under the Apache License, Version 2.0 (the
--# "License"); you may not use this file except in compliance
--# with the License. You may obtain a copy of the License at
--#
--# http://www.apache.org/licenses/LICENSE-2.0
--#
--# Unless required by applicable law or agreed to in writing,
--# software distributed under the License is distributed on an
--# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
--# KIND, either express or implied. See the License for the
--# specific language governing permissions and limitations
--# under the License.
--
--[agent]
--mb.ip =localhost
--mb.port =1885
--listen.address =localhost
--thrift.receiver.ip =localhost
--thrift.receiver.port =7712
--thrift.server.admin.username =admin
--thrift.server.admin.password =admin
--cep.stats.publisher.enabled =true
--lb.private.ip =
--lb.public.ip =
--enable.artifact.update =true
--auto.commit =true
--auto.checkout =true
--artifact.update.interval =15
--artifact.clone.retries =5
--artifact.clone.interval =10
--port.check.timeout =600000
--enable.data.publisher =false
--monitoring.server.ip =localhost
--monitoring.server.port =7612
--monitoring.server.secure.port =7712
--monitoring.server.admin.username =admin
--monitoring.server.admin.password =admin
--log.file.paths =/tmp/agent.screen-adc-mt-test.log
--metadata.service.url =https://localhost:9443
--super.tenant.repository.path =/repository/deployment/server/
--tenant.repository.path =/repository/tenants/
http://git-wip-us.apache.org/repos/asf/stratos/blob/218fc1f5/products/stratos/modules/integration/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/218fc1f5/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/IntegrationMockClient.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/218fc1f5/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
----------------------------------------------------------------------
diff --cc products/stratos/modules/integration/src/test/resources/stratos-testing.xml
index bb58de5,2e0d2a8..b9107c8
--- a/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
+++ b/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
@@@ -21,62 -21,74 +21,62 @@@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="StratosIntegrationSuite">
-
- <test name="UserTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.users.UserTest"/>
- </classes>
- </test>
- <test name="CartridgeTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.group.CartridgeTest"/>
- </classes>
- </test>
- <test name="CartridgeGroupTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.group.CartridgeGroupTest"/>
- </classes>
- </test>
- <test name="NetworkPartitionTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.policies.NetworkPartitionTest"/>
- </classes>
- </test>
- <test name="ApplicationPolicyTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.policies.ApplicationPolicyTest"/>
- </classes>
- </test>
- <test name="DeploymentPolicyTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.policies.DeploymentPolicyTest"/>
- </classes>
- </test>
- <test name="AutoscalingPolicyTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest"/>
- </classes>
- </test>
- <test name="SampleApplicationsTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest"/>
- </classes>
- </test>
- <test name="ApplicationUpdateTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.ApplicationUpdateTest"/>
- </classes>
- </test>
- <test name="SingleClusterScalingTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest"/>
- </classes>
- </test>
- <test name="ApplicationBurstingTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest"/>
- </classes>
- </test>
- <test name="PartitionRoundRobinClusterTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest"/>
- </classes>
- </test>
- <test name="GroupStartupOrderTest">
- <classes>
- <class name="org.apache.stratos.integration.tests.application.GroupStartupOrderTest"/>
- </classes>
- </test>
++ <!--
+ <test name="CartridgeTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.group.CartridgeTest" />
+ </classes>
+ </test>
+ <test name="CartridgeGroupTest" >
+ <classes>
+ <class name="org.apache.stratos.integration.tests.group.CartridgeGroupTest" />
+ </classes>
+ </test>
+
+ <test name="NetworkPartitionTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.policies.NetworkPartitionTest" />
+ </classes>
+ </test>
+ <test name="ApplicationPolicyTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.policies.ApplicationPolicyTest" />
+ </classes>
+ </test>
+ <test name="DeploymentPolicyTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.policies.DeploymentPolicyTest" />
+ </classes>
+ </test>
+ <test name="AutoscalingPolicyTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest" />
+ </classes>
+ </test>
+ <test name="SampleApplicationsTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest" />
+ </classes>
+ </test>
+ <test name="ApplicationBurstingTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest" />
+ </classes>
+ </test>
+ <test name="SingleClusterScalingTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest" />
+ </classes>
+ </test>
+ <test name="PartitionRoundRobinClusterTest">
+ <classes>
+ <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest" />
+ </classes>
+ </test>
+
<test name="GroupTerminationBehaviorTest">
<classes>
- <class name="org.apache.stratos.integration.tests.application.GroupTerminationBehaviorTest"/>
+ <class name="org.apache.stratos.integration.tests.application.GroupTerminationBehaviorTest" />
</classes>
-- </test>
-</suite>
++ </test>-->
+</suite>
[17/50] [abbrv] stratos git commit: deleting das monitoring artifacts
Posted by ga...@apache.org.
deleting das monitoring artifacts
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/0770ff10
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/0770ff10
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/0770ff10
Branch: refs/heads/master
Commit: 0770ff10f4d7a9b3582cdc033a5cdd52afc0d5c3
Parents: 260f738
Author: Thanuja <th...@wso2.com>
Authored: Fri Aug 21 18:45:08 2015 +0530
Committer: Thanuja <th...@wso2.com>
Committed: Fri Aug 21 18:45:08 2015 +0530
----------------------------------------------------------------------
.../HealthStatsEventFormatter.xml | 30 -------------------
.../eventformatters/RIFEventFormatter.xml | 31 --------------------
.../DASDefaultWSO2EventOutputAdaptor.xml | 29 ------------------
3 files changed, 90 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/0770ff10/extensions/cep/artifacts/eventformatters/HealthStatsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/HealthStatsEventFormatter.xml b/extensions/cep/artifacts/eventformatters/HealthStatsEventFormatter.xml
deleted file mode 100644
index bcef15f..0000000
--- a/extensions/cep/artifacts/eventformatters/HealthStatsEventFormatter.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<eventFormatter name="HealthStatsEventFormatter"
- statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="cartridge_agent_health_stats" version="1.0.0"/>
- <mapping customMapping="disable" type="wso2event"/>
- <to eventAdaptorName="DASDefaultWSO2EventOutputAdaptor" eventAdaptorType="wso2event">
- <property name="stream">cartridge_agent_health_stats</property>
- <property name="version">1.0.0</property>
- </to>
-</eventFormatter>
http://git-wip-us.apache.org/repos/asf/stratos/blob/0770ff10/extensions/cep/artifacts/eventformatters/RIFEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/RIFEventFormatter.xml b/extensions/cep/artifacts/eventformatters/RIFEventFormatter.xml
deleted file mode 100644
index 3cfd4a9..0000000
--- a/extensions/cep/artifacts/eventformatters/RIFEventFormatter.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<eventFormatter name="RIFEventFormatter" statistics="disable"
- trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
- <from streamName="in_flight_requests" version="1.0.0"/>
- <mapping customMapping="disable" type="wso2event"/>
- <to eventAdaptorName="DASDefaultWSO2EventOutputAdaptor" eventAdaptorType="wso2event">
- <property name="stream">in_flight_requests</property>
- <property name="version">1.0.0</property>
- </to>
-</eventFormatter>
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/0770ff10/extensions/cep/artifacts/outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml b/extensions/cep/artifacts/outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml
deleted file mode 100755
index 6dad7a0..0000000
--- a/extensions/cep/artifacts/outputeventadaptors/DASDefaultWSO2EventOutputAdaptor.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<outputEventAdaptor name="DASDefaultWSO2EventOutputAdaptor"
- statistics="disable" trace="disable" type="wso2event"
- xmlns="http://wso2.org/carbon/eventadaptormanager">
- <property name="username">admin</property>
- <property name="receiverURL">tcp://localhost:7611</property>
- <property name="password">admin</property>
- <property name="authenticatorURL">ssl://localhost:7711</property>
-</outputEventAdaptor>
[37/50] [abbrv] stratos git commit: Merge with tenant-isolation branch
Posted by ga...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/service-stubs/org.apache.stratos.manager.service.stub/src/main/resources/StratosManagerService.wsdl
----------------------------------------------------------------------
diff --cc service-stubs/org.apache.stratos.manager.service.stub/src/main/resources/StratosManagerService.wsdl
index f85732e,05077f3..6d0e3fa
--- a/service-stubs/org.apache.stratos.manager.service.stub/src/main/resources/StratosManagerService.wsdl
+++ b/service-stubs/org.apache.stratos.manager.service.stub/src/main/resources/StratosManagerService.wsdl
@@@ -34,25 -34,10 +34,24 @@@
<xs:schema xmlns:ax24="http://signup.application.domain.messaging.stratos.apache.org/xsd" xmlns:ax22="http://exception.manager.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.services.manager.stratos.apache.org">
<xs:import namespace="http://exception.manager.stratos.apache.org/xsd"/>
<xs:import namespace="http://signup.application.domain.messaging.stratos.apache.org/xsd"/>
- <xs:element name="StratosManagerServiceArtifactDistributionCoordinatorException">
++ <xs:element name="canCartirdgeGroupBeRemoved">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="ArtifactDistributionCoordinatorException" nillable="true" type="ax21:ArtifactDistributionCoordinatorException"/>
++ <xs:element minOccurs="0" name="cartridgeGroupUuid" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="notifyArtifactUpdatedEventForSignUp">
++ <xs:element name="canCartirdgeGroupBeRemovedResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="notifyArtifactUpdatedEventForRepository">
+ <xs:element name="StratosManagerServiceApplicationSignUpException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="repoUrl" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="ApplicationSignUpException" nillable="true" type="ax21:ApplicationSignUpException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -84,54 -71,32 +85,53 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="canCartridgeBeRemovedResponse">
- <xs:element name="getApplicationSignUps">
++ <xs:element name="applicationSignUpExist">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="canCartirdgeGroupBeRemoved">
- <xs:element name="getApplicationSignUpsResponse">
++ <xs:element name="applicationSignUpExistResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeGroupName" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax23:ApplicationSignUp"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="canCartirdgeGroupBeRemovedResponse">
- <xs:element name="StratosManagerServiceArtifactDistributionCoordinatorException">
++ <xs:element name="applicationSignUpsExist">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
- <xs:element minOccurs="0" name="ArtifactDistributionCoordinatorException" nillable="true" type="ax21:ArtifactDistributionCoordinatorException"/>
++ <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="StratosManagerServiceDomainMappingException">
- <xs:element name="notifyArtifactUpdatedEventForSignUp">
++ <xs:element name="applicationSignUpsExistResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="DomainMappingException" nillable="true" type="ax21:DomainMappingException"/>
++ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="addDomainMapping">
++ <xs:element name="getApplicationSignUps">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="domainMapping" nillable="true" type="ax23:DomainMapping"/>
+ <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="addUsedCartridgesInCartridgeGroups">
++ <xs:element name="getApplicationSignUpsResponse">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="cartridgeGroupName" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeNames" nillable="true" type="xs:string"/>
++ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax23:ApplicationSignUp"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
- <xs:element name="removeUsedCartridgesInCartridgeGroups">
++ <xs:element name="StratosManagerServiceArtifactDistributionCoordinatorException">
+ <xs:complexType>
+ <xs:sequence>
- <xs:element minOccurs="0" name="cartridgeGroupName" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridgeNames" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="ArtifactDistributionCoordinatorException" nillable="true" type="ax21:ArtifactDistributionCoordinatorException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -259,10 -223,17 +258,11 @@@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getApplicationSignUpsResponse">
- <xs:element name="canCartirdgeGroupBeRemoved">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="cartridgeGroupUuid" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="canCartirdgeGroupBeRemovedResponse">
++ <xs:element name="notifyArtifactUpdatedEventForSignUp">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax23:ApplicationSignUp"/>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
++ <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
++ <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@@ -297,6 -259,6 +288,15 @@@
<wsdl:message name="canCartridgeBeRemovedResponse">
<wsdl:part name="parameters" element="ns:canCartridgeBeRemovedResponse"/>
</wsdl:message>
++ <wsdl:message name="applicationSignUpExistRequest">
++ <wsdl:part name="parameters" element="ns:applicationSignUpExist"/>
++ </wsdl:message>
++ <wsdl:message name="applicationSignUpExistResponse">
++ <wsdl:part name="parameters" element="ns:applicationSignUpExistResponse"/>
++ </wsdl:message>
++ <wsdl:message name="StratosManagerServiceApplicationSignUpException">
++ <wsdl:part name="parameters" element="ns:StratosManagerServiceApplicationSignUpException"/>
++ </wsdl:message>
<wsdl:message name="getApplicationSignUpsRequest">
<wsdl:part name="parameters" element="ns:getApplicationSignUps"/>
</wsdl:message>
@@@ -385,6 -339,6 +380,11 @@@
<wsdl:input message="ns:canCartridgeBeRemovedRequest" wsaw:Action="urn:canCartridgeBeRemoved"/>
<wsdl:output message="ns:canCartridgeBeRemovedResponse" wsaw:Action="urn:canCartridgeBeRemovedResponse"/>
</wsdl:operation>
++ <wsdl:operation name="applicationSignUpExist">
++ <wsdl:input message="ns:applicationSignUpExistRequest" wsaw:Action="urn:applicationSignUpExist"/>
++ <wsdl:output message="ns:applicationSignUpExistResponse" wsaw:Action="urn:applicationSignUpExistResponse"/>
++ <wsdl:fault message="ns:StratosManagerServiceApplicationSignUpException" name="StratosManagerServiceApplicationSignUpException" wsaw:Action="urn:applicationSignUpExistStratosManagerServiceApplicationSignUpException"/>
++ </wsdl:operation>
<wsdl:operation name="getApplicationSignUps">
<wsdl:input message="ns:getApplicationSignUpsRequest" wsaw:Action="urn:getApplicationSignUps"/>
<wsdl:output message="ns:getApplicationSignUpsResponse" wsaw:Action="urn:getApplicationSignUpsResponse"/>
@@@ -457,17 -406,8 +457,20 @@@
</wsdl:portType>
<wsdl:binding name="StratosManagerServiceSoap11Binding" type="ns:StratosManagerServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <wsdl:operation name="canCartridgeBeRemoved">
- <soap:operation soapAction="urn:canCartridgeBeRemoved" style="document"/>
++ <wsdl:operation name="applicationSignUpExist">
++ <soap:operation soapAction="urn:applicationSignUpExist" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
++ <wsdl:fault name="StratosManagerServiceApplicationSignUpException">
++ <soap:fault use="literal" name="StratosManagerServiceApplicationSignUpException"/>
++ </wsdl:fault>
+ </wsdl:operation>
- <wsdl:operation name="addUsedCartridgeGroupsInApplications">
- <soap:operation soapAction="urn:addUsedCartridgeGroupsInApplications" style="document"/>
+ <wsdl:operation name="canCartridgeBeRemoved">
+ <soap:operation soapAction="urn:canCartridgeBeRemoved" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
@@@ -640,17 -565,8 +640,20 @@@
</wsdl:binding>
<wsdl:binding name="StratosManagerServiceSoap12Binding" type="ns:StratosManagerServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <wsdl:operation name="canCartridgeBeRemoved">
- <soap12:operation soapAction="urn:canCartridgeBeRemoved" style="document"/>
++ <wsdl:operation name="applicationSignUpExist">
++ <soap12:operation soapAction="urn:applicationSignUpExist" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
++ <wsdl:fault name="StratosManagerServiceApplicationSignUpException">
++ <soap12:fault use="literal" name="StratosManagerServiceApplicationSignUpException"/>
++ </wsdl:fault>
+ </wsdl:operation>
- <wsdl:operation name="addUsedCartridgeGroupsInApplications">
- <soap12:operation soapAction="urn:addUsedCartridgeGroupsInApplications" style="document"/>
+ <wsdl:operation name="canCartridgeBeRemoved">
+ <soap12:operation soapAction="urn:canCartridgeBeRemoved" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
@@@ -823,17 -724,8 +823,17 @@@
</wsdl:binding>
<wsdl:binding name="StratosManagerServiceHttpBinding" type="ns:StratosManagerServicePortType">
<http:binding verb="POST"/>
- <wsdl:operation name="canCartridgeBeRemoved">
- <http:operation location="canCartridgeBeRemoved"/>
++ <wsdl:operation name="applicationSignUpExist">
++ <http:operation location="applicationSignUpExist"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
- <wsdl:operation name="addUsedCartridgeGroupsInApplications">
- <http:operation location="addUsedCartridgeGroupsInApplications"/>
+ <wsdl:operation name="canCartridgeBeRemoved">
+ <http:operation location="canCartridgeBeRemoved"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
[09/50] [abbrv] stratos git commit: Merge branch 'tenant-isolation'
of https://github.com/apache/stratos into tenant-isolation-v1
Posted by ga...@apache.org.
Merge branch 'tenant-isolation' of https://github.com/apache/stratos into tenant-isolation-v1
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/c814a3dd
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/c814a3dd
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/c814a3dd
Branch: refs/heads/master
Commit: c814a3dd009b082a8aa494675d923ef87aee06d3
Parents: 4014dc5 02eafdf
Author: Dinithi <di...@wso2.com>
Authored: Fri Aug 21 12:39:36 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Fri Aug 21 12:39:36 2015 +0530
----------------------------------------------------------------------
.../services/impl/AutoscalerServiceImpl.java | 15 ++++++++-------
.../stratos/common/threading/StratosThreadPool.java | 5 +++--
2 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
[42/50] [abbrv] stratos git commit: Merge with tenant-isolation branch
Posted by ga...@apache.org.
Merge with tenant-isolation branch
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2c34f816
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2c34f816
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2c34f816
Branch: refs/heads/master
Commit: 2c34f816cfbd5a93c62ecc4dffe1d87026e7c329
Parents: eefef71 3ab0f9e
Author: gayangunarathne <ga...@wso2.com>
Authored: Tue Sep 1 11:18:43 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Tue Sep 1 11:18:43 2015 +0530
----------------------------------------------------------------------
.../networkpartition/AllAtOnceAlgorithm.java | 4 +-
.../OneAfterAnotherAlgorithm.java | 8 +-
.../applications/ApplicationUtils.java | 6 +-
.../applications/ClusterInformation.java | 4 +-
.../applications/MTClusterInformation.java | 8 +-
.../applications/STClusterInformation.java | 8 +-
.../dependency/DependencyBuilder.java | 1 -
.../context/ApplicationChildContextFactory.java | 1 +
.../dependency/context/ClusterChildContext.java | 9 +
.../parser/DefaultApplicationParser.java | 157 +-
.../applications/parser/ParserUtils.java | 2 +-
.../applications/payload/BasicPayloadData.java | 11 +
.../pojo/ApplicationClusterContext.java | 18 +-
.../applications/pojo/ApplicationContext.java | 23 +-
.../applications/pojo/CartridgeContext.java | 27 +-
.../applications/pojo/GroupContext.java | 28 +
.../pojo/SubscribableInfoContext.java | 40 +-
.../applications/topic/ApplicationBuilder.java | 52 +-
.../client/AutoscalerCloudControllerClient.java | 57 +-
.../autoscaler/context/AutoscalerContext.java | 17 +-
.../context/cluster/ClusterContext.java | 30 +-
.../context/cluster/ClusterContextFactory.java | 2 -
.../context/partition/PartitionContext.java | 2 +-
.../AutoscalerTopologyEventReceiver.java | 85 +-
.../internal/AutoscalerServiceComponent.java | 8 +-
.../autoscaler/monitor/MonitorFactory.java | 20 +-
.../monitor/cluster/ClusterMonitor.java | 209 ++-
.../monitor/component/ApplicationMonitor.java | 141 +-
.../monitor/component/GroupMonitor.java | 24 +-
.../component/ParentComponentMonitor.java | 2 +-
.../stratos/autoscaler/pojo/ServiceGroup.java | 30 +-
.../autoscaler/pojo/policy/PolicyManager.java | 266 ++-
.../pojo/policy/autoscale/AutoscalePolicy.java | 24 +-
.../policy/deployment/ApplicationPolicy.java | 27 +
.../policy/deployment/DeploymentPolicy.java | 35 +-
.../autoscaler/registry/RegistryManager.java | 62 +-
.../autoscaler/rule/RuleTasksDelegator.java | 42 +-
.../autoscaler/services/AutoscalerService.java | 107 +-
.../services/impl/AutoscalerServiceImpl.java | 703 ++++++--
.../group/GroupStatusInactiveProcessor.java | 2 +-
.../processor/group/GroupStatusProcessor.java | 2 +-
.../util/AutoscalerObjectConverter.java | 7 +-
.../stratos/autoscaler/util/AutoscalerUtil.java | 209 ++-
.../stratos/autoscaler/AutoscalerUtilTest.java | 64 -
.../publisher/HealthStatisticsNotifier.java | 10 +-
.../agent/test/JavaCartridgeAgentTest.java | 9 +-
.../concurrent/PartitionValidatorCallable.java | 2 +-
.../context/CloudControllerContext.java | 82 +-
.../domain/ApplicationClusterContext.java | 14 +-
.../cloud/controller/domain/Cartridge.java | 18 +
.../cloud/controller/domain/ClusterContext.java | 18 +-
.../controller/domain/NetworkPartition.java | 38 +-
.../cloud/controller/domain/Partition.java | 36 +-
.../domain/kubernetes/KubernetesCluster.java | 36 +-
.../CloudStackPartitionValidator.java | 2 +-
.../iaases/ec2/EC2PartitionValidator.java | 4 +-
.../iaases/kubernetes/KubernetesIaas.java | 38 +-
.../KubernetesPartitionValidator.java | 4 +-
.../cloud/controller/iaases/mock/MockIaas.java | 2 +-
.../openstack/OpenstackPartitionValidator.java | 4 +-
.../publisher/TopologyEventPublisher.java | 20 +-
.../messaging/topology/TopologyBuilder.java | 1457 ++++++++--------
.../services/CloudControllerService.java | 66 +-
.../impl/CloudControllerServiceImpl.java | 512 ++++--
.../impl/CloudControllerServiceUtil.java | 19 +-
.../services/impl/InstanceCreator.java | 17 +-
.../publisher/BAMUsageDataPublisher.java | 44 +-
.../util/CloudControllerConstants.java | 4 +
.../controller/util/CloudControllerUtil.java | 12 +-
.../beans/application/ApplicationBean.java | 5 +-
.../beans/application/SubscribableInfo.java | 12 +-
.../beans/cartridge/CartridgeGroupBean.java | 18 +-
.../cartridge/CartridgeGroupReferenceBean.java | 19 +-
.../beans/cartridge/CartridgeReferenceBean.java | 18 +
.../beans/kubernetes/KubernetesClusterBean.java | 18 +-
.../beans/partition/NetworkPartitionBean.java | 1 -
.../common/beans/partition/PartitionBean.java | 19 +-
.../beans/partition/PartitionReferenceBean.java | 19 +-
.../deployment/ApplicationPolicyBean.java | 9 +
.../beans/topology/ApplicationInstanceBean.java | 19 +-
.../common/client/AutoscalerServiceClient.java | 81 +-
.../client/CloudControllerServiceClient.java | 68 +-
.../client/StratosManagerServiceClient.java | 20 +-
.../common/constants/StratosConstants.java | 8 +-
.../common/partition/NetworkPartitionRef.java | 11 +-
.../stratos/common/partition/PartitionRef.java | 37 +-
.../publisher/HealthStatisticsPublisher.java | 3 +-
.../publisher/InFlightRequestPublisher.java | 4 +-
.../publisher/StatisticsPublisherType.java | 2 +-
.../publisher/ThriftClientConfig.java | 101 ++
.../publisher/ThriftClientConfigParser.java | 173 ++
.../statistics/publisher/ThriftClientInfo.java | 71 +
.../publisher/ThriftStatisticsPublisher.java | 116 ++
.../publisher/wso2/cep/ThriftClientConfig.java | 81 -
.../wso2/cep/ThriftClientConfigParser.java | 139 --
.../publisher/wso2/cep/ThriftClientInfo.java | 63 -
.../cep/WSO2CEPHealthStatisticsPublisher.java | 29 +-
.../cep/WSO2CEPInFlightRequestPublisher.java | 28 +-
.../wso2/cep/WSO2CEPStatisticsPublisher.java | 114 --
.../common/threading/StratosThreadPool.java | 21 +-
.../test/ThriftClientConfigParserTest.java | 23 +-
.../src/test/resources/thrift-client-config.xml | 22 +-
.../KubernetesAPIClientInterface.java | 13 +-
...LoadBalancerCommonTopologyEventReceiver.java | 2 +-
.../LoadBalancerStatisticsNotifier.java | 3 +-
.../schema/configure/application-policies.json | 4 +-
.../schema/configure/autoscaling-policies.json | 2 +-
.../schema/configure/deployment-policies.json | 2 +-
.../schema/configure/network-partitions.json | 2 +-
.../themes/theme0/partials/configure_form.hbs | 4 +
components/org.apache.stratos.manager/pom.xml | 1 +
.../manager/context/StratosManagerContext.java | 148 +-
.../manager/services/StratosManagerService.java | 42 +-
.../impl/StratosManagerServiceImpl.java | 44 +-
.../domain/application/Application.java | 26 +-
.../domain/application/Applications.java | 18 +-
.../domain/application/ClusterDataHolder.java | 15 +-
.../domain/application/ParentComponent.java | 4 +-
.../messaging/domain/instance/Instance.java | 10 +-
.../messaging/domain/topology/Service.java | 12 +-
.../messaging/domain/topology/Topology.java | 20 +-
.../topology/locking/TopologyLockHierarchy.java | 8 +-
.../topology/ClusterInstanceCreatedEvent.java | 12 +-
.../event/topology/ServiceCreatedEvent.java | 8 +-
.../event/topology/ServiceRemovedEvent.java | 18 +-
...licationInstanceCreatedMessageProcessor.java | 44 +-
...licationClustersCreatedMessageProcessor.java | 21 +-
.../ClusterInstanceCreatedMessageProcessor.java | 14 +-
.../ServiceCreatedMessageProcessor.java | 4 +-
.../ServiceRemovedMessageProcessor.java | 8 +-
.../topology/updater/TopologyUpdater.java | 10 +-
.../publisher/MockHealthStatisticsNotifier.java | 3 +
.../test/PythonCartridgeAgentTest.java | 9 +-
.../rest/endpoint/api/StratosApiV40Utils.java | 7 +-
.../rest/endpoint/api/StratosApiV41.java | 302 ++--
.../rest/endpoint/api/StratosApiV41Utils.java | 1277 ++++++++------
.../util/converter/ObjectConverter.java | 337 ++--
dependencies/fabric8/pom.xml | 2 +-
.../streamdefinitions/stream-manager-config.xml | 486 +++---
extensions/das/README.md | 10 +
.../CloudControllerEventReceiver.xml | 29 +
.../eventreceivers/HealthStatsEventReceiver.xml | 29 +
.../eventreceivers/RIFEventReceiver.xml | 29 +
.../eventsink/cartridge_agent_health_stats.xml | 85 +
.../artifacts/eventsink/in_flight_requests.xml | 64 +
.../org_apache_stratos_cloud_controller.xml | 211 +++
.../cartridge_agent_health_stats_1.0.0.json | 40 +
.../eventstreams/in_flight_requests_1.0.0.json | 28 +
...g.apache.stratos.cloud.controller_1.0.0.json | 112 ++
extensions/das/artifacts/sparkscript/CCEvent | 18 +
extensions/das/pom.xml | 40 +
extensions/das/spark-udf/pom.xml | 36 +
.../das/extension/spark/udf/TimeUDF.java | 49 +
.../pom.xml | 3 +-
.../src/main/conf/drools/dependent-scaling.drl | 11 +-
.../src/main/conf/drools/mincheck.drl | 22 +-
.../src/main/conf/drools/scaling.drl | 17 +-
.../src/main/conf/thrift-client-config.xml | 22 +-
products/stratos/modules/integration/pom.xml | 2 +-
.../integration/tests/RestConstants.java | 8 +
.../tests/StratosTestServerManager.java | 42 +-
.../integration/tests/TopologyHandler.java | 88 +-
.../application/ApplicationBurstingTest.java | 143 +-
.../application/ApplicationUpdateTest.java | 312 ++--
.../application/GroupStartupOrderTest.java | 358 ++--
.../GroupTerminationBehaviorTest.java | 111 +-
.../PartitionOneAfterAnotherClusterTest.java | 56 +-
.../PartitionRoundRobinClusterTest.java | 90 +-
.../application/SampleApplicationsTest.java | 233 +--
.../application/SingleClusterScalingTest.java | 196 +--
.../tests/group/CartridgeGroupTest.java | 226 +--
.../integration/tests/group/CartridgeTest.java | 138 +-
.../tests/policies/ApplicationPolicyTest.java | 179 +-
.../tests/policies/AutoscalingPolicyTest.java | 146 +-
.../tests/policies/DeploymentPolicyTest.java | 199 +--
.../tests/policies/NetworkPartitionTest.java | 108 +-
.../tests/rest/IntegrationMockClient.java | 2 +-
.../integration/tests/rest/RestClient.java | 22 +-
.../integration/tests/users/TenantTest.java | 2 +-
.../integration/tests/users/UserTest.java | 12 +-
...cation-policy-application-bursting-test.json | 18 +
.../app-bursting-single-cartriddge-group.json | 70 +
...caling-policy-application-bursting-test.json | 14 +
...esb-php-group-application-bursting-test.json | 19 +
.../mock/esb-application-bursting-test.json | 50 +
.../mock/php-application-bursting-test.json | 51 +
.../mock/tomcat-application-bursting-test.json | 53 +
...oyment-policy-application-bursting-test.json | 32 +
...k-partition-application-bursting-test-1.json | 15 +
...k-partition-application-bursting-test-2.json | 24 +
.../RegionOne.json | 17 +
.../application-martin.json | 100 ++
.../application-policy-1.json | 17 +
.../application-s-g-c1-c2-c3-s.json | 130 ++
.../application.json | 108 ++
.../startup-order-termination-behavior/c1.json | 45 +
.../startup-order-termination-behavior/c2.json | 45 +
.../startup-order-termination-behavior/c3.json | 45 +
.../startup-order-termination-behavior/c4.json | 45 +
.../startup-order-termination-behavior/c5.json | 132 ++
.../cartridge-groups-s-g-c1-c2-c3-s.json | 26 +
.../cartridge-groups-working.json | 34 +
.../cartridge-groups.json | 77 +
.../cartridge-groups.json.back | 53 +
.../deploy.sh | 43 +
.../economy-policy.json | 15 +
.../static-1.json | 17 +
.../wso2carbon 2.log | 992 +++++++++++
.../wso2carbon-working 2.log | 1053 +++++++++++
.../wso2carbon-working.log | 1053 +++++++++++
.../wso2carbon.log | 992 +++++++++++
.../src/test/resources/mock-iaas.xml | 26 +-
.../single-cluster-scaling-test.json | 2 +-
.../src/test/resources/stratos-testing.xml | 118 +-
.../src/test/resources/tenant/tenant1.json | 9 +
.../src/test/resources/tenant/tenant2.json | 9 +
.../artifacts/application.json | 2 +-
.../scripts/common/deploy.sh | 25 +-
.../scripts/common/undeploy.sh | 16 +-
.../scripts/kubernetes/deploy.sh | 8 +-
.../single-cartridge-app/scripts/mock/deploy.sh | 2 +-
.../scripts/mock/undeploy.sh | 2 +-
.../single-group-app/scripts/common/deploy.sh | 29 +-
.../single-group-app/scripts/common/undeploy.sh | 27 +-
.../single-group-app/scripts/mock/deploy.sh | 2 +-
.../single-group-app/scripts/mock/undeploy.sh | 2 +-
samples/cartridges/kubernetes/php.json | 2 +-
.../kubernetes-cluster-1.json | 2 +-
.../kubernetes-cluster-2.json | 2 +-
samples/tenants/tenant1.json | 9 +
samples/tenants/tenant2.json | 9 +
.../src/main/resources/AutoscalerService.wsdl | 1639 +++++++++++++-----
.../main/resources/CloudControllerService.wsdl | 1369 +++++++++------
.../main/resources/StratosManagerService.wsdl | 268 +--
234 files changed, 15320 insertions(+), 6538 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
index d43f364,4eec5f9..dbf264e
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
@@@ -37,11 -37,11 +37,12 @@@ import java.util.Set
import java.util.regex.Pattern;
public class ApplicationUtils {
+ private static final Log log = LogFactory.getLog(ApplicationUtils.class);
+
public static final String TOKEN_PAYLOAD_PARAM_NAME = "TOKEN";
public static final String DEPLOYMENT = "DEPLOYMENT";
+ private static final String PORT_SEPARATOR="|";
public static final String PAYLOAD_PARAMETER = "payload_parameter.";
- private static final Log log = LogFactory.getLog(ApplicationUtils.class);
public static Pattern ALIAS_PATTERN = Pattern.compile("([a-z0-9]+([-][a-z0-9])*)+");
public static boolean isAliasValid(String alias) {
@@@ -259,11 -221,9 +260,12 @@@
basicPayloadData.setSubscriptionKey(subscriptionKey);
//basicPayloadData.setDeployment("default");//currently hard coded to default
basicPayloadData.setMultitenant(String.valueOf(cartridge.getMultiTenant()));
- basicPayloadData.setPortMappings(createPortMappingPayloadString(cartridge));
+ basicPayloadData.setPorts(createPortsToPayloadString(cartridge));
+ basicPayloadData.setPortMappings(createPortMappingsToPayloadString(cartridge));
- basicPayloadData.setServiceName(cartridge.getType());
+ basicPayloadData.setServiceName(cartridge.getUuid());
++ basicPayloadData.setServiceType(cartridge.getType());
basicPayloadData.setProvider(cartridge.getProvider());
+ basicPayloadData.setLvsVirtualIP(lvsVirtualIP);
if (repoUrl != null) {
basicPayloadData.setGitRepositoryUrl(repoUrl);
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
index d9378ab,9ef6180..3c8f65a
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
@@@ -471,14 -452,14 +475,14 @@@ public class DefaultApplicationParser i
isLB = true;
}
// create and collect this cluster's information
- ApplicationClusterContext appClusterCtxt = createApplicationClusterContext(appId, groupName, cartridge,
+ ApplicationClusterContext appClusterCtxt = createApplicationClusterContext(appUuid, groupName, cartridge,
key, tenantId, repoUrl, subscriptionAlias, clusterId, hostname,
- subscribableInfoContext.getDeploymentPolicy(), isLB,
+ subscribableInfoContext.getDeploymentPolicyUuid(), isLB,
tenantRange, subscribableInfoContext.getDependencyAliases(),
subscribableInfoContext.getProperties(), arrDependencyClusterIDs, arrExportMetadata,
- arrImportMetadata, subscribableInfoContext.getLvsVirtualIP());
- arrImportMetadata);
++ arrImportMetadata,subscribableInfoContext.getLvsVirtualIP());
- appClusterCtxt.setAutoscalePolicyName(subscribableInfoContext.getAutoscalingPolicy());
+ appClusterCtxt.setAutoscalePolicyName(subscribableInfoContext.getAutoscalingPolicyUuid());
appClusterCtxt.setProperties(subscribableInfoContext.getProperties());
if (subscribableInfoContext.getPersistenceContext() != null) {
appClusterCtxt.setPersistenceContext(subscribableInfoContext.getPersistenceContext());
@@@ -935,17 -941,19 +941,19 @@@
* @return ApplicationClusterContext object with relevant information
* @throws ApplicationDefinitionException If any error occurs
*/
- private ApplicationClusterContext createApplicationClusterContext(String appId, String groupName, Cartridge cartridge,
+ private ApplicationClusterContext createApplicationClusterContext(String applicationUuid, String groupName,
+ Cartridge cartridge,
String subscriptionKey, int tenantId, String repoUrl,
String alias, String clusterId, String hostname,
- String deploymentPolicy, boolean isLB, String tenantRange,
+ String deploymentPolicyUuid, boolean isLB,
+ String tenantRange,
String[] dependencyAliases, Properties properties, String[] dependencyClustorIDs,
- String[] exportMetadata, String[] importMetadata, String lvsVirtualIP)
- String[] exportMetadata, String[] importMetadata)
++ String[] exportMetadata, String[] importMetadata,String lvsVirtualIP)
throws ApplicationDefinitionException {
// Create text payload
- PayloadData payloadData = ApplicationUtils.createPayload(appId, groupName, cartridge, subscriptionKey, tenantId, clusterId,
- hostname, repoUrl, alias, null, dependencyAliases, properties, oauthToken, dependencyClustorIDs, exportMetadata, importMetadata, lvsVirtualIP);
+ PayloadData payloadData = ApplicationUtils.createPayload(applicationUuid, groupName, cartridge, subscriptionKey, tenantId, clusterId,
- hostname, repoUrl, alias, null, dependencyAliases, properties, oauthToken, dependencyClustorIDs, exportMetadata, importMetadata);
++ hostname, repoUrl, alias, null, dependencyAliases, properties, oauthToken, dependencyClustorIDs, exportMetadata, importMetadata,lvsVirtualIP);
String textPayload = payloadData.toString();
if (log.isDebugEnabled()) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/ParserUtils.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/payload/BasicPayloadData.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/payload/BasicPayloadData.java
index 67d88e4,89eed10..ee14a56
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/payload/BasicPayloadData.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/payload/BasicPayloadData.java
@@@ -36,6 -36,6 +36,7 @@@ public class BasicPayloadData implement
private String appId;
private String groupName;
private String serviceName;
++ private String serviceType;
private String clusterId;
private String hostName;
private int tenantId;
@@@ -73,6 -73,6 +74,8 @@@
payloadBuilder.append(",");
payloadBuilder.append("SERVICE_NAME=" + getServiceName());
payloadBuilder.append(",");
++ payloadBuilder.append("SERVICE_TYPE=" + getServiceType());
++ payloadBuilder.append(",");
payloadBuilder.append("HOST_NAME=" + getHostName());
payloadBuilder.append(",");
payloadBuilder.append("MULTITENANT=" + getMultitenant());
@@@ -403,12 -388,4 +406,20 @@@
public void setImportMetadataKeys(String[] importMetadataKeys) {
this.importMetadataKeys = importMetadataKeys;
}
+
+ public String getLvsVirtualIP() {
+ return lvsVirtualIP;
+ }
+
+ public void setLvsVirtualIP(String lvsVirtualIP) {
+ this.lvsVirtualIP = lvsVirtualIP;
+ }
++
++ public String getServiceType() {
++ return serviceType;
++ }
++
++ public void setServiceType(String serviceType) {
++ this.serviceType = serviceType;
++ }
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/pojo/ApplicationClusterContext.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/pojo/ApplicationClusterContext.java
index cd48cd4,e666e54..35c68d2
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/pojo/ApplicationClusterContext.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/pojo/ApplicationClusterContext.java
@@@ -45,9 -47,18 +47,9 @@@ public class ApplicationClusterContext
private Properties properties;
private String[] dependencyClusterIds;
-
- public PersistenceContext getPersistenceContext() {
- return persistenceContext;
- }
-
- public void setPersistenceContext(PersistenceContext persistenceContext) {
- this.persistenceContext = persistenceContext;
- }
-
private PersistenceContext persistenceContext;
- public ApplicationClusterContext(String cartridgeType, String clusterId, String hostName,
+ public ApplicationClusterContext(String cartridgeUuid, String clusterId, String hostName,
String textPayload, String deploymentPolicyName, boolean isLbCluster,
String tenantRange, String[] dependencyClusterIds) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/pojo/SubscribableInfoContext.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/pojo/SubscribableInfoContext.java
index c4b57f0,119c162..01c0b98
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/pojo/SubscribableInfoContext.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/pojo/SubscribableInfoContext.java
@@@ -111,11 -111,19 +113,27 @@@ public class SubscribableInfoContext im
this.persistenceContext = persistenceContext;
}
- public String getLvsVirtualIP() {
++ public String getLvsVirtualIP() {
+ return lvsVirtualIP;
+ }
+
+ public void setLvsVirtualIP(String lvsVirtualIP) {
+ this.lvsVirtualIP = lvsVirtualIP;
+ }
++
+ public String getDeploymentPolicy() {
+ return deploymentPolicy;
+ }
+
+ public void setDeploymentPolicy(String deploymentPolicy) {
+ this.deploymentPolicy = deploymentPolicy;
+ }
+
+ public String getAutoscalingPolicy() {
+ return autoscalingPolicy;
+ }
+
+ public void setAutoscalingPolicy(String autoscalingPolicy) {
+ this.autoscalingPolicy = autoscalingPolicy;
+ }
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
index 912a2f6,f865d4b..7dd33c5
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
@@@ -74,16 -74,16 +73,16 @@@ public class ApplicationBuilder
log.debug("Handling application creation event: [application-id] " +
application.getUniqueIdentifier());
}
- AutoscalerCloudControllerClient.getInstance().createApplicationClusters(application.getUniqueIdentifier(),
- appClusterContexts);
ApplicationHolder.persistApplication(application);
ApplicationsEventPublisher.sendApplicationCreatedEvent(application);
+ AutoscalerCloudControllerClient.getInstance().createApplicationClusters(application.getUniqueIdentifier(),
+ appClusterContexts);
}
- public static ApplicationInstance handleApplicationInstanceCreatedEvent(String appId,
- String networkPartitionId) {
+ public static ApplicationInstance handleApplicationInstanceCreatedEvent(String appUuid,
+ String networkPartitionUuid) {
if (log.isDebugEnabled()) {
- log.debug("Handling application instance creation event: [application-id] " + appId);
+ log.debug("Handling application instance creation event: [application-id] " + appUuid);
}
ApplicationInstance applicationInstance = null;
//acquiring write lock to add the required instances
@@@ -366,7 -361,7 +360,7 @@@
cluster.getInstanceIdToInstanceContextMap().values()) {
ClusterStatusEventPublisher.
sendClusterStatusClusterTerminatingEvent(applicationId,
-- aClusterData.getServiceType(),
++ aClusterData.getServiceUuid(),
aClusterData.getClusterId(),
instance.getInstanceId());
}
@@@ -427,9 -422,9 +421,9 @@@
monitor1.destroy();
}
}
- org.apache.stratos.autoscaler.context.partition.network.ParentLevelNetworkPartitionContext networkPartitionContext =
- (org.apache.stratos.autoscaler.context.partition.network.ParentLevelNetworkPartitionContext) monitor.
+ org.apache.stratos.autoscaler.context.partition.network.NetworkPartitionContext networkPartitionContext =
+ (org.apache.stratos.autoscaler.context.partition.network.NetworkPartitionContext) monitor.
- getNetworkPartitionContext(groupInstance.getNetworkPartitionId());
+ getNetworkPartitionContext(groupInstance.getNetworkPartitionUuid());
networkPartitionContext.removeInstanceContext(instanceId);
if (groupInstance.getPartitionId() != null) {
networkPartitionContext.getPartitionCtxt(groupInstance.getPartitionId()).
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/AutoscalerCloudControllerClient.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/AutoscalerCloudControllerClient.java
index 0124206,f19531b..5a9aab2
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/AutoscalerCloudControllerClient.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/AutoscalerCloudControllerClient.java
@@@ -224,12 -250,4 +250,5 @@@ public class AutoscalerCloudControllerC
log.debug(String.format("Service call terminateInstances() returned in %dms", (endTime - startTime)));
}
}
-}
+
- /* An instance of a CloudControllerClient is created when the class is loaded.
- * Since the class is loaded only once, it is guaranteed that an object of
- * CloudControllerClient is created only once. Hence it is singleton.
- */
- private static class InstanceHolder {
- private static final AutoscalerCloudControllerClient INSTANCE = new AutoscalerCloudControllerClient();
- }
- }
++ }
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/AutoscalerContext.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContext.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContext.java
index 235b7b7,8055cb0..b1e3bd4
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContext.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/ClusterContext.java
@@@ -137,11 -137,11 +137,11 @@@ public class ClusterContext extends Abs
if (networkPartition == null) {
//Parent should have the partition specified
- networkPartitionContext = new ClusterLevelNetworkPartitionContext(
+ networkPartitionContext = new NetworkPartitionContext(
- clusterInstance.getNetworkPartitionId());
+ clusterInstance.getNetworkPartitionUuid());
} else {
- networkPartitionContext = new ClusterLevelNetworkPartitionContext(networkPartition.getUuid(),
- networkPartition.getPartitionAlgo(), 0);
+ networkPartitionContext = new NetworkPartitionContext(networkPartition.getId(),
+ networkPartition.getPartitionAlgo());
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
index 2573991,9388985..56a567e
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
@@@ -276,15 -285,9 +285,15 @@@ public class AutoscalerTopologyEventRec
monitor.notifyParentMonitor(ClusterStatus.Terminating, clusterInstanceId);
InstanceNotificationPublisher.getInstance().
sendInstanceCleanupEventForCluster(clusterId, clusterInstanceId);
+ //Terminating the pending members
+ monitor.terminatePendingMembers(clusterInstanceId,
- clusterInstance.getNetworkPartitionId());
++ clusterInstance.getNetworkPartitionUuid());
+ //Move all members to terminating pending list
+ monitor.moveMembersToTerminatingPending(clusterInstanceId,
- clusterInstance.getNetworkPartitionId());
++ clusterInstance.getNetworkPartitionUuid());
} else {
monitor.notifyParentMonitor(ClusterStatus.Terminating, clusterInstanceId);
- monitor.terminateAllMembers(clusterInstanceId, clusterInstance.getNetworkPartitionId());
+ monitor.terminateAllMembers(clusterInstanceId, clusterInstance.getNetworkPartitionUuid());
}
ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
process("", clusterId, clusterInstanceId);
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/internal/AutoscalerServiceComponent.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/internal/AutoscalerServiceComponent.java
index 48ee481,3671762..030a8b5
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/internal/AutoscalerServiceComponent.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/internal/AutoscalerServiceComponent.java
@@@ -136,8 -135,8 +138,9 @@@ public class AutoscalerServiceComponen
} else {
executeCoordinatorTasks();
}
+
- componentStartUpSynchronizer.waitForWebServiceActivation("AutoscalerService");
+ componentStartUpSynchronizer.waitForAxisServiceActivation(Component.Autoscaler,
+ "AutoscalerService");
componentStartUpSynchronizer.setComponentStatus(Component.Autoscaler, true);
if (log.isInfoEnabled()) {
log.info("Autoscaler service component activated");
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
index 43493bd,f700dbc..952be10
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
@@@ -84,16 -84,16 +84,18 @@@ import java.util.concurrent.atomic.Atom
*/
public class ClusterMonitor extends Monitor {
- private static final Log log = LogFactory.getLog(ClusterMonitor.class);
private final ScheduledExecutorService scheduler;
private final ExecutorService executorService;
+
protected boolean hasFaultyMember = false;
protected ClusterContext clusterContext;
+ protected String serviceType;
+ protected String clusterId;
// future to cancel it when destroying monitors
private ScheduledFuture<?> schedulerFuture;
+ protected String serviceUuid;
private AtomicBoolean monitoringStarted;
- protected String clusterId;
++
private Cluster cluster;
private int monitoringIntervalMilliseconds;
//has scaling dependents
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ApplicationMonitor.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ApplicationMonitor.java
index 70ee9d4,8638dcb..787458c
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ApplicationMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ApplicationMonitor.java
@@@ -167,9 -150,9 +152,9 @@@ public class ApplicationMonitor extend
executorService.execute(monitoringRunnable);
}
- private void handleScalingMaxOut(ParentInstanceContext instanceContext,
+ private void handleScalingMaxOut(InstanceContext instanceContext,
NetworkPartitionContext networkPartitionContext) {
- if (((ParentLevelNetworkPartitionContext) networkPartitionContext).getPendingInstancesCount() == 0) {
+ if (((NetworkPartitionContext) networkPartitionContext).getPendingInstancesCount() == 0) {
//handling the application bursting only when there are no pending instances found
try {
if (log.isInfoEnabled()) {
@@@ -546,9 -454,9 +456,9 @@@
return false;
}
- for (String networkPartitionIds : nextNetworkPartitions) {
+ for (String networkPartitionUuids : nextNetworkPartitions) {
- ParentLevelNetworkPartitionContext context =
- new ParentLevelNetworkPartitionContext(networkPartitionUuids);
+ NetworkPartitionContext context =
- new NetworkPartitionContext(networkPartitionIds);
++ new NetworkPartitionContext(networkPartitionUuids);
//If application instances found in the ApplicationsTopology,
// then have to add them first before creating new one
ApplicationInstance appInstance = (ApplicationInstance) application.
@@@ -566,17 -471,17 +476,17 @@@
}
instanceIds.add(instanceId);
- log.info("Application instance has been added for the [network partition uuid] " +
+ log.info("Application instance has been added for the [network partition] " +
- networkPartitionIds + " [appInstanceId] " + instanceId);
+ networkPartitionUuids + " [appInstanceId] " + instanceId);
}
//Find whether any other instances exists in cluster
// which has not been added to in-memory model in the restart
Map<String, ApplicationInstance> instanceMap = application.getInstanceIdToInstanceContextMap();
- for(ApplicationInstance instance : instanceMap.values()) {
- if(!instanceIds.contains(instance.getInstanceId())) {
- ParentLevelNetworkPartitionContext context =
- new ParentLevelNetworkPartitionContext(instance.getNetworkPartitionUuid());
+ for (ApplicationInstance instance : instanceMap.values()) {
+ if (!instanceIds.contains(instance.getInstanceId())) {
+ NetworkPartitionContext context =
- new NetworkPartitionContext(instance.getNetworkPartitionId());
++ new NetworkPartitionContext(instance.getNetworkPartitionUuid());
//If application instances found in the ApplicationsTopology,
// then have to add them first before creating new one
ApplicationInstance appInstance = (ApplicationInstance) application.
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
index bc3052a,3bb2254..ffa9552
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
@@@ -155,69 -155,66 +155,69 @@@ public class GroupMonitor extends Paren
}
}
- ParentLevelNetworkPartitionContext parentLevelNetworkPartitionContext
- = (ParentLevelNetworkPartitionContext) networkPartitionContext;
- Collection<Instance> parentInstances = parent.getInstances();
-
- for (Instance parentInstance : parentInstances) {
- int nonTerminatedInstancesCount = parentLevelNetworkPartitionContext.
- getNonTerminatedInstancesCount(parentInstance.getInstanceId());
- int minInstances = parentLevelNetworkPartitionContext.
- getMinInstanceCount();
- int maxInstances = parentLevelNetworkPartitionContext.
- getMaxInstanceCount();
- int activeInstances = parentLevelNetworkPartitionContext.
- getActiveInstancesCount(parentInstance.getInstanceId());
-
- if (nonTerminatedInstancesCount < minInstances) {
- int instancesToBeCreated = minInstances - nonTerminatedInstancesCount;
- for (int i = 0; i < instancesToBeCreated; i++) {
- for (InstanceContext parentInstanceContext : parent.
- getNetworkPartitionContext(parentLevelNetworkPartitionContext.getId()).
- getInstanceIdToInstanceContextMap().values()) {
- //keep on scale-up/scale-down only if the application is active
- ApplicationMonitor appMonitor = AutoscalerContext.getInstance().
- getAppMonitor(appId);
- int activeAppInstances = ((ParentLevelNetworkPartitionContext) appMonitor.
- getNetworkPartitionContext(parentLevelNetworkPartitionContext.getId())).
- getActiveInstancesCount();
- if (activeAppInstances > 0) {
- //Creating new group instance based on the existing parent instances
- if (log.isDebugEnabled()) {
- log.debug("Creating a group instance of [application] "
- + appId + " [group] " + id +
- " as the the minimum required instances not met");
-
+ ApplicationMonitor applicationMonitor = AutoscalerContext.getInstance().
+ getAppMonitor(appId);
+
+ //When the application is getting un-deployed, need to avoid
+ // checking the minimum count sanctification
+ if (!applicationMonitor.isTerminating()) {
+ Collection<Instance> parentInstances = parent.getInstances();
+
+ for (Instance parentInstance : parentInstances) {
- if (parentInstance.getNetworkPartitionId().equals(networkPartitionContext.getId())) {
++ if (parentInstance.getNetworkPartitionUuid().equals(networkPartitionContext.getId())) {
+ int nonTerminatedInstancesCount = networkPartitionContext.
+ getNonTerminatedInstancesCount(parentInstance.getInstanceId());
+ int minInstances = networkPartitionContext.
+ getMinInstanceCount();
+ int maxInstances = networkPartitionContext.
+ getMaxInstanceCount();
+ int activeInstances = networkPartitionContext.
+ getActiveInstancesCount(parentInstance.getInstanceId());
+
+ if (nonTerminatedInstancesCount < minInstances) {
+ int instancesToBeCreated = minInstances - nonTerminatedInstancesCount;
+ for (int i = 0; i < instancesToBeCreated; i++) {
+ for (InstanceContext parentInstanceContext : parent.
+ getNetworkPartitionContext(networkPartitionContext.getId()).
+ getInstanceIdToInstanceContextMap().values()) {
+ //keep on scale-up/scale-down only if the application is active
+ ApplicationMonitor appMonitor = AutoscalerContext.getInstance().
+ getAppMonitor(appId);
+ int activeAppInstances = appMonitor.
+ getNetworkPartitionContext(networkPartitionContext.getId()).
+ getActiveInstancesCount();
+ if (activeAppInstances > 0) {
+ //Creating new group instance based on the existing parent instances
+ log.info("Creating a group instance of [application] "
+ + appId + " [group] " + id +
+ " as the the minimum required instances are not met");
+
+ createInstanceOnDemand(parentInstanceContext.getId());
+ }
}
- createInstanceOnDemand(parentInstanceContext.getId());
+
}
}
+ //If the active instances are higher than the max instances,
+ // the group instance has to get terminated
+ if (activeInstances > maxInstances) {
+ int instancesToBeTerminated = activeInstances - maxInstances;
+ List<InstanceContext> contexts =
+ networkPartitionContext.getInstanceIdToInstanceContextMap(
+ parentInstance.getInstanceId());
+ List<InstanceContext> contextList = new ArrayList<InstanceContext>(contexts);
+ for (int i = 0; i < instancesToBeTerminated; i++) {
+ InstanceContext instanceContext = contextList.get(i);
+ //scale down only when extra instances found
+ log.info("Terminating a group instance of [application] "
+ + appId + " [group] " + id + " as it exceeded the " +
+ "maximum no of instances by " + instancesToBeTerminated);
+
+ handleScalingDownBeyondMin((ParentInstanceContext) instanceContext,
+ networkPartitionContext, true);
- }
- }
- //If the active instances are higher than the max instances,
- // the group instance has to get terminated
- if (activeInstances > maxInstances) {
- int instancesToBeTerminated = activeInstances - maxInstances;
- List<InstanceContext> contexts =
- ((ParentLevelNetworkPartitionContext) networkPartitionContext).
- getInstanceIdToInstanceContextMap(parentInstance.getInstanceId());
- List<InstanceContext> contextList = new ArrayList<InstanceContext>(contexts);
- for (int i = 0; i < instancesToBeTerminated; i++) {
- InstanceContext instanceContext = contextList.get(i);
- //scale down only when extra instances found
- if (log.isDebugEnabled()) {
- log.debug("Terminating a group instance of [application] "
- + appId + " [group] " + id + " as it exceeded the " +
- "maximum no of instances by " + instancesToBeTerminated);
-
+ }
}
- handleScalingDownBeyondMin(instanceContext,
- networkPartitionContext, true);
-
}
}
}
@@@ -686,9 -694,9 +686,9 @@@
String deploymentPolicyId = AutoscalerUtil.getDeploymentPolicyIdByAlias(appId, groupAlias);
DeploymentPolicy deploymentPolicy = PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId);
- String networkPartitionId = parentInstanceContext.getNetworkPartitionId();
+ String networkPartitionId = parentInstanceContext.getNetworkPartitionUuid();
if (this.getNetworkPartitionContextsMap().containsKey(networkPartitionId)) {
- parentLevelNetworkPartitionContext = (ParentLevelNetworkPartitionContext) this.getNetworkPartitionContextsMap().
+ parentLevelNetworkPartitionContext = this.getNetworkPartitionContextsMap().
get(networkPartitionId);
} else {
if (deploymentPolicy != null) {
@@@ -731,9 -739,9 +731,9 @@@
* @param groupAlias alias of the group
*/
private void addPartitionContext(Instance parentInstanceContext,
- ParentLevelNetworkPartitionContext networkPartitionContext, String groupAlias) {
+ NetworkPartitionContext networkPartitionContext, String groupAlias) {
- String networkPartitionId = parentInstanceContext.getNetworkPartitionId();
+ String networkPartitionId = parentInstanceContext.getNetworkPartitionUuid();
String deploymentPolicyId = AutoscalerUtil.getDeploymentPolicyIdByAlias(appId, groupAlias);
DeploymentPolicy deploymentPolicy = PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId);
@@@ -767,14 -775,14 +767,14 @@@
if (partitions != null && partitions.length != 0) {
for (PartitionRef partition : partitions) {
- if (networkPartitionContext.getPartitionCtxt(partition.getId()) == null) {
+ if (networkPartitionContext.getPartitionCtxt(partition.getUuid()) == null) {
- GroupLevelPartitionContext groupLevelPartitionContext = new GroupLevelPartitionContext(
+ ParentLevelPartitionContext parentLevelPartitionContext = new ParentLevelPartitionContext(
- partition.getId(), networkPartitionId, deploymentPolicyId);
+ partition.getUuid(), networkPartitionId, deploymentPolicyId);
- networkPartitionContext.addPartitionContext(groupLevelPartitionContext);
+ networkPartitionContext.addPartitionContext(parentLevelPartitionContext);
if (log.isInfoEnabled()) {
log.info(String.format("[Partition] %s has been added for the [Group] %s",
- partition.getId(), this.id));
+ partition.getUuid(), this.id));
}
}
}
@@@ -788,7 -796,7 +788,7 @@@
* Creates the group instance and adds the required context objects
*
* @param group the group
- * @param parentInstance the parent instance context
- * @param parentInstanceContext the parent instance context
++ * @param partitionContext the parent instance context
* @param partitionContext partition-context used to create the group instance
* @param parentLevelNetworkPartitionContext the group level network partition context
*/
@@@ -804,8 -812,8 +804,8 @@@
partitionId = partitionContext.getPartitionId();
}
- groupInstance = createGroupInstance(group, parentInstance.getNetworkPartitionId(),
- groupInstance = createGroupInstance(group, parentInstanceContext.getNetworkPartitionUuid(),
- parentInstanceContext.getInstanceId(), partitionId);
++ groupInstance = createGroupInstance(group, parentInstance.getNetworkPartitionUuid(),
+ parentInstance.getInstanceId(), partitionId);
}
this.addInstance(groupInstance);
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
index 3336776,957386b..3854544
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
@@@ -350,11 -411,10 +411,11 @@@ public class PolicyManager
RegistryManager.getInstance().persistApplicationPolicy(applicationPolicy);
if (log.isInfoEnabled()) {
- log.info(String
- .format("Application policy is added successfully: [application-policy-id] %s",
- applicationPolicyId));
+ log.info(String.format("Application policy added successfully: [tenant-id] %d [application-policy-uuid] %s " +
+ "[application-policy-id] %s", applicationPolicy.getTenantId(), applicationPolicyUuid,
+ applicationPolicy.getId()));
}
+
}
public boolean removeApplicationPolicy(String applicationPolicyId) throws InvalidPolicyException {
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index f0e797f,76d527b..6f447cb
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@@ -1130,36 -1472,35 +1472,36 @@@ public class AutoscalerServiceImpl impl
for (ClusterMonitor clusterMonitor : AutoscalerContext.getInstance().getClusterMonitors().values()) {
//Following if statement checks the relevant clusters for the updated deployment policy
- if (deploymentPolicy.getDeploymentPolicyID().equals(clusterMonitor.getDeploymentPolicyId())) {
+ if (deploymentPolicy.getUuid().equals(clusterMonitor.getDeploymentPolicyId())) {
for (NetworkPartitionRef networkPartition : deploymentPolicy.getNetworkPartitionRefs()) {
- ClusterLevelNetworkPartitionContext clusterLevelNetworkPartitionContext
- = clusterMonitor.getClusterContext().getNetworkPartitionCtxt(networkPartition.getUuid());
-
- try {
- addNewPartitionsToClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition,
- deploymentPolicy.getUuid(), clusterMonitor.getClusterContext().getServiceId());
- } catch (RemoteException e) {
-
- String message = "Connection to cloud controller failed, Cluster monitor update failed for" +
- " [deployment-policy] " + deploymentPolicy.getId();
- log.error(message);
- throw new CloudControllerConnectionException(message, e);
- } catch (CloudControllerServiceInvalidPartitionExceptionException e) {
-
- String message = "Invalid partition, Cluster monitor update failed for [deployment-policy] "
- + deploymentPolicy.getId();
- log.error(message);
- throw new InvalidDeploymentPolicyException(message, e);
- } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
-
- String message = "Invalid cartridge type, Cluster monitor update failed for [deployment-policy] "
- + deploymentPolicy.getId() + " [cartridge] "
- + clusterMonitor.getClusterContext().getServiceId();
- log.error(message);
- throw new InvalidDeploymentPolicyException(message, e);
+ NetworkPartitionContext clusterLevelNetworkPartitionContext
+ = clusterMonitor.getClusterContext().getNetworkPartitionCtxt(networkPartition.getId());
+ if (clusterLevelNetworkPartitionContext != null) {
+ try {
+ addNewPartitionsToClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition,
- deploymentPolicy.getDeploymentPolicyID(), clusterMonitor.getClusterContext().getServiceId());
++ deploymentPolicy.getUuid(), clusterMonitor.getClusterContext().getServiceId());
+ } catch (RemoteException e) {
+
+ String message = "Connection to cloud controller failed, Cluster monitor update failed for" +
- " [deployment-policy] " + deploymentPolicy.getDeploymentPolicyID();
++ " [deployment-policy] " + deploymentPolicy.getId();
+ log.error(message);
+ throw new CloudControllerConnectionException(message, e);
+ } catch (CloudControllerServiceInvalidPartitionExceptionException e) {
+
+ String message = "Invalid partition, Cluster monitor update failed for [deployment-policy] "
- + deploymentPolicy.getDeploymentPolicyID();
++ + deploymentPolicy.getId();
+ log.error(message);
+ throw new InvalidDeploymentPolicyException(message, e);
+ } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
+
+ String message = "Invalid cartridge type, Cluster monitor update failed for [deployment-policy] "
- + deploymentPolicy.getDeploymentPolicyID() + " [cartridge] "
++ + deploymentPolicy.getId() + " [cartridge] "
+ + clusterMonitor.getClusterContext().getServiceId();
+ log.error(message);
+ throw new InvalidDeploymentPolicyException(message, e);
+ }
+ removeOldPartitionsFromClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition);
}
- removeOldPartitionsFromClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition);
}
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
index 18a6956,85a4acc..5e992ae
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
@@@ -259,6 -269,80 +260,65 @@@ public class AutoscalerUtil
return toCommonProperties(properties);
}
- public synchronized void startApplicationMonitor(String applicationId) {
-
- AutoscalerContext autoscalerContext = AutoscalerContext.getInstance();
- if (autoscalerContext.getAppMonitor(applicationId) == null) {
- autoscalerContext.addApplicationPendingMonitor(applicationId);
- ServiceReferenceHolder.getInstance().getExecutorService().submit(new ApplicationMonitorAdder(applicationId));
-
- log.info(String.format("Monitor scheduled: [application] %s ", applicationId));
- } else {
- if (log.isDebugEnabled()) {
- log.debug(String.format("Application monitor thread already exists: " +
- "[application] %s ", applicationId));
- }
- }
- }
+
+ private class ApplicationMonitorAdder implements Runnable {
+ private String applicationId;
+
+ public ApplicationMonitorAdder(String applicationId) {
+ this.applicationId = applicationId;
+ }
+
+ public void run() {
+ long startTime = System.currentTimeMillis();
+ long endTime = startTime;
+ int retries = 5;
+ boolean success = false;
+ ApplicationMonitor applicationMonitor = null;
+ while (!success && retries != 0) {
+
+ try {
+ startTime = System.currentTimeMillis();
+ log.info("Starting monitor: [application] " + applicationId);
+ try {
+ applicationMonitor = MonitorFactory.getApplicationMonitor(applicationId);
+ } catch (PolicyValidationException e) {
+ String msg = "Monitor creation failed: [application] " + applicationId;
+ log.warn(msg, e);
+ retries--;
+ }
+ success = true;
+ endTime = System.currentTimeMillis();
+ } catch (DependencyBuilderException e) {
+ String msg = "Monitor creation failed: [application] " + applicationId;
+ log.warn(msg, e);
+ retries--;
+ } catch (TopologyInConsistentException e) {
+ String msg = "Monitor creation failed: [application] " + applicationId;
+ log.warn(msg, e);
+ retries--;
+ }
+ }
+
+ if (applicationMonitor == null) {
+ String msg = "Monitor creation failed, even after retrying for 5 times: "
+ + "[application] " + applicationId;
+ log.error(msg);
+ throw new RuntimeException(msg);
+ }
+ AutoscalerContext autoscalerContext = AutoscalerContext.getInstance();
+ autoscalerContext.removeApplicationPendingMonitor(applicationId);
+ autoscalerContext.removeAppMonitor(applicationId);
+ autoscalerContext.addAppMonitor(applicationMonitor);
+
+ long startupTime = ((endTime - startTime) / 1000);
+ if (log.isInfoEnabled()) {
+ log.info(String.format("Monitor started successfully: [application] %s [dependents] %s " +
+ "[startup-time] %d seconds", applicationMonitor.getId(),
+ applicationMonitor.getStartupDependencyTree(), startupTime));
+ }
+ }
+ }
+
public static Monitor.MonitorType findMonitorType(ApplicationChildContext context) {
if (context instanceof GroupChildContext) {
return Monitor.MonitorType.Group;
@@@ -951,66 -908,53 +1029,9 @@@
}
}
- public static void validateStartupOrders(String groupName, String[] startupOrders) throws InvalidServiceGroupException {
-
- if (startupOrders == null || startupOrders.length == 0) {
- if (log.isDebugEnabled()) {
- log.debug("No Startup Order defined for group " + groupName);
- }
- return;
- }
-
- for (String startupOrder : startupOrders) {
- // split comma separated startup orders
- String[] splittedStartupOrders = startupOrder.split(",");
- for (String splittedStartupOrder : splittedStartupOrders) {
- if (!splittedStartupOrder.trim().startsWith("cartridge.") && !splittedStartupOrder.trim().startsWith("group.")) {
- // invalid startup order; should prefixed by either 'cartridge.' or 'group.'
- throw new InvalidServiceGroupException("Invalid cartridge group: startup order [" + startupOrder +
- "] for group " + groupName +
- ", should prefixed by either 'cartridge.' or 'group.'");
- }
- }
- }
- }
-
- public static void validateScalingDependencies(String groupName, String[] scalingDependents) throws InvalidServiceGroupException {
-
- if (scalingDependents == null || scalingDependents.length == 0) {
- if (log.isDebugEnabled()) {
- log.debug("No Scaling Dependents defined for group " + groupName);
- }
- return;
- }
-
- for (String scalingDependent : scalingDependents) {
- // split comma separated scaling dependents
- String[] splittedDependents = scalingDependent.split(",");
- for (String splittedDependent : splittedDependents) {
- if (!splittedDependent.trim().startsWith("cartridge.") && !splittedDependent.trim().startsWith("group.")) {
- // invalid startup order; should prefixed by either 'cartridge.' or 'group.'
- throw new InvalidServiceGroupException("Invalid cartridge group: Scaling Dependency [" +
- scalingDependent + "] for group " + groupName +
- ", should prefixed by either 'cartridge.' or 'group.'");
- }
- }
- }
+ private static class Holder {
+ private static final AutoscalerUtil INSTANCE = new AutoscalerUtil();
}
- private class ApplicationMonitorAdder implements Runnable {
- private String applicationId;
-
- public ApplicationMonitorAdder(String applicationId) {
- this.applicationId = applicationId;
- }
-
- public void run() {
- long startTime = System.currentTimeMillis();
- long endTime = startTime;
- int retries = 5;
- boolean success = false;
- ApplicationMonitor applicationMonitor = null;
- while (!success && retries != 0) {
-
- try {
- startTime = System.currentTimeMillis();
- log.info("Starting monitor: [application] " + applicationId);
- try {
- applicationMonitor = MonitorFactory.getApplicationMonitor(applicationId);
- } catch (PolicyValidationException e) {
- String msg = "Monitor creation failed: [application] " + applicationId;
- log.warn(msg, e);
- retries--;
- }
- success = true;
- endTime = System.currentTimeMillis();
- } catch (DependencyBuilderException e) {
- String msg = "Monitor creation failed: [application] " + applicationId;
- log.warn(msg, e);
- retries--;
- } catch (TopologyInConsistentException e) {
- String msg = "Monitor creation failed: [application] " + applicationId;
- log.warn(msg, e);
- retries--;
- }
- }
-
- if (applicationMonitor == null) {
- String msg = "Monitor creation failed, even after retrying for 5 times: "
- + "[application] " + applicationId;
- log.error(msg);
- throw new RuntimeException(msg);
- }
- AutoscalerContext autoscalerContext = AutoscalerContext.getInstance();
- autoscalerContext.removeApplicationPendingMonitor(applicationId);
- autoscalerContext.removeAppMonitor(applicationId);
- autoscalerContext.addAppMonitor(applicationMonitor);
-
- long startupTime = ((endTime - startTime) / 1000);
- if (log.isInfoEnabled()) {
- log.info(String.format("Monitor started successfully: [application] %s [dependents] %s " +
- "[startup-time] %d seconds", applicationMonitor.getId(),
- applicationMonitor.getStartupDependencyTree(), startupTime));
- }
- }
- }
- public void updateMonitors() {
- }
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/AutoscalerUtilTest.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/AutoscalerUtilTest.java
index c676ed1,3706fd4..60b2fae
--- a/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/AutoscalerUtilTest.java
+++ b/components/org.apache.stratos.autoscaler/src/test/java/org/apache/stratos/autoscaler/AutoscalerUtilTest.java
@@@ -75,62 -68,4 +68,5 @@@ public class AutoscalerUtilTest
tenantRange = AutoscalerUtil.findTenantRange(tenantId, null);
assertEquals(tenantRange, "*");
}
+
- @Test
- public void testRemovalOfAutoscalingPolicy() {
- List<CartridgeContext> cartridgeContexts = new ArrayList<CartridgeContext>();
- for (int i = 0; i < 12; i++) {
- CartridgeContext cartridgeContext = new CartridgeContext();
- SubscribableInfoContext subscribableContext = new SubscribableInfoContext();
- subscribableContext.setAlias("cart-" + i);
- subscribableContext.setDeploymentPolicy("dep-" + i);
- subscribableContext.setAutoscalingPolicy("auto-" + i);
- cartridgeContext.setSubscribableInfoContext(subscribableContext);
- cartridgeContexts.add(cartridgeContext);
- }
- List<GroupContext> groupContextList = new ArrayList<GroupContext>();
- for (int i = 0; i < 5; i++) {
- GroupContext groupContext = new GroupContext();
- groupContext.setAlias("group-" + i);
- CartridgeContext[] cartridgeContexts1 = new CartridgeContext[2];
- cartridgeContexts1[0] = cartridgeContexts.get(i);
- cartridgeContexts1[1] = cartridgeContexts.get(i + 5);
-
- groupContext.setCartridgeContexts(cartridgeContexts1);
- groupContextList.add(groupContext);
- }
-
- //Application-1
- ApplicationContext applicationContext = new ApplicationContext();
- applicationContext.setApplicationId("application-1");
- ComponentContext componentContext = new ComponentContext();
- CartridgeContext[] cartridgeContexts1 = new CartridgeContext[2];
- cartridgeContexts1[0] = cartridgeContexts.get(10);
- cartridgeContexts1[1] = cartridgeContexts.get(11);
- componentContext.setCartridgeContexts(cartridgeContexts1);
- GroupContext[] groupContexts = new GroupContext[groupContextList.size()];
- componentContext.setGroupContexts(groupContextList.toArray(groupContexts));
- applicationContext.setComponents(componentContext);
-
- ServiceReferenceHolder holder = ServiceReferenceHolder.getInstance();
- holder.setDistributedObjectProvider(new HazelcastDistributedObjectProvider());
-
- AutoscalerContext.getInstance().addApplicationContext(applicationContext);
-
-
- boolean canRemove;
-
- canRemove = AutoscalerUtil.removableAutoScalerPolicy("test");
- assertEquals(canRemove, true);
-
- for (int i = 0; i < 12; i++) {
- canRemove = AutoscalerUtil.removableAutoScalerPolicy("auto-" + i);
- assertEquals(canRemove, false);
-
- }
- }
-
- public void testRemovalOfDeploymentPolicy() {
-
- }
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/cloudstack/CloudStackPartitionValidator.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/ec2/EC2PartitionValidator.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/openstack/OpenstackPartitionValidator.java
----------------------------------------------------------------------
[12/50] [abbrv] stratos git commit: Minor change in
WSo2CEPHealthStatisticsPublisher's publish log
Posted by ga...@apache.org.
Minor change in WSo2CEPHealthStatisticsPublisher's publish log
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/09170550
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/09170550
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/09170550
Branch: refs/heads/master
Commit: 09170550493498b022acededebf62510fda0cd65
Parents: 78da0ef
Author: Thanuja <th...@wso2.com>
Authored: Wed Aug 19 10:27:19 2015 +0530
Committer: Thanuja <th...@wso2.com>
Committed: Fri Aug 21 16:21:01 2015 +0530
----------------------------------------------------------------------
.../publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/09170550/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
index 6a856c1..c8517f6 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/wso2/cep/WSO2CEPHealthStatisticsPublisher.java
@@ -88,7 +88,7 @@ public class WSO2CEPHealthStatisticsPublisher extends ThriftStatisticsPublisher
String memberId, String partitionId, String health, double value) {
if (log.isDebugEnabled()) {
log.debug(String.format("Publishing health statistics: [cluster] %s [network-partition] %s " +
- "[partition] %s [member] %s [health] %s [value] %f",
+ "[partition] %s [member] %s [health] %s [value] %d",
clusterId, networkPartitionId, partitionId, memberId, health, value));
}
// Set payload values