@Path(value="api/v1beta2")
@Produces(value="application/json")
@Consumes(value="application/json")
public interface Kubernetes
Modifier and Type | Method and Description |
---|---|
String |
createPod(Pod entity)
Create a new pod.
|
String |
createPod(Pod entity,
String namespace) |
String |
createReplicationController(ReplicationController entity)
Create a new controller.
|
String |
createReplicationController(ReplicationController entity,
String namespace) |
String |
createService(Service entity)
Create a new service
|
String |
createService(Service entity,
String namespace) |
String |
deletePod(String podId)
Delete a specific pod
|
String |
deletePod(String podId,
String namespace) |
String |
deleteReplicationController(String controllerId)
Delete a specific controller
|
String |
deleteReplicationController(String controllerId,
String namespace)
Delete a specific controller
|
String |
deleteService(String serviceId)
Delete a specific service
|
String |
deleteService(String serviceId,
String namespace) |
Endpoints |
endpointsForService(String serviceId,
String namespace)
List all endpoints for a service
|
EndpointsList |
getEndpoints()
List all service endpoints on this cluster
|
MinionList |
getMinions()
List all the minions on this cluster
|
Pod |
getPod(String podId)
Get a specific pod
|
Pod |
getPod(String podId,
String namespace)
Get a specific pod
|
PodList |
getPods()
List all pods on this cluster
|
PodList |
getPods(String namespace)
List all pods on this cluster
|
ReplicationController |
getReplicationController(String controllerId)
Get a specific controller
|
ReplicationController |
getReplicationController(String controllerId,
String namespace)
Get a specific controller
|
ReplicationControllerList |
getReplicationControllers()
List all replicationControllers on this cluster
|
ReplicationControllerList |
getReplicationControllers(String namespace)
List all replicationControllers on this cluster
|
Service |
getService(String serviceId)
Get a specific service
|
Service |
getService(String serviceId,
String namespace)
Get a specific service
|
ServiceList |
getServices()
List all services on this cluster
|
ServiceList |
getServices(String namespace)
List all services on this cluster
|
Minion |
minion(String minionId)
List all endpoints for a service
|
String |
updatePod(String podId,
Pod entity)
Update a pod
|
String |
updatePod(String podId,
Pod entity,
String namespace)
Update a pod
|
String |
updateReplicationController(String controllerId,
ReplicationController entity)
Update a controller
|
String |
updateService(String serviceId,
Service entity)
Update a service
|
String |
updateService(String serviceId,
Service entity,
String namespace)
Update a service
|
@GET @Path(value="pods") PodList getPods()
@GET @Path(value="pods") PodList getPods(@QueryParam(value="namespace") String namespace)
namespace
- @POST @Path(value="pods") @Consumes(value="application/json") String createPod(Pod entity) throws Exception
entity
- 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
@POST @Path(value="pods") @Consumes(value="application/json") String createPod(Pod entity, @QueryParam(value="namespace") String namespace) throws Exception
Exception
@GET @Path(value="pods/{podId}") Pod getPod(@PathParam(value="podId")@NotNull String podId)
podId
- @GET @Path(value="pods/{podId}") Pod getPod(@PathParam(value="podId")@NotNull String podId, @QueryParam(value="namespace") String namespace)
podId
- namespace
- @PUT @Path(value="pods/{podId}") @Consumes(value="application/json") String updatePod(@PathParam(value="podId")@NotNull String podId, Pod entity) throws Exception
entity
- 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"
}
}podId
- Exception
@PUT @Path(value="pods/{podId}") @Consumes(value="application/json") String updatePod(@PathParam(value="podId")@NotNull String podId, Pod entity, @QueryParam(value="namespace") String namespace) throws Exception
podId
- entity
- namespace
- Exception
@DELETE @Path(value="pods/{podId}") @Consumes(value="text/plain") String deletePod(@PathParam(value="podId")@NotNull String podId) throws Exception
podId
- Exception
@DELETE @Path(value="pods/{podId}") @Consumes(value="text/plain") String deletePod(@PathParam(value="podId")@NotNull String podId, @QueryParam(value="namespace") String namespace) throws Exception
Exception
@Path(value="services") @GET @Produces(value="application/json") ServiceList getServices()
@Path(value="services") @GET @Produces(value="application/json") ServiceList getServices(@QueryParam(value="namespace") String namespace)
namespace
- @Path(value="services") @POST @Consumes(value="application/json") String createService(Service entity) throws Exception
entity
- e.g. {
"kind": "Service",
"apiVersion": "v1beta1",
"id": "example",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
}
}Exception
@Path(value="services") @POST @Consumes(value="application/json") String createService(Service entity, @QueryParam(value="namespace") String namespace) throws Exception
Exception
@GET @Path(value="services/{serviceId}") @Produces(value="application/json") Service getService(@PathParam(value="serviceId")@NotNull String serviceId)
serviceId
- @GET @Path(value="services/{serviceId}") @Produces(value="application/json") Service getService(@PathParam(value="serviceId")@NotNull String serviceId, @QueryParam(value="namespace") String namespace)
serviceId
- namespace
- @PUT @Path(value="services/{serviceId}") @Consumes(value="application/json") String updateService(@PathParam(value="serviceId")@NotNull String serviceId, Service entity) throws Exception
serviceId
- entity
- e.g. {
"kind": "Service",
"apiVersion": "v1beta1",
"id": "example",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
}
}Exception
@PUT @Path(value="services/{serviceId}") @Consumes(value="application/json") String updateService(@PathParam(value="serviceId")@NotNull String serviceId, Service entity, @QueryParam(value="namespace") String namespace) throws Exception
Exception
@DELETE @Path(value="services/{serviceId}") @Produces(value="application/json") @Consumes(value="text/plain") String deleteService(@PathParam(value="serviceId")@NotNull String serviceId) throws Exception
serviceId
- Exception
@DELETE @Path(value="services/{serviceId}") @Produces(value="application/json") @Consumes(value="text/plain") String deleteService(@PathParam(value="serviceId")@NotNull String serviceId, @QueryParam(value="namespace") String namespace) throws Exception
Exception
@Path(value="replicationControllers") @GET @Produces(value="application/json") ReplicationControllerList getReplicationControllers()
@Path(value="replicationControllers") @GET @Produces(value="application/json") ReplicationControllerList getReplicationControllers(@QueryParam(value="namespace") String namespace)
namespace
- @Path(value="replicationControllers") @POST @Consumes(value="application/json") String createReplicationController(ReplicationController entity) throws Exception
entity
- 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
@Path(value="replicationControllers") @POST @Consumes(value="application/json") String createReplicationController(ReplicationController entity, @QueryParam(value="namespace") String namespace) throws Exception
Exception
@GET @Path(value="replicationControllers/{controllerId}") @Produces(value="application/json") ReplicationController getReplicationController(@PathParam(value="controllerId")@NotNull String controllerId)
controllerId
- @GET @Path(value="replicationControllers/{controllerId}") @Produces(value="application/json") ReplicationController getReplicationController(@PathParam(value="controllerId")@NotNull String controllerId, @QueryParam(value="namespace") String namespace)
controllerId
- namespace
- @PUT @Path(value="replicationControllers/{controllerId}") @Consumes(value="application/json") String updateReplicationController(@PathParam(value="controllerId")@NotNull String controllerId, ReplicationController entity) throws Exception
controllerId
- entity
- 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
@DELETE @Path(value="replicationControllers/{controllerId}") @Produces(value="application/json") @Consumes(value="text/plain") String deleteReplicationController(@PathParam(value="controllerId")@NotNull String controllerId) throws Exception
controllerId
- Exception
@DELETE @Path(value="replicationControllers/{controllerId}") @Produces(value="application/json") @Consumes(value="text/plain") String deleteReplicationController(@PathParam(value="controllerId")@NotNull String controllerId, @QueryParam(value="namespace") String namespace) throws Exception
controllerId
- Exception
@GET @Path(value="endpoints") EndpointsList getEndpoints()
@GET @Path(value="endpoints/{serviceId}") Endpoints endpointsForService(@PathParam(value="serviceId")@NotNull String serviceId, @QueryParam(value="namespace") String namespace)
@GET @Path(value="minions") MinionList getMinions()
Copyright © 2011–2015 Red Hat. All rights reserved.