public class KubernetesClient extends Object implements Kubernetes, KubernetesExtensions
KubernetesFactory and the differences between
the core Kubernetes API and the KubernetesExtensions| Constructor and Description |
|---|
KubernetesClient() |
KubernetesClient(KubernetesFactory factory) |
KubernetesClient(String url) |
public KubernetesClient()
public KubernetesClient(String url)
public KubernetesClient(KubernetesFactory factory)
public Kubernetes getKubernetes()
public KubernetesExtensions getKubernetesExtensions()
public KubernetesFactory getFactory()
public void setFactory(KubernetesFactory factory)
public String getAddress()
@GET @Path(value="pods") public PodListSchema getPods()
KubernetesgetPods in interface Kubernetes@DELETE
@Path(value="pods/{podId}")
public String deletePod(@NotNull
String podId)
throws Exception
KubernetesdeletePod in interface KubernetesException@GET
@Path(value="replicationControllers/{controllerId}")
@Produces(value="application/json")
public ReplicationControllerSchema getReplicationController(@NotNull
String controllerId)
KubernetesgetReplicationController in interface Kubernetes@DELETE
@Path(value="replicationControllers/{controllerId}")
@Produces(value="application/json")
public String deleteReplicationController(@NotNull
String controllerId)
throws Exception
KubernetesdeleteReplicationController in interface KubernetesException@Path(value="replicationControllers") @GET @Produces(value="application/json") public ReplicationControllerListSchema getReplicationControllers()
KubernetesgetReplicationControllers in interface Kubernetes@PUT
@Path(value="replicationControllers/{controllerId}")
@Consumes(value="application/json")
public String updateReplicationController(@NotNull
String controllerId,
ReplicationControllerSchema entity)
throws Exception
KubernetesupdateReplicationController in interface Kubernetesentity - e.g. {
"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"}
}Exception@PUT
@Path(value="services/{serviceId}")
@Consumes(value="application/json")
public String updateService(@NotNull
String serviceId,
ServiceSchema entity)
throws Exception
KubernetesupdateService in interface Kubernetesentity - e.g. {
"kind": "Service",
"apiVersion": "v1beta1",
"id": "example",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
}
}Exception@GET
@Path(value="services/{serviceId}")
@Produces(value="application/json")
public ServiceSchema getService(@NotNull
String serviceId)
KubernetesgetService in interface Kubernetes@DELETE
@Path(value="services/{serviceId}")
@Produces(value="application/json")
public String deleteService(@NotNull
String serviceId)
throws Exception
KubernetesdeleteService in interface KubernetesException@Path(value="services") @POST @Consumes(value="application/json") public String createService(ServiceSchema entity) throws Exception
KubernetescreateService in interface Kubernetesentity - e.g. {
"kind": "Service",
"apiVersion": "v1beta1",
"id": "example",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
}
}Exception@GET
@Path(value="pods/{podId}")
public PodSchema getPod(@NotNull
String podId)
KubernetesgetPod in interface Kubernetes@PUT
@Path(value="pods/{podId}")
@Consumes(value="application/json")
public String updatePod(@NotNull
String podId,
PodSchema entity)
throws Exception
KubernetesupdatePod in interface Kubernetesentity - e.g. {
"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"
}
}Exception@Path(value="services") @GET @Produces(value="application/json") public ServiceListSchema getServices()
KubernetesgetServices in interface Kubernetes@POST @Path(value="pods") @Consumes(value="application/json") public String createPod(PodSchema entity) throws Exception
KubernetescreatePod in interface Kubernetesentity - e.g. {
"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"
}
}Exception@Path(value="replicationControllers") @POST @Consumes(value="application/json") public String createReplicationController(ReplicationControllerSchema entity) throws Exception
KubernetescreateReplicationController in interface Kubernetesentity - e.g. {
"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"}
}Exception@POST @Path(value="configs") @Consumes(value="application/json") public String createConfig(Object entity) throws Exception
createConfig in interface KubernetesExtensionsException@POST @Path(value="template") @Consumes(value="application/json") public String createTemplate(Object entity) throws Exception
createTemplate in interface KubernetesExtensionsException@POST @Path(value="templateConfigs") @Consumes(value="application/json") public String createTemplateConfig(Object entity) throws Exception
createTemplateConfig in interface KubernetesExtensionsExceptionpublic ReplicationControllerSchema getReplicationControllerForPod(String podId)
public ReplicationControllerSchema getReplicationControllerForPod(PodSchema pod)
Copyright © 2011–2014 Red Hat. All rights reserved.