You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/09/07 13:52:32 UTC

[1/2] git commit: Adding Kubernetes API Java Client as an OSGi bundle to Stratos components.

Repository: stratos
Updated Branches:
  refs/heads/master 0b63c359b -> cc0af812b


Adding Kubernetes API Java Client as an OSGi bundle to Stratos components.


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

Branch: refs/heads/master
Commit: 1e4c8b4540b49b0281832d073b81b79c932ed9ce
Parents: 0b63c35
Author: Nirmal Fernando <ni...@gmail.com>
Authored: Sun Sep 7 17:21:36 2014 +0530
Committer: Nirmal Fernando <ni...@gmail.com>
Committed: Sun Sep 7 17:21:36 2014 +0530

----------------------------------------------------------------------
 .../pom.xml                                     |  93 ++++++
 .../kubernetes/client/KubernetesApiClient.java  | 280 +++++++++++++++++++
 .../exceptions/KubernetesClientException.java   |  46 +++
 .../KubernetesAPIClientInterface.java           | 121 ++++++++
 .../kubernetes/client/model/Container.java      |  90 ++++++
 .../client/model/EnvironmentVariable.java       |  47 ++++
 .../stratos/kubernetes/client/model/Label.java  |  43 +++
 .../kubernetes/client/model/Manifest.java       |  71 +++++
 .../stratos/kubernetes/client/model/Pod.java    | 133 +++++++++
 .../kubernetes/client/model/PodList.java        |  61 ++++
 .../stratos/kubernetes/client/model/Policy.java |  42 +++
 .../stratos/kubernetes/client/model/Port.java   |  65 +++++
 .../client/model/ReplicationController.java     |  94 +++++++
 .../client/model/ReplicationControllerList.java |  61 ++++
 .../kubernetes/client/model/Selector.java       |  43 +++
 .../kubernetes/client/model/Service.java        | 116 ++++++++
 .../kubernetes/client/model/ServiceList.java    |  61 ++++
 .../stratos/kubernetes/client/model/State.java  | 111 ++++++++
 .../stratos/kubernetes/client/model/Volume.java |  44 +++
 .../kubernetes/client/model/VolumeMount.java    |  57 ++++
 20 files changed, 1679 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/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
new file mode 100644
index 0000000..c15681a
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/pom.xml
@@ -0,0 +1,93 @@
+<?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.
+-->
+
+<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">
+
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-components-parent</artifactId>
+        <version>4.1.0-SNAPSHOT</version>
+    </parent>
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.apache.stratos.kubernetes.client</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Stratos - Kubernetes API Java Client</name>
+	<description>A Java client library written for Kubernetes API</description>
+	<url>http://apache.org</url>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.jboss.resteasy</groupId>
+			<artifactId>resteasy-jaxrs</artifactId>
+			<version>2.2.0.GA</version>
+			<!-- filter out unwanted jars -->
+			<exclusions>
+				<exclusion>
+					<groupId>commons-httpclient</groupId>
+					<artifactId>commons-httpclient</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.servlet</groupId>
+					<artifactId>servlet-api</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.resteasy</groupId>
+			<artifactId>resteasy-jaxb-provider</artifactId>
+			<version>2.2.0.GA</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-httpclient</groupId>
+			<artifactId>commons-httpclient</artifactId>
+			<version>3.1</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-lang</groupId>
+			<artifactId>commons-lang</artifactId>
+			<version>2.3</version>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.resteasy</groupId>
+			<artifactId>resteasy-jackson-provider</artifactId>
+			<version>2.2.0.GA</version>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+ 		<version>1.4.0</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Bundle-Name>${project.artifactId}</Bundle-Name>
+                        <DynamicImport-Package>*</DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+		</plugins>
+	</build>
+</project>

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/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
new file mode 100644
index 0000000..52ca93a
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/KubernetesApiClient.java
@@ -0,0 +1,280 @@
+/*
+ *
+ * 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.kubernetes.client;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.http.HttpStatus;
+import org.apache.stratos.kubernetes.client.interfaces.KubernetesAPIClientInterface;
+import org.apache.stratos.kubernetes.client.exceptions.KubernetesClientException;
+import org.apache.stratos.kubernetes.client.model.Pod;
+import org.apache.stratos.kubernetes.client.model.PodList;
+import org.apache.stratos.kubernetes.client.model.ReplicationController;
+import org.apache.stratos.kubernetes.client.model.ReplicationControllerList;
+import org.apache.stratos.kubernetes.client.model.Service;
+import org.apache.stratos.kubernetes.client.model.ServiceList;
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+
+public class KubernetesApiClient implements KubernetesAPIClientInterface {
+	
+	private String endpointUrl;
+	private static final Log log = LogFactory.getLog(KubernetesApiClient.class);
+	
+	public KubernetesApiClient(String endpointUrl) {
+		this.endpointUrl = endpointUrl;
+	}
+
+	@Override
+	public Pod getPod(String podId) throws KubernetesClientException{
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"pods/{podId}");
+			ClientResponse<Pod> res = request.pathParameter("podId", podId).get(Pod.class);
+			if (res.getEntity() == null ) {
+				String msg = "Pod ["+podId+"] doesn't exist.";
+				log.error(msg);
+				throw new KubernetesClientException(msg);
+			}
+			return res.getEntity();
+		} catch (Exception e) {
+			String msg = "Error while retrieving Pod info with Pod ID: "+podId;
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+	
+	@Override
+	public Pod[] getAllPods() throws KubernetesClientException {
+		
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"pods/");
+			ClientResponse<PodList> res = request.get(PodList.class);
+			if (res.getEntity() == null ) {
+				return new Pod[0];
+			}
+			return res.getEntity().getItems();
+		} catch (Exception e) {
+			String msg = "Error while retrieving Pods.";
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+	@Override
+	public void createPod(Pod pod) throws KubernetesClientException {
+
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"pods");
+			ClientResponse<?> res = request.body("application/json", pod).post();
+			
+			if (res.getResponseStatus().getStatusCode() != HttpStatus.SC_ACCEPTED) {
+				String msg = "Pod ["+pod+"] creation failed. Error: "+
+								res.getResponseStatus().getReasonPhrase();
+				log.error(msg);
+				throw new KubernetesClientException(msg);
+			}
+		} catch (Exception e) {
+			String msg = "Error while creating Pod: "+pod;
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+	@Override
+	public void deletePod(String podId) throws KubernetesClientException {
+
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"pods/{podId}");
+			ClientResponse<?> res = request.pathParameter("podId", podId).delete();
+			if (res.getResponseStatus().getStatusCode() != HttpStatus.SC_ACCEPTED) {
+				String msg = "Pod ["+podId+"] deletion failed. Error: "+
+								res.getResponseStatus().getReasonPhrase();
+				log.error(msg);
+				throw new KubernetesClientException(msg);
+			}
+		} catch (Exception e) {
+			String msg = "Error while retrieving Pod info of Pod ID: "+podId;
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+	@Override
+	public ReplicationController getReplicationController(String controllerId)
+			throws KubernetesClientException {
+
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"replicationControllers/{controllerId}");
+			ClientResponse<ReplicationController> res = request.pathParameter("controllerId", controllerId)
+					.get(ReplicationController.class);
+			if (res.getEntity() == null ) {
+				String msg = "Replication Controller ["+controllerId+"] doesn't exist.";
+				log.error(msg);
+				throw new KubernetesClientException(msg);
+			}
+			return res.getEntity();
+		} catch (Exception e) {
+			String msg = "Error while retrieving Replication Controller info with ID: "+controllerId;
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+	@Override
+	public ReplicationController[] getAllReplicationControllers()
+			throws KubernetesClientException {
+		
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"replicationControllers/");
+			ClientResponse<ReplicationControllerList> res = request.get(ReplicationControllerList.class);
+			if (res.getEntity() == null ) {
+				return new ReplicationController[0];
+			}
+			return res.getEntity().getItems();
+		} catch (Exception e) {
+			String msg = "Error while retrieving Replication Controllers.";
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+	@Override
+	public void createReplicationController(ReplicationController controller)
+			throws KubernetesClientException {
+
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl
+					+ "replicationControllers/");
+			ClientResponse<?> res = request
+					.body("application/json", controller).post();
+
+			if (res.getResponseStatus().getStatusCode() != HttpStatus.SC_ACCEPTED) {
+				String msg = "Replication Controller [" + controller
+						+ "] creation failed. Error: "
+						+ res.getResponseStatus().getReasonPhrase();
+				log.error(msg);
+				throw new KubernetesClientException(msg);
+			}
+		} catch (Exception e) {
+			String msg = "Error while creating Replication Controller: "
+					+ controller;
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+
+		}
+	}
+
+	@Override
+	public void deleteReplicationController(String controllerId)
+			throws KubernetesClientException {
+		
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"replicationControllers/{controllerId}");
+			ClientResponse<?> res = request.pathParameter("controllerId", controllerId).delete();
+			if (res.getResponseStatus().getStatusCode() != HttpStatus.SC_ACCEPTED) {
+				String msg = "Replication Controller ["+controllerId+"] deletion failed. Error: "+
+								res.getResponseStatus().getReasonPhrase();
+				log.error(msg);
+				throw new KubernetesClientException(msg);
+			}
+		} catch (Exception e) {
+			String msg = "Error while retrieving Replication Controller info of Controller ID: "+controllerId;
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+	@Override
+	public Service getService(String serviceId)
+			throws KubernetesClientException {
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"services/{serviceId}");
+			ClientResponse<Service> res = request.pathParameter("serviceId", serviceId).get(Service.class);
+			if (res.getEntity() == null ) {
+				String msg = "Service ["+serviceId+"] doesn't exist.";
+				log.error(msg);
+				throw new KubernetesClientException(msg);
+			}
+			return res.getEntity();
+		} catch (Exception e) {
+			String msg = "Error while retrieving Service info with Service ID: "+serviceId;
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+	@Override
+	public Service[] getAllServices() throws KubernetesClientException {
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"services/");
+			ClientResponse<ServiceList> res = request.get(ServiceList.class);
+			if (res.getEntity() == null ) {
+				return new Service[0];
+			}
+			return res.getEntity().getItems();
+		} catch (Exception e) {
+			String msg = "Error while retrieving Services.";
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+	@Override
+	public void createService(Service service) throws KubernetesClientException {
+
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"services/");
+			ClientResponse<?> res = request.body("application/json", service).post();
+			
+			if (res.getResponseStatus().getStatusCode() != HttpStatus.SC_ACCEPTED) {
+				String msg = "Service ["+service+"] creation failed. Error: "+
+								res.getResponseStatus().getReasonPhrase();
+				log.error(msg);
+				throw new KubernetesClientException(msg);
+			}
+		} catch (Exception e) {
+			String msg = "Error while creating the Service: "+service;
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+	@Override
+	public void deleteService(String serviceId)
+			throws KubernetesClientException {
+
+		try {
+			ClientRequest request = new ClientRequest(endpointUrl+"services/{serviceId}");
+			ClientResponse<?> res = request.pathParameter("serviceId", serviceId).delete();
+			if (res.getResponseStatus().getStatusCode() != HttpStatus.SC_ACCEPTED) {
+				String msg = "Service ["+serviceId+"] deletion failed. Error: "+
+								res.getResponseStatus().getReasonPhrase();
+				log.error(msg);
+				throw new KubernetesClientException(msg);
+			}
+		} catch (Exception e) {
+			String msg = "Error while retrieving Service info of Service ID: "+serviceId;
+			log.error(msg, e);
+			throw new KubernetesClientException(msg, e);
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/exceptions/KubernetesClientException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/exceptions/KubernetesClientException.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/exceptions/KubernetesClientException.java
new file mode 100644
index 0000000..20702f4
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/exceptions/KubernetesClientException.java
@@ -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.
+ *
+ */
+package org.apache.stratos.kubernetes.client.exceptions;
+
+public class KubernetesClientException extends Exception {
+
+	private static final long serialVersionUID = -7521673271244696906L;
+    private String message;
+
+    public KubernetesClientException(String message, Exception exception){
+        super(message, exception);
+        this.message = message;
+    }
+
+    public KubernetesClientException(Exception exception){
+        super(exception);
+    }
+    
+    public KubernetesClientException(String msg){
+        super(msg);
+        this.message = msg;
+    }
+    
+    @Override
+    public String getMessage() {
+        return this.message;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/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
new file mode 100644
index 0000000..77b15ef
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/interfaces/KubernetesAPIClientInterface.java
@@ -0,0 +1,121 @@
+/*
+ *
+ * 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.kubernetes.client.interfaces;
+
+import org.apache.stratos.kubernetes.client.exceptions.KubernetesClientException;
+import org.apache.stratos.kubernetes.client.model.*;
+
+
+public interface KubernetesAPIClientInterface {
+	
+	/* Pod API */
+
+	/**
+	 * Get information of a Pod given the PodID
+	 * @param podId id of the pod
+	 * @return {@link Pod}
+	 * @throws KubernetesClientException
+	 */
+	public Pod getPod(String podId) throws KubernetesClientException;
+	
+	/**
+	 * Get all Pods
+	 * @return Pods
+	 * @throws KubernetesClientException
+	 */
+	public Pod[] getAllPods() throws KubernetesClientException;
+	
+	/**
+	 * Create a new Pod
+	 * @param pod Pod to be created
+	 * @throws KubernetesClientException
+	 */
+	public void createPod(Pod pod) throws KubernetesClientException;
+	
+	/**
+	 * Delete a Pod
+	 * @param podId Id of the Pod to be deleted
+	 * @throws KubernetesClientException
+	 */
+	public void deletePod(String podId) throws KubernetesClientException;
+	
+	/* Replication Controller API */
+	
+	/**
+	 * Get a Replication Controller Info
+	 * @param controllerId id of the Replication Controller
+	 * @return {@link ReplicationController}
+	 * @throws KubernetesClientException
+	 */
+	public ReplicationController getReplicationController(String controllerId) throws KubernetesClientException;
+	
+	/**
+	 * Get all Replication Controllers.
+	 * @return {@link ReplicationController}s
+	 * @throws KubernetesClientException
+	 */
+	public ReplicationController[] getAllReplicationControllers() throws KubernetesClientException;
+	
+	/**
+	 * Create a new Replication Controller
+	 * @param controller controller to be created
+	 * @throws KubernetesClientException
+	 */
+	public void createReplicationController(ReplicationController controller) throws KubernetesClientException;
+	
+	/**
+	 * Delete a Replication Controller.
+	 * @param replication controller id controller id to be deleted.
+	 * @throws KubernetesClientException
+	 */
+	public void deleteReplicationController(String controllerId) throws KubernetesClientException;
+	
+	/* Services API */
+	
+	/**
+	 * Get the Service with the given id.
+	 * @param serviceId id of the service.
+	 * @return {@link Service}
+	 * @throws KubernetesClientException
+	 */
+	public Service getService(String serviceId) throws KubernetesClientException;
+	
+	/**
+	 * Get all the services.
+	 * @return array of {@link Service}s
+	 * @throws KubernetesClientException
+	 */
+	public Service[] getAllServices() throws KubernetesClientException;
+	
+	/**
+	 * Create a new Kubernetes service.
+	 * @param service service to be created.
+	 * @throws KubernetesClientException
+	 */
+	public void createService(Service service) throws KubernetesClientException;
+	
+	/**
+	 * Delete a Service.
+	 * @param serviceId service id to be deleted.
+ 	 * @throws KubernetesClientException
+	 */
+	public void deleteService(String serviceId) throws KubernetesClientException;
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Container.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Container.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Container.java
new file mode 100644
index 0000000..0670727
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Container.java
@@ -0,0 +1,90 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import java.util.Arrays;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class Container {
+
+	private String name;
+	private String image;
+	private String workingDir;
+	private String[] command;
+	private VolumeMount[] volumeMounts;
+	private Port[] ports;
+	private EnvironmentVariable[] env;
+	
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getImage() {
+		return image;
+	}
+	public void setImage(String image) {
+		this.image = image;
+	}
+	public String getWorkingDir() {
+		return workingDir;
+	}
+	public void setWorkingDir(String workingDir) {
+		this.workingDir = workingDir;
+	}
+	public String[] getCommand() {
+		return command;
+	}
+	public void setCommand(String[] command) {
+		this.command = command;
+	}
+	public VolumeMount[] getVolumeMounts() {
+		return volumeMounts;
+	}
+	public void setVolumeMounts(VolumeMount[] volumeMounts) {
+		this.volumeMounts = volumeMounts;
+	}
+	public Port[] getPorts() {
+		return ports;
+	}
+	public void setPorts(Port[] ports) {
+		this.ports = ports;
+	}
+	public EnvironmentVariable[] getEnv() {
+		return env;
+	}
+	public void setEnv(EnvironmentVariable[] env) {
+		this.env = env;
+	}
+	@Override
+	public String toString() {
+		return "Container [name=" + name + ", image=" + image + ", workingDir="
+				+ workingDir + ", command=" + Arrays.toString(command)
+				+ ", volumeMounts=" + Arrays.toString(volumeMounts)
+				+ ", ports=" + Arrays.toString(ports) + ", env="
+				+ Arrays.toString(env) + "]";
+	}
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/EnvironmentVariable.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/EnvironmentVariable.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/EnvironmentVariable.java
new file mode 100644
index 0000000..7c9644a
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/EnvironmentVariable.java
@@ -0,0 +1,47 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+public class EnvironmentVariable {
+
+	private String name;
+	private String value;
+		
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getValue() {
+		return value;
+	}
+	public void setValue(String value) {
+		this.value = value;
+	}
+	
+	@Override
+	public String toString() {
+		return "EnvironmentVariable [name=" + name + ", value=" + value + "]";
+	}
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Label.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Label.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Label.java
new file mode 100644
index 0000000..ecf84bc
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Label.java
@@ -0,0 +1,43 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class Label {
+
+	private String name;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	@Override
+	public String toString() {
+		return "Label [name=" + name + "]";
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Manifest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Manifest.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Manifest.java
new file mode 100644
index 0000000..4fde5c7
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Manifest.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import java.util.Arrays;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+/**
+ * https://github.com/GoogleCloudPlatform/kubernetes/blob/master/api/doc/manifest-schema.json
+ * @author nirmal
+ *
+ */
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class Manifest {
+
+	private String version;
+	private String id;
+	private Container[] containers;
+	private Volume[] volumes;
+	
+	public String getVersion() {
+		return version;
+	}
+	public void setVersion(String version) {
+		this.version = version;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public Container[] getContainers() {
+		return containers;
+	}
+	public void setContainers(Container[] containers) {
+		this.containers = containers;
+	}
+	public Volume[] getVolumes() {
+		return volumes;
+	}
+	public void setVolumes(Volume[] volumes) {
+		this.volumes = volumes;
+	}
+	@Override
+	public String toString() {
+		return "Manifest [version=" + version + ", id=" + id + ", containers="
+				+ Arrays.toString(containers) + ", volumes="
+				+ Arrays.toString(volumes) + "]";
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Pod.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Pod.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Pod.java
new file mode 100644
index 0000000..f5497a0
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Pod.java
@@ -0,0 +1,133 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+/**
+ * https://github.com/GoogleCloudPlatform/kubernetes/blob/master/api/doc/pod-schema.json
+ * @author nirmal
+ *
+ */
+@XmlRootElement
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class Pod {
+
+	private String kind;
+	private String id;
+	private String creationTimestamp;
+	private String selfLink;
+	private String resourceVersion;
+	private String apiVersion;
+	private State desiredState;
+	private State currentState;
+	private String status;
+	private String message;
+	private String code;
+	private Label labels;
+	
+	public String getKind() {
+		return kind;
+	}
+	public void setKind(String kind) {
+		this.kind = kind;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getCreationTimestamp() {
+		return creationTimestamp;
+	}
+	public void setCreationTimestamp(String creationTimestamp) {
+		this.creationTimestamp = creationTimestamp;
+	}
+	public String getSelfLink() {
+		return selfLink;
+	}
+	public void setSelfLink(String selfLink) {
+		this.selfLink = selfLink;
+	}
+	public State getDesiredState() {
+		return desiredState;
+	}
+	public void setDesiredState(State desiredState) {
+		this.desiredState = desiredState;
+	}
+	public State getCurrentState() {
+		return currentState;
+	}
+	public void setCurrentState(State currentState) {
+		this.currentState = currentState;
+	}
+	public String getResourceVersion() {
+		return resourceVersion;
+	}
+	public void setResourceVersion(String resourceVersion) {
+		this.resourceVersion = resourceVersion;
+	}
+	public String getApiVersion() {
+		return apiVersion;
+	}
+	public void setApiVersion(String apiVersion) {
+		this.apiVersion = apiVersion;
+	}
+	public Label getLabels() {
+		return labels;
+	}
+	public void setLabels(Label labels) {
+		this.labels = labels;
+	}
+	public String getStatus() {
+		return status;
+	}
+	public void setStatus(String status) {
+		this.status = status;
+	}
+	public String getMessage() {
+		return message;
+	}
+	public void setMessage(String message) {
+		this.message = message;
+	}
+	public String getCode() {
+		return code;
+	}
+	public void setCode(String code) {
+		this.code = code;
+	}
+	@Override
+	public String toString() {
+		return "Pod [kind=" + kind + ", id=" + id + ", creationTimestamp="
+				+ creationTimestamp + ", selfLink=" + selfLink
+				+ ", resourceVersion=" + resourceVersion + ", apiVersion="
+				+ apiVersion + ", desiredState=" + desiredState
+				+ ", currentState=" + currentState + ", status=" + status
+				+ ", message=" + message + ", code=" + code + ", labels="
+				+ labels + "]";
+	}
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/PodList.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/PodList.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/PodList.java
new file mode 100644
index 0000000..85067ef
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/PodList.java
@@ -0,0 +1,61 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import java.util.Arrays;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@XmlRootElement
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class PodList {
+
+	private String kind;
+	private String apiVersion;
+	private Pod[] items;
+	
+	public String getKind() {
+		return kind;
+	}
+	public void setKind(String kind) {
+		this.kind = kind;
+	}
+	public String getApiVersion() {
+		return apiVersion;
+	}
+	public void setApiVersion(String apiVersion) {
+		this.apiVersion = apiVersion;
+	}
+	public Pod[] getItems() {
+		return items;
+	}
+	public void setItems(Pod[] items) {
+		this.items = items;
+	}
+	@Override
+	public String toString() {
+		return "PodList [kind=" + kind + ", apiVersion=" + apiVersion
+				+ ", items=" + Arrays.toString(items) + "]";
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Policy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Policy.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Policy.java
new file mode 100644
index 0000000..0b12e64
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Policy.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class Policy {
+
+	private String type;
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	@Override
+	public String toString() {
+		return "Policy [type=" + type + "]";
+	}
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Port.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Port.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Port.java
new file mode 100644
index 0000000..2e3c39f
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Port.java
@@ -0,0 +1,65 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class Port {
+
+	private String name;
+	private String protocol;
+	private int containerPort;
+	private int hostPort;
+	
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getProtocol() {
+		return protocol;
+	}
+	public void setProtocol(String protocol) {
+		this.protocol = protocol;
+	}
+	public int getContainerPort() {
+		return containerPort;
+	}
+	public void setContainerPort(int containerPort) {
+		this.containerPort = containerPort;
+	}
+	public int getHostPort() {
+		return hostPort;
+	}
+	public void setHostPort(int hostPort) {
+		this.hostPort = hostPort;
+	}
+	@Override
+	public String toString() {
+		return "Port [name=" + name + ", protocol=" + protocol
+				+ ", containerPort=" + containerPort + ", hostPort=" + hostPort
+				+ "]";
+	}
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ReplicationController.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ReplicationController.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ReplicationController.java
new file mode 100644
index 0000000..9bd166f
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ReplicationController.java
@@ -0,0 +1,94 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+/**
+ * @author nirmal
+ *
+ */
+@XmlRootElement
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class ReplicationController {
+
+	private String kind;
+	private String id;
+	private String creationTimestamp;
+	private String selfLink;
+	private String apiVersion;
+	private Label labels;
+	private State desiredState;
+	
+	public String getKind() {
+		return kind;
+	}
+	public void setKind(String kind) {
+		this.kind = kind;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getCreationTimestamp() {
+		return creationTimestamp;
+	}
+	public void setCreationTimestamp(String creationTimestamp) {
+		this.creationTimestamp = creationTimestamp;
+	}
+	public String getSelfLink() {
+		return selfLink;
+	}
+	public void setSelfLink(String selfLink) {
+		this.selfLink = selfLink;
+	}
+	public Label getLabels() {
+		return labels;
+	}
+	public void setLabels(Label labels) {
+		this.labels = labels;
+	}
+	public State getDesiredState() {
+		return desiredState;
+	}
+	public void setDesiredState(State desiredState) {
+		this.desiredState = desiredState;
+	}
+	
+	@Override
+	public String toString() {
+		return "ReplicationController [kind=" + kind + ", id=" + id
+				+ ", creationTimestamp=" + creationTimestamp + ", selfLink="
+				+ selfLink + ", labels=" + labels + ", desiredState="
+				+ desiredState + "]";
+	}
+	public String getApiVersion() {
+		return apiVersion;
+	}
+	public void setApiVersion(String apiVersion) {
+		this.apiVersion = apiVersion;
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ReplicationControllerList.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ReplicationControllerList.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ReplicationControllerList.java
new file mode 100644
index 0000000..00979c1
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ReplicationControllerList.java
@@ -0,0 +1,61 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import java.util.Arrays;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@XmlRootElement
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class ReplicationControllerList {
+
+	private String kind;
+	private String apiVersion;
+	private ReplicationController[] items;
+	
+	public String getKind() {
+		return kind;
+	}
+	public void setKind(String kind) {
+		this.kind = kind;
+	}
+	public String getApiVersion() {
+		return apiVersion;
+	}
+	public void setApiVersion(String apiVersion) {
+		this.apiVersion = apiVersion;
+	}
+	public ReplicationController[] getItems() {
+		return items;
+	}
+	public void setItems(ReplicationController[] items) {
+		this.items = items;
+	}
+	@Override
+	public String toString() {
+		return "ReplicationControllerList [kind=" + kind + ", apiVersion="
+				+ apiVersion + ", items=" + Arrays.toString(items) + "]";
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Selector.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Selector.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Selector.java
new file mode 100644
index 0000000..6b0904d
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Selector.java
@@ -0,0 +1,43 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+/**
+ * @author nirmal
+ *
+ */
+public class Selector {
+
+	private String name;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	@Override
+	public String toString() {
+		return "Selector [name=" + name + "]";
+	}
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Service.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Service.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Service.java
new file mode 100644
index 0000000..11d2c38
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Service.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+/**
+ * https://github.com/GoogleCloudPlatform/kubernetes/blob/master/api/doc/service-schema.json
+ * @author nirmal
+ *
+ */
+@XmlRootElement
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class Service {
+
+	private String kind;
+	private String id;
+	private String creationTimestamp;
+	private String selfLink;
+	private String name;
+	private int port;
+	private String containerPort;
+	private Selector selector;
+	private String apiVersion;
+	private Label labels;
+	
+	public String getKind() {
+		return kind;
+	}
+	public void setKind(String kind) {
+		this.kind = kind;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getCreationTimestamp() {
+		return creationTimestamp;
+	}
+	public void setCreationTimestamp(String creationTimestamp) {
+		this.creationTimestamp = creationTimestamp;
+	}
+	public String getSelfLink() {
+		return selfLink;
+	}
+	public void setSelfLink(String selfLink) {
+		this.selfLink = selfLink;
+	}
+	public String getApiVersion() {
+		return apiVersion;
+	}
+	public void setApiVersion(String apiVersion) {
+		this.apiVersion = apiVersion;
+	}
+	public Label getLabels() {
+		return labels;
+	}
+	public void setLabels(Label labels) {
+		this.labels = labels;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public int getPort() {
+		return port;
+	}
+	public void setPort(int port) {
+		this.port = port;
+	}
+	public String getContainerPort() {
+		return containerPort;
+	}
+	public void setContainerPort(String containerPort) {
+		this.containerPort = containerPort;
+	}
+	public Selector getSelector() {
+		return selector;
+	}
+	public void setSelector(Selector selector) {
+		this.selector = selector;
+	}
+	@Override
+	public String toString() {
+		return "Service [kind=" + kind + ", id=" + id + ", creationTimestamp="
+				+ creationTimestamp + ", selfLink=" + selfLink + ", name="
+				+ name + ", port=" + port + ", containerPort=" + containerPort
+				+ ", selector=" + selector + ", apiVersion=" + apiVersion
+				+ ", labels=" + labels + "]";
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ServiceList.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ServiceList.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ServiceList.java
new file mode 100644
index 0000000..90035bd
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/ServiceList.java
@@ -0,0 +1,61 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import java.util.Arrays;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@XmlRootElement
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class ServiceList {
+
+	private String kind;
+	private String apiVersion;
+	private Service[] items;
+	
+	public String getKind() {
+		return kind;
+	}
+	public void setKind(String kind) {
+		this.kind = kind;
+	}
+	public String getApiVersion() {
+		return apiVersion;
+	}
+	public void setApiVersion(String apiVersion) {
+		this.apiVersion = apiVersion;
+	}
+	public Service[] getItems() {
+		return items;
+	}
+	public void setItems(Service[] items) {
+		this.items = items;
+	}
+	@Override
+	public String toString() {
+		return "ServiceList [kind=" + kind + ", apiVersion=" + apiVersion
+				+ ", items=" + Arrays.toString(items) + "]";
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/State.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/State.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/State.java
new file mode 100644
index 0000000..a6b077f
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/State.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+import org.codehaus.jackson.annotate.JsonIgnore;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class State {
+
+	private Manifest manifest;
+	private String status;
+	private String host;
+	private String hostIP;
+	private String podIP;
+	private int replicas;
+	private Selector replicaSelector;
+	private Pod podTemplate;
+	private Policy restartpolicy;
+	@JsonIgnore
+	private Object info;
+	
+	public Manifest getManifest() {
+		return manifest;
+	}
+	public void setManifest(Manifest manifest) {
+		this.manifest = manifest;
+	}
+	public String getStatus() {
+		return status;
+	}
+	public void setStatus(String status) {
+		this.status = status;
+	}
+	public String getHost() {
+		return host;
+	}
+	public void setHost(String host) {
+		this.host = host;
+	}
+	public String getHostIP() {
+		return hostIP;
+	}
+	public void setHostIP(String hostIP) {
+		this.hostIP = hostIP;
+	}
+	public Policy getRestartpolicy() {
+		return restartpolicy;
+	}
+	public void setRestartpolicy(Policy restartpolicy) {
+		this.restartpolicy = restartpolicy;
+	}
+	public String getPodIP() {
+		return podIP;
+	}
+	public void setPodIP(String podIP) {
+		this.podIP = podIP;
+	}
+	public int getReplicas() {
+		return replicas;
+	}
+	public void setReplicas(int replicas) {
+		this.replicas = replicas;
+	}
+	public Selector getReplicaSelector() {
+		return replicaSelector;
+	}
+	public void setReplicaSelector(Selector replicaSelector) {
+		this.replicaSelector = replicaSelector;
+	}
+	public Pod getPodTemplate() {
+		return podTemplate;
+	}
+	public void setPodTemplate(Pod podTemplate) {
+		this.podTemplate = podTemplate;
+	}
+	public Object getInfo() {
+		return info;
+	}
+	public void setInfo(Object info) {
+		this.info = info;
+	}
+	
+	@Override
+	public String toString() {
+		return "State [manifest=" + manifest + ", status=" + status + ", host="
+				+ host + ", hostIP=" + hostIP + ", podIP=" + podIP
+				+ ", replicas=" + replicas + ", replicaSelector="
+				+ replicaSelector + ", podTemplate=" + podTemplate
+				+ ", restartpolicy=" + restartpolicy + ", info=" + info + "]";
+	}
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Volume.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Volume.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Volume.java
new file mode 100644
index 0000000..b6f208e
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/Volume.java
@@ -0,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.kubernetes.client.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class Volume {
+
+	private String name;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	@Override
+	public String toString() {
+		return "Volume [name=" + name + "]";
+	}
+	
+	
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1e4c8b45/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/VolumeMount.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/VolumeMount.java b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/VolumeMount.java
new file mode 100644
index 0000000..0a1a892
--- /dev/null
+++ b/components/org.apache.stratos.kubernetes.client/src/main/java/org/apache/stratos/kubernetes/client/model/VolumeMount.java
@@ -0,0 +1,57 @@
+/*
+ *
+ * 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.kubernetes.client.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class VolumeMount {
+
+	private String name;
+	private String mountPath;
+	private boolean readOnly;
+	
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getMountPath() {
+		return mountPath;
+	}
+	public void setMountPath(String mountPath) {
+		this.mountPath = mountPath;
+	}
+	public boolean isReadOnly() {
+		return readOnly;
+	}
+	public void setReadOnly(boolean readOnly) {
+		this.readOnly = readOnly;
+	}
+	@Override
+	public String toString() {
+		return "VolumeMount [name=" + name + ", mountPath=" + mountPath
+				+ ", readOnly=" + readOnly + "]";
+	}
+	
+	
+}


[2/2] git commit: Adding kubernetes client component to the components pom.

Posted by ni...@apache.org.
Adding kubernetes client component to the components pom.


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

Branch: refs/heads/master
Commit: cc0af812b059512185769ab34cd66069a8ff8ea3
Parents: 1e4c8b4
Author: Nirmal Fernando <ni...@gmail.com>
Authored: Sun Sep 7 17:22:16 2014 +0530
Committer: Nirmal Fernando <ni...@gmail.com>
Committed: Sun Sep 7 17:22:16 2014 +0530

----------------------------------------------------------------------
 components/pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/cc0af812/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index 15d0ee5..7754df0 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -43,6 +43,7 @@
         <module>org.apache.stratos.autoscaler</module>
         <!-- CC -->
         <module>org.apache.stratos.cloud.controller</module>
+        <module>org.apache.stratos.kubernetes.client</module>
         <!-- SM -->
         <module>org.apache.stratos.manager</module>
         <module>org.apache.stratos.deployment</module>